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

# GetShaderIdentifier (XBOX Series consoles)

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

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

## 语法

```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](/reference/graphics/d3d12_xs/interfaces/ID3D12StateObjectProperties/id3d12stateobjectproperties)


## Related topics

- [GetShaderStackSize (XBOX Series consoles)](/zh-CN/reference/graphics/d3d12/interfaces/id3d12stateobjectproperties/methods/id3d12stateobjectproperties_getshaderstacksize_public.md)
- [D3D12_RAYTRACING_SHADER_CONFIG (XBOX Series consoles)](/zh-CN/reference/graphics/d3d12/structs/d3d12_raytracing_shader_config_public.md)
- [D3D12_MESH_SHADER_TIER (XBOX Series consoles)](/zh-CN/reference/graphics/d3d12_xs/enums/d3d12_mesh_shader_tier_xs.md)
- [GetPipelineStackSize (XBOX Series consoles)](/zh-CN/reference/graphics/d3d12/interfaces/id3d12stateobjectproperties/methods/id3d12stateobjectproperties_getpipelinestacksize_public.md)
- [CreateShaderCacheSession (XBOX Series 主机)](/zh-CN/reference/graphics/d3d12/interfaces/id3d12device9/methods/id3d12device9_createshadercachesession_public.md)
