BITFIELDREVERSE(3G)
π BITFIELDREVERSE π
okay bestie, so this is a page from the 3G manual β that's the OpenGL-adjacent section, the one where all the GLSL girlies live. and today's main character is bitfieldReverse, a function that literally just... flips your bits. backwards. iconic behaviour, honestly.
β¨ NAME β¨
bitfieldReverse β reverse the order of bits in an integer π¦
π DECLARATION π
so here's the vibe, two overloads, both valid, both serving:
genIType bitfieldReverse(genIType value);
genUType bitfieldReverse(genUType value);
πΈ PARAMETERS πΈ
valueβ the value whose bits you want reversed. that's it. that's the whole input. hand it over and let her cook π
π DESCRIPTION π
bitfieldReverse returns the reversal of the bits of value. like, the whole bit order, flipped end to end.
the bit numbered n will be taken from bit (bits - 1) - n of value, where bits is the total number of bits used to represent value.
so yeah. bit 0 becomes the top bit, the top bit becomes bit 0, and everybody in between swaps sides. it's giving mirror. it's giving glow-up in reverse. β¨
π«Ά VERSION SUPPORT π«Ά
not every GLSL era was ready for her, ngl. here's the tea, OpenGL Shading Language Version by version:
- 1.10 β
-nope π - 1.20 β
-nope - 1.30 β
-nope - 1.40 β
-nope - 1.50 β
-nope - 3.30 β
-nope - 4.00 β
βYES bestie π - 4.10 β
βyes - 4.20 β
βyes - 4.30 β
βyes - 4.40 β
βyes - 4.50 β
βyes, still slaying π
so like, if you're kicking it in1.10through3.30,bitfieldReversesimply does not exist for you.4.00is when she made her debut. no cap. π
π₯ SEE ALSO π₯
bitfieldExtract()bitfieldInsert()bitCount()
the whole bit-manipulation friend group, fr fr. go say hi. π¦
π 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 Β© 2011-2014 Khronos Group
and that's the whole page, bestie!! πβ¨ source situation is [FIXME: source] (yes girl, we know, the FIXME is still sitting there, she's doing her best π) and the date on this masterpiece is 01/03/2018 β so it's a lil vintage but still ate. π
BITFIELDREVERSE(3G), signing off. 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