Add draw call sorting keys generation during draw calls collection (async)

This commit is contained in:
Wojtek Figat
2022-11-16 09:20:56 +01:00
parent eb281a7574
commit 3b4d91924f
9 changed files with 62 additions and 36 deletions

View File

@@ -416,7 +416,7 @@ void DrawEmitterCPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa
// Submit draw call
SpriteRenderer.SetupDrawCall(drawCall);
drawCall.InstanceCount = buffer->CPU.Count;
renderContext.List->AddDrawCall(dp, staticFlags, drawCall, false);
renderContext.List->AddDrawCall(renderContext, dp, staticFlags, drawCall, false);
break;
}
@@ -444,7 +444,7 @@ void DrawEmitterCPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa
// Submit draw call
mesh.GetDrawCallGeometry(drawCall);
drawCall.InstanceCount = buffer->CPU.Count;
renderContext.List->AddDrawCall(dp, staticFlags, drawCall, false);
renderContext.List->AddDrawCall(renderContext, dp, staticFlags, drawCall, false);
}
break;
@@ -504,7 +504,7 @@ void DrawEmitterCPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa
drawCall.Draw.StartIndex = ribbonModulesDrawIndicesStart[ribbonModuleIndex];
drawCall.Draw.IndicesCount = ribbonModulesDrawIndicesCount[ribbonModuleIndex];
drawCall.InstanceCount = 1;
renderContext.List->AddDrawCall(dp, staticFlags, drawCall, false);
renderContext.List->AddDrawCall(renderContext, dp, staticFlags, drawCall, false);
ribbonModuleIndex++;
@@ -828,7 +828,7 @@ void DrawEmitterGPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa
drawCall.Draw.IndirectArgsBuffer = buffer->GPU.IndirectDrawArgsBuffer;
drawCall.Draw.IndirectArgsOffset = indirectDrawCallIndex * sizeof(GPUDrawIndexedIndirectArgs);
if (dp != DrawPass::None)
renderContext.List->AddDrawCall(dp, staticFlags, drawCall, false);
renderContext.List->AddDrawCall(renderContext, dp, staticFlags, drawCall, false);
indirectDrawCallIndex++;
break;
@@ -858,7 +858,7 @@ void DrawEmitterGPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa
drawCall.Draw.IndirectArgsBuffer = buffer->GPU.IndirectDrawArgsBuffer;
drawCall.Draw.IndirectArgsOffset = indirectDrawCallIndex * sizeof(GPUDrawIndexedIndirectArgs);
if (dp != DrawPass::None)
renderContext.List->AddDrawCall(dp, staticFlags, drawCall, false);
renderContext.List->AddDrawCall(renderContext, dp, staticFlags, drawCall, false);
indirectDrawCallIndex++;
}