Insert GLSL ES 1.0 built-in variables at the right level.
TRAC #22954
Signed-off-by: Jamie Madill
Signed-off-by: Shannon Woods
Author: Nicolas Capens
git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2271 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/glslang_tab.cpp b/src/compiler/glslang_tab.cpp
index b7aeab9..a01fce8 100644
--- a/src/compiler/glslang_tab.cpp
+++ b/src/compiler/glslang_tab.cpp
@@ -2143,7 +2143,7 @@
context->recover();
TType type(EbtFloat, EbpUndefined);
TVariable* fakeVariable = new TVariable((yyvsp[(1) - (1)].lex).string, type);
- context->symbolTable.insert(*fakeVariable);
+ context->symbolTable.declare(*fakeVariable);
variable = fakeVariable;
} else {
// This identifier can only be a variable type symbol
@@ -4115,7 +4115,7 @@
TType* structure = new TType((yyvsp[(5) - (6)].interm.typeList), *(yyvsp[(2) - (6)].lex).string);
TVariable* userTypeDef = new TVariable((yyvsp[(2) - (6)].lex).string, *structure, true);
- if (! context->symbolTable.insert(*userTypeDef)) {
+ if (! context->symbolTable.declare(*userTypeDef)) {
context->error((yyvsp[(2) - (6)].lex).line, "redefinition", (yyvsp[(2) - (6)].lex).string->c_str(), "struct");
context->recover();
}
@@ -4677,7 +4677,7 @@
//
// Insert the parameters with name in the symbol table.
//
- if (! context->symbolTable.insert(*variable)) {
+ if (! context->symbolTable.declare(*variable)) {
context->error((yyvsp[(1) - (1)].interm).line, "redefinition", variable->getName().c_str());
context->recover();
delete variable;