pub struct UniformTracker {
pub float_uniforms: HashMap<String, f32>,
pub vec2_uniforms: HashMap<String, [f32; 2]>,
pub vec3_uniforms: HashMap<String, [f32; 3]>,
pub vec4_uniforms: HashMap<String, [f32; 4]>,
pub int_uniforms: HashMap<String, i32>,
pub bool_uniforms: HashMap<String, bool>,
pub mat4_uniforms: HashMap<String, [[f32; 4]; 4]>,
pub dirty_flags: HashSet<String>,
pub upload_count: u64,
}Fields§
§float_uniforms: HashMap<String, f32>§vec2_uniforms: HashMap<String, [f32; 2]>§vec3_uniforms: HashMap<String, [f32; 3]>§vec4_uniforms: HashMap<String, [f32; 4]>§int_uniforms: HashMap<String, i32>§bool_uniforms: HashMap<String, bool>§mat4_uniforms: HashMap<String, [[f32; 4]; 4]>§dirty_flags: HashSet<String>§upload_count: u64Implementations§
Source§impl UniformTracker
impl UniformTracker
pub fn new() -> Self
pub fn set_float(&mut self, name: impl Into<String>, v: f32)
pub fn set_vec3(&mut self, name: impl Into<String>, v: [f32; 3])
pub fn set_vec4(&mut self, name: impl Into<String>, v: [f32; 4])
pub fn set_int(&mut self, name: impl Into<String>, v: i32)
pub fn set_bool(&mut self, name: impl Into<String>, v: bool)
pub fn mark_uploaded(&mut self)
pub fn dirty_count(&self) -> usize
pub fn has_dirty(&self) -> bool
pub fn get_float(&self, name: &str) -> Option<f32>
pub fn get_vec4(&self, name: &str) -> Option<[f32; 4]>
pub fn total_uniform_count(&self) -> usize
Trait Implementations§
Source§impl Clone for UniformTracker
impl Clone for UniformTracker
Source§impl Debug for UniformTracker
impl Debug for UniformTracker
Auto Trait Implementations§
impl Freeze for UniformTracker
impl RefUnwindSafe for UniformTracker
impl Send for UniformTracker
impl Sync for UniformTracker
impl Unpin for UniformTracker
impl UnsafeUnpin for UniformTracker
impl UnwindSafe for UniformTracker
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.