pub struct Constants { /* private fields */ }Expand description
Constant-buffer words of one layout, zero until set.
Implementations§
Source§impl Constants
impl Constants
Sourcepub fn new(layout: &Layout) -> Self
pub fn new(layout: &Layout) -> Self
Constant buffers laid out as layout says, every word zero and unset.
Sourcepub fn set(&mut self, field: &str, values: &[f32]) -> Result<bool, Error>
pub fn set(&mut self, field: &str, values: &[f32]) -> Result<bool, Error>
Write a field’s leading words. Ok(false) when the layout has no such field; more values than the field has
words is an error. Words past the rows the program reads (or in a buffer it does not read) are not stored:
the program cannot read them.
Sourcepub fn set_words(
&mut self,
buffer: u32,
word_offset: u32,
words: &[u32],
) -> Result<(), Error>
pub fn set_words( &mut self, buffer: u32, word_offset: u32, words: &[u32], ) -> Result<(), Error>
Write raw words at a stated offset of a buffer the program reads (a source that states offsets, integer fields, or a caller’s own field rules). Words outside the buffer are an error.
Sourcepub fn buffers(&self) -> &[(u32, Vec<[u32; 4]>)]
pub fn buffers(&self) -> &[(u32, Vec<[u32; 4]>)]
Every buffer the program reads, by slot, as its rows of four words (zero where nothing was written).
Sourcepub fn unset_words(&self) -> u64
pub fn unset_words(&self) -> u64
Words never written, padding included: what the caller leaves at zero.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Constants
impl Freeze for Constants
impl RefUnwindSafe for Constants
impl Send for Constants
impl Sync for Constants
impl Unpin for Constants
impl UnsafeUnpin for Constants
impl UnwindSafe for Constants
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