Skip to content

Commit

Permalink
[3.8.5] Fix stateCache.glRenderbuffer is not reset to null in WebGLCm…
Browse files Browse the repository at this point in the history
…dFuncDestroyTexture (#17652)
  • Loading branch information
dumganhar authored Sep 19, 2024
1 parent d7aae74 commit 486c562
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cocos/gfx/webgl/webgl-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1008,11 +1008,11 @@ export function WebGLCmdFuncDestroyTexture (device: WebGLDevice, gpuTexture: IWe
}

if (gpuTexture.glRenderbuffer) {
let glRenderbuffer = device.stateCache.glRenderbuffer;
const glRenderbuffer = device.stateCache.glRenderbuffer;
gl.deleteRenderbuffer(gpuTexture.glRenderbuffer);
if (glRenderbuffer === gpuTexture.glRenderbuffer) {
gl.bindRenderbuffer(gl.RENDERBUFFER, null);
glRenderbuffer = null;
device.stateCache.glRenderbuffer = null;
}
gpuTexture.glRenderbuffer = null;
}
Expand Down
4 changes: 2 additions & 2 deletions cocos/gfx/webgl2/webgl2-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1238,11 +1238,11 @@ export function WebGL2CmdFuncDestroyTexture (device: WebGL2Device, gpuTexture: I
}

if (gpuTexture.glRenderbuffer) {
let glRenderbuffer = device.stateCache.glRenderbuffer;
const glRenderbuffer = device.stateCache.glRenderbuffer;
gl.deleteRenderbuffer(gpuTexture.glRenderbuffer);
if (glRenderbuffer === gpuTexture.glRenderbuffer) {
gl.bindRenderbuffer(gl.RENDERBUFFER, null);
glRenderbuffer = null;
device.stateCache.glRenderbuffer = null;
}
gpuTexture.glRenderbuffer = null;
}
Expand Down

0 comments on commit 486c562

Please sign in to comment.