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

# GetShaderIdentifier (XBOX Series 主机)

> 检索可在着色器记录中使用的着色器唯一标识符。

检索可在着色器记录中使用的着色器唯一标识符。

## 语法

```cpp theme={null}
const GetShaderIdentifier(
    LPCWSTR pExportName
)
```

### 参数

*pExportName*\
类型：LPCWSTR

状态对象中要检索标识符的入口点。

### 返回值

类型：const

指向着色器标识符的指针。

只要该标识符所来自的状态对象仍然有效，该指针所引用的数据即有效。返回的数据大小为 [D3D12\_SHADER\_IDENTIFIER\_SIZE\_IN\_BYTES](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/constants)。如果需要多次检索该数据，应用程序应对该数据进行复制并缓存，以避免在状态对象中搜索它的开销。该标识符用于 GPU 内存中着色器表内的着色器记录，应用必须自行填充这些记录。

数据本身以全局方式标识着色器，因此即使该着色器出现在另一个具有相同关联（例如任何根签名）的状态对象中，其标识符也将相同。

如果着色器在状态对象中尚未完全解析，则返回值为 **nullptr**。

## 要求

**头文件：** d3d12\_xs.h\
**库：** d3d12\_xs.lib\
**支持的平台**：XBOX Series 主机

## 另请参阅

[ID3D12StateObjectProperties](https://docs.xbox.com/zh-CN/reference/graphics/d3d12_xs/interfaces/ID3D12StateObjectProperties/id3d12stateobjectproperties.md)


## Related topics

- [CreateShaderCacheSession (XBOX Series 主机)](https://docs.xbox.com/zh-CN/reference/graphics/d3d12/interfaces/id3d12device9/methods/id3d12device9_createshadercachesession_public.md)
- [GetShaderStackSize (XBOX Series 主机)](https://docs.xbox.com/zh-CN/reference/graphics/d3d12/interfaces/id3d12stateobjectproperties/methods/id3d12stateobjectproperties_getshaderstacksize_public.md)
- [ShaderCacheControl (XBOX Series 主机)](https://docs.xbox.com/zh-CN/reference/graphics/d3d12/interfaces/id3d12device9/methods/id3d12device9_shadercachecontrol_public.md)
- [D3D_SHADER_INPUT_TYPE (XBOX Series 主机)](https://docs.xbox.com/zh-CN/reference/graphics/d3d12_xs/enums/d3d_shader_input_type.md)
- [D3D12_SHADER_CACHE_KIND_FLAGS（XBOX Series 主机）](https://docs.xbox.com/zh-CN/reference/graphics/d3d12/enums/d3d12_shader_cache_kind_flags_public.md)
