PFND3D12DDI_SHADERCACHESTOREVALUE_CB_0021 callback function (d3d12umddi.h)

The pfnShaderCacheStoreValueCb callback function stores a value in the shader cache.

Syntax

PFND3D12DDI_SHADERCACHESTOREVALUE_CB_0021 Pfnd3d12ddiShadercachestorevalueCb0021;

HRESULT Pfnd3d12ddiShadercachestorevalueCb0021(
  D3D12DDI_HRTDEVICE hRTDevice,
  D3D12DDI_HRTPIPELINESTATE hRTPSO,
  const D3D12DDI_SHADERCACHE_HASH *pPrecomputedHash,
  const void *pKey,
  SIZE_T KeyLen,
  const void *pValue,
  SIZE_T ValueLen
)
{...}

Parameters

hRTDevice

[in] Handle to the runtime's representation of the device.

hRTPSO

[in] Handle to the runtime's representation of a pipeline state object.

pPrecomputedHash

[in] Pointer to a D3D12DDI_SHADERCACHE_HASH structure that contains a precomputed hash value used for cache insertion.

pKey

[in] A pointer to the key associated with the value to be stored in the driver's shader cache. The key uniquely identifies the shader data in the cache.

KeyLen

[in] The length of the key that pKey points to, in bytes.

pValue

[in] A pointer to the data to be stored in the shader cache.

ValueLen

[in] The length of the buffer that pValue points to, in bytes.

Return value

If this callback function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The pfnShaderCacheStoreValueCb and pfnShaderCacheGetValueCb callbacks are used to store and retrieve compiled shader code or other shader-related data in the driver's shader cache. Caching helps improve performance by reducing the need to recompile shaders that have already been compiled and cached.

Access this callback by using the D3D12DDI_SHADERCACHE_CALLBACKS_0021 structure.

Requirements

Requirement Value
Target Platform Windows
Header d3d12umddi.h (include D3d12umddi.h)

See also

D3D12DDI_SHADERCACHE_CALLBACKS_0021

pfnShaderCacheGetValueCb