-
Notifications
You must be signed in to change notification settings - Fork 973
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose
StagingBelt
allocation directly.
This allows using `StagingBelt` for copying to textures or any other operation where copying to an existing buffer is not the desired outcome. One unfortunate feature of the API is that `allocate()` returns the entire buffer and an offset, so applications could accidentally touch parts of the belt buffer outside the intended allocation. It might make more sense to return `wgpu::BufferSlice`, but that struct cannot be used in operations like `copy_buffer_to_texture` and does not have getters, so it is not currently suitable for that purpose. I also moved `Exclusive` into a module so that its unsafe-to-access field is properly private, and made various improvements to the `StagingBelt` documentation, such as acknowledging that `write_buffer_with()` exists.
- Loading branch information
Showing
2 changed files
with
115 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters