BITFIELDINSERT(3G)
π BITFIELDINSERT π
okay bestie, welcome to the bitfieldInsert(3G) page β¨ this is one of those GLSL bit-manipulation girlies and she is lowkey iconic. it's giving "surgical bit surgery" and honestly? obsessed. π«Ά
πΈ NAME πΈ
bitfieldInsert β insert a range of bits into an integer π
β¨ DECLARATION β¨
here's the whole signature situation, copy it exactly bestie, no improvising π
genIType bitfieldInsert(genIType base, genIType insert, int offset,
int bits);
genUType bitfieldInsert(genUType base, genUType insert, int offset,
int bits);
π PARAMETERS π
baseβ this is the integer you're inserting into. the main character, fr fr. it's the one getting the glow-up.insertβ this is the value of the bits you're inserting. yes, the original says "the the value" and honestly? she's quirky, we love her. πoffsetβ the index of the first bit to insert. where the magic starts, periodt.bitsβ how many bits you're inserting. the count, the vibe, the number. β
π¦ DESCRIPTION π¦
okay so here's the tea: bitfieldInsert takes the bits least significant bits of insert and drops them into base at offset. πͺ
the returned value will have bits [offset, offset + bits + 1] taken from [0, bits - 1] of insert, and all other bits taken directly from the corresponding bits of base. like a little bit-swap makeover. π
if bits is zero, the result will simply be the original value of base β no notes, she's unchanged, she's thriving. πΈ
β οΈ and now the scary part bestie, listen up: the result will be undefined ifoffsetorbitsis negative, or if the sum ofoffsetandbitsis greater than the number of bits used to store the operand. undefined behaviour is not the vibe, do not test her. ππ
π VERSION SUPPORT π
so the original had a whole big table, and we're doing it as a list because tables are not the vibe here. same facts, same energy. β¨
Function name: bitfieldInsert β OpenGL Shading Language Version support:
- 1.10 β
-(nope, not yet, she wasn't born π) - 1.20 β
- - 1.30 β
- - 1.40 β
- - 1.50 β
- - 3.30 β
- - 4.00 β
β(she's HERE π) - 4.10 β
β - 4.20 β
β - 4.30 β
β - 4.40 β
β - 4.50 β
β
π SEE ALSO π
bitfieldExtract()
her sister, her other half, go read it too, iykyk π§
π 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!! π this manual came from [FIXME: source], dated 01/03/2018, and she answers to the name BITFIELDINSERT(3G). slay, ate, no crumbs, go insert some bits responsibly π
β¨π
π¦ 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