vulkano-rs / vulkano

Safe and rich Rust wrapper around the Vulkan API
Apache License 2.0
4.54k stars 438 forks source link

Add `Suballocation[Node]::as[_usize]_range` #2586

Closed marc0246 closed 1 month ago

marc0246 commented 1 month ago

I'm sick and tired of looking at code like this in a hundred places:

        let material_staging_buffer =
            Subbuffer::from(material_staging_buffer_state.buffer().clone()).slice(
                material_staging_buffer_suballocation.offset
                    ..material_staging_buffer_suballocation.offset
                        + material_staging_buffer_suballocation.size,
            );

Changelog:

### Additions
- Added `Suballocation[Node]::as[_usize]_range` for cleaner slicing.