Jobify view culling (#3983)
* Jobify culling * Move JobCompletion to stack Signed-off-by: Tobias Alexander Franke <tobias.alexander.franke@huawei.com> Co-authored-by: Tobias Alexander Franke <tobias.alexander.franke@huawei.com>
This commit is contained in:
committed by
GitHub
parent
61a9223256
commit
9477da799b
@@ -730,12 +730,22 @@ namespace AZ
|
||||
|
||||
m_debugCtx.ResetCullStats();
|
||||
m_debugCtx.m_numCullablesInScene = GetNumCullables();
|
||||
AZ::JobCompletion beginCullingCompletion;
|
||||
|
||||
for (auto& view : views)
|
||||
{
|
||||
view->BeginCulling();
|
||||
const auto cullingLambda = [&view]()
|
||||
{
|
||||
view->BeginCulling();
|
||||
};
|
||||
|
||||
AZ::Job* cullingJob = AZ::CreateJobFunction(AZStd::move(cullingLambda), true, nullptr);
|
||||
cullingJob->SetDependent(&beginCullingCompletion);
|
||||
cullingJob->Start();
|
||||
}
|
||||
|
||||
beginCullingCompletion.StartAndWaitForCompletion();
|
||||
|
||||
AuxGeomDrawPtr auxGeom;
|
||||
if (m_debugCtx.m_debugDraw)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user