WebGLRenderingContext.getProgramParameter() - Web APIs 编辑

The WebGLRenderingContext.getProgramParameter() method of the WebGL API returns information about the given program.

Syntax

any gl.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 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.

Return value

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

Examples

gl.getProgramParameter(program, gl.DELETE_STATUS);

Specifications

SpecificationStatusComment
WebGL 1.0
The definition of 'getProgramParameter' in that specification.
RecommendationInitial definition.
OpenGL ES 2.0
The definition of 'glGetProgramiv' in that specification.
StandardMan page of the (similar) OpenGL API.
WebGL 2.0
The definition of 'getProgramParameter' in that specification.
Editor's DraftAdds 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

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:141 次

字数:5856

最后编辑:8年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文