aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/ir_optimization.h
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2017-10-21 15:15:41 -0400
committerIlia Mirkin <[email protected]>2017-10-23 08:34:56 -0400
commit4d24a7cb97641cacecd371d1968f6964785822e4 (patch)
tree271c13e055c4b08ef7d068b9e4a32d33e8d8ee11 /src/compiler/glsl/ir_optimization.h
parent4302df8c8e60b79cfba0d16781393041cf79aa43 (diff)
glsl: fix derived cs variables
There are two issues with the current implementation. First, it relies on the layout(local_size_*) happening in the same shader as the main function, and secondly it doesn't work for variable group sizes. In both cases, the simplest fix is to move the setup of these derived values to a later time, similar to how the gl_VertexID workarounds are done. There already exist system values defined for both of the derived values, so we use them unconditionally, and lower them after linking is performed. While we're at it, we move to using gl_LocalGroupSizeARB instead of gl_WorkGroupSize for variable group sizes. Also the dead code elimination avoidance can be removed, since there can be situations where gl_LocalGroupSizeARB is needed but has not been inserted for the shader with main function. As a result, the lowering code has to insert its own copies of the system values if needed. Reported-by: Stephane Chevigny <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103393 Cc: [email protected] Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/compiler/glsl/ir_optimization.h')
-rw-r--r--src/compiler/glsl/ir_optimization.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/compiler/glsl/ir_optimization.h b/src/compiler/glsl/ir_optimization.h
index eb3ec3b0c7d..f44ddcb05be 100644
--- a/src/compiler/glsl/ir_optimization.h
+++ b/src/compiler/glsl/ir_optimization.h
@@ -166,6 +166,7 @@ void optimize_dead_builtin_variables(exec_list *instructions,
bool lower_tess_level(gl_linked_shader *shader);
bool lower_vertex_id(gl_linked_shader *shader);
+bool lower_cs_derived(gl_linked_shader *shader);
bool lower_blend_equation_advanced(gl_linked_shader *shader);
bool lower_subroutine(exec_list *instructions, struct _mesa_glsl_parse_state *state);