pub struct ShaderProgram {
pub id: u32,
pub name: String,
pub vertex_source: String,
pub fragment_source: String,
pub geometry_source: Option<String>,
pub compute_source: Option<String>,
pub defines: HashMap<String, String>,
pub version: String,
pub compiled: bool,
pub compile_errors: Vec<String>,
pub compile_warnings: Vec<String>,
}Fields§
§id: u32§name: String§vertex_source: String§fragment_source: String§geometry_source: Option<String>§compute_source: Option<String>§defines: HashMap<String, String>§version: String§compiled: bool§compile_errors: Vec<String>§compile_warnings: Vec<String>Implementations§
Source§impl ShaderProgram
impl ShaderProgram
pub fn new(id: u32, name: impl Into<String>) -> Self
pub fn with_vertex(self, src: impl Into<String>) -> Self
pub fn with_fragment(self, src: impl Into<String>) -> Self
pub fn add_define(&mut self, key: impl Into<String>, val: impl Into<String>)
pub fn is_compute(&self) -> bool
pub fn has_geometry(&self) -> bool
pub fn is_valid(&self) -> bool
pub fn error_count(&self) -> usize
pub fn warning_count(&self) -> usize
pub fn add_error(&mut self, err: impl Into<String>)
pub fn add_warning(&mut self, warn: impl Into<String>)
pub fn clear_diagnostics(&mut self)
pub fn mark_compiled(&mut self)
Trait Implementations§
Source§impl Clone for ShaderProgram
impl Clone for ShaderProgram
Auto Trait Implementations§
impl Freeze for ShaderProgram
impl RefUnwindSafe for ShaderProgram
impl Send for ShaderProgram
impl Sync for ShaderProgram
impl Unpin for ShaderProgram
impl UnsafeUnpin for ShaderProgram
impl UnwindSafe for ShaderProgram
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.