Add common pipeline state helper to grab stencil face states

This commit is contained in:
baldurk
2020-12-14 15:49:47 +00:00
parent 5bdf00c0bf
commit 90ced90a89
2 changed files with 34 additions and 0 deletions
+7
View File
@@ -354,6 +354,13 @@ For some APIs that don't distinguish by entry point, this may be empty.
)");
rdcarray<ColorBlend> 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<StencilFace, StencilFace> GetStencilFaces() const;
DOCUMENT(R"(Determines whether or not independent blending is enabled.
:return: A boolean indicating if independent blending is enabled.
+27
View File
@@ -1624,6 +1624,33 @@ rdcarray<ColorBlend> PipeState::GetColorBlends() const
return {};
}
rdcpair<StencilFace, StencilFace> 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())