WebGLRenderingContext.getProgramParameter()
WebGLRenderingContext.getProgramParameter()
方法返回WebGLProgram的信息。
语法
any gl.getProgramParameter(program, pname);
参数
- program
- A
WebGLProgram
to get parameter information from. - pname
- A
Glenum
(en-US) specifying the information to query. Possible values:gl.DELETE_STATUS
: Returns aGLboolean
(en-US) indicating whether or not the program is flagged for deletion.gl.LINK_STATUS
: Returns aGLboolean
(en-US) indicating whether or not the last link operation was successful.gl.VALIDATE_STATUS
: Returns aGLboolean
(en-US) indicating whether or not the last validation operation was successful.gl.ATTACHED_SHADERS
: Returns aGLint
(en-US) indicating the number of attached shaders to a program.gl.ACTIVE_ATTRIBUTES
: Returns aGLint
(en-US) indicating the number of active attribute variables to a program.gl.ACTIVE_UNIFORMS
: Returns aGLint
(en-US) 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
(en-US) indicating the buffer mode when transform feedback is active. May begl.SEPARATE_ATTRIBS
orgl.INTERLEAVED_ATTRIBS
.gl.TRANSFORM_FEEDBACK_VARYINGS
: Returns aGLint
(en-US) indicating the number of varying variables to capture in transform feedback mode.gl.ACTIVE_UNIFORM_BLOCKS
: Returns aGLint
(en-US) indicating the number of uniform blocks containing active uniforms.
返回值
Returns the requested program information (as specified with pname
).
例子
gl.getProgramParameter(program, gl.DELETE_STATUS);
Specifications
Specification | Status | Comment |
---|---|---|
WebGL 1.0 getProgramParameter |
Recommendation | Initial definition. |
OpenGL ES 2.0 glGetProgramiv |
Standard | Man page of the (similar) OpenGL API. |
WebGL 2.0 getProgramParameter |
Editor's Draft | Adds new pname values:gl.TRANSFORM_FEEDBACK_BUFFER_MODE ,gl.TRANSFORM_FEEDBACK_VARYINGS ,gl.ACTIVE_UNIFORM_BLOCKS |
Browser compatibility
BCD tables only load in the browser
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.