Firefox Tomorrow

web api instance method

WebGLRenderingContext: getShaderSource() method

View on MDN ↗

Available in workers

The WebGLRenderingContext.getShaderSource() method of the WebGL API returns the source code of a WebGLShader as a string.

Syntax

getShaderSource(shader)

Parameters

  • shader

Return value

A string containing the source code of the shader.

Examples

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

const source = gl.getShaderSource(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