WebGL2RenderingContext: phương thức getUniformIndices()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2021.

Note: This feature is available in Web Workers.

Phương thức WebGL2RenderingContext.getUniformIndices() của WebGL 2 API truy xuất các chỉ mục của một số uniform trong một WebGLProgram.

Cú pháp

js
getUniformIndices(program, uniformNames)

Tham số

program

Một WebGLProgram chứa các uniform mà chỉ mục sẽ được truy vấn.

uniformNames

Một Array chuỗi chỉ định tên của các uniform sẽ truy vấn.

Giá trị trả về

Một Array các GLuint chứa các chỉ mục uniform.

Ví dụ

js
const uniformIndices = gl.getUniformIndices(program, [
  "UBORed",
  "UBOGreen",
  "UBOBlue",
]);

Đặc tả kỹ thuật

Thông số kỹ thuật
WebGL 2.0 Specification
# 3.7.16

Tương thích trình duyệt

Xem thêm