mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-09-14 14:38:16 +00:00
Compare layout handle in vertex-stream rebind gate (#3811)
The gate compares (handle, startVertex) but not the layout handle, so draws colliding on startVertex with different-stride layouts wrongly skip the rebind. Fix hasVertexStreamChanged() and OpenGL's inline copy. Matches #2562.
This commit is contained in:
@@ -788,8 +788,9 @@ namespace bgfx
|
||||
{
|
||||
const uint8_t idx = it.idx;
|
||||
|
||||
if (_current.m_stream[idx].m_handle.idx != _new.m_stream[idx].m_handle.idx
|
||||
|| _current.m_stream[idx].m_startVertex != _new.m_stream[idx].m_startVertex)
|
||||
if (_current.m_stream[idx].m_handle.idx != _new.m_stream[idx].m_handle.idx
|
||||
|| _current.m_stream[idx].m_startVertex != _new.m_stream[idx].m_startVertex
|
||||
|| _current.m_stream[idx].m_layoutHandle.idx != _new.m_stream[idx].m_layoutHandle.idx)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -8480,6 +8480,12 @@ namespace bgfx { namespace gl
|
||||
currentState.m_stream[idx].m_startVertex = draw.m_stream[idx].m_startVertex;
|
||||
bindAttribs = true;
|
||||
}
|
||||
|
||||
if (currentState.m_stream[idx].m_layoutHandle.idx != draw.m_stream[idx].m_layoutHandle.idx)
|
||||
{
|
||||
currentState.m_stream[idx].m_layoutHandle = draw.m_stream[idx].m_layoutHandle;
|
||||
bindAttribs = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user