Created
April 30, 2024 09:36
-
-
Save byBretema/72b1a4a32c2addde8a10b32b6c497daa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Global | |
ivec3 gi_id = ivec3(gl_GlobalInvocationID); | |
// Group | |
ivec3 wg_id = ivec3(gl_WorkGroupID); | |
ivec3 wg_size = ivec3(gl_NumWorkGroups); | |
int wg_index = (wg_id.z * wg_size.x * wg_size.y) + (wg_id.y * wg_size.x) + wg_id.x; | |
// Local | |
ivec3 li_id = ivec3(gl_LocalInvocationID); | |
ivec3 li_size = ivec3(gl_WorkGroupSize); | |
int li_index = (li_id.z * li_size.x * li_size.y) + (li_id.y * li_size.x) + li_id.x; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment