Skip to content

Commit

Permalink
zzre: Fix dynamic mesh corruption on realloc
Browse files Browse the repository at this point in the history
Fixes #309
  • Loading branch information
Helco committed Feb 11, 2024
1 parent 7ae928a commit 83454a0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions zzre.core/rendering/DynamicGraphicsBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ public void Update(CommandList cl)
buffer?.Dispose();
buffer = device.ResourceFactory.CreateBuffer(new((uint)capacityInBytes, usage));
buffer.Name = bufferName;
dirtyBytes.Clear();
foreach (var usedElementRange in usedElements)
dirtyBytes.Add(AsByteRange(usedElementRange));
}

dirtyBytes.MergeNearbyRanges(MaxUploadDistance);
Expand Down

0 comments on commit 83454a0

Please sign in to comment.