Struct librashader_runtime::uniforms::UniformStorage
source · pub struct UniformStorage<H = NoUniformBinder, C = Option<()>, U = Box<[u8]>, P = Box<[u8]>>where
U: Deref<Target = [u8]> + DerefMut,
P: Deref<Target = [u8]> + DerefMut,{ /* 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>where
U: Deref<Target = [u8]> + DerefMut,
P: Deref<Target = [u8]> + DerefMut,
impl<H, C, U, P> UniformStorage<H, C, U, P>where U: Deref<Target = [u8]> + DerefMut, P: Deref<Target = [u8]> + DerefMut,
source§impl<H, C, U, P> UniformStorage<H, C, U, P>where
C: Copy,
U: Deref<Target = [u8]> + DerefMut,
P: Deref<Target = [u8]> + DerefMut,
impl<H, C, U, P> UniformStorage<H, C, U, P>where C: Copy, U: Deref<Target = [u8]> + DerefMut, P: Deref<Target = [u8]> + DerefMut,
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]>>where
C: Copy,
U: Deref<Target = [u8]> + DerefMut,
impl<H, C, U> UniformStorage<H, C, U, Box<[u8]>>where C: Copy, U: Deref<Target = [u8]> + DerefMut,
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
Trait Implementations§
source§impl<T, H, U, P> UniformStorageAccess for UniformStorage<T, H, U, P>where
U: Deref<Target = [u8]> + DerefMut,
P: Deref<Target = [u8]> + DerefMut,
impl<T, H, U, P> UniformStorageAccess for UniformStorage<T, H, U, P>where U: Deref<Target = [u8]> + DerefMut, P: Deref<Target = [u8]> + DerefMut,
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.