Optimize multiple dispatches on JobSystem done via TaskGraph

This commit is contained in:
Wojtek Figat
2021-06-16 19:02:02 +02:00
parent d895789296
commit c2590fc0d9
3 changed files with 33 additions and 4 deletions

View File

@@ -94,6 +94,7 @@ void TaskGraph::Execute()
// Execute in order
Sorting::QuickSort(_queue.Get(), _queue.Count(), &SortTaskGraphSystem);
JobSystem::SetJobStartingOnDispatch(false);
_currentLabel = 0;
for (int32 i = 0; i < _queue.Count(); i++)
{
@@ -104,6 +105,7 @@ void TaskGraph::Execute()
_queue.Clear();
// Wait for async jobs to finish
JobSystem::SetJobStartingOnDispatch(true);
JobSystem::Wait(_currentLabel);
}