Back to Content

WebGL2RenderingContext: uniformBlockBinding() method

files/en-us/web/api/webgl2renderingcontext/uniformblockbinding/index.md

latest985 B
Original Source

{{APIRef("WebGL")}}{{AvailableInWorkers}}

The WebGL2RenderingContext.uniformBlockBinding() method of the WebGL 2 API assigns binding points for active uniform blocks.

Syntax

js-nolint
uniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding)

Parameters

  • program
    • : A {{domxref("WebGLProgram")}} containing the active uniform block whose binding to assign.
  • uniformBlockIndex
    • : A {{domxref("WebGL_API/Types", "GLuint")}} specifying the index of the active uniform block within the program.
  • uniformBlockBinding
    • : A {{domxref("WebGL_API/Types", "GLuint")}} specifying the binding point to which to bind the uniform block.

Return value

None ({{jsxref("undefined")}}).

Examples

js
gl.uniformBlockBinding(program, 0, 1);

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{domxref("WebGL2RenderingContext.getUniformIndices()")}}