mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
27: Resource lifetime tracking r=grovesNL a=kvark Fixes #26 This change ends up being much more serious and intrusive, but hopefully manage-able. The idea is that the native layer would have explicit deletion calls exposed, but would still guarantee that resources live for as long as they are used by either CPU or GPU. The device, in order to guarantee that, keeps track of resources associated with fences and walks through them for clean up. Maintaining the actual ref-counts per object up-to-date is one of the most challenging tasks. I choose to use the existing `Stored` structure to host it, so that we are forced to clone the refcounts, and it's difficult to screw up. I still had to provide the "old" semantics under the new name of `WeaklyStored` though, and we should be careful about it. TODO: - [ ] review and test - [x] fix transition API once more, so that command buffers are stitched properly and resources are tracked by the device - [ ] update the Rust layer, using RAII - [ ] update the examples Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
WebGPU
This is an experimental WebGPU implementation as a native static library. It's written in Rust and is based on gfx-hal and satellite libraries. The corresponding WebIDL specification can be found at gpuweb project.
The implementation consists of the following parts:
wgpu-native- the native implementation of WebGPU as a C API librarywgpu-bindings- automatic generator of actual C headerswgpu-remote- remoting layer to work with WebGPU across the process boundarywgpu-rs- idiomatic Rust wrapper of the native library
Description
Languages
Rust
94.6%
JavaScript
5.4%