IMAGEATOMICEXCHANGE(3G)

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

πŸ’– imageAtomicExchange πŸ’–

okay bestie, welcome to IMAGEATOMICEXCHANGE(3G) β€” yes that's the manual section, 3G is giving library-functions-but-make-it-shaders energy and we're gonna get through it together, no cap 🫢


✨ NAME ✨

imageAtomicExchange β€” atomically store supplied data into memory and return the original value from memory 🌸

like, it swaps. it returns the old one. it does it atomically. that's the whole vibe. periodt.


🌈 DECLARATION 🌈

bestie there are SO many overloads, buckle up, here they all are verbatim:

uint imageAtomicExchange(gimage1D image, int P, uint data);

uint imageAtomicExchange(gimage2D image, ivec2 P, uint data);

uint imageAtomicExchange(gimage3D image, ivec3 P, uint data);

uint imageAtomicExchange(gimage2DRect image, ivec2 P, uint data);

uint imageAtomicExchange(gimageCube image, ivec3 P, uint data);

uint imageAtomicExchange(gbufferImage image, int P, uint data);

uint imageAtomicExchange(gimage1DArray image, ivec2 P, uint data);

uint imageAtomicExchange(gimage2DArray image, ivec3 P, uint data);

uint imageAtomicExchange(gimageCubeArray image, ivec3 P, uint data);

uint imageAtomicExchange(gimage2DMS image, ivec2 P, int sample,
                         uint data);

uint imageAtomicExchange(gimage2DMSArray image, ivec3 P, int sample,
                         uint data);

int imageAtomicExchange(gimage1D image, int P, int data);

int imageAtomicExchange(gimage2D image, ivec2 P, int data);

int imageAtomicExchange(gimage3D image, ivec3 P, int data);

int imageAtomicExchange(gimage2DRect image, ivec2 P, int data);

int imageAtomicExchange(gimageCube image, ivec3 P, int data);

int imageAtomicExchange(gbufferImage image, int P, int data);

int imageAtomicExchange(gimage1DArray image, ivec2 P, int data);

int imageAtomicExchange(gimage2DArray image, ivec3 P, int data);

int imageAtomicExchange(gimageCubeArray image, ivec3 P, int data);

int imageAtomicExchange(gimage2DMS image, ivec2 P, int sample,
                        int data);

int imageAtomicExchange(gimage2DMSArray image, ivec3 P, int sample,
                        int data);

int imageAtomicExchange(gimage1D image, int P, float data);

int imageAtomicExchange(gimage2D image, ivec2 P, float data);

int imageAtomicExchange(gimage3D image, ivec3 P, float data);

int imageAtomicExchange(gimage2DRect image, ivec2 P, float data);

int imageAtomicExchange(gimageCube image, ivec3 P, float data);

int imageAtomicExchange(gbufferImage image, int P, float data);

int imageAtomicExchange(gimage1DArray image, ivec2 P, float data);

int imageAtomicExchange(gimage2DArray image, ivec3 P, float data);

int imageAtomicExchange(gimageCubeArray image, ivec3 P, float data);

int imageAtomicExchange(gimage2DMS image, ivec2 P, int sample,
                        float data);

int imageAtomicExchange(gimage2DMSArray image, ivec3 P, int sample,
                        float data);

look at that wall of signatures. it's giving thorough. we love a function that covers every image type fr fr πŸ’…


πŸŽ€ PARAMETERS πŸŽ€

  • image β€” Specify the image unit into which to store data. it's the lil target, the destination, the place we're sliding into 😌
  • P β€” Specify the coordinate at which to store the data. basically the address, the where, the spot πŸ¦‹
  • sample β€” When present, specifies the sample within the image to store into. only shows up in some overloads, so don't panic if you don't see it πŸ‘‘
  • data β€” Specifies the data to exchange with that stored in the image. this is the new stuff going in, and whatever was already there comes back out to you πŸ’–

🌸 DESCRIPTION 🌸

okay so here's the tea: imageAtomicExchange atomically stores the value of data into the texel at coordinate P and sample in the image bound to unit image, and returns the original value of the texel. πŸ”₯

read that again. it stores your thing, and it hands you back the old thing. atomically. nobody in between. no race conditions crashing the party. iconic behaviour honestly ✨


πŸ’œ VERSION SUPPORT πŸ’œ

the original had a whole big grid here, so lemme lay it out for you in list form because we keep every detail, bestie. the columns were OpenGL Shading Language Versions: 1.10, 1.20, 1.30, 1.40, 1.50, 3.30, 4.00, 4.10, 4.20, 4.30, 4.40, 4.50.

  • imageAtomicExchange (uint and int data) β€” 1.10: -, 1.20: -, 1.30: -, 1.40: -, 1.50: -, 3.30: -, 4.00: -, 4.10: -, 4.20: βœ”, 4.30: βœ”, 4.40: βœ”, 4.50: βœ”
  • imageAtomicExchange (float data) β€” 1.10: -, 1.20: -, 1.30: -, 1.40: -, 1.50: -, 3.30: -, 4.00: -, 4.10: -, 4.20: -, 4.30: -, 4.40: -, 4.50: βœ”

so the uint/int version showed up in 4.20 like the queen it is πŸ‘‘ and the float version was fashionably late, arriving only in 4.50 πŸ™ˆ


πŸ¦‹ SEE ALSO πŸ¦‹

go read these next, they're all in the same friend group:

imageLoad(), imageStore(), imageAtomicAdd(), imageAtomicMin(), imageAtomicMax(), imageAtomicXor(), imageAtomicOr(), imageAtomicAnd(), imageAtomicCompSwap()


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


and that's the whole page, bestie!! πŸŽ€ this came from source [FIXME: source], dated 01/03/2018, and yeah the manual name was IMAGEATOMICEXCHANGE(3G) the entire time πŸ’… slay, go atomically exchange something, i'm obsessed with you 🫢✨

πŸ“¦ where this page comes from