Step 5 storng option
This commit is contained in:
@@ -0,0 +1,144 @@
|
||||
#include "CommittedLiveState.h"
|
||||
|
||||
bool CommittedLiveState::LoadPersistentStateValue(const JsonValue& root)
|
||||
{
|
||||
return mLayerStack.LoadPersistentStateValue(root);
|
||||
}
|
||||
|
||||
JsonValue CommittedLiveState::BuildPersistentStateValue(const ShaderPackageCatalog& shaderCatalog) const
|
||||
{
|
||||
return mLayerStack.BuildPersistentStateValue(shaderCatalog);
|
||||
}
|
||||
|
||||
void CommittedLiveState::NormalizeLayerIds()
|
||||
{
|
||||
mLayerStack.NormalizeLayerIds();
|
||||
}
|
||||
|
||||
void CommittedLiveState::EnsureDefaultsForAllLayers(const ShaderPackageCatalog& shaderCatalog)
|
||||
{
|
||||
mLayerStack.EnsureDefaultsForAllLayers(shaderCatalog);
|
||||
}
|
||||
|
||||
void CommittedLiveState::EnsureDefaultLayer(const ShaderPackageCatalog& shaderCatalog)
|
||||
{
|
||||
mLayerStack.EnsureDefaultLayer(shaderCatalog);
|
||||
}
|
||||
|
||||
void CommittedLiveState::RemoveLayersWithMissingPackages(const ShaderPackageCatalog& shaderCatalog)
|
||||
{
|
||||
mLayerStack.RemoveLayersWithMissingPackages(shaderCatalog);
|
||||
}
|
||||
|
||||
bool CommittedLiveState::CreateLayer(const ShaderPackageCatalog& shaderCatalog, const std::string& shaderId, std::string& error)
|
||||
{
|
||||
return mLayerStack.CreateLayer(shaderCatalog, shaderId, error);
|
||||
}
|
||||
|
||||
bool CommittedLiveState::DeleteLayer(const std::string& layerId, std::string& error)
|
||||
{
|
||||
return mLayerStack.DeleteLayer(layerId, error);
|
||||
}
|
||||
|
||||
bool CommittedLiveState::MoveLayer(const std::string& layerId, int direction, std::string& error)
|
||||
{
|
||||
return mLayerStack.MoveLayer(layerId, direction, error);
|
||||
}
|
||||
|
||||
bool CommittedLiveState::MoveLayerToIndex(const std::string& layerId, std::size_t targetIndex, std::string& error)
|
||||
{
|
||||
return mLayerStack.MoveLayerToIndex(layerId, targetIndex, error);
|
||||
}
|
||||
|
||||
bool CommittedLiveState::SetLayerBypassState(const std::string& layerId, bool bypassed, std::string& error)
|
||||
{
|
||||
return mLayerStack.SetLayerBypassState(layerId, bypassed, error);
|
||||
}
|
||||
|
||||
bool CommittedLiveState::SetLayerShaderSelection(const ShaderPackageCatalog& shaderCatalog, const std::string& layerId, const std::string& shaderId, std::string& error)
|
||||
{
|
||||
return mLayerStack.SetLayerShaderSelection(shaderCatalog, layerId, shaderId, error);
|
||||
}
|
||||
|
||||
bool CommittedLiveState::SetParameterValue(const std::string& layerId, const std::string& parameterId, const ShaderParameterValue& value, std::string& error)
|
||||
{
|
||||
return mLayerStack.SetParameterValue(layerId, parameterId, value, error);
|
||||
}
|
||||
|
||||
bool CommittedLiveState::ResetLayerParameterValues(const ShaderPackageCatalog& shaderCatalog, const std::string& layerId, std::string& error)
|
||||
{
|
||||
return mLayerStack.ResetLayerParameterValues(shaderCatalog, layerId, error);
|
||||
}
|
||||
|
||||
bool CommittedLiveState::HasLayer(const std::string& layerId) const
|
||||
{
|
||||
return mLayerStack.HasLayer(layerId);
|
||||
}
|
||||
|
||||
bool CommittedLiveState::TryGetParameterById(const ShaderPackageCatalog& shaderCatalog, const std::string& layerId, const std::string& parameterId, StoredParameterSnapshot& snapshot, std::string& error) const
|
||||
{
|
||||
return mLayerStack.TryGetParameterById(shaderCatalog, layerId, parameterId, snapshot, error);
|
||||
}
|
||||
|
||||
bool CommittedLiveState::TryGetParameterByControlKey(const ShaderPackageCatalog& shaderCatalog, const std::string& layerKey, const std::string& parameterKey, StoredParameterSnapshot& snapshot, std::string& error) const
|
||||
{
|
||||
return mLayerStack.TryGetParameterByControlKey(shaderCatalog, layerKey, parameterKey, snapshot, error);
|
||||
}
|
||||
|
||||
bool CommittedLiveState::ResolveLayerMove(const std::string& layerId, int direction, bool& shouldMove, std::string& error) const
|
||||
{
|
||||
return mLayerStack.ResolveLayerMove(layerId, direction, shouldMove, error);
|
||||
}
|
||||
|
||||
bool CommittedLiveState::ResolveLayerMoveToIndex(const std::string& layerId, std::size_t targetIndex, bool& shouldMove, std::string& error) const
|
||||
{
|
||||
return mLayerStack.ResolveLayerMoveToIndex(layerId, targetIndex, shouldMove, error);
|
||||
}
|
||||
|
||||
JsonValue CommittedLiveState::BuildStackPresetValue(const ShaderPackageCatalog& shaderCatalog, const std::string& presetName) const
|
||||
{
|
||||
return mLayerStack.BuildStackPresetValue(shaderCatalog, presetName);
|
||||
}
|
||||
|
||||
bool CommittedLiveState::LoadStackPresetValue(const ShaderPackageCatalog& shaderCatalog, const JsonValue& root, std::string& error)
|
||||
{
|
||||
return mLayerStack.LoadStackPresetValue(shaderCatalog, root, error);
|
||||
}
|
||||
|
||||
CommittedLiveStateReadModel CommittedLiveState::BuildReadModel(const ShaderPackageCatalog& shaderCatalog) const
|
||||
{
|
||||
CommittedLiveStateReadModel model;
|
||||
model.layers = mLayerStack.Layers();
|
||||
model.packagesById = shaderCatalog.CaptureSnapshot().packagesById;
|
||||
return model;
|
||||
}
|
||||
|
||||
std::vector<CommittedLiveState::LayerPersistentState> CommittedLiveState::CopyLayerStates() const
|
||||
{
|
||||
return mLayerStack.Layers();
|
||||
}
|
||||
|
||||
const std::vector<CommittedLiveState::LayerPersistentState>& CommittedLiveState::Layers() const
|
||||
{
|
||||
return mLayerStack.Layers();
|
||||
}
|
||||
|
||||
std::vector<CommittedLiveState::LayerPersistentState>& CommittedLiveState::Layers()
|
||||
{
|
||||
return mLayerStack.Layers();
|
||||
}
|
||||
|
||||
const CommittedLiveState::LayerPersistentState* CommittedLiveState::FindLayerById(const std::string& layerId) const
|
||||
{
|
||||
return mLayerStack.FindLayerById(layerId);
|
||||
}
|
||||
|
||||
const LayerStackStore& CommittedLiveState::LayerStack() const
|
||||
{
|
||||
return mLayerStack;
|
||||
}
|
||||
|
||||
LayerStackStore& CommittedLiveState::LayerStack()
|
||||
{
|
||||
return mLayerStack;
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
#pragma once
|
||||
|
||||
#include "LayerStackStore.h"
|
||||
#include "RuntimeStoreReadModels.h"
|
||||
#include "ShaderPackageCatalog.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class CommittedLiveState
|
||||
{
|
||||
public:
|
||||
using LayerPersistentState = LayerStackStore::LayerPersistentState;
|
||||
using StoredParameterSnapshot = LayerStackStore::StoredParameterSnapshot;
|
||||
|
||||
bool LoadPersistentStateValue(const JsonValue& root);
|
||||
JsonValue BuildPersistentStateValue(const ShaderPackageCatalog& shaderCatalog) const;
|
||||
void NormalizeLayerIds();
|
||||
void EnsureDefaultsForAllLayers(const ShaderPackageCatalog& shaderCatalog);
|
||||
void EnsureDefaultLayer(const ShaderPackageCatalog& shaderCatalog);
|
||||
void RemoveLayersWithMissingPackages(const ShaderPackageCatalog& shaderCatalog);
|
||||
|
||||
bool CreateLayer(const ShaderPackageCatalog& shaderCatalog, const std::string& shaderId, std::string& error);
|
||||
bool DeleteLayer(const std::string& layerId, std::string& error);
|
||||
bool MoveLayer(const std::string& layerId, int direction, std::string& error);
|
||||
bool MoveLayerToIndex(const std::string& layerId, std::size_t targetIndex, std::string& error);
|
||||
bool SetLayerBypassState(const std::string& layerId, bool bypassed, std::string& error);
|
||||
bool SetLayerShaderSelection(const ShaderPackageCatalog& shaderCatalog, const std::string& layerId, const std::string& shaderId, std::string& error);
|
||||
bool SetParameterValue(const std::string& layerId, const std::string& parameterId, const ShaderParameterValue& value, std::string& error);
|
||||
bool ResetLayerParameterValues(const ShaderPackageCatalog& shaderCatalog, const std::string& layerId, std::string& error);
|
||||
|
||||
bool HasLayer(const std::string& layerId) const;
|
||||
bool TryGetParameterById(const ShaderPackageCatalog& shaderCatalog, const std::string& layerId, const std::string& parameterId, StoredParameterSnapshot& snapshot, std::string& error) const;
|
||||
bool TryGetParameterByControlKey(const ShaderPackageCatalog& shaderCatalog, const std::string& layerKey, const std::string& parameterKey, StoredParameterSnapshot& snapshot, std::string& error) const;
|
||||
bool ResolveLayerMove(const std::string& layerId, int direction, bool& shouldMove, std::string& error) const;
|
||||
bool ResolveLayerMoveToIndex(const std::string& layerId, std::size_t targetIndex, bool& shouldMove, std::string& error) const;
|
||||
|
||||
JsonValue BuildStackPresetValue(const ShaderPackageCatalog& shaderCatalog, const std::string& presetName) const;
|
||||
bool LoadStackPresetValue(const ShaderPackageCatalog& shaderCatalog, const JsonValue& root, std::string& error);
|
||||
|
||||
CommittedLiveStateReadModel BuildReadModel(const ShaderPackageCatalog& shaderCatalog) const;
|
||||
std::vector<LayerPersistentState> CopyLayerStates() const;
|
||||
const std::vector<LayerPersistentState>& Layers() const;
|
||||
std::vector<LayerPersistentState>& Layers();
|
||||
const LayerPersistentState* FindLayerById(const std::string& layerId) const;
|
||||
const LayerStackStore& LayerStack() const;
|
||||
LayerStackStore& LayerStack();
|
||||
|
||||
private:
|
||||
LayerStackStore mLayerStack;
|
||||
};
|
||||
@@ -92,7 +92,7 @@ std::vector<RuntimeStateLayerDescriptor> GetRuntimeStateLayerInventory()
|
||||
{
|
||||
RuntimeStateLayerKind::CommittedLive,
|
||||
"Committed live state",
|
||||
"RuntimeCoordinator, physically backed by RuntimeStore during migration",
|
||||
"RuntimeCoordinator / CommittedLiveState",
|
||||
"Current running session",
|
||||
"May request persistence depending on mutation policy",
|
||||
"Operator/session truth until changed again"
|
||||
@@ -152,14 +152,14 @@ std::vector<RuntimeStateFieldDescriptor> GetRuntimeStateFieldInventory()
|
||||
RuntimeStateField::CommittedSessionParameterValues,
|
||||
ClassifyRuntimeStateField(RuntimeStateField::CommittedSessionParameterValues),
|
||||
"committed session parameter values",
|
||||
"RuntimeCoordinator policy, RuntimeStore backing during migration",
|
||||
"RuntimeCoordinator policy, CommittedLiveState backing",
|
||||
"Operator/API truth after accepted mutations"
|
||||
},
|
||||
{
|
||||
RuntimeStateField::CommittedLayerBypass,
|
||||
ClassifyRuntimeStateField(RuntimeStateField::CommittedLayerBypass),
|
||||
"committed layer bypass",
|
||||
"RuntimeCoordinator policy, RuntimeStore backing during migration",
|
||||
"RuntimeCoordinator policy, CommittedLiveState backing",
|
||||
"Current operator/API bypass state"
|
||||
},
|
||||
{
|
||||
@@ -227,4 +227,3 @@ std::vector<RuntimeStateFieldDescriptor> GetRuntimeStateFieldInventory()
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -72,9 +72,9 @@ bool RuntimeStore::InitializeStore(std::string& error)
|
||||
return false;
|
||||
if (!ScanShaderPackages(error))
|
||||
return false;
|
||||
mLayerStack.NormalizeLayerIds();
|
||||
mLayerStack.EnsureDefaultsForAllLayers(mShaderCatalog);
|
||||
mLayerStack.EnsureDefaultLayer(mShaderCatalog);
|
||||
mCommittedLiveState.NormalizeLayerIds();
|
||||
mCommittedLiveState.EnsureDefaultsForAllLayers(mShaderCatalog);
|
||||
mCommittedLiveState.EnsureDefaultLayer(mShaderCatalog);
|
||||
|
||||
mServerPort = mConfigStore.GetConfig().serverPort;
|
||||
mAutoReloadEnabled = mConfigStore.GetConfig().autoReload;
|
||||
@@ -133,8 +133,8 @@ bool RuntimeStore::PollStoredFileChanges(bool& registryChanged, bool& reloadRequ
|
||||
|
||||
registryChanged = mShaderCatalog.HasCatalogChangedSince(previousCatalog);
|
||||
|
||||
mLayerStack.EnsureDefaultsForAllLayers(mShaderCatalog);
|
||||
for (RuntimeStore::LayerPersistentState& layer : mLayerStack.Layers())
|
||||
mCommittedLiveState.EnsureDefaultsForAllLayers(mShaderCatalog);
|
||||
for (RuntimeStore::LayerPersistentState& layer : mCommittedLiveState.Layers())
|
||||
{
|
||||
const ShaderPackage* active = mShaderCatalog.FindPackage(layer.shaderId);
|
||||
if (!active)
|
||||
@@ -163,7 +163,7 @@ bool RuntimeStore::PollStoredFileChanges(bool& registryChanged, bool& reloadRequ
|
||||
bool RuntimeStore::CreateStoredLayer(const std::string& shaderId, std::string& error)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mMutex);
|
||||
if (!mLayerStack.CreateLayer(mShaderCatalog, shaderId, error))
|
||||
if (!mCommittedLiveState.CreateLayer(mShaderCatalog, shaderId, error))
|
||||
return false;
|
||||
|
||||
mReloadRequested = true;
|
||||
@@ -174,7 +174,7 @@ bool RuntimeStore::CreateStoredLayer(const std::string& shaderId, std::string& e
|
||||
bool RuntimeStore::DeleteStoredLayer(const std::string& layerId, std::string& error)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mMutex);
|
||||
if (!mLayerStack.DeleteLayer(layerId, error))
|
||||
if (!mCommittedLiveState.DeleteLayer(layerId, error))
|
||||
return false;
|
||||
|
||||
mReloadRequested = true;
|
||||
@@ -186,12 +186,12 @@ bool RuntimeStore::MoveStoredLayer(const std::string& layerId, int direction, st
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mMutex);
|
||||
bool shouldMove = false;
|
||||
if (!mLayerStack.ResolveLayerMove(layerId, direction, shouldMove, error))
|
||||
if (!mCommittedLiveState.ResolveLayerMove(layerId, direction, shouldMove, error))
|
||||
return false;
|
||||
if (!shouldMove)
|
||||
return true;
|
||||
|
||||
if (!mLayerStack.MoveLayer(layerId, direction, error))
|
||||
if (!mCommittedLiveState.MoveLayer(layerId, direction, error))
|
||||
return false;
|
||||
|
||||
mReloadRequested = true;
|
||||
@@ -203,12 +203,12 @@ bool RuntimeStore::MoveStoredLayerToIndex(const std::string& layerId, std::size_
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mMutex);
|
||||
bool shouldMove = false;
|
||||
if (!mLayerStack.ResolveLayerMoveToIndex(layerId, targetIndex, shouldMove, error))
|
||||
if (!mCommittedLiveState.ResolveLayerMoveToIndex(layerId, targetIndex, shouldMove, error))
|
||||
return false;
|
||||
if (!shouldMove)
|
||||
return true;
|
||||
|
||||
if (!mLayerStack.MoveLayerToIndex(layerId, targetIndex, error))
|
||||
if (!mCommittedLiveState.MoveLayerToIndex(layerId, targetIndex, error))
|
||||
return false;
|
||||
|
||||
mReloadRequested = true;
|
||||
@@ -219,7 +219,7 @@ bool RuntimeStore::MoveStoredLayerToIndex(const std::string& layerId, std::size_
|
||||
bool RuntimeStore::SetStoredLayerBypassState(const std::string& layerId, bool bypassed, std::string& error)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mMutex);
|
||||
if (!mLayerStack.SetLayerBypassState(layerId, bypassed, error))
|
||||
if (!mCommittedLiveState.SetLayerBypassState(layerId, bypassed, error))
|
||||
return false;
|
||||
|
||||
mReloadRequested = true;
|
||||
@@ -230,7 +230,7 @@ bool RuntimeStore::SetStoredLayerBypassState(const std::string& layerId, bool by
|
||||
bool RuntimeStore::SetStoredLayerShaderSelection(const std::string& layerId, const std::string& shaderId, std::string& error)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mMutex);
|
||||
if (!mLayerStack.SetLayerShaderSelection(mShaderCatalog, layerId, shaderId, error))
|
||||
if (!mCommittedLiveState.SetLayerShaderSelection(mShaderCatalog, layerId, shaderId, error))
|
||||
return false;
|
||||
|
||||
mReloadRequested = true;
|
||||
@@ -242,7 +242,7 @@ bool RuntimeStore::SetStoredParameterValue(const std::string& layerId, const std
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mMutex);
|
||||
|
||||
if (!mLayerStack.SetParameterValue(layerId, parameterId, value, error))
|
||||
if (!mCommittedLiveState.SetParameterValue(layerId, parameterId, value, error))
|
||||
return false;
|
||||
|
||||
MarkParameterStateDirtyLocked();
|
||||
@@ -253,7 +253,7 @@ bool RuntimeStore::ResetStoredLayerParameterValues(const std::string& layerId, s
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mMutex);
|
||||
|
||||
if (!mLayerStack.ResetLayerParameterValues(mShaderCatalog, layerId, error))
|
||||
if (!mCommittedLiveState.ResetLayerParameterValues(mShaderCatalog, layerId, error))
|
||||
return false;
|
||||
|
||||
MarkParameterStateDirtyLocked();
|
||||
@@ -271,7 +271,7 @@ bool RuntimeStore::SaveStackPresetSnapshot(const std::string& presetName, std::s
|
||||
}
|
||||
|
||||
JsonValue root = JsonValue::MakeObject();
|
||||
root = mLayerStack.BuildStackPresetValue(mShaderCatalog, presetName);
|
||||
root = mCommittedLiveState.BuildStackPresetValue(mShaderCatalog, presetName);
|
||||
|
||||
return WriteTextFile(mConfigStore.GetPresetRoot() / (safeStem + ".json"), SerializeJson(root, true), error);
|
||||
}
|
||||
@@ -295,7 +295,7 @@ bool RuntimeStore::LoadStackPresetSnapshot(const std::string& presetName, std::s
|
||||
if (!ParseJson(presetText, root, error))
|
||||
return false;
|
||||
|
||||
if (!mLayerStack.LoadStackPresetValue(mShaderCatalog, root, error))
|
||||
if (!mCommittedLiveState.LoadStackPresetValue(mShaderCatalog, root, error))
|
||||
return false;
|
||||
|
||||
mReloadRequested = true;
|
||||
@@ -306,7 +306,7 @@ bool RuntimeStore::LoadStackPresetSnapshot(const std::string& presetName, std::s
|
||||
bool RuntimeStore::HasStoredLayer(const std::string& layerId) const
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mMutex);
|
||||
return mLayerStack.HasLayer(layerId);
|
||||
return mCommittedLiveState.HasLayer(layerId);
|
||||
}
|
||||
|
||||
bool RuntimeStore::HasStoredShader(const std::string& shaderId) const
|
||||
@@ -319,26 +319,26 @@ bool RuntimeStore::TryGetStoredParameterById(const std::string& layerId, const s
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mMutex);
|
||||
|
||||
return mLayerStack.TryGetParameterById(mShaderCatalog, layerId, parameterId, snapshot, error);
|
||||
return mCommittedLiveState.TryGetParameterById(mShaderCatalog, layerId, parameterId, snapshot, error);
|
||||
}
|
||||
|
||||
bool RuntimeStore::TryGetStoredParameterByControlKey(const std::string& layerKey, const std::string& parameterKey, StoredParameterSnapshot& snapshot, std::string& error) const
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mMutex);
|
||||
|
||||
return mLayerStack.TryGetParameterByControlKey(mShaderCatalog, layerKey, parameterKey, snapshot, error);
|
||||
return mCommittedLiveState.TryGetParameterByControlKey(mShaderCatalog, layerKey, parameterKey, snapshot, error);
|
||||
}
|
||||
|
||||
bool RuntimeStore::ResolveStoredLayerMove(const std::string& layerId, int direction, bool& shouldMove, std::string& error) const
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mMutex);
|
||||
return mLayerStack.ResolveLayerMove(layerId, direction, shouldMove, error);
|
||||
return mCommittedLiveState.ResolveLayerMove(layerId, direction, shouldMove, error);
|
||||
}
|
||||
|
||||
bool RuntimeStore::ResolveStoredLayerMoveToIndex(const std::string& layerId, std::size_t targetIndex, bool& shouldMove, std::string& error) const
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mMutex);
|
||||
return mLayerStack.ResolveLayerMoveToIndex(layerId, targetIndex, shouldMove, error);
|
||||
return mCommittedLiveState.ResolveLayerMoveToIndex(layerId, targetIndex, shouldMove, error);
|
||||
}
|
||||
|
||||
bool RuntimeStore::IsValidStackPresetName(const std::string& presetName) const
|
||||
@@ -460,12 +460,12 @@ bool RuntimeStore::LoadPersistentState(std::string& error)
|
||||
if (!ParseJson(stateText, root, error))
|
||||
return false;
|
||||
|
||||
return mLayerStack.LoadPersistentStateValue(root);
|
||||
return mCommittedLiveState.LoadPersistentStateValue(root);
|
||||
}
|
||||
|
||||
bool RuntimeStore::SavePersistentState(std::string& error) const
|
||||
{
|
||||
return WriteTextFile(mConfigStore.GetRuntimeStatePath(), SerializeJson(mLayerStack.BuildPersistentStateValue(mShaderCatalog), true), error);
|
||||
return WriteTextFile(mConfigStore.GetRuntimeStatePath(), SerializeJson(mCommittedLiveState.BuildPersistentStateValue(mShaderCatalog), true), error);
|
||||
}
|
||||
|
||||
bool RuntimeStore::ScanShaderPackages(std::string& error)
|
||||
@@ -473,7 +473,7 @@ bool RuntimeStore::ScanShaderPackages(std::string& error)
|
||||
if (!mShaderCatalog.Scan(mConfigStore.GetShaderRoot(), mConfigStore.GetConfig().maxTemporalHistoryFrames, error))
|
||||
return false;
|
||||
|
||||
mLayerStack.RemoveLayersWithMissingPackages(mShaderCatalog);
|
||||
mCommittedLiveState.RemoveLayersWithMissingPackages(mShaderCatalog);
|
||||
|
||||
MarkRenderStateDirtyLocked();
|
||||
return true;
|
||||
@@ -548,7 +548,7 @@ std::vector<std::string> RuntimeStore::GetStackPresetNamesLocked() const
|
||||
bool RuntimeStore::CopyShaderPackageForStoredLayer(const std::string& layerId, ShaderPackage& shaderPackage, std::string& error) const
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mMutex);
|
||||
const RuntimeStore::LayerPersistentState* layer = mLayerStack.FindLayerById(layerId);
|
||||
const RuntimeStore::LayerPersistentState* layer = mCommittedLiveState.FindLayerById(layerId);
|
||||
if (!layer)
|
||||
{
|
||||
error = "Unknown layer id: " + layerId;
|
||||
@@ -578,11 +578,8 @@ ShaderCompilerInputs RuntimeStore::GetShaderCompilerInputs() const
|
||||
|
||||
CommittedLiveStateReadModel RuntimeStore::BuildCommittedLiveStateReadModel() const
|
||||
{
|
||||
CommittedLiveStateReadModel model;
|
||||
std::lock_guard<std::mutex> lock(mMutex);
|
||||
model.layers = mLayerStack.Layers();
|
||||
model.packagesById = mShaderCatalog.CaptureSnapshot().packagesById;
|
||||
return model;
|
||||
return mCommittedLiveState.BuildReadModel(mShaderCatalog);
|
||||
}
|
||||
|
||||
RenderSnapshotReadModel RuntimeStore::BuildRenderSnapshotReadModel() const
|
||||
@@ -599,7 +596,7 @@ RenderSnapshotReadModel RuntimeStore::BuildRenderSnapshotReadModel() const
|
||||
std::vector<RuntimeStore::LayerPersistentState> RuntimeStore::CopyCommittedLiveLayerStates() const
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mMutex);
|
||||
return mLayerStack.Layers();
|
||||
return mCommittedLiveState.CopyLayerStates();
|
||||
}
|
||||
|
||||
std::vector<RuntimeStore::LayerPersistentState> RuntimeStore::CopyLayerStates() const
|
||||
@@ -622,7 +619,7 @@ RuntimeStatePresentationReadModel RuntimeStore::BuildRuntimeStatePresentationRea
|
||||
model.telemetry = mHealthTelemetry.GetSnapshot();
|
||||
std::lock_guard<std::mutex> lock(mMutex);
|
||||
model.config = mConfigStore.GetConfig();
|
||||
model.layerStack = mLayerStack;
|
||||
model.layerStack = mCommittedLiveState.LayerStack();
|
||||
model.shaderCatalog = mShaderCatalog.CaptureSnapshot();
|
||||
model.packageStatuses = mShaderCatalog.PackageStatuses();
|
||||
model.stackPresetNames = GetStackPresetNamesLocked();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "HealthTelemetry.h"
|
||||
#include "CommittedLiveState.h"
|
||||
#include "LayerStackStore.h"
|
||||
#include "RenderSnapshotBuilder.h"
|
||||
#include "RuntimeConfigStore.h"
|
||||
@@ -91,7 +92,7 @@ private:
|
||||
RenderSnapshotBuilder mRenderSnapshotBuilder;
|
||||
RuntimeConfigStore mConfigStore;
|
||||
ShaderPackageCatalog mShaderCatalog;
|
||||
LayerStackStore mLayerStack;
|
||||
CommittedLiveState mCommittedLiveState;
|
||||
HealthTelemetry mHealthTelemetry;
|
||||
mutable std::mutex mMutex;
|
||||
bool mReloadRequested;
|
||||
|
||||
Reference in New Issue
Block a user