KhronosGroup / KhronosGroup/GLSL
Compute: When can gl_GlobalInvocationID + gl_LocalInvocationIndex be used?
- Dominant language
- JavaScript
- Stars
- 458
- Forks
- 114
- Avg merge
- 4m
- Merged PRs (30d)
- 1
Description
gl_GlobalInvocationID and gl_LocalInvocationIndex are both derived from, among others, gl_WorkGroupSize. There is language that says that
> It is a compile-time error to use _gl_WorkGroupSize_ in a shader that does not declare a fixed local group size, or before that shader has declared a fixed local group size, using **local_size_x**, **local_size_y**, and **local_size_z**.
So ... is it an error to use the derived values before a layout(local_size_*) is declared in that shader? The corollary to all this, is there some variant of
```
[shader 1]
#extension GL_ARB_compute_variable_group_size: enable;
layout(local_size_variable) in;
[shader 2]
void main() { use(gl_GlobalInvocationID); }
```
that is allowed when these are linked together into a single program?
Contributor guide
Assessment
This issue has not been assessed yet.