GLWAITSYNC(3G)

πŸ’… GLWAITSYNC(3G) β€” like, the sync-waiting girlie of the OpenGL 3G manual ✨

okay so bestie, before we even start: this whole page lives in the 3G manual section, and the star of the show is glWaitSync. she's a whole vibe. let's get into it πŸŽ€


🌸 NAME 🌸

glWaitSync β€” she tells the GL server to block until the specified sync object becomes signaled. that's it. that's the job. and she does it every single time, no negotiating 🫢


✨ C SPECIFICATION ✨

void glWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout);

literally the entire signature. memorize her. she's iconic πŸ‘‘


πŸŽ€ PARAMETERS πŸŽ€

  • sync β€” the sync object whose status we're waiting on. like, who are we stalking- respectfully. πŸ‘€
  • flags β€” a bitfield that controls the command flushing behavior. and yes, flags may be zero. it's allowed to be a whole nothing. slay.
  • timeout β€” the timeout the server should wait before continuing. timeout must be GL_TIMEOUT_IGNORED β€” no exceptions, she has one (1) acceptable value and it's that one πŸ’€

🌈 DESCRIPTION 🌈

glWaitSync makes the GL server block and wait until sync becomes signaled. sync is the name of an existing sync object upon which to wait. no random strings, no made-up names, an actual existing sync object bestie 😭

flags and timeout are currently not used and must be set to zero and the special value GL_TIMEOUT_IGNORED, respectively[1]. like, they're placeholders. they're there. they're not doing anything. they're the group chat members who never type. πŸ™ˆ

glWaitSync will always wait no longer than an implementation-dependent timeout. the duration of this timeout in nanoseconds may be queried by calling glGet() with the parameter GL_MAX_SERVER_WAIT_TIMEOUT. go check her if you need the number ✨

and here's the tragic part β€” there is currently no way to determine whether glWaitSync unblocked because the timeout expired or because the sync object being waited on was signaled. two completely different reasons, same output, zero closure. it's giving mystery. πŸ’€

If an error occurs, glWaitSync does not cause the GL server to block. so at least she's not gonna ghost you and hang you. small mercies 🫢


πŸ’œ NOTES πŸ’œ

glWaitSync is available only if the GL version is 3.2 or higher. born in 3.2. does not exist before that. do not come for her in 2.1 🚫


πŸ”₯ ERRORS πŸ”₯

these are the ways to make her big mad. all three generate GL_INVALID_VALUE:

  • GL_INVALID_VALUE is generated if sync is not the name of a sync object.
  • GL_INVALID_VALUE is generated if flags is not zero.
  • GL_INVALID_VALUE is generated if timeout is not GL_TIMEOUT_IGNORED.

same error, three different crimes. consistent queen πŸ’…


πŸ‘‘ VERSION SUPPORT πŸ‘‘

the vibe check, version by version. the function/feature name here is glWaitSync:

  • OpenGL 2.0 β€” - (nope)
  • OpenGL 2.1 β€” - (nope)
  • OpenGL 3.0 β€” - (nope)
  • OpenGL 3.1 β€” - (nope)
  • OpenGL 3.2 β€” βœ” (HERE. she has arrived πŸ”₯)
  • OpenGL 3.3 β€” βœ”
  • OpenGL 4.0 β€” βœ”
  • OpenGL 4.1 β€” βœ”
  • OpenGL 4.2 β€” βœ”
  • OpenGL 4.3 β€” βœ”
  • OpenGL 4.4 β€” βœ”
  • OpenGL 4.5 β€” βœ”

so basically: four dashes then a whole wall of checkmarks. glow-up of the century ✨


πŸ¦‹ SEE ALSO πŸ¦‹

go read her friends too, they're all linked up:

  • glFenceSync()
  • glClientWaitSync()

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


🧚 NOTES 🧚

  1. flags and timeout are placeholders for anticipated future extensions of sync object capabilities. They must have these reserved values in order that existing code calling glWaitSync operate properly in the presence of such extensions. so like β€” don't go rogue and put random values in there, future-you (and future-Khronos) will be sobbing 😭

πŸ’‘ real talk bestie: flags = zero, timeout = GL_TIMEOUT_IGNORED. that's the whole assignment. don't overthink it. 🩷

and that's the page!! source says [FIXME: source] and the date on this baby is 08/09/2021 β€” so if something's stale, it's not on me πŸ’– go wait on your sync objects responsibly, mwah βœ¨πŸ’…

πŸ“¦ where this page comes from