glsl/cs: Don't strip gl_GlobalInvocationID and dependencies
authorJordan Justen <jordan.l.justen@intel.com>
Mon, 17 Aug 2015 19:30:25 +0000 (12:30 -0700)
committerJordan Justen <jordan.l.justen@intel.com>
Sun, 13 Sep 2015 16:53:16 +0000 (09:53 -0700)
commit34e187ec38cee78fbc0e1d1a09a99160fbdf7a9f
tree3dcccb76e970a1eb1b9992c9b6460d17b38eaf30
parentc5743a5d7fa62a339222ceb96d568a525d77fe0c
glsl/cs: Don't strip gl_GlobalInvocationID and dependencies

We lower gl_GlobalInvocationID based on the extension spec formula:

    gl_GlobalInvocationID =
        gl_WorkGroupID * gl_WorkGroupSize + gl_LocalInvocationID

https://www.opengl.org/registry/specs/ARB/compute_shader.txt

We need to set this variable in main(), even if gl_GlobalInvocationID
is not referenced by the shader. (It may be used by a linked shader.)
Therefore, we can't eliminate these as dead variables.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/glsl/opt_dead_builtin_variables.cpp