pub struct WGSLTypeChecker;Expand description
Lightweight WGSL type checker.
Implementations§
Source§impl WGSLTypeChecker
impl WGSLTypeChecker
Sourcepub fn check_binop(
&self,
_op: &str,
lhs: &WGSLType,
rhs: &WGSLType,
) -> Result<WGSLType, WGSLTypeError>
pub fn check_binop( &self, _op: &str, lhs: &WGSLType, rhs: &WGSLType, ) -> Result<WGSLType, WGSLTypeError>
Check that two types match for a binary arithmetic operation.
Sourcepub fn check_atomic(&self, ty: &WGSLType) -> Result<(), WGSLTypeError>
pub fn check_atomic(&self, ty: &WGSLType) -> Result<(), WGSLTypeError>
Check that a type is valid for atomic operations.
Check that a type is host-shareable (can be used in uniform/storage buffers).
Sourcepub fn element_type(ty: &WGSLType) -> &WGSLType
pub fn element_type(ty: &WGSLType) -> &WGSLType
Return the component type of a vector, or the type itself if scalar.
Sourcepub fn vector_width(ty: &WGSLType) -> u32
pub fn vector_width(ty: &WGSLType) -> u32
Return the number of vector components, or 1 for scalars.
Trait Implementations§
Source§impl Debug for WGSLTypeChecker
impl Debug for WGSLTypeChecker
Source§impl Default for WGSLTypeChecker
impl Default for WGSLTypeChecker
Source§fn default() -> WGSLTypeChecker
fn default() -> WGSLTypeChecker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for WGSLTypeChecker
impl RefUnwindSafe for WGSLTypeChecker
impl Send for WGSLTypeChecker
impl Sync for WGSLTypeChecker
impl Unpin for WGSLTypeChecker
impl UnsafeUnpin for WGSLTypeChecker
impl UnwindSafe for WGSLTypeChecker
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