Macro gl_utils::def_programs_include [−][src]
macro_rules! def_programs_include { ( 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 []) => { ... }; }
Like def_programs!
except that the shader source will be compiled-in with
include_str!
. The original source path is still available through the
source_path
method on shader IDs, but it is not required to be present
when loading shaders.
Note that unlike def_programs!
where paths are relative to the
executable invocation directory, here paths are relative to the source
file which is invoking the def_programs_include!
macro.