diff --git a/Source/Engine/Renderer/RenderList.cpp b/Source/Engine/Renderer/RenderList.cpp index 577d58255..a8a4ae73b 100644 --- a/Source/Engine/Renderer/RenderList.cpp +++ b/Source/Engine/Renderer/RenderList.cpp @@ -570,6 +570,7 @@ void RenderList::SortDrawCalls(const RenderContext& renderContext, bool reverseD const auto* drawCallsData = drawCalls.Get(); const auto* listData = list.Indices.Get(); const int32 listSize = list.Indices.Count(); + ZoneValue(listSize); // Peek shared memory #define PREPARE_CACHE(list) (list).Clear(); (list).Resize(listSize) @@ -626,6 +627,7 @@ void RenderList::SortDrawCalls(const RenderContext& renderContext, bool reverseD } DrawBatch batch; + static_assert(sizeof(DrawBatch) == sizeof(uint64) * 2, "Fix the size of draw batch to optimize memory access."); batch.SortKey = sortedKeys[i]; batch.StartIndex = i; batch.BatchSize = batchSize; diff --git a/Source/Engine/Renderer/RenderList.h b/Source/Engine/Renderer/RenderList.h index 8d90be2e4..854aca986 100644 --- a/Source/Engine/Renderer/RenderList.h +++ b/Source/Engine/Renderer/RenderList.h @@ -212,17 +212,17 @@ struct DrawBatch /// /// The first draw call index. /// - int32 StartIndex; + uint16 StartIndex; /// /// A number of draw calls to be submitted at once. /// - int32 BatchSize; + uint16 BatchSize; /// /// The total amount of instances (sum from all draw calls in this batch). /// - int32 InstanceCount; + uint32 InstanceCount; bool operator<(const DrawBatch& other) const {