Skip to content

Commit

Permalink
rebind instance data buffer if index offset changes
Browse files Browse the repository at this point in the history
Fix case of drawing different offsets of indices of same vertex buffer
using same instance data.

This can happen in the case of conditionally drawing subsets of vertex
buffer stored in different offsets of the same index buffer while re-using
non-transient instance buffers.
  • Loading branch information
bwrsandman committed Feb 4, 2020
1 parent d24077d commit ade0820
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/renderer_gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7259,6 +7259,11 @@ namespace bgfx { namespace gl
diffIndexBuffer = true;
}

if (currentState.m_startIndex != draw.m_startIndex)
{
diffIndexBuffer = true;
}

if (0 != currentState.m_streamMask)
{
bool diffStartVertex = false;
Expand Down

0 comments on commit ade0820

Please sign in to comment.