lava/vulkan/vk/
vk_physical_device_features.rs

1// Generated by `scripts/generate.js`
2
3use std::os::raw::c_char;
4use std::ops::Deref;
5use std::ptr;
6use std::cmp;
7use std::mem;
8use utils::c_bindings::*;
9use utils::vk_convert::*;
10use utils::vk_null::*;
11use utils::vk_ptr::*;
12use utils::vk_traits::*;
13use vulkan::vk::*;
14
15/// Wrapper for [VkPhysicalDeviceFeatures](https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPhysicalDeviceFeatures.html).
16///
17/// Use the macro `VkPhysicalDeviceFeatures!` as an alternative method to create a structure. For example, these two snippets return the same value:
18/// ```
19/// VkPhysicalDeviceFeatures!(robust_buffer_access, full_draw_index_uint_32)
20/// ```
21/// ```
22/// VkPhysicalDeviceFeatures {
23///     robust_buffer_access: true,
24///     full_draw_index_uint_32: true,
25///     ..VkPhysicalDeviceFeatures::none()
26/// }
27/// ```
28#[derive(Debug, Clone)]
29pub struct VkPhysicalDeviceFeatures {
30    pub robust_buffer_access: bool,
31    pub full_draw_index_uint_32: bool,
32    pub image_cube_array: bool,
33    pub independent_blend: bool,
34    pub geometry_shader: bool,
35    pub tessellation_shader: bool,
36    pub sample_rate_shading: bool,
37    pub dual_src_blend: bool,
38    pub logic_op: bool,
39    pub multi_draw_indirect: bool,
40    pub draw_indirect_first_instance: bool,
41    pub depth_clamp: bool,
42    pub depth_bias_clamp: bool,
43    pub fill_mode_non_solid: bool,
44    pub depth_bounds: bool,
45    pub wide_lines: bool,
46    pub large_points: bool,
47    pub alpha_to_one: bool,
48    pub multi_viewport: bool,
49    pub sampler_anisotropy: bool,
50    pub texture_compression_etc_2: bool,
51    pub texture_compression_astc_ldr: bool,
52    pub texture_compression_bc: bool,
53    pub occlusion_query_precise: bool,
54    pub pipeline_statistics_query: bool,
55    pub vertex_pipeline_stores_and_atomics: bool,
56    pub fragment_stores_and_atomics: bool,
57    pub shader_tessellation_and_geometry_point_size: bool,
58    pub shader_image_gather_extended: bool,
59    pub shader_storage_image_extended_formats: bool,
60    pub shader_storage_image_multisample: bool,
61    pub shader_storage_image_read_without_format: bool,
62    pub shader_storage_image_write_without_format: bool,
63    pub shader_uniform_buffer_array_dynamic_indexing: bool,
64    pub shader_sampled_image_array_dynamic_indexing: bool,
65    pub shader_storage_buffer_array_dynamic_indexing: bool,
66    pub shader_storage_image_array_dynamic_indexing: bool,
67    pub shader_clip_distance: bool,
68    pub shader_cull_distance: bool,
69    pub shader_float_64: bool,
70    pub shader_int_64: bool,
71    pub shader_int_16: bool,
72    pub shader_resource_residency: bool,
73    pub shader_resource_min_lod: bool,
74    pub sparse_binding: bool,
75    pub sparse_residency_buffer: bool,
76    pub sparse_residency_image_2d: bool,
77    pub sparse_residency_image_3d: bool,
78    pub sparse_residency_2_samples: bool,
79    pub sparse_residency_4_samples: bool,
80    pub sparse_residency_8_samples: bool,
81    pub sparse_residency_16_samples: bool,
82    pub sparse_residency_aliased: bool,
83    pub variable_multisample_rate: bool,
84    pub inherited_queries: bool,
85}
86
87#[doc(hidden)]
88#[repr(C)]
89#[derive(Debug, Copy, Clone)]
90pub struct RawVkPhysicalDeviceFeatures {
91    pub robust_buffer_access: u32,
92    pub full_draw_index_uint_32: u32,
93    pub image_cube_array: u32,
94    pub independent_blend: u32,
95    pub geometry_shader: u32,
96    pub tessellation_shader: u32,
97    pub sample_rate_shading: u32,
98    pub dual_src_blend: u32,
99    pub logic_op: u32,
100    pub multi_draw_indirect: u32,
101    pub draw_indirect_first_instance: u32,
102    pub depth_clamp: u32,
103    pub depth_bias_clamp: u32,
104    pub fill_mode_non_solid: u32,
105    pub depth_bounds: u32,
106    pub wide_lines: u32,
107    pub large_points: u32,
108    pub alpha_to_one: u32,
109    pub multi_viewport: u32,
110    pub sampler_anisotropy: u32,
111    pub texture_compression_etc_2: u32,
112    pub texture_compression_astc_ldr: u32,
113    pub texture_compression_bc: u32,
114    pub occlusion_query_precise: u32,
115    pub pipeline_statistics_query: u32,
116    pub vertex_pipeline_stores_and_atomics: u32,
117    pub fragment_stores_and_atomics: u32,
118    pub shader_tessellation_and_geometry_point_size: u32,
119    pub shader_image_gather_extended: u32,
120    pub shader_storage_image_extended_formats: u32,
121    pub shader_storage_image_multisample: u32,
122    pub shader_storage_image_read_without_format: u32,
123    pub shader_storage_image_write_without_format: u32,
124    pub shader_uniform_buffer_array_dynamic_indexing: u32,
125    pub shader_sampled_image_array_dynamic_indexing: u32,
126    pub shader_storage_buffer_array_dynamic_indexing: u32,
127    pub shader_storage_image_array_dynamic_indexing: u32,
128    pub shader_clip_distance: u32,
129    pub shader_cull_distance: u32,
130    pub shader_float_64: u32,
131    pub shader_int_64: u32,
132    pub shader_int_16: u32,
133    pub shader_resource_residency: u32,
134    pub shader_resource_min_lod: u32,
135    pub sparse_binding: u32,
136    pub sparse_residency_buffer: u32,
137    pub sparse_residency_image_2d: u32,
138    pub sparse_residency_image_3d: u32,
139    pub sparse_residency_2_samples: u32,
140    pub sparse_residency_4_samples: u32,
141    pub sparse_residency_8_samples: u32,
142    pub sparse_residency_16_samples: u32,
143    pub sparse_residency_aliased: u32,
144    pub variable_multisample_rate: u32,
145    pub inherited_queries: u32,
146}
147
148impl VkWrappedType<RawVkPhysicalDeviceFeatures> for VkPhysicalDeviceFeatures {
149    fn vk_to_raw(src: &VkPhysicalDeviceFeatures, dst: &mut RawVkPhysicalDeviceFeatures) {
150        dst.robust_buffer_access = vk_to_raw_value(&src.robust_buffer_access);
151        dst.full_draw_index_uint_32 = vk_to_raw_value(&src.full_draw_index_uint_32);
152        dst.image_cube_array = vk_to_raw_value(&src.image_cube_array);
153        dst.independent_blend = vk_to_raw_value(&src.independent_blend);
154        dst.geometry_shader = vk_to_raw_value(&src.geometry_shader);
155        dst.tessellation_shader = vk_to_raw_value(&src.tessellation_shader);
156        dst.sample_rate_shading = vk_to_raw_value(&src.sample_rate_shading);
157        dst.dual_src_blend = vk_to_raw_value(&src.dual_src_blend);
158        dst.logic_op = vk_to_raw_value(&src.logic_op);
159        dst.multi_draw_indirect = vk_to_raw_value(&src.multi_draw_indirect);
160        dst.draw_indirect_first_instance = vk_to_raw_value(&src.draw_indirect_first_instance);
161        dst.depth_clamp = vk_to_raw_value(&src.depth_clamp);
162        dst.depth_bias_clamp = vk_to_raw_value(&src.depth_bias_clamp);
163        dst.fill_mode_non_solid = vk_to_raw_value(&src.fill_mode_non_solid);
164        dst.depth_bounds = vk_to_raw_value(&src.depth_bounds);
165        dst.wide_lines = vk_to_raw_value(&src.wide_lines);
166        dst.large_points = vk_to_raw_value(&src.large_points);
167        dst.alpha_to_one = vk_to_raw_value(&src.alpha_to_one);
168        dst.multi_viewport = vk_to_raw_value(&src.multi_viewport);
169        dst.sampler_anisotropy = vk_to_raw_value(&src.sampler_anisotropy);
170        dst.texture_compression_etc_2 = vk_to_raw_value(&src.texture_compression_etc_2);
171        dst.texture_compression_astc_ldr = vk_to_raw_value(&src.texture_compression_astc_ldr);
172        dst.texture_compression_bc = vk_to_raw_value(&src.texture_compression_bc);
173        dst.occlusion_query_precise = vk_to_raw_value(&src.occlusion_query_precise);
174        dst.pipeline_statistics_query = vk_to_raw_value(&src.pipeline_statistics_query);
175        dst.vertex_pipeline_stores_and_atomics = vk_to_raw_value(&src.vertex_pipeline_stores_and_atomics);
176        dst.fragment_stores_and_atomics = vk_to_raw_value(&src.fragment_stores_and_atomics);
177        dst.shader_tessellation_and_geometry_point_size = vk_to_raw_value(&src.shader_tessellation_and_geometry_point_size);
178        dst.shader_image_gather_extended = vk_to_raw_value(&src.shader_image_gather_extended);
179        dst.shader_storage_image_extended_formats = vk_to_raw_value(&src.shader_storage_image_extended_formats);
180        dst.shader_storage_image_multisample = vk_to_raw_value(&src.shader_storage_image_multisample);
181        dst.shader_storage_image_read_without_format = vk_to_raw_value(&src.shader_storage_image_read_without_format);
182        dst.shader_storage_image_write_without_format = vk_to_raw_value(&src.shader_storage_image_write_without_format);
183        dst.shader_uniform_buffer_array_dynamic_indexing = vk_to_raw_value(&src.shader_uniform_buffer_array_dynamic_indexing);
184        dst.shader_sampled_image_array_dynamic_indexing = vk_to_raw_value(&src.shader_sampled_image_array_dynamic_indexing);
185        dst.shader_storage_buffer_array_dynamic_indexing = vk_to_raw_value(&src.shader_storage_buffer_array_dynamic_indexing);
186        dst.shader_storage_image_array_dynamic_indexing = vk_to_raw_value(&src.shader_storage_image_array_dynamic_indexing);
187        dst.shader_clip_distance = vk_to_raw_value(&src.shader_clip_distance);
188        dst.shader_cull_distance = vk_to_raw_value(&src.shader_cull_distance);
189        dst.shader_float_64 = vk_to_raw_value(&src.shader_float_64);
190        dst.shader_int_64 = vk_to_raw_value(&src.shader_int_64);
191        dst.shader_int_16 = vk_to_raw_value(&src.shader_int_16);
192        dst.shader_resource_residency = vk_to_raw_value(&src.shader_resource_residency);
193        dst.shader_resource_min_lod = vk_to_raw_value(&src.shader_resource_min_lod);
194        dst.sparse_binding = vk_to_raw_value(&src.sparse_binding);
195        dst.sparse_residency_buffer = vk_to_raw_value(&src.sparse_residency_buffer);
196        dst.sparse_residency_image_2d = vk_to_raw_value(&src.sparse_residency_image_2d);
197        dst.sparse_residency_image_3d = vk_to_raw_value(&src.sparse_residency_image_3d);
198        dst.sparse_residency_2_samples = vk_to_raw_value(&src.sparse_residency_2_samples);
199        dst.sparse_residency_4_samples = vk_to_raw_value(&src.sparse_residency_4_samples);
200        dst.sparse_residency_8_samples = vk_to_raw_value(&src.sparse_residency_8_samples);
201        dst.sparse_residency_16_samples = vk_to_raw_value(&src.sparse_residency_16_samples);
202        dst.sparse_residency_aliased = vk_to_raw_value(&src.sparse_residency_aliased);
203        dst.variable_multisample_rate = vk_to_raw_value(&src.variable_multisample_rate);
204        dst.inherited_queries = vk_to_raw_value(&src.inherited_queries);
205    }
206}
207
208impl VkRawType<VkPhysicalDeviceFeatures> for RawVkPhysicalDeviceFeatures {
209    fn vk_to_wrapped(src: &RawVkPhysicalDeviceFeatures) -> VkPhysicalDeviceFeatures {
210        VkPhysicalDeviceFeatures {
211            robust_buffer_access: u32::vk_to_wrapped(&src.robust_buffer_access),
212            full_draw_index_uint_32: u32::vk_to_wrapped(&src.full_draw_index_uint_32),
213            image_cube_array: u32::vk_to_wrapped(&src.image_cube_array),
214            independent_blend: u32::vk_to_wrapped(&src.independent_blend),
215            geometry_shader: u32::vk_to_wrapped(&src.geometry_shader),
216            tessellation_shader: u32::vk_to_wrapped(&src.tessellation_shader),
217            sample_rate_shading: u32::vk_to_wrapped(&src.sample_rate_shading),
218            dual_src_blend: u32::vk_to_wrapped(&src.dual_src_blend),
219            logic_op: u32::vk_to_wrapped(&src.logic_op),
220            multi_draw_indirect: u32::vk_to_wrapped(&src.multi_draw_indirect),
221            draw_indirect_first_instance: u32::vk_to_wrapped(&src.draw_indirect_first_instance),
222            depth_clamp: u32::vk_to_wrapped(&src.depth_clamp),
223            depth_bias_clamp: u32::vk_to_wrapped(&src.depth_bias_clamp),
224            fill_mode_non_solid: u32::vk_to_wrapped(&src.fill_mode_non_solid),
225            depth_bounds: u32::vk_to_wrapped(&src.depth_bounds),
226            wide_lines: u32::vk_to_wrapped(&src.wide_lines),
227            large_points: u32::vk_to_wrapped(&src.large_points),
228            alpha_to_one: u32::vk_to_wrapped(&src.alpha_to_one),
229            multi_viewport: u32::vk_to_wrapped(&src.multi_viewport),
230            sampler_anisotropy: u32::vk_to_wrapped(&src.sampler_anisotropy),
231            texture_compression_etc_2: u32::vk_to_wrapped(&src.texture_compression_etc_2),
232            texture_compression_astc_ldr: u32::vk_to_wrapped(&src.texture_compression_astc_ldr),
233            texture_compression_bc: u32::vk_to_wrapped(&src.texture_compression_bc),
234            occlusion_query_precise: u32::vk_to_wrapped(&src.occlusion_query_precise),
235            pipeline_statistics_query: u32::vk_to_wrapped(&src.pipeline_statistics_query),
236            vertex_pipeline_stores_and_atomics: u32::vk_to_wrapped(&src.vertex_pipeline_stores_and_atomics),
237            fragment_stores_and_atomics: u32::vk_to_wrapped(&src.fragment_stores_and_atomics),
238            shader_tessellation_and_geometry_point_size: u32::vk_to_wrapped(&src.shader_tessellation_and_geometry_point_size),
239            shader_image_gather_extended: u32::vk_to_wrapped(&src.shader_image_gather_extended),
240            shader_storage_image_extended_formats: u32::vk_to_wrapped(&src.shader_storage_image_extended_formats),
241            shader_storage_image_multisample: u32::vk_to_wrapped(&src.shader_storage_image_multisample),
242            shader_storage_image_read_without_format: u32::vk_to_wrapped(&src.shader_storage_image_read_without_format),
243            shader_storage_image_write_without_format: u32::vk_to_wrapped(&src.shader_storage_image_write_without_format),
244            shader_uniform_buffer_array_dynamic_indexing: u32::vk_to_wrapped(&src.shader_uniform_buffer_array_dynamic_indexing),
245            shader_sampled_image_array_dynamic_indexing: u32::vk_to_wrapped(&src.shader_sampled_image_array_dynamic_indexing),
246            shader_storage_buffer_array_dynamic_indexing: u32::vk_to_wrapped(&src.shader_storage_buffer_array_dynamic_indexing),
247            shader_storage_image_array_dynamic_indexing: u32::vk_to_wrapped(&src.shader_storage_image_array_dynamic_indexing),
248            shader_clip_distance: u32::vk_to_wrapped(&src.shader_clip_distance),
249            shader_cull_distance: u32::vk_to_wrapped(&src.shader_cull_distance),
250            shader_float_64: u32::vk_to_wrapped(&src.shader_float_64),
251            shader_int_64: u32::vk_to_wrapped(&src.shader_int_64),
252            shader_int_16: u32::vk_to_wrapped(&src.shader_int_16),
253            shader_resource_residency: u32::vk_to_wrapped(&src.shader_resource_residency),
254            shader_resource_min_lod: u32::vk_to_wrapped(&src.shader_resource_min_lod),
255            sparse_binding: u32::vk_to_wrapped(&src.sparse_binding),
256            sparse_residency_buffer: u32::vk_to_wrapped(&src.sparse_residency_buffer),
257            sparse_residency_image_2d: u32::vk_to_wrapped(&src.sparse_residency_image_2d),
258            sparse_residency_image_3d: u32::vk_to_wrapped(&src.sparse_residency_image_3d),
259            sparse_residency_2_samples: u32::vk_to_wrapped(&src.sparse_residency_2_samples),
260            sparse_residency_4_samples: u32::vk_to_wrapped(&src.sparse_residency_4_samples),
261            sparse_residency_8_samples: u32::vk_to_wrapped(&src.sparse_residency_8_samples),
262            sparse_residency_16_samples: u32::vk_to_wrapped(&src.sparse_residency_16_samples),
263            sparse_residency_aliased: u32::vk_to_wrapped(&src.sparse_residency_aliased),
264            variable_multisample_rate: u32::vk_to_wrapped(&src.variable_multisample_rate),
265            inherited_queries: u32::vk_to_wrapped(&src.inherited_queries),
266        }
267    }
268}
269
270impl Default for VkPhysicalDeviceFeatures {
271    fn default() -> VkPhysicalDeviceFeatures {
272        VkPhysicalDeviceFeatures {
273            robust_buffer_access: false,
274            full_draw_index_uint_32: false,
275            image_cube_array: false,
276            independent_blend: false,
277            geometry_shader: false,
278            tessellation_shader: false,
279            sample_rate_shading: false,
280            dual_src_blend: false,
281            logic_op: false,
282            multi_draw_indirect: false,
283            draw_indirect_first_instance: false,
284            depth_clamp: false,
285            depth_bias_clamp: false,
286            fill_mode_non_solid: false,
287            depth_bounds: false,
288            wide_lines: false,
289            large_points: false,
290            alpha_to_one: false,
291            multi_viewport: false,
292            sampler_anisotropy: false,
293            texture_compression_etc_2: false,
294            texture_compression_astc_ldr: false,
295            texture_compression_bc: false,
296            occlusion_query_precise: false,
297            pipeline_statistics_query: false,
298            vertex_pipeline_stores_and_atomics: false,
299            fragment_stores_and_atomics: false,
300            shader_tessellation_and_geometry_point_size: false,
301            shader_image_gather_extended: false,
302            shader_storage_image_extended_formats: false,
303            shader_storage_image_multisample: false,
304            shader_storage_image_read_without_format: false,
305            shader_storage_image_write_without_format: false,
306            shader_uniform_buffer_array_dynamic_indexing: false,
307            shader_sampled_image_array_dynamic_indexing: false,
308            shader_storage_buffer_array_dynamic_indexing: false,
309            shader_storage_image_array_dynamic_indexing: false,
310            shader_clip_distance: false,
311            shader_cull_distance: false,
312            shader_float_64: false,
313            shader_int_64: false,
314            shader_int_16: false,
315            shader_resource_residency: false,
316            shader_resource_min_lod: false,
317            sparse_binding: false,
318            sparse_residency_buffer: false,
319            sparse_residency_image_2d: false,
320            sparse_residency_image_3d: false,
321            sparse_residency_2_samples: false,
322            sparse_residency_4_samples: false,
323            sparse_residency_8_samples: false,
324            sparse_residency_16_samples: false,
325            sparse_residency_aliased: false,
326            variable_multisample_rate: false,
327            inherited_queries: false,
328        }
329    }
330}
331
332impl VkSetup for VkPhysicalDeviceFeatures {
333    fn vk_setup(&mut self, fn_table: *mut VkFunctionTable) {
334        
335    }
336}
337
338impl VkFree for RawVkPhysicalDeviceFeatures {
339    fn vk_free(&self) {
340        
341    }
342}
343
344impl VkPhysicalDeviceFeatures {
345    
346    /// Return a structure with all flags to `false`.
347    pub fn none() -> Self {
348        VkPhysicalDeviceFeatures {
349            robust_buffer_access: false,
350            full_draw_index_uint_32: false,
351            image_cube_array: false,
352            independent_blend: false,
353            geometry_shader: false,
354            tessellation_shader: false,
355            sample_rate_shading: false,
356            dual_src_blend: false,
357            logic_op: false,
358            multi_draw_indirect: false,
359            draw_indirect_first_instance: false,
360            depth_clamp: false,
361            depth_bias_clamp: false,
362            fill_mode_non_solid: false,
363            depth_bounds: false,
364            wide_lines: false,
365            large_points: false,
366            alpha_to_one: false,
367            multi_viewport: false,
368            sampler_anisotropy: false,
369            texture_compression_etc_2: false,
370            texture_compression_astc_ldr: false,
371            texture_compression_bc: false,
372            occlusion_query_precise: false,
373            pipeline_statistics_query: false,
374            vertex_pipeline_stores_and_atomics: false,
375            fragment_stores_and_atomics: false,
376            shader_tessellation_and_geometry_point_size: false,
377            shader_image_gather_extended: false,
378            shader_storage_image_extended_formats: false,
379            shader_storage_image_multisample: false,
380            shader_storage_image_read_without_format: false,
381            shader_storage_image_write_without_format: false,
382            shader_uniform_buffer_array_dynamic_indexing: false,
383            shader_sampled_image_array_dynamic_indexing: false,
384            shader_storage_buffer_array_dynamic_indexing: false,
385            shader_storage_image_array_dynamic_indexing: false,
386            shader_clip_distance: false,
387            shader_cull_distance: false,
388            shader_float_64: false,
389            shader_int_64: false,
390            shader_int_16: false,
391            shader_resource_residency: false,
392            shader_resource_min_lod: false,
393            sparse_binding: false,
394            sparse_residency_buffer: false,
395            sparse_residency_image_2d: false,
396            sparse_residency_image_3d: false,
397            sparse_residency_2_samples: false,
398            sparse_residency_4_samples: false,
399            sparse_residency_8_samples: false,
400            sparse_residency_16_samples: false,
401            sparse_residency_aliased: false,
402            variable_multisample_rate: false,
403            inherited_queries: false,
404        }
405    }
406    
407    /// Return a structure with all flags to `true`.
408    pub fn all() -> Self {
409        VkPhysicalDeviceFeatures {
410            robust_buffer_access: true,
411            full_draw_index_uint_32: true,
412            image_cube_array: true,
413            independent_blend: true,
414            geometry_shader: true,
415            tessellation_shader: true,
416            sample_rate_shading: true,
417            dual_src_blend: true,
418            logic_op: true,
419            multi_draw_indirect: true,
420            draw_indirect_first_instance: true,
421            depth_clamp: true,
422            depth_bias_clamp: true,
423            fill_mode_non_solid: true,
424            depth_bounds: true,
425            wide_lines: true,
426            large_points: true,
427            alpha_to_one: true,
428            multi_viewport: true,
429            sampler_anisotropy: true,
430            texture_compression_etc_2: true,
431            texture_compression_astc_ldr: true,
432            texture_compression_bc: true,
433            occlusion_query_precise: true,
434            pipeline_statistics_query: true,
435            vertex_pipeline_stores_and_atomics: true,
436            fragment_stores_and_atomics: true,
437            shader_tessellation_and_geometry_point_size: true,
438            shader_image_gather_extended: true,
439            shader_storage_image_extended_formats: true,
440            shader_storage_image_multisample: true,
441            shader_storage_image_read_without_format: true,
442            shader_storage_image_write_without_format: true,
443            shader_uniform_buffer_array_dynamic_indexing: true,
444            shader_sampled_image_array_dynamic_indexing: true,
445            shader_storage_buffer_array_dynamic_indexing: true,
446            shader_storage_image_array_dynamic_indexing: true,
447            shader_clip_distance: true,
448            shader_cull_distance: true,
449            shader_float_64: true,
450            shader_int_64: true,
451            shader_int_16: true,
452            shader_resource_residency: true,
453            shader_resource_min_lod: true,
454            sparse_binding: true,
455            sparse_residency_buffer: true,
456            sparse_residency_image_2d: true,
457            sparse_residency_image_3d: true,
458            sparse_residency_2_samples: true,
459            sparse_residency_4_samples: true,
460            sparse_residency_8_samples: true,
461            sparse_residency_16_samples: true,
462            sparse_residency_aliased: true,
463            variable_multisample_rate: true,
464            inherited_queries: true,
465        }
466    }
467    
468    pub fn to_u64(&self) -> u64 {
469        0
470        + if self.robust_buffer_access { 1 } else { 0 }
471        + if self.full_draw_index_uint_32 { 2 } else { 0 }
472        + if self.image_cube_array { 4 } else { 0 }
473        + if self.independent_blend { 8 } else { 0 }
474        + if self.geometry_shader { 16 } else { 0 }
475        + if self.tessellation_shader { 32 } else { 0 }
476        + if self.sample_rate_shading { 64 } else { 0 }
477        + if self.dual_src_blend { 128 } else { 0 }
478        + if self.logic_op { 256 } else { 0 }
479        + if self.multi_draw_indirect { 512 } else { 0 }
480        + if self.draw_indirect_first_instance { 1024 } else { 0 }
481        + if self.depth_clamp { 2048 } else { 0 }
482        + if self.depth_bias_clamp { 4096 } else { 0 }
483        + if self.fill_mode_non_solid { 8192 } else { 0 }
484        + if self.depth_bounds { 16384 } else { 0 }
485        + if self.wide_lines { 32768 } else { 0 }
486        + if self.large_points { 65536 } else { 0 }
487        + if self.alpha_to_one { 131072 } else { 0 }
488        + if self.multi_viewport { 262144 } else { 0 }
489        + if self.sampler_anisotropy { 524288 } else { 0 }
490        + if self.texture_compression_etc_2 { 1048576 } else { 0 }
491        + if self.texture_compression_astc_ldr { 2097152 } else { 0 }
492        + if self.texture_compression_bc { 4194304 } else { 0 }
493        + if self.occlusion_query_precise { 8388608 } else { 0 }
494        + if self.pipeline_statistics_query { 16777216 } else { 0 }
495        + if self.vertex_pipeline_stores_and_atomics { 33554432 } else { 0 }
496        + if self.fragment_stores_and_atomics { 67108864 } else { 0 }
497        + if self.shader_tessellation_and_geometry_point_size { 134217728 } else { 0 }
498        + if self.shader_image_gather_extended { 268435456 } else { 0 }
499        + if self.shader_storage_image_extended_formats { 536870912 } else { 0 }
500        + if self.shader_storage_image_multisample { 1073741824 } else { 0 }
501        + if self.shader_storage_image_read_without_format { 2147483648 } else { 0 }
502        + if self.shader_storage_image_write_without_format { 4294967296 } else { 0 }
503        + if self.shader_uniform_buffer_array_dynamic_indexing { 8589934592 } else { 0 }
504        + if self.shader_sampled_image_array_dynamic_indexing { 17179869184 } else { 0 }
505        + if self.shader_storage_buffer_array_dynamic_indexing { 34359738368 } else { 0 }
506        + if self.shader_storage_image_array_dynamic_indexing { 68719476736 } else { 0 }
507        + if self.shader_clip_distance { 137438953472 } else { 0 }
508        + if self.shader_cull_distance { 274877906944 } else { 0 }
509        + if self.shader_float_64 { 549755813888 } else { 0 }
510        + if self.shader_int_64 { 1099511627776 } else { 0 }
511        + if self.shader_int_16 { 2199023255552 } else { 0 }
512        + if self.shader_resource_residency { 4398046511104 } else { 0 }
513        + if self.shader_resource_min_lod { 8796093022208 } else { 0 }
514        + if self.sparse_binding { 17592186044416 } else { 0 }
515        + if self.sparse_residency_buffer { 35184372088832 } else { 0 }
516        + if self.sparse_residency_image_2d { 70368744177664 } else { 0 }
517        + if self.sparse_residency_image_3d { 140737488355328 } else { 0 }
518        + if self.sparse_residency_2_samples { 281474976710656 } else { 0 }
519        + if self.sparse_residency_4_samples { 562949953421312 } else { 0 }
520        + if self.sparse_residency_8_samples { 1125899906842624 } else { 0 }
521        + if self.sparse_residency_16_samples { 2251799813685248 } else { 0 }
522        + if self.sparse_residency_aliased { 4503599627370496 } else { 0 }
523        + if self.variable_multisample_rate { 9007199254740992 } else { 0 }
524        + if self.inherited_queries { 18014398509481984 } else { 0 }
525    }
526    
527    pub fn from_u64(value: u64) -> Self {
528        VkPhysicalDeviceFeatures {
529            robust_buffer_access: value & 1 > 0,
530            full_draw_index_uint_32: value & 2 > 0,
531            image_cube_array: value & 4 > 0,
532            independent_blend: value & 8 > 0,
533            geometry_shader: value & 16 > 0,
534            tessellation_shader: value & 32 > 0,
535            sample_rate_shading: value & 64 > 0,
536            dual_src_blend: value & 128 > 0,
537            logic_op: value & 256 > 0,
538            multi_draw_indirect: value & 512 > 0,
539            draw_indirect_first_instance: value & 1024 > 0,
540            depth_clamp: value & 2048 > 0,
541            depth_bias_clamp: value & 4096 > 0,
542            fill_mode_non_solid: value & 8192 > 0,
543            depth_bounds: value & 16384 > 0,
544            wide_lines: value & 32768 > 0,
545            large_points: value & 65536 > 0,
546            alpha_to_one: value & 131072 > 0,
547            multi_viewport: value & 262144 > 0,
548            sampler_anisotropy: value & 524288 > 0,
549            texture_compression_etc_2: value & 1048576 > 0,
550            texture_compression_astc_ldr: value & 2097152 > 0,
551            texture_compression_bc: value & 4194304 > 0,
552            occlusion_query_precise: value & 8388608 > 0,
553            pipeline_statistics_query: value & 16777216 > 0,
554            vertex_pipeline_stores_and_atomics: value & 33554432 > 0,
555            fragment_stores_and_atomics: value & 67108864 > 0,
556            shader_tessellation_and_geometry_point_size: value & 134217728 > 0,
557            shader_image_gather_extended: value & 268435456 > 0,
558            shader_storage_image_extended_formats: value & 536870912 > 0,
559            shader_storage_image_multisample: value & 1073741824 > 0,
560            shader_storage_image_read_without_format: value & 2147483648 > 0,
561            shader_storage_image_write_without_format: value & 4294967296 > 0,
562            shader_uniform_buffer_array_dynamic_indexing: value & 8589934592 > 0,
563            shader_sampled_image_array_dynamic_indexing: value & 17179869184 > 0,
564            shader_storage_buffer_array_dynamic_indexing: value & 34359738368 > 0,
565            shader_storage_image_array_dynamic_indexing: value & 68719476736 > 0,
566            shader_clip_distance: value & 137438953472 > 0,
567            shader_cull_distance: value & 274877906944 > 0,
568            shader_float_64: value & 549755813888 > 0,
569            shader_int_64: value & 1099511627776 > 0,
570            shader_int_16: value & 2199023255552 > 0,
571            shader_resource_residency: value & 4398046511104 > 0,
572            shader_resource_min_lod: value & 8796093022208 > 0,
573            sparse_binding: value & 17592186044416 > 0,
574            sparse_residency_buffer: value & 35184372088832 > 0,
575            sparse_residency_image_2d: value & 70368744177664 > 0,
576            sparse_residency_image_3d: value & 140737488355328 > 0,
577            sparse_residency_2_samples: value & 281474976710656 > 0,
578            sparse_residency_4_samples: value & 562949953421312 > 0,
579            sparse_residency_8_samples: value & 1125899906842624 > 0,
580            sparse_residency_16_samples: value & 2251799813685248 > 0,
581            sparse_residency_aliased: value & 4503599627370496 > 0,
582            variable_multisample_rate: value & 9007199254740992 > 0,
583            inherited_queries: value & 18014398509481984 > 0,
584        }
585    }
586}
587
588#[doc(hidden)]
589#[macro_export]
590macro_rules! VkPhysicalDeviceFeatures {
591    ( $( $x:ident ),* ) => {
592        VkPhysicalDeviceFeatures {
593            $($x: true,)*
594            ..VkPhysicalDeviceFeatures::none()
595        }
596    }
597}