Files
XCEngine/docs/api/rhi/d3d12/depth-stencil-view/create-desc.md
2026-03-20 02:35:45 +08:00

28 lines
744 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::CreateDesc
```cpp
static D3D12_DEPTH_STENCIL_VIEW_DESC CreateDesc(Format format, D3D12_DSV_DIMENSION dimension = D3D12_DSV_DIMENSION_TEXTURE2D);
```
创建深度模板视图描述(静态方法)。
**参数:**
- `format` - 深度模板格式(如 `Format::D32_FLOAT`
- `dimension` - 视图维度,默认为 `D3D12_DSV_DIMENSION_TEXTURE2D`
**返回:** D3D12 深度模板视图描述
**复杂度:** O(1)
## 示例
```cpp
auto desc = D3D12DepthStencilView::CreateDesc(Format::D32_FLOAT, D3D12_DSV_DIMENSION_TEXTURE2D);
dsv.Initialize(device, depthBuffer, &desc);
```
## 相关文档
- [D3D12DepthStencilView 总览](depth-stencil-view.md) - 类总览
- [Initialize](initialize.md) - 初始化方法