WebGL2RenderingContext.bindBufferBase()

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.

实验性: 这是一项实验性技术
在将其用于生产之前,请仔细检查浏览器兼容性表格

WebGL 2 APIWebGL2RenderingContext.bindBufferBase() 方法将一个 WebGLBuffer 绑定到某个点 (target) 的特定的 index上。

语法

void gl.bindBufferBase(target, index, buffer);

参数

target

Glenum 指定绑定操作的目标。可能的值:

  • gl.TRANSFORM_FEEDBACK_BUFFER
  • gl.UNIFORM_BUFFER
index

GLuint 指定目标(target)的 index。

buffer

绑定到目标点(target)的 WebGLBuffer

返回值

无。

示例

js
gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buffer);

规范

Specification
WebGL 2.0 Specification
# 3.7.16

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
bindBufferBase

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

相关链接