Fix matc bug when compiling for multiple APIs (#1393)

This commit is contained in:
Ben Doherty
2019-07-10 17:06:28 -07:00
committed by GitHub
parent 80f3afaac6
commit 6fc10c1dda
+6 -3
View File
@@ -423,13 +423,16 @@ bool MaterialBuilder::runSemanticAnalysis() noexcept {
assert(!mCodeGenPermutations.empty());
CodeGenParams params = mCodeGenPermutations[0];
ShaderModel model = ShaderModel::UNKNOWN;
TargetApi targetApi = params.targetApi;
assertSingleTargetApi(targetApi);
ShaderModel model = static_cast<ShaderModel>(params.shaderModel);
std::string shaderCode = peek(ShaderType::VERTEX, params, mProperties);
bool result = glslTools.analyzeVertexShader(shaderCode, model, mTargetApi);
bool result = glslTools.analyzeVertexShader(shaderCode, model, targetApi);
if (!result) return false;
shaderCode = peek(ShaderType::FRAGMENT, params, mProperties);
result = glslTools.analyzeFragmentShader(shaderCode, model, mTargetApi);
result = glslTools.analyzeFragmentShader(shaderCode, model, targetApi);
return result;
#else
return true;