Struct librashader_runtime::uniforms::UniformStorage
source · pub struct UniformStorage<H = NoUniformBinder, C = Option<()>, U = Box<[u8]>, P = Box<[u8]>>{ /* private fields */ }
Expand description
A helper to bind uniform variables to UBO or Push Constant Buffers.
Implementations§
source§impl<H, C, U, P> UniformStorage<H, C, U, P>
impl<H, C, U, P> UniformStorage<H, C, U, P>
source§impl<H, C, U, P> UniformStorage<H, C, U, P>
impl<H, C, U, P> UniformStorage<H, C, U, P>
sourcepub fn bind_scalar<T: UniformScalar>(
&mut self,
offset: MemberOffset,
value: T,
ctx: C
)where
H: BindUniform<C, T>,
pub fn bind_scalar<T: UniformScalar>(
&mut self,
offset: MemberOffset,
value: T,
ctx: C
)where
H: BindUniform<C, T>,
Bind a scalar to the given offset.
sourcepub fn new_with_storage(ubo: U, push: P) -> UniformStorage<H, C, U, P>
pub fn new_with_storage(ubo: U, push: P) -> UniformStorage<H, C, U, P>
Create a new UniformStorage
with the given backing storage
source§impl<H, C, U> UniformStorage<H, C, U, Box<[u8]>>
impl<H, C, U> UniformStorage<H, C, U, Box<[u8]>>
sourcepub fn new_with_ubo_storage(
storage: U,
push_size: usize
) -> UniformStorage<H, C, U, Box<[u8]>>
pub fn new_with_ubo_storage( storage: U, push_size: usize ) -> UniformStorage<H, C, U, Box<[u8]>>
Create a new UniformStorage
with the given backing storage
source§impl<H, C, U, P> UniformStorage<H, C, U, P>
impl<H, C, U, P> UniformStorage<H, C, U, P>
Trait Implementations§
source§impl<T, H, U, P> UniformStorageAccess for UniformStorage<T, H, U, P>
impl<T, H, U, P> UniformStorageAccess for UniformStorage<T, H, U, P>
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> RefUnwindSafe for UniformStorage<H, C, U, P>
impl<H, C, U, P> Send for UniformStorage<H, C, U, P>
impl<H, C, U, P> Sync for UniformStorage<H, C, U, P>
impl<H, C, U, P> Unpin for UniformStorage<H, C, U, P>
impl<H, C, U, P> UnwindSafe for UniformStorage<H, C, U, P>
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