Firefox Tomorrow

web api instance method

WebGLRenderingContext: compileShader() method

View on MDN ↗

Available in workers

The WebGLRenderingContext.compileShader() method of the WebGL API compiles a GLSL shader into binary data so that it can be used by a WebGLProgram.

Syntax

compileShader(shader)

Parameters

Return value

None (undefined).

Exceptions

  • TypeError
    • : Thrown if the specified shader is not of type WebGLShader.

Examples

const shader = gl.createShader(gl.VERTEX_SHADER);
gl.shaderSource(shader, shaderSource);
gl.compileShader(shader);

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also