# D3D12DepthStencilView::GetCPUDescriptorHandle ```cpp D3D12_CPU_DESCRIPTOR_HANDLE GetCPUDescriptorHandle() const; ``` 获取深度模板视图的 CPU 描述符句柄,用于绑定到渲染管线。 **返回:** CPU 描述符句柄 **复杂度:** O(1) ## 说明 返回的描述符句柄用于将深度模板视图绑定到渲染管线的 OM(输出合并)阶段。此方法是 const 的,因为描述符句柄本身不修改对象状态。 ## 示例 ```cpp D3D12DepthStencilView dsv; dsv.Initialize(device, depthBuffer, nullptr); D3D12_CPU_DESCRIPTOR_HANDLE handle = dsv.GetCPUDescriptorHandle(); // 使用 handle 绑定到 OM 阶段 ``` ## 相关文档 - [D3D12DepthStencilView 总览](depth-stencil-view.md) - 返回类总览