Add GPUContext::SetStencilRef to stencil reference value

This commit is contained in:
Wojtek Figat
2023-06-19 11:21:35 +02:00
parent 228ef4e130
commit 1c9d8aa470
9 changed files with 46 additions and 2 deletions

View File

@@ -727,6 +727,7 @@ void GPUContextVulkan::FrameBegin()
_cbDirtyFlag = 0;
_rtCount = 0;
_vbCount = 0;
_stencilRef = 0;
_renderPass = nullptr;
_currentState = nullptr;
_rtDepth = nullptr;
@@ -972,6 +973,16 @@ void GPUContextVulkan::SetBlendFactor(const Float4& value)
vkCmdSetBlendConstants(cmdBuffer->GetHandle(), value.Raw);
}
void GPUContextVulkan::SetStencilRef(uint32 value)
{
if (_stencilRef != value)
{
_stencilRef = value;
const auto cmdBuffer = _cmdBufferManager->GetCmdBuffer();
vkCmdSetStencilReference(cmdBuffer->GetHandle(), VK_STENCIL_FRONT_AND_BACK, _stencilRef);
}
}
void GPUContextVulkan::ResetSR()
{
Platform::MemoryClear(_srHandles, sizeof(_srHandles));