diff --git a/renderdoc/api/replay/pipestate.h b/renderdoc/api/replay/pipestate.h index 0b8c09848..eb7ba6d62 100644 --- a/renderdoc/api/replay/pipestate.h +++ b/renderdoc/api/replay/pipestate.h @@ -354,6 +354,13 @@ For some APIs that don't distinguish by entry point, this may be empty. )"); rdcarray GetColorBlends() const; + DOCUMENT(R"(Retrieves the current stencil states. + +:return: The currently stencil states. Front facing first, back facing second. +:rtype: Tuple[StencilFace, StencilFace] +)"); + rdcpair GetStencilFaces() const; + DOCUMENT(R"(Determines whether or not independent blending is enabled. :return: A boolean indicating if independent blending is enabled. diff --git a/renderdoc/api/replay/pipestate.inl b/renderdoc/api/replay/pipestate.inl index 1b96449db..e190ba042 100644 --- a/renderdoc/api/replay/pipestate.inl +++ b/renderdoc/api/replay/pipestate.inl @@ -1624,6 +1624,33 @@ rdcarray PipeState::GetColorBlends() const return {}; } +rdcpair PipeState::GetStencilFaces() const +{ + if(IsCaptureLoaded()) + { + if(IsCaptureD3D11()) + { + return {m_D3D11->outputMerger.depthStencilState.frontFace, + m_D3D11->outputMerger.depthStencilState.backFace}; + } + else if(IsCaptureD3D12()) + { + return {m_D3D12->outputMerger.depthStencilState.frontFace, + m_D3D12->outputMerger.depthStencilState.backFace}; + } + else if(IsCaptureGL()) + { + return {m_GL->stencilState.frontFace, m_GL->stencilState.backFace}; + } + else if(IsCaptureVK()) + { + return {m_Vulkan->depthStencil.frontFace, m_Vulkan->depthStencil.backFace}; + } + } + + return {StencilFace(), StencilFace()}; +} + bool PipeState::IsIndependentBlendingEnabled() const { if(IsCaptureLoaded())