aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-11-22 08:50:11 +0100
committermarha <marha@users.sourceforge.net>2013-11-22 08:50:11 +0100
commit697f071e3dcd3b01dba050d6c5316f2a23ee82f8 (patch)
tree78ab3ffa70b85d25940220d8768c304889c24a85 /mesalib/src/glsl/ast_to_hir.cpp
parentbb953a87489963f63e65c797a1f2837382ff7808 (diff)
downloadvcxsrv-697f071e3dcd3b01dba050d6c5316f2a23ee82f8.tar.gz
vcxsrv-697f071e3dcd3b01dba050d6c5316f2a23ee82f8.tar.bz2
vcxsrv-697f071e3dcd3b01dba050d6c5316f2a23ee82f8.zip
libxtrans mesa git update 22 nov 2013
libxtrans commit 8b2c8aabe27bcaa4de6432b53c4a1296010ea823 mesa commit bb354c6c279031dafc08029a62cd3e76a6c1ca71
Diffstat (limited to 'mesalib/src/glsl/ast_to_hir.cpp')
-rw-r--r--mesalib/src/glsl/ast_to_hir.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/mesalib/src/glsl/ast_to_hir.cpp b/mesalib/src/glsl/ast_to_hir.cpp
index 76b256c73..01280478c 100644
--- a/mesalib/src/glsl/ast_to_hir.cpp
+++ b/mesalib/src/glsl/ast_to_hir.cpp
@@ -3355,6 +3355,15 @@ ast_declarator_list::hir(exec_list *instructions,
ir_variable *earlier =
get_variable_being_redeclared(var, decl->get_location(), state,
false /* allow_all_redeclarations */);
+ if (earlier != NULL) {
+ if (strncmp(var->name, "gl_", 3) == 0 &&
+ earlier->how_declared == ir_var_declared_in_block) {
+ _mesa_glsl_error(&loc, state,
+ "`%s' has already been redeclared using "
+ "gl_PerVertex", var->name);
+ }
+ earlier->how_declared = ir_var_declared_normally;
+ }
if (decl->initializer != NULL) {
result = process_initializer((earlier == NULL) ? var : earlier,
@@ -5048,6 +5057,7 @@ ast_interface_block::hir(exec_list *instructions,
_mesa_glsl_error(&loc, state, "`%s' redeclared",
this->instance_name);
}
+ earlier->how_declared = ir_var_declared_normally;
earlier->type = var->type;
earlier->reinit_interface_type(block_type);
delete var;
@@ -5078,7 +5088,11 @@ ast_interface_block::hir(exec_list *instructions,
_mesa_glsl_error(&loc, state,
"redeclaration of gl_PerVertex can only "
"include built-in variables");
+ } else if (earlier->how_declared == ir_var_declared_normally) {
+ _mesa_glsl_error(&loc, state,
+ "`%s' has already been redeclared", var->name);
} else {
+ earlier->how_declared = ir_var_declared_in_block;
earlier->reinit_interface_type(block_type);
}
continue;
@@ -5125,6 +5139,12 @@ ast_interface_block::hir(exec_list *instructions,
if (var != NULL &&
var->get_interface_type() == earlier_per_vertex &&
var->mode == var_mode) {
+ if (var->how_declared == ir_var_declared_normally) {
+ _mesa_glsl_error(&loc, state,
+ "redeclaration of gl_PerVertex cannot "
+ "follow a redeclaration of `%s'",
+ var->name);
+ }
state->symbols->disable_variable(var->name);
var->remove();
}