Skip to content
Commit a8a5a97f authored by Ilia Mirkin's avatar Ilia Mirkin Committed by Emil Velikov
Browse files

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: default avatarStephane Chevigny <stephane.chevigny@polymtl.ca>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103393


Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: default avatarIlia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: default avatarJordan Justen <jordan.l.justen@intel.com>
Reviewed-by: default avatarSamuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit 4d24a7cb)
Signed-off-by: default avatarEmil Velikov <emil.velikov@collabora.com>

Conflicts:
	src/compiler/glsl/meson.build
parent b9b60dbf
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment