What Built-In Bitwise Functions Does GLSL Support?

Modern GLSL provides a dedicated set of hardware-accelerated integer functions designed for advanced bit-level manipulation, supplementing standard C-style bitwise operators. Introduced with GLSL 4.00 and OpenGL ES 3.10 (via GL_ARB_gpu_shader5), these built-in functions operate component-wise on signed and unsigned 32-bit scalars (int, uint) and integer vector types (ivec2ivec4, uvec2uvec4). Below is an overview of the core bitwise manipulation functions available in modern GLSL.

Core Bitfield Operations

Bit Inspection and Counting

Extended Arithmetic and Carry Handling

Modern GLSL also incorporates extended arithmetic routines to assist with multi-precision integer operations: