mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-23 07:51:08 +01:00
Move the `Mutex` in `Device::command_allocator` inside the `CommandAllocator` type itself, allowing it to be passed by shared reference instead of mutable reference. Passing `CommandAllocator` to functions like `PendingWrites::post_submit` by mutable reference requires the caller to acquire and hold the mutex for the entire time the callee runs, but `CommandAllocator` is just a recycling pool, with very simple invariants; there's no reason to hold the lock for a long time.