mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-20 06:21:13 +01:00
b01a4bb16923781e82cdc655d85afc0615125660
82: Return Queue separately r=grovesNL a=kvark What problem is this PR trying to solve? We want `Device` to be freely accessible from multiple threads/objects and internally synchronized. `Arc<Device>` seems like a natural choice of such a sharable object, especially since all except one methods are `&self`. That one method is `get_queue()`, and it returns a temporary object `Queue<'a>`. If we turn it into `&self`, we'd end up with multiple instances of `Queue` created at any time, which contradicts the initial design (of this Rust wrapper). If it stays `&mut` and the user wraps the device into `Arc`, they'll never be able to submit any work... So this PR solves this by moving the `Queue` completely outside of the device. Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
Languages
Rust
78.5%
WGSL
13%
GLSL
3.1%
Metal
2.8%
HLSL
2.3%
Other
0.2%