翻译不完整。 请帮助我们翻译这篇文章!

WebGLRenderingContext.getProgramParameter() 方法返回WebGLProgram的信息。


any gl.getProgramParameter(program, pname);


A WebGLProgram to get parameter information from.
A Glenum specifying the information to query. Possible values:
  • gl.DELETE_STATUS: Returns a GLboolean indicating whether or not the program is flagged for deletion.
  • gl.LINK_STATUS: Returns a GLboolean indicating whether or not the last link operation was successful.
  • gl.VALIDATE_STATUS: Returns a GLboolean indicating whether or not the last validation operation was successful.
  • gl.ATTACHED_SHADERS: Returns a GLint indicating the number of attached shaders to a program.
  • gl.ACTIVE_ATTRIBUTES: Returns a GLint indicating the number of active attribute variables to a program.
  • gl.ACTIVE_UNIFORMS: Returns a GLint 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 a GLenum indicating the buffer mode when transform feedback is active. May be gl.SEPARATE_ATTRIBS or gl.INTERLEAVED_ATTRIBS.
    • gl.TRANSFORM_FEEDBACK_VARYINGS: Returns a GLint indicating the number of varying variables to capture in transform feedback mode.
    • gl.ACTIVE_UNIFORM_BLOCKS: Returns a GLint indicating the number of uniform blocks containing active uniforms.


Returns the requested program information (as specified with pname).


gl.getProgramParameter(program, gl.DELETE_STATUS);


Specification Status Comment
WebGL 1.0
Recommendation Initial definition.
OpenGL ES 2.0
Standard Man page of the (similar) OpenGL API.
WebGL 2.0
Editor's Draft Adds new pname values:

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
getProgramParameterChrome Full support 9Edge Full support 12Firefox Full support 4IE Full support 11Opera Full support 12Safari Full support 5.1WebView Android Full support YesChrome Android Full support 25Firefox Android Full support YesOpera Android Full support 12Safari iOS Full support 8Samsung Internet Android Full support 1.5
WebGL2Chrome Full support 56Edge Full support 79Firefox Full support 51IE No support NoOpera Full support 43Safari No support NoWebView Android Full support 58Chrome Android Full support 58Firefox Android Full support 51Opera Android Full support 43Safari iOS No support NoSamsung Internet Android Full support 7.0


Full support  
Full support
No support  
No support

See also