Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

getShaderPrecisionFormat method

Returns the precision and range of the supplied numeric format for a given shader type.

IE11

 

Syntax

var retVal = WebGLRenderingContext.getShaderPrecisionFormat(shaderType, precisionType);

Parameters

shaderType [in]

Type: Number

Type of shader. One of the following:

  • gl.VERTEX_SHADER
  • gl.FRAGMENT_SHADER
precisionType [in]

Type: Number

The numeric format to query for range and precision. One of the following:

  • gl.LOW_FLOAT
  • gl.MEDIUM_FLOAT
  • gl.HIGH_FLOAT
  • gl.LOW_INT
  • gl.MEDIUM_INT
  • gl.HIGH_INT

Return value

Type: WebGLShaderPrecisionFormat

Precision and range of numeric format.

Remarks

WebGL errorDescription
gl.INVALID_ENUMIf either shaderType or precisionType aren't accepted values.
gl.INVALID_OPERATIONIf the shader compiler isn't supported.

 

If an error is generated, the contents of precisionType is returned as undefined.

See also

WebGLRenderingContext

 

 

Show:
© 2015 Microsoft