Expand description
This library provides types and functions which are used by the Rust code generated by
naga_rust_back or naga_rust_embed. These types and functions implement vector arithmetic
in the style expected by shader code, which differs from straightforward Rust in various ways.
This library currently does not have a clean public API distinct from the API provided for the benefit of the code generator. Expect changes in future versions.
Re-exports§
pub use texture::Sampler;pub use texture::Texture1d;pub use texture::Texture2d;pub use texture::Texture2dArray;pub use texture::Texture3d;pub use texture::TextureCube;pub use texture::TextureCubeArray;pub use texture::TextureMultisampled2d;
Modules§
Structs§
- Mat2x2
- Matrix with 2 columns and 2 rows.
- Mat2x3
- Matrix with 2 columns and 3 rows.
- Mat2x4
- Matrix with 2 columns and 4 rows.
- Mat3x2
- Matrix with 3 columns and 2 rows.
- Mat3x3
- Matrix with 3 columns and 3 rows.
- Mat3x4
- Matrix with 3 columns and 4 rows.
- Mat4x2
- Matrix with 4 columns and 2 rows.
- Mat4x3
- Matrix with 4 columns and 3 rows.
- Mat4x4
- Matrix with 4 columns and 4 rows.
- Scalar
- This type wraps an underlying Rust-native scalar (or someday SIMD) type
to provide only methods and operators which are compatible with shader
function behaviors. That is, they act like
Vec*even whereTmight not. This allows the code generator to not worry as much about mismatches between Rust and shader semantics. - Vec2
- Vec3
- Vec4
Traits§
- Default
- A trait for giving a type a useful default value.
- Into
- A value-to-value conversion that consumes the input value. The
opposite of
From.
Functions§
- discard
- into
- Equivalent to
Into::into(). - zero
- Returns the WGSL zero value of a type.
Attribute Macros§
- compute
- Returns the input unchanged.
- fragment
- Returns the input unchanged.
- vertex
- Returns the input unchanged.
- workgroup_
size - Returns the input unchanged.
Derive Macros§
- Default
- Derive macro generating an impl of the trait
Default.