[hal] Add BufferBinding::buffer read accessor (#9820)

This commit is contained in:
Daniel Lehmann authored and GitHub committed 2026-07-06 23:51:13 -04:00
1 parent 1798a02d3d
commit 270bd5d3ad
2 files changed
+13 -1

No files matched your search

+6
View File
@@ -42,6 +42,12 @@ Bottom level categories:
## Unreleased
### Added/New Features
#### Hal
- Add `BufferBinding::buffer`, a public read accessor for the bound buffer, which was previously inaccessible to out-of-tree `wgpu_hal::Api` implementations. By @danlehmann in [#9820](https://github.com/gfx-rs/wgpu/pull/9820).
### Bug Fixes
#### GLES
+7 -1
View File
@@ -2344,7 +2344,8 @@ pub struct BufferBinding<'a, B: DynBuffer + ?Sized> {
///
/// This is not fully `pub` to prevent direct construction of
/// `BufferBinding`s, while still allowing public read access to the `offset`
/// and `size` properties.
/// and `size` properties. Read access to the buffer is available via
/// [`Self::buffer`].
pub(crate) buffer: &'a B,
/// The offset at which the bound region starts.
@@ -2427,6 +2428,11 @@ impl<'a, B: DynBuffer + ?Sized> BufferBinding<'a, B> {
size: size.into(),
}
}
/// The buffer being bound.
pub fn buffer(&self) -> &'a B {
self.buffer
}
}
#[derive(Debug)]