Files
XCEngine/docs/api/rhi/d3d12/command-list/clear-depth-stencil-view.md
ssdfasd 1358bb0a5a docs: 修复 D3D12 后端 API 文档问题
- 修复 texture/dtor.md 和 enums/enums.md 的错误链接
- 重命名 texture/ctor.md → constructor.md, texture/dtor.md → destructor.md
- 创建 command-list, fence, device, query-heap, sampler 的 constructor/destructor 文档
- 创建 D3D12Texture 缺失的 16 个方法文档
- 创建 D3D12CommandList 缺失的 12 个 internal 方法文档
- 补充 shader-resource-view 缺少的头文件和类型字段
2026-03-22 02:08:51 +08:00

999 B
Raw Blame History

D3D12CommandList::ClearDepthStencilView

清除深度模板视图(句柄重载)。

void ClearDepthStencilView(D3D12_CPU_DESCRIPTOR_HANDLE depthStencilHandle, uint32_t clearFlags, float depth = 1.0f, uint8_t stencil = 0, uint32_t rectCount = 0, const D3D12_RECT* rects = nullptr);

参数

  • depthStencilHandle - 深度模板视图 CPU 句柄
  • clearFlags - 清除标志D3D12_CLEAR_FLAG_DEPTH / D3D12_CLEAR_FLAG_STENCIL
  • depth - 深度值默认1.0f
  • stencil - 模板值默认0
  • rectCount - 矩形数量默认为0表示整个资源
  • rects - 要清除的矩形数组默认为nullptr表示整个资源

返回值

线程安全:

复杂度: O(n)

示例

commandList.ClearDepthStencilView(depthStencilHandle, D3D12_CLEAR_FLAG_DEPTH | D3D12_CLEAR_FLAG_STENCIL, 1.0f, 0);

相关文档