feat: add JobSystem
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include <destrum/Scene/ResourceCollector.h>
|
||||
#include <destrum/Scene/Scene.h>
|
||||
#include <destrum/Scene/SceneManager.h>
|
||||
#include <destrum/Threading/JobSystem.h>
|
||||
#include <destrum/Util/DeltaTime.h>
|
||||
|
||||
namespace {
|
||||
@@ -60,6 +61,7 @@ void App::init(const AppParams& params)
|
||||
tracy::SetThreadName("Main Thread");
|
||||
TracySetProgramName(params.appName.c_str());
|
||||
AssetFS::GetInstance().Init(params.exeDir);
|
||||
JobSystem::GetInstance().Init();
|
||||
|
||||
window.Create({
|
||||
.title = params.windowTitle,
|
||||
@@ -171,6 +173,7 @@ void App::run()
|
||||
continue;
|
||||
}
|
||||
|
||||
JobSystem::GetInstance().DrainMainThreadQueue();
|
||||
if (layer) {
|
||||
layer->onBeginFrame();
|
||||
}
|
||||
@@ -386,6 +389,7 @@ void App::cleanup()
|
||||
// The one place we wait for the GPU on shutdown: the cleanup calls below destroy
|
||||
// pipelines and other objects directly, which is only valid once nothing is in flight.
|
||||
attempt([this] { gfxDevice.waitIdle(); });
|
||||
attempt([] { JobSystem::GetInstance().Shutdown(); });
|
||||
|
||||
attempt([this] {
|
||||
if (layer) {
|
||||
|
||||
Reference in New Issue
Block a user