mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
D3D11: Fixed creating redundant depth/stencil state. Issue #623.
This commit is contained in:
parent
4635a0ce81
commit
dcd4ab951c
1 changed files with 7 additions and 7 deletions
|
@ -2599,7 +2599,8 @@ BX_PRAGMA_DIAGNOSTIC_POP();
|
|||
|
||||
void setDepthStencilState(uint64_t _state, uint64_t _stencil = 0)
|
||||
{
|
||||
_state &= BGFX_D3D11_DEPTH_STENCIL_MASK;
|
||||
uint32_t func = (_state&BGFX_STATE_DEPTH_TEST_MASK)>>BGFX_STATE_DEPTH_TEST_SHIFT;
|
||||
_state &= 0 == func ? 0 : BGFX_D3D11_DEPTH_STENCIL_MASK;
|
||||
|
||||
uint32_t fstencil = unpackStencil(0, _stencil);
|
||||
uint32_t ref = (fstencil&BGFX_STENCIL_FUNC_REF_MASK)>>BGFX_STENCIL_FUNC_REF_SHIFT;
|
||||
|
@ -2616,7 +2617,6 @@ BX_PRAGMA_DIAGNOSTIC_POP();
|
|||
{
|
||||
D3D11_DEPTH_STENCIL_DESC desc;
|
||||
memset(&desc, 0, sizeof(desc) );
|
||||
uint32_t func = (_state&BGFX_STATE_DEPTH_TEST_MASK)>>BGFX_STATE_DEPTH_TEST_SHIFT;
|
||||
desc.DepthEnable = 0 != func;
|
||||
desc.DepthWriteMask = !!(BGFX_STATE_DEPTH_WRITE & _state) ? D3D11_DEPTH_WRITE_MASK_ALL : D3D11_DEPTH_WRITE_MASK_ZERO;
|
||||
desc.DepthFunc = s_cmpFunc[func];
|
||||
|
|
Loading…
Reference in a new issue