pub struct DynamicUniformBuffer<B> { /* private fields */ }
Expand description
Dynamic uniform buffer wrapper facilitating RW operations
Implementations§
Source§impl<B> DynamicUniformBuffer<B>
impl<B> DynamicUniformBuffer<B>
Sourcepub const fn new(buffer: B) -> Self
pub const fn new(buffer: B) -> Self
Creates a new dynamic uniform buffer wrapper with an alignment of 256 (default alignment in the WebGPU spec).
Sourcepub const fn new_with_alignment(buffer: B, alignment: u64) -> Self
pub const fn new_with_alignment(buffer: B, alignment: u64) -> Self
Creates a new dynamic uniform buffer wrapper with a given alignment.
§Panics
- if
alignment
is not a power of two. - if
alignment
is less than 32 (min alignment imposed by the WebGPU spec).
pub fn set_offset(&mut self, offset: u64)
pub fn into_inner(self) -> B
Source§impl<B: BufferMut> DynamicUniformBuffer<B>
impl<B: BufferMut> DynamicUniformBuffer<B>
Source§impl<B: BufferRef> DynamicUniformBuffer<B>
impl<B: BufferRef> DynamicUniformBuffer<B>
pub fn read<T>(&mut self, value: &mut T) -> Result<()>
pub fn create<T>(&mut self) -> Result<T>where
T: ShaderType + CreateFrom,
Trait Implementations§
Source§impl<B> AsMut<B> for DynamicUniformBuffer<B>
impl<B> AsMut<B> for DynamicUniformBuffer<B>
Source§impl<B> AsRef<B> for DynamicUniformBuffer<B>
impl<B> AsRef<B> for DynamicUniformBuffer<B>
Auto Trait Implementations§
impl<B> Freeze for DynamicUniformBuffer<B>where
B: Freeze,
impl<B> RefUnwindSafe for DynamicUniformBuffer<B>where
B: RefUnwindSafe,
impl<B> Send for DynamicUniformBuffer<B>where
B: Send,
impl<B> Sync for DynamicUniformBuffer<B>where
B: Sync,
impl<B> Unpin for DynamicUniformBuffer<B>where
B: Unpin,
impl<B> UnwindSafe for DynamicUniformBuffer<B>where
B: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more