wgpu icon indicating copy to clipboard operation
wgpu copied to clipboard

buffer_get_mapped_range different way of passing range than buffer_map_async

Open sagudev opened this issue 2 years ago • 3 comments

Is your feature request related to a problem? Please describe. buffer_get_mapped_range has offset and size while buffer_map_async uses rust's range.

Describe the solution you'd like To make things more concise and more up to specs buffer_map_async should have offset and size like in spec: https://gpuweb.github.io/gpuweb/#dom-gpubuffer-mapasync

Describe alternatives you've considered Alternative would be to switch buffer_get_mapped_range to use range.

Additional context This is all in wgpu-core, the goal is to have only one way of describing ranges.

sagudev avatar Oct 07 '23 16:10 sagudev

I would personally prefer they both just use Range

cwfitzgerald avatar Oct 09 '23 16:10 cwfitzgerald

Is this not already implemented? buffer_get_mapped_range in the core wrapper already uses range instead of the offset

andristarr avatar Feb 01 '24 20:02 andristarr

Is this not already implemented?

Not on wgpu-core (latest on crates): https://docs.rs/wgpu-core/latest/wgpu_core/global/struct.Global.html#method.buffer_get_mapped_range also not on trunk: https://github.com/gfx-rs/wgpu/blob/trunk/wgpu-core/src/device/global.rs#L2462

sagudev avatar Feb 02 '24 05:02 sagudev