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

# D3D12_SHADER_CACHE_MODE

> Defines constants that specify a shader cache's mode.

Defines constants that specify a shader cache's mode.

## Syntax

```cpp theme={null}
typedef enum D3D12_SHADER_CACHE_MODE
{
    D3D12_SHADER_CACHE_MODE_MEMORY = 0,
    D3D12_SHADER_CACHE_MODE_DISK = 0
} D3D12_SHADER_CACHE_MODE
```

## Constants

| Constant | Description |
| - | - |
| D3D12\_SHADER\_CACHE\_MODE\_MEMORY | Specifies that there's no backing file for this cache. All stores are discarded when the session object is destroyed. |
| D3D12\_SHADER\_CACHE\_MODE\_DISK | Specifies that the session is backed by files on disk that persist from run to run unless cleared. For ways to clear a disk cache, see [ID3D12ShaderCacheSession::SetDeleteOnDestroy](https://docs.xbox.com/reference/graphics/d3d12/interfaces/id3d12shadercachesession/methods/id3d12shadercachesession_setdeleteondestroy_public.md). |

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

* [ID3D12ShaderCacheSession::SetDeleteOnDestroy](https://docs.xbox.com/reference/graphics/d3d12/interfaces/id3d12shadercachesession/methods/id3d12shadercachesession_setdeleteondestroy_public.md)
* [D3D12 shader cache APIs](https://microsoft.github.io/DirectX-Specs/d3d/ShaderCache.html)


## Related topics

- [D3D12_SHADER_CACHE_SESSION_DESC](https://docs.xbox.com/reference/graphics/d3d12/structs/d3d12_shader_cache_session_desc_public.md)
- [D3D12_SHADER_CACHE_FLAGS](https://docs.xbox.com/reference/graphics/d3d12/enums/d3d12_shader_cache_flags_public.md)
- [D3D12_SHADER_CACHE_SUPPORT_FLAGS](https://docs.xbox.com/reference/graphics/d3d12/enums/d3d12_shader_cache_support_flags_public.md)
- [D3D12_FEATURE_DATA_SHADER_CACHE](https://docs.xbox.com/reference/graphics/d3d12/structs/d3d12_feature_data_shader_cache_public.md)
- [D3D12_SHADER_CACHE_KIND_FLAGS (XBOX Series consoles)](https://docs.xbox.com/reference/graphics/d3d12/enums/d3d12_shader_cache_kind_flags_public.md)
