feat: start loading some stuff async

This commit is contained in:
2026-10-24 01:29:00 +02:00
parent 9c5a97cfbd
commit aa3eef259c
6 changed files with 53 additions and 8 deletions
+2 -1
View File
@@ -15,6 +15,7 @@
#include <destrum/FS/AssetFS.h>
#include <destrum/Graphics/Material.h>
#include <destrum/Serialization/MaterialSerialization.h>
#include <destrum/Threading/JobSystem.h>
#include <destrum/Util/ImGuiUtils.h>
namespace {
@@ -219,7 +220,7 @@ void AssetBrowser::StartCook()
return;
}
m_Cook = std::async(std::launch::async, [commands = std::move(commands)] {
m_Cook = JobSystem::GetInstance().Async([commands = std::move(commands)] {
bool succeeded = true;
for (const std::string& command : commands) {
succeeded = std::system(command.c_str()) == 0 && succeeded;
+3 -1
View File
@@ -6,6 +6,8 @@
#include <spdlog/spdlog.h>
#include <destrum/Threading/JobSystem.h>
namespace {
constexpr float PollInterval = 0.5f;
@@ -48,7 +50,7 @@ void ShaderHotReload::StartCook()
// cmd.exe strips the outer quotes, the inner ones keep paths with spaces intact
const std::string command = "\"\"" + m_Cooker.string() + "\" --input \"" + m_SourceRoot.string() +
"\" --output \"" + m_RuntimeRoot.string() + "\"\"";
m_Cook = std::async(std::launch::async, [command] { return std::system(command.c_str()); });
m_Cook = JobSystem::GetInstance().Async([command] { return std::system(command.c_str()); });
spdlog::info("Shader sources changed, cooking engine assets");
}