Skip to main content

ShaderValues

Derive Macro ShaderValues 

Source
#[derive(ShaderValues)]
Expand description

Derives ShaderValues for the values a style’s or an effect’s WGSL reads: the WGSL struct declaring them, and the layout writing each of them where that struct reads it.

The WGSL struct takes the Rust type’s own name and each field its own, in the order they were written; a field of any other type than these fails to compile, and a type with no fields reads no values and binds none.

RustWGSL
f32f32
u32u32
Vec2vec2<f32>
Vec3vec3<f32>
Vec4vec4<f32>
Mat4mat4x4<f32>
Colorvec4<f32>, linear red, green, blue and alpha