pub struct MatInstance { /* private fields */ }Expand description
Instance of a matCxR<T> type.
Reference: https://www.w3.org/TR/WGSL/#matrix-types
Implementations§
Source§impl MatInstance
impl MatInstance
Sourcepub fn transpose(&self) -> MatInstance
pub fn transpose(&self) -> MatInstance
Warning, this function does not check operand types
Source§impl MatInstance
impl MatInstance
Source§impl MatInstance
impl MatInstance
pub fn op_add(&self, rhs: &Self, stage: ShaderStage) -> Result<Self, Error>
pub fn op_sub(&self, rhs: &Self, stage: ShaderStage) -> Result<Self, Error>
pub fn op_mul_sca( &self, rhs: &LiteralInstance, stage: ShaderStage, ) -> Result<Self, Error>
pub fn op_mul_vec( &self, rhs: &VecInstance, stage: ShaderStage, ) -> Result<VecInstance, Error>
pub fn op_mul(&self, rhs: &Self, stage: ShaderStage) -> Result<Self, Error>
Source§impl MatInstance
impl MatInstance
Sourcepub fn from_cols(components: Vec<Instance>) -> Self
pub fn from_cols(components: Vec<Instance>) -> Self
Construct a mat from column vectors.
§Panics
- if the number of columns is not [2, 3, 4]
- if the columns don’t have the same number of rows
- if the number of rows is not [2, 3, 4]
- if the elements don’t have the same type
- if the type is not a scalar
pub fn iter_cols(&self) -> impl Iterator<Item = &Instance>
pub fn iter_cols_mut(&mut self) -> impl Iterator<Item = &mut Instance>
pub fn iter(&self) -> impl Iterator<Item = &Instance>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut Instance>
Trait Implementations§
Source§impl Clone for MatInstance
impl Clone for MatInstance
Source§fn clone(&self) -> MatInstance
fn clone(&self) -> MatInstance
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Convert for MatInstance
impl Convert for MatInstance
Source§fn convert_to(&self, ty: &Type) -> Option<Self>
fn convert_to(&self, ty: &Type) -> Option<Self>
Convert an instance to another type, if a feasible conversion exists. Read more
Source§fn convert_inner_to(&self, ty: &Type) -> Option<Self>
fn convert_inner_to(&self, ty: &Type) -> Option<Self>
Convert an instance by changing its inner type to another. Read more
Source§fn concretize(&self) -> Option<Self>
fn concretize(&self) -> Option<Self>
Convert an abstract instance to a concrete type. Read more
Source§impl Debug for MatInstance
impl Debug for MatInstance
Source§impl Display for MatInstance
impl Display for MatInstance
Source§impl From<MatInstance> for Instance
impl From<MatInstance> for Instance
Source§fn from(value: MatInstance) -> Self
fn from(value: MatInstance) -> Self
Converts to this type from the input type.
Source§impl IntoIterator for MatInstance
impl IntoIterator for MatInstance
Source§impl PartialEq for MatInstance
impl PartialEq for MatInstance
Source§impl Ty for MatInstance
impl Ty for MatInstance
impl StructuralPartialEq for MatInstance
Auto Trait Implementations§
impl Freeze for MatInstance
impl !RefUnwindSafe for MatInstance
impl !Send for MatInstance
impl !Sync for MatInstance
impl Unpin for MatInstance
impl !UnwindSafe for MatInstance
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more