GLOBJECTPTRLABEL(3G)

πŸ’– NAME πŸ’–

okay so bestie, this is glObjectPtrLabel β€” and what it does is label a sync object identified by a pointer. that's it, that's the whole gig ✨

this is a page from the 3G manual, and it's literally about giving your sync objects cute little name tags so debugging doesn't make you cry 🫢


🌸 C SPECIFICATION 🌸

here's the signature, copied exactly, don't @ me:

void glObjectPtrLabel(void * ptr, GLsizei length, const char * label);

πŸŽ€ PARAMETERS πŸŽ€

  • ptr β€” a pointer that identifies a sync object. yes, a whole pointer. main character energy tbh πŸ‘‘
  • length β€” the length of the label you're gonna use for the object. how many characters we talkin'
  • label β€” the address of a string containing the label to assign to the object. like, the actual name tag 🏷️

πŸ¦‹ DESCRIPTION πŸ¦‹

so glObjectPtrLabel labels the sync object identified by ptr. lowkey iconic, highkey useful πŸ’…

label is the address of a string that's gonna be used to label the object. length contains the number of characters in label. and here's the tea:

  • if length is negative, it's implied that label contains a null-terminated string 🧡
  • if label is NULL, any debug label is effectively removed from the object πŸ—‘οΈβœ¨

⭐ ERRORS ⭐

these are the vibe checks that fail, no cap:

  • GL_INVALID_VALUE is generated if ptr is not a valid sync object πŸ’€
  • GL_INVALID_VALUE is generated if the number of characters in label, excluding the null terminator when length is negative, is greater than the value of GL_MAX_LABEL_LENGTH 😭
fr fr bestie, keep your labels short or the spec will simply not let you live πŸ™ˆ

🌈 ASSOCIATED GETS 🌈

  • glGet() with argument GL_MAX_LABEL_LENGTH β€” go check how many characters you're allowed, iykyk

πŸ‘‘ VERSION SUPPORT πŸ‘‘

okay so the original had a whole pretty grid and i can't do tables here, so here's the exact same info in list form, nothing skipped, periodt:

  • glObjectPtrLabel β€” OpenGL 2.0: -
  • glObjectPtrLabel β€” OpenGL 2.1: -
  • glObjectPtrLabel β€” OpenGL 3.0: -
  • glObjectPtrLabel β€” OpenGL 3.1: -
  • glObjectPtrLabel β€” OpenGL 3.2: -
  • glObjectPtrLabel β€” OpenGL 3.3: -
  • glObjectPtrLabel β€” OpenGL 4.0: -
  • glObjectPtrLabel β€” OpenGL 4.1: -
  • glObjectPtrLabel β€” OpenGL 4.2: -
  • glObjectPtrLabel β€” OpenGL 4.3: βœ”
  • glObjectPtrLabel β€” OpenGL 4.4: βœ”
  • glObjectPtrLabel β€” OpenGL 4.5: βœ”

so uh yeah, it's giving "4.3 and up only" πŸ’… 4.0, 4.1, 4.2? not invited to the party πŸ™ˆ


πŸ“‘ SEE ALSO πŸ“‘

go read these next, bestie, they're the friend group:

  • glPushDebugGroup()
  • glPopDebugGroup()
  • glObjectLabel()

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


and that's the whole page, babe πŸŽ€ the source line is a whole [FIXME: source] situation and the date on this beauty is 08/09/2021 β€” so yeah, she's a little vintage, but she ate πŸ’…βœ¨ slay, now go label some sync objects πŸ¦‹πŸ’–

πŸ“¦ where this page comes from