pub enum WgslType {
Show 17 variants
F32,
I32,
U32,
Bool,
Void,
Vec2(Box<WgslType>),
Vec3(Box<WgslType>),
Vec4(Box<WgslType>),
Mat2x2(Box<WgslType>),
Mat3x3(Box<WgslType>),
Mat4x4(Box<WgslType>),
Array {
element: Box<WgslType>,
size: Option<usize>,
},
Ptr {
address_space: AddressSpace,
inner: Box<WgslType>,
access: AccessMode,
},
Atomic(Box<WgslType>),
Struct(String),
U64Pair,
I64Pair,
}Expand description
WGSL type representation.
Variants§
F32
32-bit float
I32
32-bit signed integer
U32
32-bit unsigned integer
Bool
Boolean
Void
Void (for functions with no return)
Vec2(Box<WgslType>)
2-component vector
Vec3(Box<WgslType>)
3-component vector
Vec4(Box<WgslType>)
4-component vector
Mat2x2(Box<WgslType>)
2x2 matrix
Mat3x3(Box<WgslType>)
3x3 matrix
Mat4x4(Box<WgslType>)
4x4 matrix
Array
Array type
Ptr
Pointer type (for function parameters)
Atomic(Box<WgslType>)
Atomic type
Struct(String)
User-defined struct
U64Pair
Emulated 64-bit unsigned (stored as vec2
I64Pair
Emulated 64-bit signed (stored as vec2
Implementations§
Source§impl WgslType
impl WgslType
Sourcepub fn is_emulated_64bit(&self) -> bool
pub fn is_emulated_64bit(&self) -> bool
Check if this type is a 64-bit emulated type.
Sourcepub fn element_type(&self) -> Option<&WgslType>
pub fn element_type(&self) -> Option<&WgslType>
Get the element type for arrays and vectors.
Trait Implementations§
impl Eq for WgslType
impl StructuralPartialEq for WgslType
Auto Trait Implementations§
impl Freeze for WgslType
impl RefUnwindSafe for WgslType
impl Send for WgslType
impl Sync for WgslType
impl Unpin for WgslType
impl UnwindSafe for WgslType
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