Baseline Widely available
Note: This feature is available in Web Workers.
The WebGL2RenderingContext.getUniformBlockIndex()
method of the WebGL 2 API retrieves the index of a uniform block within a WebGLProgram
.
getUniformBlockIndex(program, uniformBlockName)
Parameters
program
A WebGLProgram
containing the uniform block.
uniformName
A string specifying the name of the uniform block to whose index to retrieve.
A GLuint
indicating the uniform block index.
// Assuming a shader with the following declaration:
// uniform UBOData {
// mat4 foo;
// } instanceName;
// use the block name, not the instance name:
const blockIndex = gl.getUniformBlockIndex(program, "UBOData");
Specifications Browser compatibility See also
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3