Skip to main content

Module types

Module types 

Source
Expand description

Type mapping from Rust to WGSL.

This module handles the conversion of Rust types to their WGSL equivalents.

§Type Mappings

Rust TypeWGSL TypeNotes
f32f32Direct mapping
f64f32Warning: Downcast, WGSL 1.0 has no f64
i32i32Direct mapping
u32u32Direct mapping
i64vec2<i32>Emulated as lo/hi pair
u64vec2<u32>Emulated as lo/hi pair
boolboolDirect mapping
&[T]array<T>Storage buffer binding
&mut [T]array<T>Storage buffer binding (read_write)

Structs§

TypeMapper
Type mapper for converting Rust types to WGSL types.

Enums§

AccessMode
Access mode for storage/uniform buffers.
AddressSpace
WGSL address spaces for variable declarations.
WgslType
WGSL type representation.

Functions§

get_slice_element_type
Get the element type of a slice type.
is_grid_pos_type
Check if a type is the GridPos marker type.
is_mutable_reference
Check if a type is a mutable reference.
is_ring_context_type
Check if a type is the RingContext marker type.