USUBBORROW(3G)

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

πŸ’– 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's out, 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 Β© 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 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