luma.gl icon indicating copy to clipboard operation
luma.gl copied to clipboard

gl.getParameter(gl.ARRAY_BUFFER_BINDING) returns outdated value

Open Pessimistress opened this issue 4 years ago • 0 comments

Reported in https://github.com/visgl/deck.gl/pull/6224#issuecomment-931521220

Actual Result

When querying the bound buffer, gl.getParameter(gl.ARRAY_BUFFER_BINDING) always returns the bound buffer when it was queried the first time.

Expected Result

gl.getParameter(gl.ARRAY_BUFFER_BINDING) should return the currently bound buffer.

Reproduce Steps

const gl = createGLContext();
const buffer = new Buffer(gl, {});

console.log(gl.getParameter(gl.ARRAY_BUFFER_BINDING));

buffer.bind();
console.log(gl.getParameter(gl.ARRAY_BUFFER_BINDING));

buffer.unbind();
console.log(gl.getParameter(gl.ARRAY_BUFFER_BINDING));

Result: null, null, null

Comment out the first console.log and the result is WebGLBuffer {}, WebGLBuffer {}

To Do List

  • [ ] Add label and assign to milestone
  • [ ] Coding
  • [ ] Test

Pessimistress avatar Sep 30 '21 18:09 Pessimistress