summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlejandro Piñeiro <[email protected]>2016-04-01 09:11:15 +0200
committerAlejandro Piñeiro <[email protected]>2016-04-01 09:54:09 +0200
commitcd7d631c71bb1342a6607a193918ccb3289c0bbf (patch)
tree7e51f41641cfa530f48be95c75c2bd419dcfe0cb /src
parentdf03be196abc34bdf29ff1119099e1477a991ad3 (diff)
glsl: do not raise unitialized variable warnings on builtins/reserved GL variables
Needed because not all the built-in variables are marked as system values, so they still have the mode ir_var_auto. Right now it fixes raising the warning when gl_GlobalInvocationID and gl_LocalInvocationIndex are used. v2: use is_gl_identifier instead of filtering for some names (Ilia Mirkin) Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/compiler/glsl/ast_to_hir.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index a0312319161..3fe90079420 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -1905,7 +1905,8 @@ ast_expression::do_hir(exec_list *instructions,
if ((var->data.mode == ir_var_auto || var->data.mode == ir_var_shader_out)
&& !this->is_lhs
- && result->variable_referenced()->data.assigned != true) {
+ && result->variable_referenced()->data.assigned != true
+ && !is_gl_identifier(var->name)) {
_mesa_glsl_warning(&loc, state, "`%s' used uninitialized",
this->primary_expression.identifier);
}