> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# D3D12_SHADER_CACHE_SESSION_DESC

> Describes a shader cache session.

Describes a shader cache session.

## Syntax

```cpp theme={null}
typedef struct D3D12_SHADER_CACHE_SESSION_DESC
{
    GUID Identifier;
    D3D12_SHADER_CACHE_MODE Mode;
    D3D12_SHADER_CACHE_FLAGS Flags;
    UINT MaximumInMemoryCacheSizeBytes;
    UINT MaximumInMemoryCacheEntries;
    UINT MaximumValueFileSizeBytes;
    UINT64 Version;
} D3D12_SHADER_CACHE_SESSION_DESC
```

### Members

*Identifier*\
Type: GUID

A unique identifier to give to this specific cache. Caches with different identifiers are stored side by side. Caches with the same identifier are shared across all sessions in the same process. Creating a disk cache with the same identifier as an already-existing cache opens that cache, unless the **Version** doesn't matches. In that case, if there are no other sessions open to that cache, it is cleared and re-created. If there are existing sessions, then [ID3D12Device9::CreateShaderCacheSession](/reference/graphics/d3d12/interfaces/id3d12device9/methods/id3d12device9_createshadercachesession_public) returns **DXGI\_ERROR\_ALREADY\_EXISTS**.

*Mode*\
Type: D3D12\_SHADER\_CACHE\_MODE

Specifies the kind of cache.

*Flags*\
Type: D3D12\_SHADER\_CACHE\_FLAGS

Modifies the behavior of the cache.

*MaximumInMemoryCacheSizeBytes*\
Type: UINT

For in-memory caches, this is the only storage available. For disk caches, all entries that are stored or found are temporarily stored in memory, until evicted by newer entries. This value determines the size of that temporary storage. Defaults to 1KB.

*MaximumInMemoryCacheEntries*\
Type: UINT

Specifies how many entries can be stored in memory. Defaults to 128.

*MaximumValueFileSizeBytes*\
Type: UINT

For disk caches, controls the maximum file size. Defaults to 128MB.

*Version*\
Type: UINT64

Can be used to implicitly clear caches when an application or component update is done. If the version doesn't match the version stored in the cache, then it will be wiped and re-created.

## Remarks

## Requirements

**Header:** d3d12\_xs.h or d3d12\_x.h\
**Library:** d3d12\_xs.lib or d3d12\_x.lib\
**Supported Platforms**: XBOX Series consoles and XBOX One family

## See Also

* [ID3D12Device9::CreateShaderCacheSession](/reference/graphics/d3d12/interfaces/id3d12device9/methods/id3d12device9_createshadercachesession_public)
* [D3D12 shader cache APIs](https://microsoft.github.io/DirectX-Specs/d3d/ShaderCache.html)


## Related topics

- [ID3D12ShaderCacheSession::GetDesc](/reference/graphics/d3d12/interfaces/id3d12shadercachesession/methods/id3d12shadercachesession_getdesc_public.md)
- [D3D12_SHADER_CACHE_FLAGS](/reference/graphics/d3d12/enums/d3d12_shader_cache_flags_public.md)
- [CreateShaderCacheSession (XBOX Series consoles)](/reference/graphics/d3d12/interfaces/id3d12device9/methods/id3d12device9_createshadercachesession_public.md)
- [D3D12_SHADER_CACHE_MODE](/reference/graphics/d3d12/enums/d3d12_shader_cache_mode_public.md)
- [D3D12_SHADER_CACHE_SUPPORT_FLAGS](/reference/graphics/d3d12/enums/d3d12_shader_cache_support_flags_public.md)
