GLGETQUERYINDEXEDIV(3G)

GLGETQUERYINDEXEDIV(3G) πŸ’…

okay bestie, so this is a 3G manual page, which means it's all about OpenGL and we're literally about to get into the indexed query object tea. no cap, this function is giving serious main character energy for anyone who needs to peek at what their GPU is doing under the hood. let's get into it. ✨


C SPECIFICATION πŸŽ€

like, here's the exact signature, copy it character for character or it won't compile, iykyk:

void glGetQueryIndexediv(GLenum target, GLuint index, GLenum pname,
                         GLint *params);

PARAMETERS 🌸

  • target β€” this is the specific query object target you're obsessed with. it must be one of: GL_SAMPLES_PASSED, GL_ANY_SAMPLES_PASSED, GL_ANY_SAMPLES_PASSED_CONSERVATIVE, GL_PRIMITIVES_GENERATED, GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, GL_TIME_ELAPSED, or GL_TIMESTAMP. no random values, bestie, the driver will literally not have it.
  • index β€” the index of the query object target. like, which one in the stack you're asking about.
  • pname β€” the symbolic name of a query object target parameter. the accepted values are GL_CURRENT_QUERY or GL_QUERY_COUNTER_BITS. that's it. don't try anything else.
  • params β€” this is where the requested data gets returned. it's a pointer, so it's gonna write the answer right into your variable. periodt.

DESCRIPTION πŸ¦‹

okay so glGetQueryIndexediv returns, in params, a selected parameter of the indexed query object target specified by target and index. the index specifies the index of the query object target and must be between zero and a target-specific maximum. (yes, "maxiumum" is a typo in the original, and no, i'm not fixing it β€” that's not my job, i just work here. πŸ’€)

pname is the name of a specific query object target parameter. so when pname is GL_CURRENT_QUERY, the name of the currently active query for the specified index of target β€” or zero if no query is active β€” will be placed in params. and if pname is GL_QUERY_COUNTER_BITS, the implementation-dependent number of bits used to hold the result of queries for target is returned in params. slay. πŸ”₯


NOTES πŸ™ˆ

  • the target GL_ANY_SAMPLES_PASSED_CONSERVATIVE is available only if the GL version is 4.3 or greater. no 4.2-and-below shenanigans, bestie.
  • if an error is generated, no change is made to the contents of params. so like, don't go reading stale data and blaming me, okay?
  • calling glGetQueryiv() is equivalent to calling glGetQueryIndexediv with index set to zero. literally the same vibe, just a shortcut.

ERRORS 😭

  • GL_INVALID_ENUM is generated if target or pname is not an accepted value. so like, read the parameter list again, bestie.
  • GL_INVALID_VALUE is generated if index is greater than or equal to the target-specific maximum. don't go out of bounds, that's not the move.

VERSION SUPPORT πŸ‘‘

here's the vibe check on which OpenGL versions are down for this function. the original was a whole table, so i'm giving you the facts in list form β€” glGetQueryIndexediv is supported from OpenGL 4.0 onward, and not supported in 2.0, 2.1, 3.0, 3.1, 3.2, or 3.3:

  • OpenGL 2.0 β€” - (nah)
  • OpenGL 2.1 β€” - (nah)
  • OpenGL 3.0 β€” - (nah)
  • OpenGL 3.1 β€” - (nah)
  • OpenGL 3.2 β€” - (nah)
  • OpenGL 3.3 β€” - (nah)
  • OpenGL 4.0 β€” βœ” (yes bestie)
  • OpenGL 4.1 β€” βœ” (yes bestie)
  • OpenGL 4.2 β€” βœ” (yes bestie)
  • OpenGL 4.3 β€” βœ” (yes bestie)
  • OpenGL 4.4 β€” βœ” (yes bestie)
  • OpenGL 4.5 β€” βœ” (yes bestie)

SEE ALSO 🫢

go check out these other icons when you're done here:

  • glGetQueryObject()
  • glIsQuery()

Copyright Β© 2010-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 Β© 2010-2014 Khronos Group.


okay so that's the whole page, bestie. πŸ’– no gatekeeping here β€” every flag, every enum, every error, and every copyright line is exactly where it should be. this page came from the [FIXME: source] and was dated 08/09/2021, and the header says GLGETQUERYINDEXEDIV(3G) with a [FIXME: manual] vibe. go forth and query those indexed targets. you're gonna slay. πŸŒˆπŸ‘‘

πŸ“¦ where this page comes from