OSDN Git Service

glsl/cs: Initialize gl_LocalInvocationIndex in main()
authorJordan Justen <jordan.l.justen@intel.com>
Mon, 17 Aug 2015 23:32:42 +0000 (16:32 -0700)
committerJordan Justen <jordan.l.justen@intel.com>
Sun, 13 Sep 2015 16:53:17 +0000 (09:53 -0700)
commitc4cf824658da283cf350fd6833d50dff9de4a1ad
treec12d06d47947784d07b8e5ff1c5a7c06153f9997
parent6823e12d5aa4646fc8ef0e32455104ba47f80a38
glsl/cs: Initialize gl_LocalInvocationIndex in main()

We initialize gl_LocalInvocationIndex based on the extension spec
formula:

    gl_LocalInvocationIndex =
        gl_LocalInvocationID.z * gl_WorkGroupSize.x * gl_WorkGroupSize.y +
        gl_LocalInvocationID.y * gl_WorkGroupSize.x +
        gl_LocalInvocationID.x;

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

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