GLDELETESYNC(3G)

πŸ’… glDeleteSync(3G) β€” the "bye bestie" page

okay so this is glDeleteSync from section 3G of the manual (yes, the 3G is the manual name, we love a little OpenGL corner of the docs ✨). It's short, it's sweet, and it's literally just "how to yeet a sync object into the void". Let's go 🫢


🌸 NAME

glDeleteSync β€” delete a sync object πŸ’€βœ¨


πŸŽ€ C SPECIFICATION

void glDeleteSync(GLsync sync);

that's it. one parameter. one job. iconic behavior honestly.


πŸ’– PARAMETERS

  • sync β€” the sync object you want to be deleted. the one. the target. the soon-to-be-gone πŸ¦‹

⭐ DESCRIPTION

okay so here's the tea, bestie 🍡

glDeleteSync deletes the sync object that you passed in as sync. Simple right? Well, kind of, because there's two whole timelines here depending on what's going on:

  • If the fence command that corresponds to your sync object has already completed, or if there are no glWaitSync() or glClientWaitSync() commands blocking on sync, then the object is deleted immediately. instant. poof. gone. slay πŸ’…
  • Otherwise β€” meaning something is still holding on β€” sync gets flagged for deletion. It doesn't vanish right away; it gets deleted later, when it's no longer associated with any fence command AND is no longer blocking any glWaitSync() or glClientWaitSync() command. it's giving "your Uber is arriving" energy πŸš—

Either way? In either case, once glDeleteSync returns, the name sync is invalid and can no longer be used to refer to the sync object. periodt. the name is cooked. don't try it πŸ”₯

Also β€” glDeleteSync will silently ignore a sync value of zero. no error, no drama, just vibes. zero gets a free pass πŸ™ˆ


🧚 NOTES

lowkey important: glSync is only supported if the GL version is 3.2 or greater, or if the ARB_sync extension is supported. so do a little vibe check on your context before you come at this function πŸ¦‹


🌈 ERRORS

  • GL_INVALID_VALUE is generated if sync is neither zero nor the name of a sync object. so like… it has to be one of those two things. anything else and the GL is gonna be like "girl what" 😭

πŸ‘‘ VERSION SUPPORT

the whole function/feature name here is glDeleteSync, and here's the version tea across every OpenGL version listed on the page:

  • 2.0 β€” - (nope πŸ™…)
  • 2.1 β€” -
  • 3.0 β€” -
  • 3.1 β€” -
  • 3.2 β€” βœ” (here we go!! πŸŽ‰)
  • 3.3 β€” βœ”
  • 4.0 β€” βœ”
  • 4.1 β€” βœ”
  • 4.2 β€” βœ”
  • 4.3 β€” βœ”
  • 4.4 β€” βœ”
  • 4.5 β€” βœ”

so it's a - for the whole 2.0 through 3.1 era, and then βœ” all the way from 3.2 to 4.5. consistent queen πŸ‘‘


πŸ¦‹ SEE ALSO

go read these too, they're the friend group πŸ’œ

  • glFenceSync()
  • glWaitSync()
  • 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


and that's the whole page, bestie πŸ₯Ή source is [FIXME: source] and the date on this lil beauty is 08/09/2021 β€” so go forth, delete your sync objects responsibly, and remember: the name is invalid afterwards, no cap πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from