Macro gl_utils::def_programs [−][src]
macro_rules! def_programs { ( SHADERS [ $($shader:ident, $sourcepath:expr),* ] PROGRAMS [ $( program $program:ident { vertex_shader: $vert_shader:ident $(tessellation_control_shader: $tess_ctrl_shader:ident tessellation_evaluation_shader: $tess_eval_shader:ident)* $(geometry_shader: $geom_shader:ident)* fragment_shader: $frag_shader:ident } )* ] ) => { ... }; ( @def_programs SHADERS [ $($shader:ident),* ] PROGRAMS [ $( program $program:ident { vertex_shader: $vert_shader:ident $(tessellation_control_shader: $tess_ctrl_shader:ident tessellation_evaluation_shader: $tess_eval_shader:ident)* $(geometry_shader: $geom_shader:ident)* fragment_shader: $frag_shader:ident } )* ] ) => { ... }; ( @def_shaders $($shader:ident, $sourcepath:expr),* ) => { ... }; (@option_shader $shaders:ident [$shader_id:ident]) => { ... }; (@option_shader $shaders:ident []) => { ... }; }
Define a list of shaders with source paths and a list of shader programs using those shaders.
This will create two enums in local scope named ShaderId
and ProgramId
with variants from the given identifiers.