Skip to main content

Crate wgame_shader_macros

Crate wgame_shader_macros 

Source
Expand description

Procedural macros for deriving shader attribute implementations.

Provides #[derive(Attribute)] and #[derive(AttributeGlobal)] for named and tuple structs. These describe vertex/instance attributes, not uniform packing.

§Examples

use wgame_shader_macros::{Attribute, AttributeGlobal};

#[derive(Attribute)]
struct Vertex {
    position: [f32; 3],
    normal: [f32; 3],
}

#[derive(AttributeGlobal)]
struct InstanceTransforms {
    projection: glam::Mat4,
    view: glam::Mat4,
}

Derive Macros§

Attribute
Derives vertex/instance attributes using the canonical wgame_shader path.
AttributeGlobal
Derives vertex/instance attributes using the canonical wgame::shader path.