Skip to content

Commit

Permalink
#5584: Respect bucket index when adjusting geometry indices
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Dec 4, 2021
1 parent e96f65c commit 3e50d82
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions radiantcore/rendersystem/backend/GeometryRenderer.h
Expand Up @@ -180,11 +180,16 @@ class GeometryRenderer :

bucket.removeSurface(slotInfo.firstVertex, slotInfo.numVertices, slotInfo.firstIndex, slotInfo.numIndices);

// Adjust all offsets in other slots
// Adjust all offsets in other slots pointing to the same bucket
for (auto& slot : _slots)
{
if (slot.firstVertex > slotInfo.firstVertex)
if (slot.bucketIndex == slotInfo.bucketIndex &&
slot.firstVertex > slotInfo.firstVertex &&
slot.firstVertex != InvalidVertexIndex)
{
assert(slot.firstVertex >= slotInfo.numVertices);
assert(slot.firstIndex >= slotInfo.numIndices);

slot.firstVertex -= slotInfo.numVertices;
slot.firstIndex -= slotInfo.numIndices;
}
Expand Down

0 comments on commit 3e50d82

Please sign in to comment.