Skip to content

Commit 291280b

Browse files
authored
WebGPUTextureUtils: Fix copyTextureToBuffer() dispose buffer (#33366)
1 parent 99cc9af commit 291280b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/renderers/webgpu/utils/WebGPUTextureUtils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,9 @@ class WebGPUTextureUtils {
692692

693693
await readBuffer.mapAsync( GPUMapMode.READ );
694694

695-
const buffer = readBuffer.getMappedRange();
695+
const buffer = readBuffer.getMappedRange().slice();
696+
697+
readBuffer.destroy();
696698

697699
return new typedArrayType( buffer );
698700

0 commit comments

Comments
 (0)