gl_PrimitiveIDIn - contains the index of the current primitive
Contents
Copyright
Copyright © 2011-2014 Khronos Group
[FIXME: source] 11/18/2024 GL_PRIMITIVEIDIN(3G)
Declaration
in int gl_PrimitiveIDIn ;.SH "DESCRIPTION"
gl_PrimitiveIDIn is a geometry language input variable that holds the number of primitives processed by
the shader since the current set of rendering primitives was started. The first primitive processed by
the drawing command is numbered zero and the primitive ID counter is incremented after every individual
point, line or triangle primitive is processed. For triangles drawn in point or line mode, the primitive
ID counter is incremented only once, even through multiple points or lines may actually be drawn.
Restarting a primitive topology using the primitive restart index has no effect on the primitive ID
counter.
Name
gl_PrimitiveIDIn - contains the index of the current primitive
See Also
gl_InstanceID()
Version Support
┌──────────────────┬───────────────────────────────────────────────────────────────────────────────────┐
│ │ OpenGLShadingLanguageVersion │
├──────────────────┼──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┤
│ Variable │ 1.10 │ 1.20 │ 1.30 │ 1.40 │ 1.50 │ 3.30 │ 4.00 │ 4.10 │ 4.20 │ 4.30 │ 4.40 │ 4.50 │
│ Name │ │ │ │ │ │ │ │ │ │ │ │ │
├──────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
│ gl_PrimitiveIDIn │ - │ - │ - │ - │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │
└──────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┘
