The WebGLRenderingContext.getProgramParameter()
method of the WebGL API returns information about the given program.
WebGLRenderingContext.getProgramParameter()
Syntax
getProgramParameter(program, pname)
Parameters
- program
-
A
WebGLProgram
to get parameter information from. - pname
-
A
GLenum
specifying the information to query. Possible values:-
gl.DELETE_STATUS
: Returns aGLboolean
indicating whether or not the program is flagged for deletion. -
gl.LINK_STATUS
: Returns aGLboolean
indicating whether or not the last link operation was successful. -
gl.VALIDATE_STATUS
: Returns aGLboolean
indicating whether or not the last validation operation was successful. -
gl.ATTACHED_SHADERS
: Returns aGLint
indicating the number of attached shaders to a program. -
gl.ACTIVE_ATTRIBUTES
: Returns aGLint
indicating the number of active attribute variables to a program. -
gl.ACTIVE_UNIFORMS
: Returns aGLint
indicating the number of active uniform variables to a program. - When using a WebGL 2 context, the following values are available additionally:
-
gl.TRANSFORM_FEEDBACK_BUFFER_MODE
: Returns aGLenum
indicating the buffer mode when transform feedback is active. May begl.SEPARATE_ATTRIBS
orgl.INTERLEAVED_ATTRIBS
. -
gl.TRANSFORM_FEEDBACK_VARYINGS
: Returns aGLint
indicating the number of varying variables to capture in transform feedback mode. -
gl.ACTIVE_UNIFORM_BLOCKS
: Returns aGLint
indicating the number of uniform blocks containing active uniforms.
-
-
Return value
Returns the requested program information (as specified with pname
).
Examples
gl.getProgramParameter(program, gl.DELETE_STATUS);
Specifications
Specification |
---|
WebGL Specification # 5.14.9 |
WebGL 2.0 Specification # 3.7.7 |
Browser compatibility
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
getProgramParameter |
9
|
12
|
4
|
11
|
12
|
5.1
|
4.4.3
|
25
|
4
|
12
|
8
|
1.5
|
WebGL2 |
56
|
79
|
51
|
No
|
43
|
No
|
58
|
58
|
51
|
43
|
No
|
7.0
|
See also
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getProgramParameter