USUBBORROW(3G)
π NAME π
okay so bestie, welcome to usubBorrow β she subtracts unsigned integers and generates borrow. that's the whole vibe. it's from the 3G manual section, which is giving "OpenGL shading language core functions" energy, iykyk π
β¨ DECLARATION β¨
like, here's literally how you call her:
genUType usubBorrow(genUType x, genUType y, out genUType borrow);
she takes two genUTypes and an out param. main character behavior fr fr π«Ά
πΈ PARAMETERS πΈ
xβ the first vector to be used in the subtraction operation. she's the one being subtracted FROM, so pay attention bestie πyβ the second vector to be used in the subtraction operation. the one doing the subtracting πborrowβ the variable that receives the borrow output of the difference. yes it'sout, yes it gets written, no you don't pass it by value, okurrr π
π¦ DESCRIPTION π¦
okay so here's the tea, and it's actually kind of iconic:
usubBorrow subtracts two 32-bit unsigned integer variables (scalars or vectors, she does both, she's versatile like that β¨) and generates a 32-bit unsigned integer result, along with a borrow output.
The result is the difference of x and y if non-negative, or 232 plus that difference otherwise.
And borrow? The value borrow is set to 0 if x β₯ y and to 1 otherwise. no cap, that's literally it π
lowkey the borrow flag is the whole point bestie β it's how you know the subtraction went β¨underβ¨ zero and wrapped around. it's giving unsigned arithmetic with receipts π§Ύ
π VERSION SUPPORT π
so which OpenGL Shading Language versions let you have her? let's do a little vibe check across the eras π
- OpenGL Shading Language 1.10 β
- - OpenGL Shading Language 1.20 β
- - OpenGL Shading Language 1.30 β
- - OpenGL Shading Language 1.40 β
- - OpenGL Shading Language 1.50 β
- - OpenGL Shading Language 3.30 β
- - OpenGL Shading Language 4.00 β β
- OpenGL Shading Language 4.10 β β
- OpenGL Shading Language 4.20 β β
- OpenGL Shading Language 4.30 β β
- OpenGL Shading Language 4.40 β β
- OpenGL Shading Language 4.50 β β
so likeβ¦ she didn't exist until 4.00 and then she ATE and never left. periodt π
π₯ (the function name across all of those columns is, obviously, usubBorrow.)
π SEE ALSO π
uaddCarry()
(the carry sibling!! she borrows, they carry, it's a whole dynamic, obsessed π«Ά)
π 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 page bestie!! π this was [FIXME: source], dated 01/03/2018, and you just read USUBBORROW(3G) β go forth and subtract with borrows responsibly, mwah ππβ¨
π¦ 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