PACKHALF2X16(3G)

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

πŸ’– packHalf2x16 β€” the manual page, but make it make sense πŸ’–

okay bestie, so this is the 3G manual, and the star of the show is a lil function called packHalf2x16. no cap, it's lowkey iconic.


✨ NAME ✨

packHalf2x16 β€” convert two 32-bit floating-point quantities to 16-bit quantities and pack them into a single 32-bit integer πŸŽ€

like, two floats go in, one chonky integer comes out. the way that it just works. πŸ¦‹


🌸 DECLARATION 🌸

uint packHalf2x16(vec2 v);

that's it, that's the whole signature. she's simple, she's elegant, she ate. πŸ’…


πŸŽ€ PARAMETERS πŸŽ€

  • v β€” bestie, this is a vector of two 32-bit floating point values. they're the ones getting converted to 16-bit representation and packed into the result. two float girlies, one destination ✨

πŸ’œ DESCRIPTION πŸ’œ

so packHalf2x16 returns an unsigned integer, right? and it gets there by converting the components of a two-component floating-point vector into the 16-bit floating-point representation found in the OpenGL Specification, and then packing those two 16-bit integers into a single 32-bit unsigned integer. πŸ”₯

here's the part you gotta remember, fr fr:

  • the first vector component specifies the 16 least-significant bits of the result 🫢
  • the second component specifies the 16 most-significant bits πŸ‘‘

so like, order matters. don't come for me if you flip them. πŸ™ˆ


🌈 VERSION SUPPORT 🌈

vibe check on which OpenGL Shading Language Versions are serving this function:

  • GLSL 1.10 β€” - (nope, not yet πŸ’€)
  • GLSL 1.20 β€” - (still no πŸ’€)
  • GLSL 1.30 β€” - (crickets πŸ’€)
  • GLSL 1.40 β€” - (bestie no πŸ’€)
  • GLSL 1.50 β€” - (nada πŸ’€)
  • GLSL 3.30 β€” - (not invited πŸ’€)
  • GLSL 4.00 β€” - (so close yet so far πŸ’€)
  • GLSL 4.10 β€” - (the drought continues πŸ’€)
  • GLSL 4.20 β€” βœ” (SHE'S HERE, she arrived πŸ‘‘βœ¨)
  • GLSL 4.30 β€” βœ” (still slaying πŸ’–)
  • GLSL 4.40 β€” βœ” (consistent queen πŸŽ€)
  • GLSL 4.50 β€” βœ” (periodt πŸ’…)

so the function name is packHalf2x16, and she really said "4.20 and up only." main character energy fr. 🌸


πŸ¦‹ SEE ALSO πŸ¦‹

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

  • packDouble2x32()
  • unpackDouble2x32()
  • unpackHalf2x16()

iykyk πŸ’œ


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


okay that's the whole page bestie, no notes, go pack some halves πŸ’…βœ¨

and for the lil sign-off: this one came from [FIXME: source], dated 01/03/2018, and it lives in the 3G manual as PACKHALF2X16(3G). mwah, love u, bye πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from