Both gl_GlobalInvocationID and gl_LocalInvocationIndex depend on the gl_WorkGroupSize. However with variable group sizes, this value is not available. Use the gl_LocalGroupSizeARB instead, which contains the relevant value.
There should not be any situation where at least one of those is not defined. Reported-by: Stephane Chevigny <stephane.chevi...@polymtl.ca> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103393 Cc: mesa-sta...@lists.freedesktop.org Signed-off-by: Ilia Mirkin <imir...@alum.mit.edu> --- src/compiler/glsl/builtin_variables.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/compiler/glsl/builtin_variables.cpp b/src/compiler/glsl/builtin_variables.cpp index ea2d897cc8e..85ac0de848b 100644 --- a/src/compiler/glsl/builtin_variables.cpp +++ b/src/compiler/glsl/builtin_variables.cpp @@ -1494,15 +1494,9 @@ initialize_cs_derived_variables(gl_shader *shader, assert(gl_WorkGroupID); ir_variable *gl_WorkGroupSize = shader->symbols->get_variable("gl_WorkGroupSize"); - if (gl_WorkGroupSize == NULL) { - void *const mem_ctx = ralloc_parent(shader->ir); - gl_WorkGroupSize = new(mem_ctx) ir_variable(glsl_type::uvec3_type, - "gl_WorkGroupSize", - ir_var_auto); - gl_WorkGroupSize->data.how_declared = ir_var_declared_implicitly; - gl_WorkGroupSize->data.read_only = true; - shader->ir->push_head(gl_WorkGroupSize); - } + if (gl_WorkGroupSize == NULL) + gl_WorkGroupSize = shader->symbols->get_variable("gl_LocalGroupSizeARB"); + assert(gl_WorkGroupSize); ir_variable *gl_LocalInvocationID = shader->symbols->get_variable("gl_LocalInvocationID"); assert(gl_LocalInvocationID); -- 2.13.6 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev