Cleanup some rendering code

This commit is contained in:
Wojtek Figat
2024-06-28 21:21:17 +02:00
parent e265b760c1
commit 516ed3e9a0
10 changed files with 22 additions and 35 deletions

View File

@@ -691,7 +691,6 @@ void RenderList::ExecuteDrawCalls(const RenderContext& renderContext, DrawCallsL
// Prepare instance buffer
if (useInstancing)
{
PROFILE_CPU_NAMED("Build Instancing");
int32 instancedBatchesCount = 0;
for (int32 i = 0; i < list.Batches.Count(); i++)
{
@@ -707,6 +706,7 @@ void RenderList::ExecuteDrawCalls(const RenderContext& renderContext, DrawCallsL
}
if (instancedBatchesCount != 0)
{
PROFILE_CPU_NAMED("Build Instancing");
_instanceBuffer.Clear();
_instanceBuffer.Data.Resize(instancedBatchesCount * sizeof(InstanceData));
auto instanceData = (InstanceData*)_instanceBuffer.Data.Get();