ATOMICOR(3G)

πŸ“¦
version 1.0~svn33624 Β· 4 versions
, in ubuntu jammy, ubuntu noble

✨ ATOMICOR ✨ (that's atomicOr from the 3G manual section, bestie πŸ’–)

🌸 NAME 🌸

atomicOr β€” do an atomic logical OR operation on a variable, no cap πŸ’…


πŸŽ€ DECLARATION πŸŽ€

int atomicOr(inout int mem, int data);

uint atomicOr(inout uint mem, uint data);

🫢 PARAMETERS 🫢

  • mem β€” the variable that's gonna be the target of the operation, aka the thing we're messing with πŸ‘‘
  • data β€” the data that gets logically ORed with mem ✨

πŸ’– DESCRIPTION πŸ’–

So atomicOr does an atomic logical OR of data into whatever's living in mem, and it hands back the original contents of mem from before the logical operation happened. Like, the receipts from before, not after. 🧾

And the way the memory being updated by the atomic operation is guaranteed not to be touched by any other assignment or atomic memory function in any shader invocation between the moment the original value gets read and the moment the new value gets written? That's the whole point. Periodt. πŸ’€

Lowkey important caveat: atomic memory functions are only supported for a limited set of variables. If the value you pass to the mem argument of an atomic memory function doesn't correspond to a buffer or shared variable, the shader will fail to compile. πŸ’€ So don't do that.

Good news though: it is acceptable to pass an element of an array, or a single component of a vector, to the mem argument of an atomic memory function β€” as long as the underlying array or vector is a buffer or shared variable. Slay 🌈


⭐ VERSION SUPPORT ⭐

Here's the vibe check on which OpenGL Shading Language Versions have atomicOr in their life πŸ¦‹

atomicOr:

  • 1.10 β€” - (nope)
  • 1.20 β€” - (nope)
  • 1.30 β€” - (nope)
  • 1.40 β€” - (nope)
  • 1.50 β€” - (nope)
  • 3.30 β€” - (nope)
  • 4.00 β€” - (nope)
  • 4.10 β€” - (nope)
  • 4.20 β€” - (nope)
  • 4.30 β€” βœ” (okay we're so back)
  • 4.40 β€” βœ” (still iconic)
  • 4.50 β€” βœ” (ate, obviously)

πŸ‘€ SEE ALSO πŸ‘€

Your other atomic besties, go say hi:

  • atomicAdd()
  • atomicAnd()
  • atomicXor()
  • atomicMin()
  • atomicMax()
  • atomicExchange()
  • atomicCompSwap()

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


okay that's the whole page, mwah 🫢 this came from the [FIXME: source] source, dated 01/03/2018, and yeah it's filed under ATOMICOR(3G) in case you lost the plot. bye bestie, go compile something cute πŸ’…βœ¨

πŸ“¦ where this page comes from