UADDCARRY(3G)
π NAME π
okay so this one's called uaddCarry β it adds unsigned integers and generates a carry. that's the whole gig. it's in the 3G manual, bestie, so we're in GLSL land now β¨
π DECLARATION π
here's the exact signature, do not freestyle it:
genUType uaddCarry(genUType x, genUType y, out genUType carry);
π«Ά PARAMETERS π«Ά
xβ the first vector going into the summation operation. yes babe, it's vector one πyβ the second vector in the summation operation. the other half of the situationship π¦carryβ the variable that receives the carry output of the sum. it's anoutparam, so it's literally catching the overflow tea for you π
π DESCRIPTION π
so uaddCarry takes two 32-bit unsigned integer variables β could be scalars, could be vectors, either one, no judgment πΈ β and it generates a 32-bit unsigned integer result, plus a carry output riding shotgun.
the result is the sum of x and y modulo 232. no cap.
and then carry? it gets set to 0 if the sum is less than 232, and to 1 otherwise. so it's basically the little flag that goes "hey girl, we overflowed π".
π VERSION SUPPORT π
here's the vibe check on which OpenGL Shading Language Versions actually let you have this function. uaddCarry is the function name, and the columns are the GLSL versions:
1.10β-(nope, not supported)1.20β-(still nope)1.30β-1.40β-1.50β-3.30β-(last of the no era, rip)4.00ββ(and suddenly she's supported, we love a glow up)4.10ββ4.20ββ4.30ββ4.40ββ4.50ββ(still eating, still iconic)
π SEE ALSO π
usubBorrow()
(yes that's her sister, go read it next π«Ά)
π COPYRIGHT π
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 π
Copyright Β© 2011-2014 Khronos Group
and that's the whole page, bestie π mwah. this was pulled from [FIXME: source] and dated 01/03/2018 β so if you're reading this in the group chat, yes, it's giving vintage, and yes, it still slays π
π¦ where this page comes from
- ubuntu jammy: opengl-4-man-doc 1.0~svn33624-1 Β· SGI-Free-Software-B-License-2
- ubuntu noble: opengl-4-man-doc 1.0~svn33624-1 Β· SGI-Free-Software-B-License-2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms