Imagination PowerVR SDK Blog

Bit operations


#1

Hi

I was just wondering why there aren’t bit operations like bit-shift in OpenGL 2.0 ES Shading Language? Is there some architectural reason?

-hnyk


#2

This restriction allows implementation of the OpenGL ES 2.0 shader pipeline on hardware which is floating point only.


#3

Okay, but if it is floating point only, how come there are still variable types like int? Or are they just floating point numbers with lower precision?


#4

The range requirements for integers are specified so that they can be implemented as floats. Having integers in the language is still useful for type checking and a few other things.