mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-23 07:51:08 +01:00
fix(core): Fix lock release order in PendingSubmission and Queue::write_buffer
This commit is contained in:
1 parent
a20d5d4c9b
commit
192207d376
1 file changed
+2
-7
@@ -635,8 +635,7 @@ impl WebGpuError for QueueSubmitError {
|
||||
/// [`submit`]: `PendingSubmission::submit`
|
||||
pub(crate) struct PendingSubmission<'a> {
|
||||
queue: &'a Queue,
|
||||
// NOTE: Guards must be declared in reverse of acquisition order, so `wgpu_validate_locks`
|
||||
// succeeds.
|
||||
// The lock ordering checker cares about the drop order for these guards.
|
||||
command_index_guard: RwLockWriteGuard<'a, CommandIndices>,
|
||||
snatch_guard: SnatchGuard<'a>,
|
||||
// Command buffers to be executed, along with trackers for the resources they use.
|
||||
@@ -729,12 +728,8 @@ impl Queue {
|
||||
buffer_offset,
|
||||
);
|
||||
|
||||
drop(snatch_guard);
|
||||
|
||||
pending_writes.consume(staging_buffer);
|
||||
|
||||
drop(pending_writes);
|
||||
|
||||
result
|
||||
}
|
||||
|
||||
@@ -1704,8 +1699,8 @@ impl Queue {
|
||||
|
||||
let submission = PendingSubmission {
|
||||
queue: self,
|
||||
snatch_guard,
|
||||
command_index_guard,
|
||||
snatch_guard,
|
||||
executions: Vec::new(),
|
||||
surface_textures: FastHashMap::default(),
|
||||
index,
|
||||
|
||||
Reference in new issue
Block a user