Refactor draw calls drawing to use single objects buffer and better materials batching
This commit is contained in:
@@ -428,6 +428,9 @@ void RenderInner(SceneRenderTask* task, RenderContext& renderContext, RenderCont
|
||||
// Sort draw calls
|
||||
{
|
||||
PROFILE_CPU_NAMED("Sort Draw Calls");
|
||||
// TODO: run all of these functions in async via jobs
|
||||
for (int32 i = 0; i < renderContextBatch.Contexts.Count(); i++)
|
||||
renderContextBatch.Contexts[i].List->BuildObjectsBuffer();
|
||||
renderContext.List->SortDrawCalls(renderContext, false, DrawCallsListType::GBuffer);
|
||||
renderContext.List->SortDrawCalls(renderContext, false, DrawCallsListType::GBufferNoDecals);
|
||||
renderContext.List->SortDrawCalls(renderContext, true, DrawCallsListType::Forward);
|
||||
@@ -440,6 +443,11 @@ void RenderInner(SceneRenderTask* task, RenderContext& renderContext, RenderCont
|
||||
shadowContext.List->SortDrawCalls(shadowContext, false, DrawCallsListType::Depth, DrawPass::Depth);
|
||||
shadowContext.List->SortDrawCalls(shadowContext, false, shadowContext.List->ShadowDepthDrawCallsList, renderContext.List->DrawCalls, DrawPass::Depth);
|
||||
}
|
||||
{
|
||||
PROFILE_CPU_NAMED("FlushObjectsBuffer");
|
||||
for (int32 i = 0; i < renderContextBatch.Contexts.Count(); i++)
|
||||
renderContextBatch.Contexts[i].List->ObjectBuffer.Flush(context);
|
||||
}
|
||||
}
|
||||
|
||||
// Get the light accumulation buffer
|
||||
|
||||
Reference in New Issue
Block a user