[Mesa-dev] [PATCH] glsl: do not raise uninitialized variable warning with gl_GlobalInvocationID/gl_LocalInvocationIndex
Alejandro PiƱeiro
apinheiro at igalia.com
Thu Mar 31 09:48:05 UTC 2016
Most GLSL built-ins variables are filtered out because they have
the mode ir_var_system_value, but those two not. Those two are
specially handled as they can be infered from other system values,
and were represented as a variable initialized with a value
based of those system values, instead of a lowering.
---
As a reference, this would be the patch I'm proposing.
src/compiler/glsl/ast_to_hir.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index a031231..aec8e6f 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -1905,7 +1905,9 @@ 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
+ && strcmp(var->name, "gl_GlobalInvocationID") != 0
+ && strcmp(var->name, "gl_LocalInvocationIndex") != 0) {
_mesa_glsl_warning(&loc, state, "`%s' used uninitialized",
this->primary_expression.identifier);
}
--
2.5.0
More information about the mesa-dev
mailing list