Files
XCEngine/docs/api/rhi/command-list/set-depth-stencil-state.md
2026-03-20 02:35:45 +08:00

880 B

RHICommandList::SetDepthStencilState

virtual void SetDepthStencilState(const DepthStencilState& state) = 0;

设置深度测试和模板测试的状态配置。控制像素是否根据深度值和模板值被丢弃。

参数:

  • state - 深度模板状态结构体(包含 depthEnable、depthWriteMask、depthFunc、stencilEnable 等)

返回: void

异常:

线程安全:

复杂度: O(1)

示例:

DepthStencilState dsState;
dsState.depthEnable = true;
dsState.depthWriteMask = true;
dsState.depthFunc = ComparisonFunc::Less;
dsState.stencilEnable = false;
cmdList->SetDepthStencilState(dsState);

相关文档