glGetShaderPrecisionFormat — return the range and precision for different shader numeric formats
Specifies the type of shader to query. Must be either
Specifies the numeric format to query, corresponding to a shader precision qualifier and variable type. Must be one of
Specifies a pointer to the two-element array in which the of the minimum and maximum representable magnitudes of the format are returned.
Specifies a pointer to the location in which the of the precision of the format is returned.
glGetShaderPrecisionFormat returns range and precision limits for floating-point and integer shader variable formats with low, medium, and high precision qualifiers. When and are the minimum and maximum representable values of the format, and are returned in
range as the first and second elements, respectively.
If the smallest representable value greater than 1 is then is returned in
precision. An integer format will have an ∊ of 1, and thus will return 0. Floating-point formats will return values greater than 0.
The minimum range and precision required for different formats is described in the OpenGL ES Shading Language Specification.
If a high precision floating-point format is not supported for fragment shaders, calling
glGetShaderPrecisionFormat with arguments
GL_HIGH_FLOAT will return 0 for both
precision. Support for a high precision floating-point format is mandatory for vertex shaders.
Shader compiler support is optional, and thus must be queried before use by calling glGet with argument
GL_SHADER_COMPILER. glShaderSource, glCompileShader,
glGetShaderPrecisionFormat, and glReleaseShaderCompiler will each generate
GL_INVALID_OPERATION on implementations that do not support a shader compiler. Such implementations instead offer the glShaderBinary alternative for supplying a pre-compiled shader binary.
If an error is generated, no change is made to the contents of
GL_INVALID_OPERATION is generated if a shader compiler is not supported.
GL_INVALID_ENUM is generated if
precisionType is not an accepted value.
glGet with argument
Copyright © 2008 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.