pub struct VecInstance { /* private fields */ }Expand description
Instance of a vecN<T> type.
Reference: https://www.w3.org/TR/WGSL/#vector-types
Implementations§
Source§impl VecInstance
impl VecInstance
Sourcepub fn dot(
&self,
rhs: &VecInstance,
stage: ShaderStage,
) -> Result<LiteralInstance, Error>
pub fn dot( &self, rhs: &VecInstance, stage: ShaderStage, ) -> Result<LiteralInstance, Error>
Warning, this function does not check operand types
Source§impl VecInstance
impl VecInstance
Source§impl VecInstance
impl VecInstance
pub fn op_neg(&self) -> Result<Self, Error>
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(&self, rhs: &Self, stage: ShaderStage) -> Result<Self, Error>
pub fn op_div(&self, rhs: &Self, stage: ShaderStage) -> Result<Self, Error>
pub fn op_rem(&self, rhs: &Self, stage: ShaderStage) -> Result<Self, Error>
pub fn op_add_sca( &self, rhs: &LiteralInstance, stage: ShaderStage, ) -> Result<Self, Error>
pub fn op_sub_sca( &self, rhs: &LiteralInstance, stage: ShaderStage, ) -> Result<Self, Error>
pub fn op_mul_sca( &self, rhs: &LiteralInstance, stage: ShaderStage, ) -> Result<Self, Error>
pub fn op_div_sca( &self, rhs: &LiteralInstance, stage: ShaderStage, ) -> Result<Self, Error>
pub fn op_rem_sca( &self, rhs: &LiteralInstance, stage: ShaderStage, ) -> Result<Self, Error>
pub fn op_mul_mat( &self, rhs: &MatInstance, stage: ShaderStage, ) -> Result<Self, Error>
Source§impl VecInstance
impl VecInstance
pub fn op_eq(&self, rhs: &Self) -> Result<Self, Error>
pub fn op_ne(&self, rhs: &Self) -> Result<Self, Error>
pub fn op_lt(&self, rhs: &Self) -> Result<Self, Error>
pub fn op_le(&self, rhs: &Self) -> Result<Self, Error>
pub fn op_gt(&self, rhs: &Self) -> Result<Self, Error>
pub fn op_ge(&self, rhs: &Self) -> Result<Self, Error>
Source§impl VecInstance
impl VecInstance
pub fn op_bitnot(&self) -> Result<Self, Error>
Sourcepub fn op_bitor(&self, rhs: &Self) -> Result<Self, Error>
pub fn op_bitor(&self, rhs: &Self) -> Result<Self, Error>
Note: this is both the “bitwise OR” and “logical OR” operator.
Sourcepub fn op_bitand(&self, rhs: &Self) -> Result<Self, Error>
pub fn op_bitand(&self, rhs: &Self) -> Result<Self, Error>
Note: this is both the “bitwise AND” and “logical AND” operator.
pub fn op_bitxor(&self, rhs: &Self) -> Result<Self, Error>
pub fn op_shl(&self, rhs: &Self, stage: ShaderStage) -> Result<Self, Error>
pub fn op_shr(&self, rhs: &Self, stage: ShaderStage) -> Result<Self, Error>
Source§impl VecInstance
impl VecInstance
Sourcepub fn new(components: Vec<Instance>) -> Self
pub fn new(components: Vec<Instance>) -> Self
Construct a vec.
§Panics
- if the components length is not [2, 3, 4]
- if the components are not all the same type
- if the type is not a scalar
pub fn iter(&self) -> impl Iterator<Item = &Instance>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut Instance>
pub fn as_slice(&self) -> &[Instance]
Trait Implementations§
Source§impl Clone for VecInstance
impl Clone for VecInstance
Source§fn clone(&self) -> VecInstance
fn clone(&self) -> VecInstance
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 VecInstance
impl Convert for VecInstance
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 VecInstance
impl Debug for VecInstance
Source§impl Display for VecInstance
impl Display for VecInstance
Source§impl From<VecInstance> for Instance
impl From<VecInstance> for Instance
Source§fn from(value: VecInstance) -> Self
fn from(value: VecInstance) -> Self
Converts to this type from the input type.
Source§impl Index<usize> for VecInstance
impl Index<usize> for VecInstance
Source§impl IntoIterator for VecInstance
impl IntoIterator for VecInstance
Source§impl PartialEq for VecInstance
impl PartialEq for VecInstance
Source§impl Ty for VecInstance
impl Ty for VecInstance
impl StructuralPartialEq for VecInstance
Auto Trait Implementations§
impl Freeze for VecInstance
impl !RefUnwindSafe for VecInstance
impl !Send for VecInstance
impl !Sync for VecInstance
impl Unpin for VecInstance
impl !UnwindSafe for VecInstance
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