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:
vrimar
2026-07-04 10:31:07 -04:00
committed by GitHub
parent e8ad6b69d7
commit aa176c7763
2 changed files with 9 additions and 2 deletions

View File

@@ -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;
}

View File

@@ -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;
}
}
}