IMAGEATOMICMIN(3G)

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

πŸ’– IMAGEATOMICMIN πŸ’–

okay bestie, sit down, hydrate, and let me tell you about imageAtomicMin β€” a little legend from the 3G manual (that's the OpenGL Shading Language corner of the world, iykyk). This is the one that swoops into your image memory, compares numbers, keeps the smaller one, and hands you back the original like a lil receipt. no cap. ✨


🌸 NAME 🌸

imageAtomicMin β€” atomically compute the minimum of a value with an existing value in memory, store that value and return the original value. πŸ’…


✨ DECLARATION ✨

here's the whole squad, all 22 of them, looking absolutely iconic:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

notice how it comes in uint flavor and int flavor? yeah. range. versatility. the range is ranging. 🌈


πŸŽ€ PARAMETERS πŸŽ€

  • image β€” the image unit you're storing data into. that's the destination, the main character of the memory world. πŸ‘‘
  • P β€” the coordinate where you're putting the data. like a lil address, but cute. πŸ“
  • sample β€” only shows up sometimes! when it's there, it says which sample within the image you're storing into. 🧚
  • data β€” the value you're taking the minimum of against whatever's already chillin' in the image. πŸ“

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea. imageAtomicMin atomically computes a new value by finding the minimum of the value of data and the contents of the texel at coordinate P and sample in the image bound to uint image, stores that value into the image and returns the original value. πŸ”₯

"atomically" means nobody can cut in line. no other thread is sneaking in halfway through to mess with that texel. it's giving locked-in, no distractions, one at a time. periodt. πŸ’…

and the way it's a little snapshot too?? it stores the new minimum AND gives you back the old value like "here's what it was before i got here, bestie." 😭 so good.


⭐ VERSION SUPPORT ⭐

which OpenGL Shading Language versions have imageAtomicMin? vibe check time:

Function Name: imageAtomicMin

  • 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 basically it didn't exist for a long while and then showed up at 4.20 and never left. glow up of the century fr fr. βœ¨πŸ‘‘


πŸ’œ SEE ALSO πŸ’œ

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

imageLoad(), imageStore(), imageAtomicAdd(), imageAtomicMax(), imageAtomicXor(), imageAtomicOr(), imageAtomicAnd(), imageAtomicExchange(), 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!! πŸ’– the source is listed as [FIXME: source], the date on this one is 01/03/2018, and it lives in the IMAGEATOMICMIN(3G) manual. now go atomically minimize something and slay responsibly. 🫢🌸

πŸ“¦ where this page comes from