GL_INVOCATIONID(3G)
π GL_INVOCATIONID (3G) β the manual page, but make it make sense
okay bestie, so this is the manual page for gl_InvocationID β it lives in the OpenGL Shading Language docs (the header literally says [FIXME: manual], which is giving "we'll fix it later, and later never came" π). Anyway, it's short, it's iconic, let's go π«Ά
β¨ NAME β¨
gl_InvocationID β it's the variable that holds the invocation index of whatever shader invocation is currently running, no cap π
π DECLARATION π
Here's the literal declaration, exactly as written, don't touch it:
in int gl_InvocationID ;
π DESCRIPTION π
So the whole personality of this variable changes depending on which shader language you're in. Two vibes, one variable:
π§ In the tessellation control language
gl_InvocationID holds the index of the output patch vertex that got assigned to the shader invocation. It's handed an integer value in the range [0, N-1], where N is the number of output patch vertices.
π¦ In the geometry language
gl_InvocationID identifies the invocation number that got assigned to the geometry shader invocation. It's handed an integer value in the range [0, N-1], where N is the number of geometry shader invocations per primitive.
TL;DR: same <pink>int variable name, two completely different job descriptions depending on where you're standing. lowkey iconic β¨
π VERSION SUPPORT π
Here's the vibe check across every OpenGL Shading Language version β β means it's there, - means she has not arrived yet π
- Variable name:
gl_InvocationID- 1.10 β
- - 1.20 β
- - 1.30 β
- - 1.40 β
- - 1.50 β
β - 3.30 β
β - 4.00 β
β - 4.10 β
β - 4.20 β
β - 4.30 β
β - 4.40 β
β - 4.50 β
β
- 1.10 β
[1] Versions 1.50 to 3.30 β geometry shaders only. so clock that π she was exclusive before she went mainstream, iykyk
π SEE ALSO π
Go give these a look too, they're in the same friend group:
gl_InstanceID()
π COPYRIGHT π
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 (yes, again π) π
Copyright Β© 2011-2014 Khronos Group
okay that's the whole page, you ate that π fr fr. quick cute sign-off: this masterpiece is sourced from [FIXME: source], dated 08/09/2021, and it's GL_INVOCATIONID(3G) all the way down. mwah πβ¨
π¦ where this page comes from
- centos-stream 9: gl-manpages 1.1-24.20190306.el9 Β· MIT and Open Publication
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms