12 OpenGL Operation
FLOAT, HIGH FLOAT, LOW INT, MEDIUM INT or HIGH INT. range points to an array of two integers in
which encodings of the format’s numeric range are returned. If min and max are the smallest and largest
values representable in the format, then the values returned are defined to be
range[0] = blog
2
(|min|)c
range[1] = blog
2
(|max|)c
precision points to an integer in which the log
2
value of the number of bits of precision of the format is
returned. If the smallest representable value greater than 1 is 1 + , then *precision will contain b−log
2
()c,
and every value in the range
[−2
range[0]
, 2
range[1]
]
can be represented to at least one part in 2
∗precision
. For example, an IEEE single-precision floating-point
format would return range[0] = 127, range[1] = 127, and ∗precision = 23, while a 32-bit twos-
complement integer format would return range[0] = 31, range[1] = 30, and ∗precision = 0.
The minimum required precision and range for formats corresponding to the different values of preci-
siontype are described in section 4.5 of the OpenGL ES Shading Language specification.
If high precision floating-point is not supported in fragment shaders, calling GetShaderPrecisionFormat
with a precisiontype of HIGH FLOAT will return zero for range[0], range[1], and *precision.
If the value of SHADER COMPILER is not TRUE, then the error INVALID OPERATION is generated.
2.15.2 Shader Binaries
The ShaderBinary command can be used to load precompiled shader binaries.
void ShaderBinary(sizei count, const uint *shaders, enum binaryformat, const void *binary, sizei length)
This call takes a list of count shader handles described by shaders. Each shader handle refers to a unique
shader type i.e. a vertex shader or a fragment shader. The binary argument points to length bytes of pre-
compiled binary code. This provides the ability to individually load binary vertex, or fragment shaders or
load an executable binary that contains the optimized pair of vertex and fragment shaders stored in the same
binary.
The binary image will be decoded according to the specification defining the binaryformat token. A
binary data that does not match the specified binaryformat will result in an INVALID VALUE error. The bits
that represent the binary is implementation specific. An INVALID OPERATION error is generated if any of
the handles in shaders is not a valid shader object created with CreateShader, or if more than one of the
handles refers to the same type of shader (vertex or fragment shader.) If ShaderBinary failed, GetError can
be used to return the appropriate error. A failed binary load does not restore the old state of shaders for
which the binary was being loaded.
Queries of values NUM
SHADER BINARY FORMATS and SHADER BINARY FORMATS return the number
of shader binary formats and the list of shader binary format values supported by an OpenGL ES implemen-
tation
Note that if shader binary interfaces are supported, then an OpenGL ES implementation may require
that an optimized pair of vertex and fragment shader binaries that were compiled together be specified to
LinkProgram. Not specifying an optimized pair may result in the LinkProgram call to fail.