Add multi-threaded scene rendering with Job System

This commit is contained in:
Wojtek Figat
2022-11-06 15:35:43 +01:00
parent 183636289a
commit 9c7da16c1a
23 changed files with 564 additions and 160 deletions

View File

@@ -369,3 +369,12 @@ void JobSystem::SetJobStartingOnDispatch(bool value)
}
#endif
}
int32 JobSystem::GetThreadsCount()
{
#if JOB_SYSTEM_ENABLED
return ThreadsCount;
#else
return 0;
#endif
}

View File

@@ -41,4 +41,9 @@ API_CLASS(Static) class FLAXENGINE_API JobSystem
/// Sets whether automatically start jobs execution on Dispatch. If disabled jobs won't be executed until it gets re-enabled. Can be used to optimize execution of multiple dispatches that should overlap.
/// </summary>
API_FUNCTION() static void SetJobStartingOnDispatch(bool value);
/// <summary>
/// Gets the amount of job system threads.
/// </summary>
API_PROPERTY() static int32 GetThreadsCount();
};