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

@@ -222,6 +222,7 @@ void GPUContextDX12::Reset()
_rtDepth = nullptr;
_srMaskDirtyGraphics = 0;
_srMaskDirtyCompute = 0;
_stencilRef = 0;
_psDirtyFlag = false;
_isCompute = false;
_currentCompute = nullptr;
@@ -850,6 +851,15 @@ void GPUContextDX12::SetBlendFactor(const Float4& value)
_commandList->OMSetBlendFactor(value.Raw);
}
void GPUContextDX12::SetStencilRef(uint32 value)
{
if (_stencilRef != value)
{
_stencilRef = value;
_commandList->OMSetStencilRef(value);
}
}
void GPUContextDX12::ResetSR()
{
for (int32 slot = 0; slot < GPU_MAX_SR_BINDED; slot++)

View File

@@ -47,6 +47,7 @@ private:
uint32 _srMaskDirtyGraphics;
uint32 _srMaskDirtyCompute;
uint32 _stencilRef;
int32 _isCompute : 1;
int32 _rtDirtyFlag : 1;
@@ -167,6 +168,7 @@ public:
void SetRenderTarget(GPUTextureView* depthBuffer, GPUTextureView* rt) override;
void SetRenderTarget(GPUTextureView* depthBuffer, const Span<GPUTextureView*>& rts) override;
void SetBlendFactor(const Float4& value) override;
void SetStencilRef(uint32 value) override;
void ResetSR() override;
void ResetUA() override;
void ResetCB() override;