44 lines
1.4 KiB
C++
44 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include "RuntimeHost.h"
|
|
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
struct RuntimeSnapshotVersions
|
|
{
|
|
uint64_t renderStateVersion = 0;
|
|
uint64_t parameterStateVersion = 0;
|
|
};
|
|
|
|
struct RuntimeRenderStateSnapshot
|
|
{
|
|
RuntimeSnapshotVersions versions;
|
|
unsigned outputWidth = 0;
|
|
unsigned outputHeight = 0;
|
|
std::vector<RuntimeRenderState> states;
|
|
};
|
|
|
|
class RuntimeSnapshotProvider
|
|
{
|
|
public:
|
|
explicit RuntimeSnapshotProvider(RuntimeHost& runtimeHost);
|
|
|
|
bool BuildLayerPassFragmentShaderSources(const std::string& layerId, std::vector<ShaderPassBuildSource>& passSources, std::string& error) const;
|
|
unsigned GetMaxTemporalHistoryFrames() const;
|
|
RuntimeSnapshotVersions GetVersions() const;
|
|
void AdvanceFrame();
|
|
RuntimeRenderStateSnapshot GetRenderStateSnapshot(unsigned outputWidth, unsigned outputHeight) const;
|
|
bool TryGetRenderStateSnapshot(unsigned outputWidth, unsigned outputHeight, RuntimeRenderStateSnapshot& snapshot) const;
|
|
bool TryRefreshSnapshotParameters(RuntimeRenderStateSnapshot& snapshot) const;
|
|
void RefreshDynamicRenderStateFields(std::vector<RuntimeRenderState>& states) const;
|
|
|
|
private:
|
|
void BuildLayerRenderStatesLocked(unsigned outputWidth, unsigned outputHeight, std::vector<RuntimeRenderState>& states) const;
|
|
void RefreshCachedLayerStatesLocked(std::vector<RuntimeRenderState>& states) const;
|
|
void RefreshDynamicRenderStateFieldsLocked(std::vector<RuntimeRenderState>& states) const;
|
|
|
|
RuntimeHost& mRuntimeHost;
|
|
};
|