Expand description
Type mapping from Rust to WGSL.
This module handles the conversion of Rust types to their WGSL equivalents.
§Type Mappings
| Rust Type | WGSL Type | Notes |
|---|---|---|
f32 | f32 | Direct mapping |
f64 | f32 | Warning: Downcast, WGSL 1.0 has no f64 |
i32 | i32 | Direct mapping |
u32 | u32 | Direct mapping |
i64 | vec2<i32> | Emulated as lo/hi pair |
u64 | vec2<u32> | Emulated as lo/hi pair |
bool | bool | Direct mapping |
&[T] | array<T> | Storage buffer binding |
&mut [T] | array<T> | Storage buffer binding (read_write) |
Structs§
- Type
Mapper - Type mapper for converting Rust types to WGSL types.
Enums§
- Access
Mode - Access mode for storage/uniform buffers.
- Address
Space - WGSL address spaces for variable declarations.
- Wgsl
Type - 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.