Files
XCEngine/docs/api/rhi/d3d12/depth-stencil-view/get-cpu-descriptor-handle.md

30 lines
747 B
Markdown
Raw Normal View History

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