Files
XCEngine/docs/api/rhi/d3d12/depth-stencil-view/get-cpu-descriptor-handle.md
2026-03-20 02:35:45 +08:00

30 lines
747 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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) - 返回类总览