mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 06:44:14 +00:00
dont panic when submitting same commandbuffer multiple times (#2449)
This commit is contained in:
parent
63dfd98d68
commit
e50b62fae4
@ -1474,6 +1474,9 @@
|
||||
queueRid: device.rid,
|
||||
commandBuffers: commandBufferRids,
|
||||
});
|
||||
for (const commandBuffer of commandBuffers) {
|
||||
commandBuffer[_rid] = undefined;
|
||||
}
|
||||
device.pushError(err);
|
||||
}
|
||||
|
||||
|
@ -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::<super::command_encoder::WebGpuCommandBuffer>(rid)?;
|
||||
.get::<super::command_encoder::WebGpuCommandBuffer>(*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))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user