GLFLUSH(3G)

✨ GLFLUSH β€” ok bestie let's talk about flushing ✨

So this is glFlush from the 3G manual, and honestly? It's a little icon and you're gonna love her.


🌸 NAME 🌸

glFlush β€” force execution of GL commands in finite time πŸ’…


πŸŽ€ C SPECIFICATION πŸŽ€

void glFlush(void);

No args, no return, no drama. She takes nothing and gives you everything. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so here's the tea: different GL implementations buffer commands in several different locations. Like, we're talking network buffers, and also the graphics accelerator itself. Multiple hiding spots. Sneaky little buffers. πŸ™ˆ

What glFlush does is it empties all of these buffers, causing all issued commands to be executed as quickly as they are accepted by the actual rendering engine. So everything you've been queuing up finally gets sent out into the world. Slay. πŸ’…

One thing though β€” and this is important, ngl β€” this execution may not be completed in any particular time period, but it does complete in finite time. So it's not instant-instant, but it's not infinite either. It's giving "eventually, bestie." ⭐

And here's the part where it gets personal: because any GL program might be executed over a network, or on an accelerator that buffers commands, all programs should call glFlush whenever they count on having all of their previously issued commands completed. Like, imagine you're waiting on user input that depends on the generated image β€” call glFlush before you do that. That's the vibe check. 🫢


πŸ’€ NOTES πŸ’€

glFlush can return at any time. She does not wait until the execution of all previously issued GL commands is complete.

🚨 Read that again, bestie! glFlush returning does not mean everything finished. It just means the commands got handed off. If you need actual completion-completion, that's a different function (see below πŸ‘€).

πŸ‘‘ VERSION SUPPORT πŸ‘‘

glFlush is supported in every single OpenGL version listed here. She ate and left no crumbs:

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

Function/feature name: glFlush. Iconic behavior. 🌈


πŸ”₯ SEE ALSO πŸ”₯

  • glFinish()

(iykyk β€” that's the one that actually waits πŸ’œ)


Copyright Β© 1991-2006 Silicon Graphics, Inc. Copyright Β© 2010-2014 Khronos Group. This document is licensed under the SGI Free Software B License. For details, see http://oss.sgi.com/projects/FreeB/.

Copyright Β© 1991-2006 Silicon Graphics, Inc. Copyright Β© 2010-2014 Khronos Group


k that's the whole page bestie, mwah πŸ’– this one came from [FIXME: source], dated 08/09/2021, and she's GLFLUSH(3G) forever and always πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from