Skip to content

Commit a334e9f

Browse files
committed
Improve macro.
1 parent bacf1b1 commit a334e9f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/target
2+
rustc-ice-*.txt

shaders/src/shaders/mod.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,27 +41,26 @@ macro_rules! match_index {
4141
}
4242

4343
macro_rules! render_shader_macro {
44-
($num_shaders:expr, $($shader_name:ident),* $(,)?) => {
44+
($($shader_name:ident),* $(,)?) => {
4545
#[inline(always)]
4646
pub fn render_shader(shader_index: u32, shader_input: &ShaderInput, shader_output: &mut ShaderResult) {
4747
match_index!(shader_index; $(
4848
$shader_name::shader_fn(shader_input, shader_output),
4949
)*)
5050
}
5151

52-
pub const SHADER_DEFINITIONS: [ShaderDefinition; $num_shaders] = [
52+
pub const SHADER_DEFINITIONS: &[ShaderDefinition] = &[
5353
$(
5454
$shader_name::SHADER_DEFINITION,
5555
)*
5656
];
5757
};
5858
}
5959

60-
render_shader_macro!(1, loading_repeating_circles,);
60+
render_shader_macro!(loading_repeating_circles,);
6161

6262
/*
6363
render_shader_macro!(
64-
29,
6564
loading_repeating_circles,
6665
two_tweets,
6766
heart,
@@ -92,4 +91,4 @@ render_shader_macro!(
9291
luminescence,
9392
voxel_pac_man,
9493
);
95-
*/
94+
*/

0 commit comments

Comments
 (0)