Skip to content

Commit 09ffc17

Browse files
authored
fix sporadic objects flickering (o3de#17491)
* fix incorrect counting of objects in the last batch Signed-off-by: Mateusz Żak <[email protected]>
1 parent 25cacde commit 09ffc17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ namespace AZ
651651
{
652652
size_t batchStart = batchIndex * batchSize;
653653
// If we're in the last batch, we just get the remaining objects
654-
size_t currentBatchCount = batchIndex == batchCount - 1 ? visibleObjectCount % batchSize : batchSize;
654+
size_t currentBatchCount = batchIndex == batchCount - 1 ? visibleObjectCount - batchStart : batchSize;
655655

656656
addVisibleObjectsToBucketsTG.AddTask(
657657
addVisibleObjectsToBucketsTaskDescriptor,

0 commit comments

Comments
 (0)