fix(core): drop PendingSubmission's guards in reverse acquisition order (#9960)

Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
This commit is contained in:
AdrianEddyandErich Gubler authored and GitHub committed 2026-07-30 06:07:11 -04:00
1 parent ecf8932500
commit f9f55b7d51
2 files changed
+4 -1

No files matched your search

+1
View File
@@ -80,6 +80,7 @@ Bottom level categories:
- Zero-initialize padding (if any) at the end of a buffer allocation. This was application-visible in rare cases on Vulkan when a shader read beyond the valid range of a vertex buffer. By @andyleiserson in [#9791](https://github.com/gfx-rs/wgpu/pull/9791).
- Fix required immediate slots calculation and remove `naga::valid::FunctionInfo::immediate_slots_used`. By @beicause in [#9725](https://github.com/gfx-rs/wgpu/pull/9725).
- Fix `PendingSubmission` releasing its lock guards out of stacking order, which tripped `--cfg wgpu_validate_locks` on any submission. By @AdrianEddy in [#9960](https://github.com/gfx-rs/wgpu/pull/9960).
#### naga
+3 -1
View File
@@ -638,8 +638,10 @@ impl WebGpuError for QueueSubmitError {
/// [`submit`]: `PendingSubmission::submit`
pub(crate) struct PendingSubmission<'a> {
queue: &'a Queue,
snatch_guard: SnatchGuard<'a>,
// NOTE: Guards must be declared in reverse of acquisition order, so `wgpu_validate_locks`
// succeeds.
command_index_guard: RwLockWriteGuard<'a, CommandIndices>,
snatch_guard: SnatchGuard<'a>,
// Command buffers to be executed, along with trackers for the resources they use.
pub executions: Vec<EncoderInFlight>,
// Surface textures referenced by command buffers in this submission. These need to be