rendy_core/
features.rs

1/// Resolve into input AST if dx12 backend is enabled.
2#[macro_export]
3#[cfg(all(
4    feature = "dx12",
5    all(target_os = "windows", not(target_arch = "wasm32"))
6))]
7macro_rules! rendy_with_dx12_backend {
8    ($($tt:tt)*) => { $($tt)* };
9}
10
11/// Resolve into input AST if dx12 backend is enabled.
12#[macro_export]
13#[cfg(not(all(
14    feature = "dx12",
15    all(target_os = "windows", not(target_arch = "wasm32"))
16)))]
17macro_rules! rendy_with_dx12_backend {
18    ($($tt:tt)*) => {};
19}
20
21/// Resolve into input AST if dx12 backend is disabled.
22#[macro_export]
23#[cfg(not(all(
24    feature = "dx12",
25    all(target_os = "windows", not(target_arch = "wasm32"))
26)))]
27macro_rules! rendy_without_dx12_backend {
28    ($($tt:tt)*) => { $($tt)* };
29}
30
31/// Resolve into input AST if dx12 backend is disabled.
32#[macro_export]
33#[cfg(all(
34    feature = "dx12",
35    all(target_os = "windows", not(target_arch = "wasm32"))
36))]
37macro_rules! rendy_without_dx12_backend {
38    ($($tt:tt)*) => {};
39}
40
41/// Resolve into input AST if empty backend is enabled.
42#[macro_export]
43#[cfg(feature = "empty")]
44macro_rules! rendy_with_empty_backend {
45    ($($tt:tt)*) => { $($tt)* };
46}
47
48/// Resolve into input AST if empty backend is enabled.
49#[macro_export]
50#[cfg(not(feature = "empty"))]
51macro_rules! rendy_with_empty_backend {
52    ($($tt:tt)*) => {};
53}
54
55/// Resolve into input AST if empty backend is disabled.
56#[macro_export]
57#[cfg(not(feature = "empty"))]
58macro_rules! rendy_without_empty_backend {
59    ($($tt:tt)*) => { $($tt)* };
60}
61
62/// Resolve into input AST if empty backend is disabled.
63#[macro_export]
64#[cfg(feature = "empty")]
65macro_rules! rendy_without_empty_backend {
66    ($($tt:tt)*) => {};
67}
68
69/// Resolve into input AST if gl backend is enabled.
70#[macro_export]
71#[cfg(feature = "gl")]
72macro_rules! rendy_with_gl_backend {
73    ($($tt:tt)*) => { $($tt)* };
74}
75
76/// Resolve into input AST if gl backend is enabled.
77#[macro_export]
78#[cfg(not(feature = "gl"))]
79macro_rules! rendy_with_gl_backend {
80    ($($tt:tt)*) => {};
81}
82
83/// Resolve into input AST if gl backend is disabled.
84#[macro_export]
85#[cfg(not(feature = "gl"))]
86macro_rules! rendy_without_gl_backend {
87    ($($tt:tt)*) => { $($tt)* };
88}
89
90/// Resolve into input AST if gl backend is disabled.
91#[macro_export]
92#[cfg(feature = "gl")]
93macro_rules! rendy_without_gl_backend {
94    ($($tt:tt)*) => {};
95}
96
97/// Resolve into input AST if metal backend is enabled.
98#[macro_export]
99#[cfg(all(
100    feature = "metal",
101    any(
102        all(not(target_arch = "wasm32"), target_os = "macos"),
103        all(target_arch = "aarch64", target_os = "ios")
104    )
105))]
106macro_rules! rendy_with_metal_backend {
107    ($($tt:tt)*) => { $($tt)* };
108}
109
110/// Resolve into input AST if metal backend is enabled.
111#[macro_export]
112#[cfg(not(all(
113    feature = "metal",
114    any(
115        all(not(target_arch = "wasm32"), target_os = "macos"),
116        all(target_arch = "aarch64", target_os = "ios")
117    )
118)))]
119macro_rules! rendy_with_metal_backend {
120    ($($tt:tt)*) => {};
121}
122
123/// Resolve into input AST if metal backend is disabled.
124#[macro_export]
125#[cfg(not(all(
126    feature = "metal",
127    any(
128        all(not(target_arch = "wasm32"), target_os = "macos"),
129        all(target_arch = "aarch64", target_os = "ios")
130    )
131)))]
132macro_rules! rendy_without_metal_backend {
133    ($($tt:tt)*) => { $($tt)* };
134}
135
136/// Resolve into input AST if metal backend is disabled.
137#[macro_export]
138#[cfg(all(
139    feature = "metal",
140    any(
141        all(not(target_arch = "wasm32"), target_os = "macos"),
142        all(target_arch = "aarch64", target_os = "ios")
143    )
144))]
145macro_rules! rendy_without_metal_backend {
146    ($($tt:tt)*) => {};
147}
148
149/// Resolve into input AST if vulkan backend is enabled.
150#[macro_export]
151#[cfg(all(
152    feature = "vulkan",
153    all(
154        any(
155            target_os = "windows",
156            all(unix, not(any(target_os = "macos", target_os = "ios")))
157        ),
158        not(target_arch = "wasm32")
159    )
160))]
161macro_rules! rendy_with_vulkan_backend {
162    ($($tt:tt)*) => { $($tt)* };
163}
164
165/// Resolve into input AST if vulkan backend is enabled.
166#[macro_export]
167#[cfg(not(all(
168    feature = "vulkan",
169    all(
170        any(
171            target_os = "windows",
172            all(unix, not(any(target_os = "macos", target_os = "ios")))
173        ),
174        not(target_arch = "wasm32")
175    )
176)))]
177macro_rules! rendy_with_vulkan_backend {
178    ($($tt:tt)*) => {};
179}
180
181/// Resolve into input AST if vulkan backend is disabled.
182#[macro_export]
183#[cfg(not(all(
184    feature = "vulkan",
185    all(
186        any(
187            target_os = "windows",
188            all(unix, not(any(target_os = "macos", target_os = "ios")))
189        ),
190        not(target_arch = "wasm32")
191    )
192)))]
193macro_rules! rendy_without_vulkan_backend {
194    ($($tt:tt)*) => { $($tt)* };
195}
196
197/// Resolve into input AST if vulkan backend is disabled.
198#[macro_export]
199#[cfg(all(
200    feature = "vulkan",
201    all(
202        any(
203            target_os = "windows",
204            all(unix, not(any(target_os = "macos", target_os = "ios")))
205        ),
206        not(target_arch = "wasm32")
207    )
208))]
209macro_rules! rendy_without_vulkan_backend {
210    ($($tt:tt)*) => {};
211}
212
213/// Resolve into input AST if target architecture is "wasm32"
214#[macro_export]
215#[cfg(target_arch = "wasm32")]
216macro_rules! rendy_wasm32 {
217    ($($tt:tt)*) => { $($tt)* };
218}
219
220/// Resolve into input AST if target architecture is "wasm32"
221#[macro_export]
222#[cfg(not(target_arch = "wasm32"))]
223macro_rules! rendy_wasm32 {
224    ($($tt:tt)*) => {};
225}
226
227/// Resolve into input AST if target architecture is not "wasm32"
228#[macro_export]
229#[cfg(target_arch = "wasm32")]
230macro_rules! rendy_not_wasm32 {
231    ($($tt:tt)*) => {};
232}
233
234/// Resolve into input AST if target architecture is not "wasm32"
235#[macro_export]
236#[cfg(not(target_arch = "wasm32"))]
237macro_rules! rendy_not_wasm32 {
238    ($($tt:tt)*) => { $($tt)* };
239}
240
241/// Resolve into input AST if rendy is requested to not perform slow safety checks.
242#[macro_export]
243#[cfg(feature = "no-slow-safety-checks")]
244macro_rules! rendy_without_slow_safety_checks {
245    ($($tt:tt)*) => { $($tt)* };
246}
247
248/// Resolve into input AST if rendy is requested to not perform slow safety checks.
249#[macro_export]
250#[cfg(not(feature = "no-slow-safety-checks"))]
251macro_rules! rendy_without_slow_safety_checks {
252    ($($tt:tt)*) => {};
253}
254
255/// Resolve into input AST if rendy is requested to perform slow safety checks.
256#[macro_export]
257#[cfg(not(feature = "no-slow-safety-checks"))]
258macro_rules! rendy_with_slow_safety_checks {
259    ($($tt:tt)*) => { $($tt)* };
260}
261
262/// Resolve into input AST if rendy is requested to perform slow safety checks.
263#[macro_export]
264#[cfg(feature = "no-slow-safety-checks")]
265macro_rules! rendy_with_slow_safety_checks {
266    ($($tt:tt)*) => {};
267}