web api instance method
WebGLRenderingContext: getShaderSource() method
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- : A
WebGLShaderobject to get the source code from.
- : A
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.