phase 1 runtime complete
All checks were successful
CI / React UI Build (push) Successful in 11s
CI / Native Windows Build And Tests (push) Successful in 2m46s
CI / Windows Release Package (push) Successful in 2m59s

This commit is contained in:
Aiden
2026-05-11 02:23:01 +10:00
parent cbf1b541dc
commit 9cbb5d8004
20 changed files with 265 additions and 1288 deletions

View File

@@ -564,15 +564,60 @@ bool RuntimeStore::CopyShaderPackageForStoredLayer(const std::string& layerId, S
return true;
}
void RuntimeStore::GetShaderCompilerInputs(std::filesystem::path& repoRoot, std::filesystem::path& wrapperPath,
std::filesystem::path& generatedGlslPath, std::filesystem::path& patchedGlslPath, unsigned& maxTemporalHistoryFrames) const
ShaderCompilerInputs RuntimeStore::GetShaderCompilerInputs() const
{
std::lock_guard<std::mutex> lock(mMutex);
repoRoot = mConfigStore.GetRepoRoot();
wrapperPath = mConfigStore.GetWrapperPath();
generatedGlslPath = mConfigStore.GetGeneratedGlslPath();
patchedGlslPath = mConfigStore.GetPatchedGlslPath();
maxTemporalHistoryFrames = mConfigStore.GetConfig().maxTemporalHistoryFrames;
ShaderCompilerInputs inputs;
inputs.repoRoot = mConfigStore.GetRepoRoot();
inputs.wrapperPath = mConfigStore.GetWrapperPath();
inputs.generatedGlslPath = mConfigStore.GetGeneratedGlslPath();
inputs.patchedGlslPath = mConfigStore.GetPatchedGlslPath();
inputs.maxTemporalHistoryFrames = mConfigStore.GetConfig().maxTemporalHistoryFrames;
return inputs;
}
RenderSnapshotReadModel RuntimeStore::BuildRenderSnapshotReadModel() const
{
RenderSnapshotReadModel model;
model.signalStatus = mHealthTelemetry.GetSignalStatusSnapshot();
std::lock_guard<std::mutex> lock(mMutex);
model.layers = mLayerStack.Layers();
model.packagesById = mShaderCatalog.CaptureSnapshot().packagesById;
model.timing.startTime = mStartTime;
model.timing.startupRandom = mStartupRandom;
return model;
}
std::vector<RuntimeStore::LayerPersistentState> RuntimeStore::CopyLayerStates() const
{
std::lock_guard<std::mutex> lock(mMutex);
return mLayerStack.Layers();
}
RenderTimingSnapshot RuntimeStore::GetRenderTimingSnapshot() const
{
std::lock_guard<std::mutex> lock(mMutex);
RenderTimingSnapshot snapshot;
snapshot.startTime = mStartTime;
snapshot.startupRandom = mStartupRandom;
return snapshot;
}
RuntimeStatePresentationReadModel RuntimeStore::BuildRuntimeStatePresentationReadModel() const
{
RuntimeStatePresentationReadModel model;
model.telemetry = mHealthTelemetry.GetSnapshot();
std::lock_guard<std::mutex> lock(mMutex);
model.config = mConfigStore.GetConfig();
model.layerStack = mLayerStack;
model.shaderCatalog = mShaderCatalog.CaptureSnapshot();
model.packageStatuses = mShaderCatalog.PackageStatuses();
model.stackPresetNames = GetStackPresetNamesLocked();
model.serverPort = mServerPort;
model.autoReloadEnabled = mAutoReloadEnabled;
model.compileSucceeded = mCompileSucceeded;
model.compileMessage = mCompileMessage;
return model;
}
void RuntimeStore::MarkRenderStateDirtyLocked()

View File

@@ -5,6 +5,7 @@
#include "RenderSnapshotBuilder.h"
#include "RuntimeConfigStore.h"
#include "RuntimeJson.h"
#include "RuntimeStoreReadModels.h"
#include "ShaderPackageCatalog.h"
#include "ShaderTypes.h"
@@ -14,8 +15,6 @@
#include <string>
#include <vector>
class RuntimeStatePresenter;
class RuntimeStore
{
public:
@@ -70,19 +69,20 @@ public:
void SetCompileStatus(bool succeeded, const std::string& message);
void ClearReloadRequest();
bool CopyShaderPackageForStoredLayer(const std::string& layerId, ShaderPackage& shaderPackage, std::string& error) const;
::ShaderCompilerInputs GetShaderCompilerInputs() const;
::RenderSnapshotReadModel BuildRenderSnapshotReadModel() const;
std::vector<LayerPersistentState> CopyLayerStates() const;
::RenderTimingSnapshot GetRenderTimingSnapshot() const;
::RuntimeStatePresentationReadModel BuildRuntimeStatePresentationReadModel() const;
private:
friend class RenderSnapshotBuilder;
friend class RuntimeStatePresenter;
bool LoadPersistentState(std::string& error);
bool SavePersistentState(std::string& error) const;
bool ScanShaderPackages(std::string& error);
std::string ReadTextFile(const std::filesystem::path& path, std::string& error) const;
bool WriteTextFile(const std::filesystem::path& path, const std::string& contents, std::string& error) const;
std::vector<std::string> GetStackPresetNamesLocked() const;
bool CopyShaderPackageForStoredLayer(const std::string& layerId, ShaderPackage& shaderPackage, std::string& error) const;
void GetShaderCompilerInputs(std::filesystem::path& repoRoot, std::filesystem::path& wrapperPath,
std::filesystem::path& generatedGlslPath, std::filesystem::path& patchedGlslPath, unsigned& maxTemporalHistoryFrames) const;
void MarkRenderStateDirtyLocked();
void MarkParameterStateDirtyLocked();

View File

@@ -0,0 +1,50 @@
#pragma once
#include "HealthTelemetry.h"
#include "LayerStackStore.h"
#include "RuntimeConfigStore.h"
#include "ShaderPackageCatalog.h"
#include "ShaderTypes.h"
#include <chrono>
#include <filesystem>
#include <map>
#include <string>
#include <vector>
struct ShaderCompilerInputs
{
std::filesystem::path repoRoot;
std::filesystem::path wrapperPath;
std::filesystem::path generatedGlslPath;
std::filesystem::path patchedGlslPath;
unsigned maxTemporalHistoryFrames = 0;
};
struct RenderTimingSnapshot
{
std::chrono::steady_clock::time_point startTime;
double startupRandom = 0.0;
};
struct RenderSnapshotReadModel
{
std::vector<LayerStackStore::LayerPersistentState> layers;
std::map<std::string, ShaderPackage> packagesById;
HealthTelemetry::SignalStatusSnapshot signalStatus;
RenderTimingSnapshot timing;
};
struct RuntimeStatePresentationReadModel
{
RuntimeConfigStore::AppConfig config;
HealthTelemetry::Snapshot telemetry;
LayerStackStore layerStack;
ShaderPackageCatalog::Snapshot shaderCatalog;
std::vector<ShaderPackageStatus> packageStatuses;
std::vector<std::string> stackPresetNames;
unsigned short serverPort = 0;
bool autoReloadEnabled = false;
bool compileSucceeded = false;
std::string compileMessage;
};