logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

gl_InvocationID - contains the invocation index of the current shader

Declaration

       in int gl_InvocationID ;.SH "DESCRIPTION"

       In the tessellation control language, gl_InvocationID contains the index of the output patch vertex
       assigned to the shader invocation. It is assigned 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 assigned to the geometry
       shader invocation. It is assigned an integer value in the range [0, N-1] where N is the number of
       geometry shader invocations per primitive.

Name

       gl_InvocationID - contains the invocation index of the current shader

See Also

gl_InstanceID()

Version Support

       ┌─────────────────┬───────────────────────────────────────────────────────────────────────────────────┐
       │                 │        OpenGLShadingLanguageVersion                                            │
       ├─────────────────┼──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┤
       │ Variable1.101.201.301.401.503.304.004.104.204.304.404.50 │
       │ Name            │      │      │      │      │      │      │      │      │      │      │      │      │
       ├─────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
       │ gl_InvocationID │  -   │  -   │  -   │  -   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │
       └─────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┘

       [1] Versions 1.50 to 3.30 - geometry shaders only.

See Also