More changes
Some checks failed
CI / React UI Build (push) Successful in 11s
CI / Native Windows Build And Tests (push) Failing after 2m12s
CI / Windows Release Package (push) Has been skipped

This commit is contained in:
2026-05-21 16:51:00 +10:00
parent d68cf9b1a0
commit 5c46eaf18a
10 changed files with 505 additions and 2 deletions

View File

@@ -36,6 +36,9 @@ void RuntimeLayerController::InitializeLayerModel(std::string& runtimeShaderId)
if (InitializeLayerModelFromRuntimeState())
return;
if (!runtimeShaderId.empty())
Log("runtime-state", "Falling back to configured runtime shader '" + runtimeShaderId + "'.");
std::lock_guard<std::mutex> lock(mRuntimeLayerMutex);
std::string error;
if (!mRuntimeLayerModel.InitializeSingleLayer(mShaderCatalog, runtimeShaderId, error))
@@ -48,9 +51,11 @@ void RuntimeLayerController::InitializeLayerModel(std::string& runtimeShaderId)
bool RuntimeLayerController::InitializeLayerModelFromRuntimeState()
{
const std::filesystem::path runtimeStatePath = FindRepoPath("runtime/runtime_state.json");
const std::filesystem::path runtimeStatePath = mRuntimeStatePath.empty() ? ResolveRuntimeStatePath() : mRuntimeStatePath;
if (runtimeStatePath.empty())
return false;
if (!std::filesystem::exists(runtimeStatePath))
return false;
std::ifstream input(runtimeStatePath, std::ios::binary);
if (!input)
@@ -83,6 +88,25 @@ bool RuntimeLayerController::InitializeLayerModelFromRuntimeState()
return true;
}
std::filesystem::path RuntimeLayerController::ResolveRuntimeStatePath() const
{
const std::filesystem::path runtimeDirectory = FindRepoPath("runtime");
if (!runtimeDirectory.empty())
return runtimeDirectory / "runtime_state.json";
return std::filesystem::current_path() / "runtime" / "runtime_state.json";
}
void RuntimeLayerController::RequestRuntimeStatePersistence()
{
std::lock_guard<std::mutex> lock(mRuntimeLayerMutex);
RequestRuntimeStatePersistenceLocked();
}
void RuntimeLayerController::RequestRuntimeStatePersistenceLocked()
{
mPersistenceWriter.RequestSave(mRuntimeLayerModel.Snapshot());
}
void RuntimeLayerController::StartLayerShaderBuild(const std::string& layerId, const std::string& shaderId)
{
CleanupRetiredShaderBuilds();