Set correct symbol ids when referring to GLSL built-ins
The symbol ids are fetched from the symbol table. A new utility
function is added to make this more convenient.
BUG=angleproject:1490
TEST=angle_unittests, angle_end2end_tests
Change-Id: I780430e3386f6599503d8290c568ca9bc9cad147
Reviewed-on: https://chromium-review.googlesource.com/559535
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/translator/Compiler.cpp b/src/compiler/translator/Compiler.cpp
index 92c850a..17acebf 100644
--- a/src/compiler/translator/Compiler.cpp
+++ b/src/compiler/translator/Compiler.cpp
@@ -432,7 +432,7 @@
parseContext.isMultiviewExtensionEnabled() && getShaderType() != GL_COMPUTE_SHADER)
{
DeclareAndInitBuiltinsForInstancedMultiview(root, mNumViews, shaderType, compileOptions,
- outputType);
+ outputType, symbolTable);
}
// This pass might emit short circuits so keep it before the short circuit unfolding
@@ -517,7 +517,8 @@
compileResources.EXT_draw_buffers && compileResources.MaxDrawBuffers > 1 &&
IsExtensionEnabled(extensionBehavior, "GL_EXT_draw_buffers"))
{
- EmulateGLFragColorBroadcast(root, compileResources.MaxDrawBuffers, &outputVariables);
+ EmulateGLFragColorBroadcast(root, compileResources.MaxDrawBuffers, &outputVariables,
+ symbolTable, shaderVersion);
}
if (success)
@@ -946,7 +947,7 @@
sh::ShaderVariable var(GL_FLOAT_VEC4, 0);
var.name = "gl_Position";
list.push_back(var);
- InitializeVariables(root, list, symbolTable, shaderVersion, shaderSpec, extensionBehavior);
+ InitializeVariables(root, list, symbolTable, shaderVersion, extensionBehavior);
}
void TCompiler::useAllMembersInUnusedStandardAndSharedBlocks(TIntermBlock *root)
@@ -988,7 +989,7 @@
list.push_back(var);
}
}
- InitializeVariables(root, list, symbolTable, shaderVersion, shaderSpec, extensionBehavior);
+ InitializeVariables(root, list, symbolTable, shaderVersion, extensionBehavior);
}
const TExtensionBehavior &TCompiler::getExtensionBehavior() const