Struct librashader_runtime::uniforms::UniformStorage
source · pub struct UniformStorage<H = NoUniformBinder, C = Option<()>, S = Box<[u8]>>where
S: 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, S> UniformStorage<H, C, S>where
S: Deref<Target = [u8]> + DerefMut,
impl<H, C, S> UniformStorage<H, C, S>where
S: 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(storage: S, push_size: usize) -> UniformStorage<H, C, S>
pub fn new_with_storage(storage: S, push_size: usize) -> UniformStorage<H, C, S>
Create a new UniformStorage with the given backing storage
source§impl<H, C> UniformStorage<H, C, Box<[u8]>>
impl<H, C> UniformStorage<H, C, Box<[u8]>>
source§impl<H, C, S> UniformStorage<H, C, S>where
S: Deref<Target = [u8]> + DerefMut,
H: for<'a> BindUniform<C, &'a [f32; 4]>,
impl<H, C, S> UniformStorage<H, C, S>where
S: Deref<Target = [u8]> + DerefMut,
H: for<'a> BindUniform<C, &'a [f32; 4]>,
source§impl<H, C, S> UniformStorage<H, C, S>where
S: Deref<Target = [u8]> + DerefMut,
H: for<'a> BindUniform<C, &'a [f32; 16]>,
impl<H, C, S> UniformStorage<H, C, S>where
S: Deref<Target = [u8]> + DerefMut,
H: for<'a> BindUniform<C, &'a [f32; 16]>,
sourcepub fn bind_mat4(&mut self, offset: MemberOffset, value: &[f32; 16], ctx: C)
pub fn bind_mat4(&mut self, offset: MemberOffset, value: &[f32; 16], ctx: C)
Bind a mat4 to the given offset.
Trait Implementations§
source§impl<T, H, S> UniformStorageAccess for UniformStorage<T, H, S>where
S: Deref<Target = [u8]> + DerefMut,
impl<T, H, S> UniformStorageAccess for UniformStorage<T, H, S>where
S: 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.