大网数据广告活动
Web 标准与前端开发

WebGLRenderingContext: getProgramParameter() method

· 52CE 我爱测

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

WebGL

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

Syntax

getProgramParameter(program, pname)

Parameters

  • program
    • : A WebGLProgram to get parameter information from.
  • pname
    • : A WebGL_API/Types specifying the information to query. Possible values:

      • gl.DELETE_STATUS
        • : Returns a WebGL_API/Types indicating whether or not the program is flagged for deletion.
      • gl.LINK_STATUS
        • : Returns a WebGL_API/Types indicating whether or not the last link operation was successful.
      • gl.VALIDATE_STATUS
        • : Returns a WebGL_API/Types indicating whether or not the last validation operation was successful.
      • gl.ATTACHED_SHADERS
        • : Returns a WebGL_API/Types indicating the number of attached shaders to a program.
      • gl.ACTIVE_ATTRIBUTES
        • : Returns a WebGL_API/Types indicating the number of active attribute variables to a program.
      • gl.ACTIVE_UNIFORMS
        • : Returns a WebGL_API/Types indicating the number of active uniform variables to a program.

      When using a WebGL2RenderingContext, the following values are available additionally:

      • gl.TRANSFORM_FEEDBACK_BUFFER_MODE
        • : Returns a WebGL_API/Types indicating the buffer mode when transform feedback is active. May be gl.SEPARATE_ATTRIBS or gl.INTERLEAVED_ATTRIBS.
      • gl.TRANSFORM_FEEDBACK_VARYINGS
        • : Returns a WebGL_API/Types indicating the number of varying variables to capture in transform feedback mode.
      • gl.ACTIVE_UNIFORM_BLOCKS
        • : Returns a WebGL_API/Types 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

Browser compatibility

See also

  • WebGLRenderingContext.getShaderParameter()

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。