mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
Only flush and set the depth test bits if depth is currently enabled already. (#1375)
This removes a bug where you could blow away the options set in a previous call to setState() which can enabled/disable depth testing.
This commit is contained in:
committed by
Branimir Karadžić
parent
7541625df4
commit
d6777a8887
@@ -1087,10 +1087,13 @@ struct DebugDrawEncoderImpl
|
||||
if (m_depthTestLess != _depthTestLess)
|
||||
{
|
||||
m_depthTestLess = _depthTestLess;
|
||||
flush();
|
||||
Attrib& attrib = m_attrib[m_stack];
|
||||
attrib.m_state &= ~BGFX_STATE_DEPTH_TEST_MASK;
|
||||
attrib.m_state |= _depthTestLess ? BGFX_STATE_DEPTH_TEST_LESS : BGFX_STATE_DEPTH_TEST_GREATER;
|
||||
if (attrib.m_state & BGFX_STATE_DEPTH_TEST_MASK)
|
||||
{
|
||||
flush();
|
||||
attrib.m_state &= ~BGFX_STATE_DEPTH_TEST_MASK;
|
||||
attrib.m_state |= _depthTestLess ? BGFX_STATE_DEPTH_TEST_LESS : BGFX_STATE_DEPTH_TEST_GREATER;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user