GLTEXTUREBARRIER(3G)

πŸ’… GLTEXTUREBARRIER(3G) β€” glTextureBarrier πŸ’…

okay so bestie, welcome to the GLTEXTUREBARRIER(3G) page. the main character is glTextureBarrier, and yes it's short, but it's lowkey crucial for not having a rendering feedback loop moment. let's get into it 🫢

✨ NAME ✨

glTextureBarrier β€” controls the ordering of reads and writes to rendered fragments across drawing commands. periodt.

πŸŽ€ C SPECIFICATION πŸŽ€

the signature is literally this, character for character:

void glTextureBarrier(void);

🌸 DESCRIPTION 🌸

here's the tea, bestie: when a shader stage fetches texels and the exact same texels are written via fragment shader outputs, the values of rendered fragments are undefined β€” even if the reads and writes are not in the same drawing command. 😭

so if you want to safely read the result of a written texel via a texel fetch in a subsequent drawing command, call glTextureBarrier between the two drawing commands. that guarantees writes have completed and caches have been invalidated before subsequent drawing commands are executed. slay.

πŸ¦‹ NOTES πŸ¦‹

the situation described above is called a rendering feedback loop, and it's discussed in more detail in section 9.3 of the OpenGL 4.5 Specification. iykyk.

πŸ’€ ERRORS πŸ’€

None. literally none. no errors. iconic behavior.

πŸ‘‘ VERSION SUPPORT πŸ‘‘

the row label is Function / Feature Name, the function is glTextureBarrier, and the OpenGL Version columns are 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5. here's the support tea:

  • 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 β€” βœ”

🌈 SEE ALSO 🌈

glMemoryBarrier() β€” go give it a look, bestie.

legal tea, verbatim:

Copyright Β© 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/.

and the second copyright section, because the page said so:

Copyright Β© 2014 Khronos Group


and that's the whole page! source/version: [FIXME: source]; date: 08/09/2021; and the footer energy is still GLTEXTUREBARRIER(3G). mwah πŸ’‹

πŸ“¦ where this page comes from