2.3.2. Running code on OpenGL and OpenGL ES

If you are writing code to run on both OpenGL 2.0 and OpenGL ES 2.0, be aware of slight differences between the shader languages used in the two APIs. For example, OpenGL ES 2.0 requires a precision declaration in the fragment shader code, while OpenGL 2.0 does not support this.

To enable your code to run on both OpenGL 2.0 and OpenGL ES 2.0, start every fragment shader with:

#ifdef GL_ES
 precision mediump float;
#endif
Copyright © 2007-2009 ARM. All rights reserved.ARM DUI 0363D
Non-Confidential