Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ae0c64d

Browse files
committedJan 16, 2025·
Add "Most objects in wgpu are now Clone" to highlight section
1 parent beb3341 commit ae0c64d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
 

‎CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,17 @@ The crate `wgpu` has two different "backends", one which targets webgpu in the b
6464

6565
By @cwfitzgerald in [#6619](https://github.com/gfx-rs/wgpu/pull/6619).
6666

67+
#### Most objects in `wgpu` are now `Clone`
68+
69+
All types in the `wgpu` API are now `Clone`.
70+
This is implemented with internal reference counting, so cloning for instance a `Buffer` does copies only the "handle" of the GPU buffer, not the underlying resource.
71+
72+
Previously, libraries using `wgpu` objects like `Device`, `Buffer` or `Texture` etc. often had to manually wrap them in a `Arc` to allow passing between libraries.
73+
This caused a lot of friction since if one library wanted to use a `Buffer` by value, calling code had to give up ownership of the resource which may interfere with other subsystems.
74+
Note that this also mimics how the WebGPU javascript API works where objects can be cloned and moved around freely.
75+
76+
By @cwfitzgerald in [#6665](https://github.com/gfx-rs/wgpu/pull/6665).
77+
6778
#### Render and Compute Passes Now Properly Enforce Their Lifetime
6879

6980
A regression introduced in 23.0.0 caused lifetimes of render and compute passes to be incorrectly enforced. While this is not

0 commit comments

Comments
 (0)
Please sign in to comment.