1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
mod pso;
mod structure;
#[macro_export]
macro_rules! gfx_format {
($name:ident : $surface:ident = $container:ident<$channel:ident>) => {
impl $crate::format::Formatted for $name {
type Surface = $crate::format::$surface;
type Channel = $crate::format::$channel;
type View = $crate::format::$container<
<$crate::format::$channel as $crate::format::ChannelTyped>::ShaderType
>;
}
}
}
#[macro_export]
macro_rules! gfx_defines {
(vertex $name:ident {
$( $field:ident : $ty:ty = $e:expr, )+
}) => {
gfx_vertex_struct!($name {$($field:$ty = $e,)+});
};
(constant $name:ident {
$( $field:ident : $ty:ty = $e:expr, )+
}) => {
gfx_constant_struct!($name {$($field:$ty = $e,)+});
};
(pipeline $name:ident {
$( $field:ident : $ty:ty = $e:expr, )+
}) => {
gfx_pipeline!($name {$($field:$ty = $e,)+});
};
($keyword:ident $name:ident {
$( $field:ident : $ty:ty = $e:expr, )+
} $($tail:tt)+) => {
gfx_defines! {
$keyword $name { $($field : $ty = $e,)+ }
}
gfx_defines!($($tail)+);
}
}