Skip to content

Commit

Permalink
fix(webgl): reset buffer binding in WEBGLVertexArray.setBuffer (#2075)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pessimistress committed Apr 25, 2024
1 parent 0af201f commit 8f792db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Expand Up @@ -56,7 +56,7 @@ export class WEBGLTransformFeedback extends TransformFeedback {

end(): void {
this.gl.endTransformFeedback();
if (!this.bindOnUse) {
if (this.bindOnUse) {
this._unbindBuffers();
}
this.gl.bindTransformFeedback(GL.TRANSFORM_FEEDBACK, null);
Expand Down
3 changes: 3 additions & 0 deletions modules/webgl/src/adapter/resources/webgl-vertex-array.ts
Expand Up @@ -97,6 +97,9 @@ export class WEBGLVertexArray extends VertexArray {
// Attaches ARRAY_BUFFER with specified buffer format to location
this.device.gl.vertexAttribPointer(location, size, type, normalized, stride, offset);
}
// Clear binding - keeping it may cause [.WebGL-0x12804417100]
// GL_INVALID_OPERATION: A transform feedback buffer that would be written to is also bound to a non-transform-feedback target
this.device.gl.bindBuffer(GL.ARRAY_BUFFER, null);

// Mark as non-constant
this.device.gl.enableVertexAttribArray(location);
Expand Down

0 comments on commit 8f792db

Please sign in to comment.