Imagination PowerVR SDK Blog

Can the precision effect frame rate???


#1

Whilst fixing some texture issues I had I changed the pixel shader from lowp to mediump and it made no difference to the frame rate.

If it does not I’m considering running my pixel shader all at mediump.



#2

Yes, precision qualifiers can substantially affect performance. Please have a look at section 7.2 of the Application Development Recommendations document that comes with our OpenGL ES 2.0 SDK.





A short summary:


Use lowp to represent colours and any data read from low precision textures, such as normals from a normal map. Be careful not to exceed the numeric range of lowp floats, especially with intermediate results. Swizzling the components of lowp vectors is expensive and should be avoided.





Use mediump for texture coordinate varyings as well as colours and other values if they exceed the lowp range of [-2, 2].





Use highp for all vertex position calculations, including transformation matrices, as well as any scalar calculations that use complex built-in functions such as sin, cos, pow, log, etc.