Struct librashader_runtime::uniforms::UniformStorage
source · 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