render pass macros now allow trailing commas (#2151)

This commit is contained in:
Marvin 2023-03-02 22:15:25 +01:00 committed by GitHub
parent 6994ce613e
commit 2781d898fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,10 +14,11 @@ macro_rules! single_pass_renderpass {
$device:expr,
attachments: { $($a:tt)* },
pass: {
color: [$($color_atch:ident),*],
depth_stencil: {$($depth_atch:ident)*}$(,)*
$(resolve: [$($resolve_atch:ident),*])*$(,)*
}
color: [$($color_atch:ident),* $(,)?],
depth_stencil: {$($depth_atch:ident)?}
$(,resolve: [$($resolve_atch:ident),* $(,)?])*
$(,)*
} $(,)?
) => (
$crate::ordered_passes_renderpass!(
$device,
@ -45,22 +46,24 @@ macro_rules! ordered_passes_renderpass {
load: $load:ident,
store: $store:ident,
format: $format:expr,
samples: $samples:expr,
$(initial_layout: $init_layout:expr,)*
$(final_layout: $final_layout:expr,)*
samples: $samples:expr
$(,initial_layout: $init_layout:expr)?
$(,final_layout: $final_layout:expr)?
$(,)?
}
),*
),* $(,)?
},
passes: [
$(
{
color: [$($color_atch:ident),*],
depth_stencil: {$($depth_atch:ident)*},
input: [$($input_atch:ident),*]$(,)*
$(resolve: [$($resolve_atch:ident),*])*$(,)*
color: [$($color_atch:ident),* $(,)?],
depth_stencil: {$($depth_atch:ident)* $(,)?},
input: [$($input_atch:ident),* $(,)?]
$(,resolve: [$($resolve_atch:ident),* $(,)?])?
$(,)*
}
),*
]
),* $(,)?
] $(,)?
) => ({
use $crate::render_pass::RenderPass;