GL_LOCALINVOCATIONID(3G)

✨ NAME ✨

okay bestie, welcome to the GL_LOCALINVOCATIONID(3G) page β€” the header also has a [FIXME: manual] placeholder, but the actual tea is this: it's the manual for the variable that tells you which work item you're on in a compute shader πŸ’…

  • gl_LocalInvocationID β€” contains the index of the work item currently being operated on by a compute shader. That's the whole name line, no cap.

πŸ“ DECLARATION πŸ“

in uvec3 gl_LocalInvocationID ;

(yes, the raw page has a little roff artifact β€” .SH "DESCRIPTION" β€” glued right after that semicolon; we're moving on, bestie 🫢)

πŸ’… DESCRIPTION πŸ’…

In the compute language, gl_LocalInvocationID is an input variable. It contains the n-dimensional index of the local work invocation within the work group that the current shader is executing in. The possible values for this variable range across the local work group size β€” literally from (0,0,0) to (gl_WorkGroupSize.x - 1, gl_WorkGroupSize.y - 1, gl_WorkGroupSize.z - 1). Iconic, honestly. 🌈

🌈 VERSION SUPPORT 🌈

The table's columns are Variable Name and OpenGL Shading Language Version, and the row for gl_LocalInvocationID hits different in exactly these versions:

  • 1.10 β€” -
  • 1.20 β€” -
  • 1.30 β€” -
  • 1.40 β€” -
  • 1.50 β€” -
  • 3.30 β€” -
  • 4.00 β€” -
  • 4.10 β€” -
  • 4.20 β€” -
  • 4.30 β€” βœ”
  • 4.40 β€” βœ”
  • 4.50 β€” βœ”

πŸ‘€ SEE ALSO πŸ‘€

  • gl_NumWorkGroups()
  • gl_WorkGroupID()
  • gl_WorkGroupSize()
  • gl_GlobalInvocationID()
Copyright Β© 2011-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.
Copyright Β© 2012-2014 Khronos Group

okay that's the whole GL_LOCALINVOCATIONID(3G) tea β€” footer says source/version [FIXME: source], dated 08/09/2021, so bye bestie, go write a compute shader and slay πŸ’–βœ¨

πŸ“¦ where this page comes from