Phase 5 step 5
This commit is contained in:
@@ -89,7 +89,7 @@ bool RenderSnapshotBuilder::TryBuildLayerRenderStates(unsigned outputWidth, unsi
|
||||
|
||||
bool RenderSnapshotBuilder::TryRefreshLayerParameters(std::vector<RuntimeRenderState>& states) const
|
||||
{
|
||||
RefreshLayerParameters(mRuntimeStore.CopyLayerStates(), states);
|
||||
RefreshLayerParameters(mRuntimeStore.CopyCommittedLiveLayerStates(), states);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -113,10 +113,10 @@ void RenderSnapshotBuilder::BuildLayerRenderStates(unsigned outputWidth, unsigne
|
||||
{
|
||||
states.clear();
|
||||
|
||||
for (const LayerStackStore::LayerPersistentState& layer : readModel.layers)
|
||||
for (const LayerStackStore::LayerPersistentState& layer : readModel.committedLiveState.layers)
|
||||
{
|
||||
auto shaderIt = readModel.packagesById.find(layer.shaderId);
|
||||
if (shaderIt == readModel.packagesById.end())
|
||||
auto shaderIt = readModel.committedLiveState.packagesById.find(layer.shaderId);
|
||||
if (shaderIt == readModel.committedLiveState.packagesById.end())
|
||||
continue;
|
||||
const ShaderPackage& shaderPackage = shaderIt->second;
|
||||
|
||||
|
||||
@@ -576,24 +576,37 @@ ShaderCompilerInputs RuntimeStore::GetShaderCompilerInputs() const
|
||||
return inputs;
|
||||
}
|
||||
|
||||
CommittedLiveStateReadModel RuntimeStore::BuildCommittedLiveStateReadModel() const
|
||||
{
|
||||
CommittedLiveStateReadModel model;
|
||||
std::lock_guard<std::mutex> lock(mMutex);
|
||||
model.layers = mLayerStack.Layers();
|
||||
model.packagesById = mShaderCatalog.CaptureSnapshot().packagesById;
|
||||
return model;
|
||||
}
|
||||
|
||||
RenderSnapshotReadModel RuntimeStore::BuildRenderSnapshotReadModel() const
|
||||
{
|
||||
RenderSnapshotReadModel model;
|
||||
model.signalStatus = mHealthTelemetry.GetSignalStatusSnapshot();
|
||||
model.committedLiveState = BuildCommittedLiveStateReadModel();
|
||||
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::vector<RuntimeStore::LayerPersistentState> RuntimeStore::CopyCommittedLiveLayerStates() const
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mMutex);
|
||||
return mLayerStack.Layers();
|
||||
}
|
||||
|
||||
std::vector<RuntimeStore::LayerPersistentState> RuntimeStore::CopyLayerStates() const
|
||||
{
|
||||
return CopyCommittedLiveLayerStates();
|
||||
}
|
||||
|
||||
RenderTimingSnapshot RuntimeStore::GetRenderTimingSnapshot() const
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mMutex);
|
||||
|
||||
@@ -71,7 +71,9 @@ public:
|
||||
void ClearReloadRequest();
|
||||
bool CopyShaderPackageForStoredLayer(const std::string& layerId, ShaderPackage& shaderPackage, std::string& error) const;
|
||||
::ShaderCompilerInputs GetShaderCompilerInputs() const;
|
||||
::CommittedLiveStateReadModel BuildCommittedLiveStateReadModel() const;
|
||||
::RenderSnapshotReadModel BuildRenderSnapshotReadModel() const;
|
||||
std::vector<LayerPersistentState> CopyCommittedLiveLayerStates() const;
|
||||
std::vector<LayerPersistentState> CopyLayerStates() const;
|
||||
::RenderTimingSnapshot GetRenderTimingSnapshot() const;
|
||||
::RuntimeStatePresentationReadModel BuildRuntimeStatePresentationReadModel() const;
|
||||
|
||||
@@ -27,10 +27,15 @@ struct RenderTimingSnapshot
|
||||
double startupRandom = 0.0;
|
||||
};
|
||||
|
||||
struct RenderSnapshotReadModel
|
||||
struct CommittedLiveStateReadModel
|
||||
{
|
||||
std::vector<LayerStackStore::LayerPersistentState> layers;
|
||||
std::map<std::string, ShaderPackage> packagesById;
|
||||
};
|
||||
|
||||
struct RenderSnapshotReadModel
|
||||
{
|
||||
CommittedLiveStateReadModel committedLiveState;
|
||||
HealthTelemetry::SignalStatusSnapshot signalStatus;
|
||||
RenderTimingSnapshot timing;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user