diff --git a/deno_webgpu/01_webgpu.js b/deno_webgpu/01_webgpu.js index ec1c5a813..2bd9952e7 100644 --- a/deno_webgpu/01_webgpu.js +++ b/deno_webgpu/01_webgpu.js @@ -1474,6 +1474,9 @@ queueRid: device.rid, commandBuffers: commandBufferRids, }); + for (const commandBuffer of commandBuffers) { + commandBuffer[_rid] = undefined; + } device.pushError(err); } diff --git a/deno_webgpu/src/queue.rs b/deno_webgpu/src/queue.rs index c46f511b2..a3e3d34bd 100644 --- a/deno_webgpu/src/queue.rs +++ b/deno_webgpu/src/queue.rs @@ -30,15 +30,19 @@ pub fn op_webgpu_queue_submit( let mut ids = vec![]; - for rid in args.command_buffers { + for rid in &args.command_buffers { let buffer_resource = state .resource_table - .get::(rid)?; + .get::(*rid)?; ids.push(buffer_resource.0); } let maybe_err = gfx_select!(queue => instance.queue_submit(queue, &ids)).err(); + for rid in args.command_buffers { + state.resource_table.close(rid)?; + } + Ok(WebGpuResult::maybe_err(maybe_err)) }