D3D12_SHADER_CACHE_SESSION_DESC structure (d3d12.h)

Describes a shader cache session.

Syntax

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 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.

Requirements

Requirement Value
Minimum supported client Windows 10 Build 20348
Minimum supported server Windows 10 Build 20348
Header d3d12.h

See also