| 338 | } |
| 339 | |
| 340 | void Renderer::DrawActors(RenderContext& renderContext, const Array<Actor*>& customActors) |
| 341 | { |
| 342 | if (customActors.HasItems()) |
| 343 | { |
| 344 | // Draw custom actors |
| 345 | for (Actor* actor : customActors) |
| 346 | { |
| 347 | if (actor && actor->GetIsActive()) |
| 348 | actor->Draw(renderContext); |
| 349 | } |
| 350 | } |
| 351 | else |
| 352 | { |
| 353 | // Draw scene actors |
| 354 | RenderContextBatch renderContextBatch(renderContext); |
| 355 | JobSystem::SetJobStartingOnDispatch(false); |
| 356 | Level::DrawActors(renderContextBatch, SceneRendering::DrawCategory::SceneDraw); |
| 357 | Level::DrawActors(renderContextBatch, SceneRendering::DrawCategory::SceneDrawAsync); |
| 358 | JobSystem::SetJobStartingOnDispatch(true); |
| 359 | for (const int64 label : renderContextBatch.WaitLabels) |
| 360 | JobSystem::Wait(label); |
| 361 | renderContextBatch.WaitLabels.Clear(); |
| 362 | } |
| 363 | } |
| 364 | |
| 365 | void RenderInner(SceneRenderTask* task, RenderContext& renderContext, RenderContextBatch& renderContextBatch) |
| 366 | { |