Skip to content

Commit 1246386

Browse files
authored
WebGPURenderer: Consistent bindFramebuffer() usage. (#32504)
1 parent 8487613 commit 1246386

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/renderers/webgl-fallback/utils/WebGLTextureUtils.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ class WebGLTextureUtils {
488488
backend.state.unbindTexture();
489489
// debug
490490
// const framebuffer = gl.createFramebuffer();
491-
// gl.bindFramebuffer( gl.FRAMEBUFFER, framebuffer );
491+
// backend.state.bindFramebuffer( gl.FRAMEBUFFER, framebuffer );
492492
// gl.framebufferTexture2D( gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, glTextureType, textureGPU, 0 );
493493

494494
// const readout = new Float32Array( width * height * 4 );
@@ -497,7 +497,7 @@ class WebGLTextureUtils {
497497
// const altType = gl.getParameter( gl.IMPLEMENTATION_COLOR_READ_TYPE );
498498

499499
// gl.readPixels( 0, 0, width, height, altFormat, altType, readout );
500-
// gl.bindFramebuffer( gl.FRAMEBUFFER, null );
500+
// backend.state.bindFramebuffer( gl.FRAMEBUFFER, null );
501501
// log( readout );
502502

503503
}
@@ -1183,7 +1183,7 @@ class WebGLTextureUtils {
11831183

11841184
const fb = gl.createFramebuffer();
11851185

1186-
gl.bindFramebuffer( gl.READ_FRAMEBUFFER, fb );
1186+
backend.state.bindFramebuffer( gl.READ_FRAMEBUFFER, fb );
11871187

11881188
const target = texture.isCubeTexture ? gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex : gl.TEXTURE_2D;
11891189

@@ -1210,6 +1210,8 @@ class WebGLTextureUtils {
12101210
gl.getBufferSubData( gl.PIXEL_PACK_BUFFER, 0, dstBuffer );
12111211
gl.bindBuffer( gl.PIXEL_PACK_BUFFER, null );
12121212

1213+
backend.state.bindFramebuffer( gl.READ_FRAMEBUFFER, null );
1214+
12131215
gl.deleteFramebuffer( fb );
12141216

12151217
return dstBuffer;

0 commit comments

Comments
 (0)