pub struct UniformStorage<H = NoUniformBinder, C = Option<()>, U = Box<[u8]>, P = Box<[u8]>, D = ()>{ /* private fields */ }
Expand description
A helper to bind uniform variables to UBO or Push Constant Buffers.
Implementations§
Source§impl<H, C, U, P, D> UniformStorage<H, C, U, P, D>
impl<H, C, U, P, D> UniformStorage<H, C, U, P, D>
Source§impl<H, C, U, P, D> UniformStorage<H, C, U, P, D>
impl<H, C, U, P, D> UniformStorage<H, C, U, P, D>
Sourcepub fn bind_scalar<T: UniformScalar>(
&mut self,
offset: MemberOffset,
value: T,
ctx: C,
device: &D,
)where
H: BindUniform<C, T, D>,
pub fn bind_scalar<T: UniformScalar>(
&mut self,
offset: MemberOffset,
value: T,
ctx: C,
device: &D,
)where
H: BindUniform<C, T, D>,
Bind a scalar to the given offset.
Sourcepub fn new_with_storage(ubo: U, push: P) -> UniformStorage<H, C, U, P, D>
pub fn new_with_storage(ubo: U, push: P) -> UniformStorage<H, C, U, P, D>
Create a new UniformStorage
with the given backing storage
Source§impl<H, C, U, D> UniformStorage<H, C, U, Box<[u8]>, D>
impl<H, C, U, D> UniformStorage<H, C, U, Box<[u8]>, D>
Sourcepub fn new_with_ubo_storage(
storage: U,
push_size: usize,
) -> UniformStorage<H, C, U, Box<[u8]>, D>
pub fn new_with_ubo_storage( storage: U, push_size: usize, ) -> UniformStorage<H, C, U, Box<[u8]>, D>
Create a new UniformStorage
with the given backing storage
Source§impl<H, C, U, P, D> UniformStorage<H, C, U, P, D>
impl<H, C, U, P, D> UniformStorage<H, C, U, P, D>
Source§impl<H, C, U, P, D> UniformStorage<H, C, U, P, D>
impl<H, C, U, P, D> UniformStorage<H, C, U, P, D>
Trait Implementations§
Source§impl<D, T, H, U, P> UniformStorageAccess for UniformStorage<T, H, U, P, D>
impl<D, T, H, U, P> UniformStorageAccess for UniformStorage<T, H, U, P, D>
Source§fn ubo_pointer(&self) -> *const u8
fn ubo_pointer(&self) -> *const u8
Get a pointer to the backing UBO storage. This pointer must be valid for the lifetime
of the implementing struct.
Source§fn ubo_slice(&self) -> &[u8] ⓘ
fn ubo_slice(&self) -> &[u8] ⓘ
Get a pointer to the backing UBO storage. This pointer must be valid for the lifetime
of the implementing struct.
Source§fn push_pointer(&self) -> *const u8
fn push_pointer(&self) -> *const u8
Get a pointer to the backing Push Constant buffer storage.
This pointer must be valid for the lifetime of the implementing struct.
Source§fn push_slice(&self) -> &[u8] ⓘ
fn push_slice(&self) -> &[u8] ⓘ
Get a slice to the backing Push Constant buffer storage.
This pointer must be valid for the lifetime of the implementing struct.
Auto Trait Implementations§
impl<H, C, U, P, D> Freeze for UniformStorage<H, C, U, P, D>
impl<H, C, U, P, D> RefUnwindSafe for UniformStorage<H, C, U, P, D>
impl<H, C, U, P, D> Send for UniformStorage<H, C, U, P, D>
impl<H, C, U, P, D> Sync for UniformStorage<H, C, U, P, D>
impl<H, C, U, P, D> Unpin for UniformStorage<H, C, U, P, D>
impl<H, C, U, P, D> UnwindSafe for UniformStorage<H, C, U, P, D>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more