Multi pass
This commit is contained in:
@@ -1302,7 +1302,7 @@ bool RuntimeHost::TryAdvanceFrame()
|
||||
|
||||
bool RuntimeHost::BuildLayerFragmentShaderSource(const std::string& layerId, std::string& fragmentShaderSource, std::string& error)
|
||||
{
|
||||
std::vector<std::pair<std::string, std::string>> passSources;
|
||||
std::vector<ShaderPassBuildSource> passSources;
|
||||
if (!BuildLayerPassFragmentShaderSources(layerId, passSources, error))
|
||||
return false;
|
||||
if (passSources.empty())
|
||||
@@ -1310,11 +1310,11 @@ bool RuntimeHost::BuildLayerFragmentShaderSource(const std::string& layerId, std
|
||||
error = "Shader layer produced no compiled passes: " + layerId;
|
||||
return false;
|
||||
}
|
||||
fragmentShaderSource = passSources.front().second;
|
||||
fragmentShaderSource = passSources.front().fragmentShaderSource;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RuntimeHost::BuildLayerPassFragmentShaderSources(const std::string& layerId, std::vector<std::pair<std::string, std::string>>& passSources, std::string& error)
|
||||
bool RuntimeHost::BuildLayerPassFragmentShaderSources(const std::string& layerId, std::vector<ShaderPassBuildSource>& passSources, std::string& error)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -1342,10 +1342,13 @@ bool RuntimeHost::BuildLayerPassFragmentShaderSources(const std::string& layerId
|
||||
passSources.reserve(shaderPackage.passes.size());
|
||||
for (const ShaderPassDefinition& pass : shaderPackage.passes)
|
||||
{
|
||||
std::string fragmentShaderSource;
|
||||
if (!compiler.BuildPassFragmentShaderSource(shaderPackage, pass, fragmentShaderSource, error))
|
||||
ShaderPassBuildSource passSource;
|
||||
passSource.passId = pass.id;
|
||||
passSource.inputNames = pass.inputNames;
|
||||
passSource.outputName = pass.outputName;
|
||||
if (!compiler.BuildPassFragmentShaderSource(shaderPackage, pass, passSource.fragmentShaderSource, error))
|
||||
return false;
|
||||
passSources.push_back(std::make_pair(pass.id, std::move(fragmentShaderSource)));
|
||||
passSources.push_back(std::move(passSource));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
bool TryAdvanceFrame();
|
||||
|
||||
bool BuildLayerFragmentShaderSource(const std::string& layerId, std::string& fragmentShaderSource, std::string& error);
|
||||
bool BuildLayerPassFragmentShaderSources(const std::string& layerId, std::vector<std::pair<std::string, std::string>>& passSources, std::string& error);
|
||||
bool BuildLayerPassFragmentShaderSources(const std::string& layerId, std::vector<ShaderPassBuildSource>& passSources, std::string& error);
|
||||
std::vector<RuntimeRenderState> GetLayerRenderStates(unsigned outputWidth, unsigned outputHeight) const;
|
||||
bool TryGetLayerRenderStates(unsigned outputWidth, unsigned outputHeight, std::vector<RuntimeRenderState>& states) const;
|
||||
void RefreshDynamicRenderStateFields(std::vector<RuntimeRenderState>& states) const;
|
||||
|
||||
Reference in New Issue
Block a user