screen_13/driver/
physical_device.rs

1//! Physical device resource types
2
3use {
4    super::{DriverError, Instance},
5    ash::{ext, khr, vk},
6    log::{debug, error},
7    std::{
8        collections::HashSet,
9        ffi::{CStr, c_char},
10        fmt::{Debug, Formatter},
11        ops::Deref,
12    },
13};
14
15// TODO: There is a bunch of unsafe cstr handling here - does not check for null-termination
16
17fn vk_cstr_to_string_lossy(cstr: &[c_char]) -> String {
18    unsafe { CStr::from_ptr(cstr.as_ptr()) }
19        .to_string_lossy()
20        .to_string()
21}
22
23/// Properties of the physical device for acceleration structures.
24///
25/// See
26/// [`VkPhysicalDeviceAccelerationStructurePropertiesKHR`](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceAccelerationStructurePropertiesKHR.html)
27/// manual page.
28#[derive(Debug)]
29pub struct AccelerationStructureProperties {
30    /// The maximum number of geometries in a bottom level acceleration structure.
31    pub max_geometry_count: u64,
32
33    /// The maximum number of instances in a top level acceleration structure.
34    pub max_instance_count: u64,
35
36    /// The maximum number of triangles or AABBs in all geometries in a bottom level acceleration
37    /// structure.
38    pub max_primitive_count: u64,
39
40    /// The maximum number of acceleration structure bindings that can be accessible to a single
41    /// shader stage in a pipeline layout.
42    ///
43    /// Descriptor bindings with a descriptor type of
44    /// `VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR` count against this limit.
45    pub max_per_stage_descriptor_accel_structs: u32,
46
47    /// The maximum number of acceleration structure descriptors that can be included in descriptor
48    /// bindings in a pipeline layout across all pipeline shader stages and descriptor set numbers.
49    ///
50    /// Descriptor bindings with a descriptor type of
51    /// `VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR` count against this limit.
52    pub max_descriptor_set_accel_structs: u32,
53
54    /// The minimum required alignment, in bytes, for scratch data passed in to an acceleration
55    /// structure build command.
56    pub min_accel_struct_scratch_offset_alignment: u32,
57}
58
59impl From<vk::PhysicalDeviceAccelerationStructurePropertiesKHR<'_>>
60    for AccelerationStructureProperties
61{
62    fn from(props: vk::PhysicalDeviceAccelerationStructurePropertiesKHR<'_>) -> Self {
63        Self {
64            max_geometry_count: props.max_geometry_count,
65            max_instance_count: props.max_instance_count,
66            max_primitive_count: props.max_primitive_count,
67            max_per_stage_descriptor_accel_structs: props
68                .max_per_stage_descriptor_acceleration_structures,
69            max_descriptor_set_accel_structs: props.max_descriptor_set_acceleration_structures,
70            min_accel_struct_scratch_offset_alignment: props
71                .min_acceleration_structure_scratch_offset_alignment,
72        }
73    }
74}
75
76/// Structure describing depth/stencil resolve properties that can be supported by an
77/// implementation.
78///
79/// See
80/// [`VkPhysicalDeviceDepthStencilResolveProperties`](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceDepthStencilResolveProperties.html)
81/// manual page.
82#[derive(Debug)]
83pub struct DepthStencilResolveProperties {
84    /// A bitmask indicating the set of supported depth resolve modes.
85    ///
86    /// `VK_RESOLVE_MODE_SAMPLE_ZERO_BIT` must be included in the set but implementations may
87    /// support additional modes.
88    pub supported_depth_resolve_modes: vk::ResolveModeFlags,
89
90    /// A bitmask of indicating the set of supported stencil resolve modes.
91    ///
92    /// `VK_RESOLVE_MODE_SAMPLE_ZERO_BIT` must be included in the set but implementations may
93    /// support additional modes. `VK_RESOLVE_MODE_AVERAGE_BIT` must not be included in the set.
94    pub supported_stencil_resolve_modes: vk::ResolveModeFlags,
95
96    /// `true` if the implementation supports setting the depth and stencil resolve modes to
97    /// different values when one of those modes is `VK_RESOLVE_MODE_NONE`. Otherwise the
98    /// implementation only supports setting both modes to the same value.
99    pub independent_resolve_none: bool,
100
101    /// `true` if the implementation supports all combinations of the supported depth and stencil
102    /// resolve modes, including setting either depth or stencil resolve mode to
103    /// `VK_RESOLVE_MODE_NONE`.
104    ///
105    /// An implementation that supports `independent_resolve` must also support
106    /// `independent_resolve_none`.
107    pub independent_resolve: bool,
108}
109
110impl From<vk::PhysicalDeviceDepthStencilResolveProperties<'_>> for DepthStencilResolveProperties {
111    fn from(props: vk::PhysicalDeviceDepthStencilResolveProperties<'_>) -> Self {
112        Self {
113            supported_depth_resolve_modes: props.supported_depth_resolve_modes,
114            supported_stencil_resolve_modes: props.supported_stencil_resolve_modes,
115            independent_resolve_none: props.independent_resolve_none == vk::TRUE,
116            independent_resolve: props.independent_resolve == vk::TRUE,
117        }
118    }
119}
120
121/// Features of the physical device for vertex indexing.
122///
123/// See
124/// [`VkPhysicalDeviceIndexTypeUint8FeaturesEXT`](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceIndexTypeUint8FeaturesEXT.html)
125/// manual page.
126#[derive(Debug, Default)]
127pub struct IndexTypeUint8Features {
128    /// Indicates that VK_INDEX_TYPE_UINT8_EXT can be used with vkCmdBindIndexBuffer2KHR and
129    /// vkCmdBindIndexBuffer.
130    pub index_type_uint8: bool,
131}
132
133impl From<vk::PhysicalDeviceIndexTypeUint8FeaturesEXT<'_>> for IndexTypeUint8Features {
134    fn from(features: vk::PhysicalDeviceIndexTypeUint8FeaturesEXT<'_>) -> Self {
135        Self {
136            index_type_uint8: features.index_type_uint8 == vk::TRUE,
137        }
138    }
139}
140
141/// Structure which holds data about the physical hardware selected by the current device.
142pub struct PhysicalDevice {
143    /// Describes the properties of the device which relate to acceleration structures, if
144    /// available.
145    pub accel_struct_properties: Option<AccelerationStructureProperties>,
146
147    /// Describes the properties of the device which relate to depth/stencil resolve operations.
148    pub depth_stencil_resolve_properties: DepthStencilResolveProperties,
149
150    /// Describes the features of the physical device which are part of the Vulkan 1.0 base feature set.
151    pub features_v1_0: Vulkan10Features,
152
153    /// Describes the features of the physical device which are part of the Vulkan 1.1 base feature set.
154    pub features_v1_1: Vulkan11Features,
155
156    /// Describes the features of the physical device which are part of the Vulkan 1.2 base feature set.
157    pub features_v1_2: Vulkan12Features,
158
159    /// Describes the features of the physical device which relate to vertex indexing.
160    pub index_type_uint8_features: IndexTypeUint8Features,
161
162    /// Memory properties of the physical device.
163    pub memory_properties: vk::PhysicalDeviceMemoryProperties,
164
165    /// Device properties of the physical device which are part of the Vulkan 1.0 base feature set.
166    pub properties_v1_0: Vulkan10Properties,
167
168    /// Describes the properties of the physical device which are part of the Vulkan 1.1 base
169    /// feature set.
170    pub properties_v1_1: Vulkan11Properties,
171
172    /// Describes the properties of the physical device which are part of the Vulkan 1.2 base
173    /// feature set.
174    pub properties_v1_2: Vulkan12Properties,
175
176    physical_device: vk::PhysicalDevice,
177
178    /// Describes the queues offered by this physical device.
179    pub queue_families: Box<[vk::QueueFamilyProperties]>,
180
181    pub(crate) queue_family_indices: Box<[u32]>,
182
183    /// Describes the features of the device which relate to ray query, if available.
184    pub ray_query_features: RayQueryFeatures,
185
186    /// Describes the features of the device which relate to ray tracing, if available.
187    pub ray_trace_features: RayTraceFeatures,
188
189    /// Describes the properties of the device which relate to ray tracing, if available.
190    pub ray_trace_properties: Option<RayTraceProperties>,
191
192    /// Describes the properties of the device which relate to min/max sampler filtering.
193    pub sampler_filter_minmax_properties: SamplerFilterMinmaxProperties,
194}
195
196impl PhysicalDevice {
197    /// Creates a physical device wrapper which reports features and properties.
198    #[profiling::function]
199    pub fn new(
200        instance: &Instance,
201        physical_device: vk::PhysicalDevice,
202    ) -> Result<Self, DriverError> {
203        if physical_device == vk::PhysicalDevice::null() {
204            return Err(DriverError::InvalidData);
205        }
206
207        let (memory_properties, queue_families) = unsafe {
208            (
209                instance.get_physical_device_memory_properties(physical_device),
210                instance.get_physical_device_queue_family_properties(physical_device),
211            )
212        };
213
214        let mut queue_family_indices = Vec::with_capacity(queue_families.len());
215        for idx in 0..queue_families.len() as u32 {
216            queue_family_indices.push(idx);
217        }
218
219        let queue_families = queue_families.into();
220        let queue_family_indices = queue_family_indices.into();
221
222        let ash::InstanceFnV1_1 {
223            get_physical_device_features2,
224            get_physical_device_properties2,
225            ..
226        } = instance.fp_v1_1();
227
228        // Gather required features of the physical device
229        let mut features_v1_1 = vk::PhysicalDeviceVulkan11Features::default();
230        let mut features_v1_2 = vk::PhysicalDeviceVulkan12Features::default();
231        let mut acceleration_structure_features =
232            vk::PhysicalDeviceAccelerationStructureFeaturesKHR::default();
233        let mut index_type_u8_features = vk::PhysicalDeviceIndexTypeUint8FeaturesEXT::default();
234        let mut ray_query_features = vk::PhysicalDeviceRayQueryFeaturesKHR::default();
235        let mut ray_trace_features = vk::PhysicalDeviceRayTracingPipelineFeaturesKHR::default();
236        let mut features = vk::PhysicalDeviceFeatures2::default()
237            .push_next(&mut features_v1_1)
238            .push_next(&mut features_v1_2)
239            .push_next(&mut acceleration_structure_features)
240            .push_next(&mut index_type_u8_features)
241            .push_next(&mut ray_query_features)
242            .push_next(&mut ray_trace_features);
243        unsafe {
244            get_physical_device_features2(physical_device, &mut features);
245        }
246        let features_v1_0 = features.features.into();
247        let features_v1_1 = features_v1_1.into();
248        let features_v1_2 = features_v1_2.into();
249
250        // Gather required properties of the physical device
251        let mut properties_v1_1 = vk::PhysicalDeviceVulkan11Properties::default();
252        let mut properties_v1_2 = vk::PhysicalDeviceVulkan12Properties::default();
253        let mut accel_struct_properties =
254            vk::PhysicalDeviceAccelerationStructurePropertiesKHR::default();
255        let mut depth_stencil_resolve_properties =
256            vk::PhysicalDeviceDepthStencilResolveProperties::default();
257        let mut ray_trace_properties = vk::PhysicalDeviceRayTracingPipelinePropertiesKHR::default();
258        let mut sampler_filter_minmax_properties =
259            vk::PhysicalDeviceSamplerFilterMinmaxProperties::default();
260        let mut properties = vk::PhysicalDeviceProperties2::default()
261            .push_next(&mut properties_v1_1)
262            .push_next(&mut properties_v1_2)
263            .push_next(&mut accel_struct_properties)
264            .push_next(&mut depth_stencil_resolve_properties)
265            .push_next(&mut ray_trace_properties)
266            .push_next(&mut sampler_filter_minmax_properties);
267        unsafe {
268            get_physical_device_properties2(physical_device, &mut properties);
269        }
270        let properties_v1_0: Vulkan10Properties = properties.properties.into();
271        let properties_v1_1 = properties_v1_1.into();
272        let properties_v1_2 = properties_v1_2.into();
273        let depth_stencil_resolve_properties = depth_stencil_resolve_properties.into();
274        let sampler_filter_minmax_properties = sampler_filter_minmax_properties.into();
275
276        let extensions = unsafe {
277            instance
278                .enumerate_device_extension_properties(physical_device)
279                .map_err(|err| {
280                    error!("Unable to enumerate device extensions {err}");
281
282                    DriverError::Unsupported
283                })?
284        };
285
286        debug!("physical device: {}", &properties_v1_0.device_name);
287
288        for property in &extensions {
289            let extension_name = property.extension_name.as_ptr();
290
291            if extension_name.is_null() {
292                return Err(DriverError::InvalidData);
293            }
294
295            let extension_name = unsafe { CStr::from_ptr(extension_name) };
296
297            debug!("extension {:?} v{}", extension_name, property.spec_version);
298        }
299
300        // Check for supported extensions
301        let extensions = extensions
302            .iter()
303            .map(|property: &vk::ExtensionProperties| property.extension_name.as_ptr())
304            .filter(|&extension_name| !extension_name.is_null())
305            .map(|extension_name| unsafe { CStr::from_ptr(extension_name) })
306            .collect::<HashSet<_>>();
307        let supports_accel_struct = extensions.contains(khr::acceleration_structure::NAME)
308            && extensions.contains(khr::deferred_host_operations::NAME);
309        let supports_index_type_uint8 = extensions.contains(ext::index_type_uint8::NAME);
310        let supports_ray_query = extensions.contains(khr::ray_query::NAME);
311        let supports_ray_trace = extensions.contains(khr::ray_tracing_pipeline::NAME);
312
313        // Gather optional features and properties of the physical device
314        let index_type_uint8_features = if supports_index_type_uint8 {
315            index_type_u8_features.into()
316        } else {
317            Default::default()
318        };
319        let ray_query_features = if supports_ray_query {
320            ray_query_features.into()
321        } else {
322            Default::default()
323        };
324        let ray_trace_features = if supports_ray_trace {
325            ray_trace_features.into()
326        } else {
327            Default::default()
328        };
329        let accel_struct_properties = supports_accel_struct.then(|| accel_struct_properties.into());
330        let ray_trace_properties = supports_ray_trace.then(|| ray_trace_properties.into());
331
332        Ok(Self {
333            accel_struct_properties,
334            depth_stencil_resolve_properties,
335            features_v1_0,
336            features_v1_1,
337            features_v1_2,
338            index_type_uint8_features,
339            memory_properties,
340            physical_device,
341            properties_v1_0,
342            properties_v1_1,
343            properties_v1_2,
344            queue_families,
345            queue_family_indices,
346            ray_query_features,
347            ray_trace_features,
348            ray_trace_properties,
349            sampler_filter_minmax_properties,
350        })
351    }
352}
353
354impl Debug for PhysicalDevice {
355    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
356        write!(
357            f,
358            "{} ({:?})",
359            &self.properties_v1_0.device_name, self.properties_v1_0.device_type
360        )
361    }
362}
363
364impl Deref for PhysicalDevice {
365    type Target = vk::PhysicalDevice;
366
367    fn deref(&self) -> &Self::Target {
368        &self.physical_device
369    }
370}
371
372/// Features of the physical device for ray query.
373///
374/// See
375/// [`VkPhysicalDeviceRayQueryFeaturesKHR`](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceRayQueryFeaturesKHR.html)
376/// manual page.
377#[derive(Debug, Default)]
378pub struct RayQueryFeatures {
379    /// Indicates whether the implementation supports ray query (`OpRayQueryProceedKHR`)
380    /// functionality.
381    pub ray_query: bool,
382}
383
384impl From<vk::PhysicalDeviceRayQueryFeaturesKHR<'_>> for RayQueryFeatures {
385    fn from(features: vk::PhysicalDeviceRayQueryFeaturesKHR<'_>) -> Self {
386        Self {
387            ray_query: features.ray_query == vk::TRUE,
388        }
389    }
390}
391
392/// Features of the physical device for ray tracing.
393///
394/// See
395/// [`VkPhysicalDeviceRayTracingPipelineFeaturesKHR`](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceRayTracingPipelineFeaturesKHR.html)
396/// manual page.
397#[derive(Debug, Default)]
398pub struct RayTraceFeatures {
399    /// Indicates whether the implementation supports the ray tracing pipeline functionality.
400    ///
401    /// See
402    /// [Ray Tracing](https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#ray-tracing).
403    pub ray_tracing_pipeline: bool,
404
405    /// Indicates whether the implementation supports saving and reusing shader group handles, e.g.
406    /// for trace capture and replay.
407    pub ray_tracing_pipeline_shader_group_handle_capture_replay: bool,
408
409    /// Indicates whether the implementation supports reuse of shader group handles being
410    /// arbitrarily mixed with creation of non-reused shader group handles.
411    ///
412    /// If this is `false`, all reused shader group handles must be specified before any non-reused
413    /// handles may be created.
414    pub ray_tracing_pipeline_shader_group_handle_capture_replay_mixed: bool,
415
416    /// Indicates whether the implementation supports indirect ray tracing commands, e.g.
417    /// `vkCmdTraceRaysIndirectKHR`.
418    pub ray_tracing_pipeline_trace_rays_indirect: bool,
419
420    /// Indicates whether the implementation supports primitive culling during ray traversal.
421    pub ray_traversal_primitive_culling: bool,
422}
423
424impl From<vk::PhysicalDeviceRayTracingPipelineFeaturesKHR<'_>> for RayTraceFeatures {
425    fn from(features: vk::PhysicalDeviceRayTracingPipelineFeaturesKHR<'_>) -> Self {
426        Self {
427            ray_tracing_pipeline: features.ray_tracing_pipeline == vk::TRUE,
428            ray_tracing_pipeline_shader_group_handle_capture_replay: features
429                .ray_tracing_pipeline_shader_group_handle_capture_replay
430                == vk::TRUE,
431            ray_tracing_pipeline_shader_group_handle_capture_replay_mixed: features
432                .ray_tracing_pipeline_shader_group_handle_capture_replay_mixed
433                == vk::TRUE,
434            ray_tracing_pipeline_trace_rays_indirect: features
435                .ray_tracing_pipeline_trace_rays_indirect
436                == vk::TRUE,
437            ray_traversal_primitive_culling: features.ray_traversal_primitive_culling == vk::TRUE,
438        }
439    }
440}
441
442/// Properties of the physical device for ray tracing.
443///
444/// See
445/// [`VkPhysicalDeviceRayTracingPipelinePropertiesKHR`](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceRayTracingPipelinePropertiesKHR.html)
446/// manual page.
447#[derive(Debug)]
448pub struct RayTraceProperties {
449    /// The size in bytes of the shader header.
450    pub shader_group_handle_size: u32,
451
452    /// The maximum number of levels of ray recursion allowed in a trace command.
453    pub max_ray_recursion_depth: u32,
454
455    /// The maximum stride in bytes allowed between shader groups in the shader binding table.
456    pub max_shader_group_stride: u32,
457
458    /// The required alignment in bytes for the base of the shader binding table.
459    pub shader_group_base_alignment: u32,
460
461    /// The number of bytes for the information required to do capture and replay for shader group
462    /// handles.
463    pub shader_group_handle_capture_replay_size: u32,
464
465    /// The maximum number of ray generation shader invocations which may be produced by a single
466    /// vkCmdTraceRaysIndirectKHR or vkCmdTraceRaysKHR command.
467    pub max_ray_dispatch_invocation_count: u32,
468
469    /// The required alignment in bytes for each shader binding table entry.
470    ///
471    /// The value must be a power of two.
472    pub shader_group_handle_alignment: u32,
473
474    /// The maximum size in bytes for a ray attribute structure.
475    pub max_ray_hit_attribute_size: u32,
476}
477
478impl From<vk::PhysicalDeviceRayTracingPipelinePropertiesKHR<'_>> for RayTraceProperties {
479    fn from(props: vk::PhysicalDeviceRayTracingPipelinePropertiesKHR<'_>) -> Self {
480        Self {
481            shader_group_handle_size: props.shader_group_handle_size,
482            max_ray_recursion_depth: props.max_ray_recursion_depth,
483            max_shader_group_stride: props.max_shader_group_stride,
484            shader_group_base_alignment: props.shader_group_base_alignment,
485            shader_group_handle_capture_replay_size: props.shader_group_handle_capture_replay_size,
486            max_ray_dispatch_invocation_count: props.max_ray_dispatch_invocation_count,
487            shader_group_handle_alignment: props.shader_group_handle_alignment,
488            max_ray_hit_attribute_size: props.max_ray_hit_attribute_size,
489        }
490    }
491}
492
493/// Properties of the physical device for min/max sampler filtering.
494///
495/// See
496/// [`VkPhysicalDeviceSamplerFilterMinmaxProperties`](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT.html)
497#[derive(Debug)]
498pub struct SamplerFilterMinmaxProperties {
499    /// When `false` the component mapping of the image view used with min/max filtering must have
500    /// been created with the r component set to the identity swizzle. Only the r component of the
501    /// sampled image value is defined and the other component values are undefined.
502    ///
503    /// When `true` this restriction does not apply and image component mapping works as normal.
504    pub image_component_mapping: bool,
505
506    /// When `true` the following formats support the
507    /// `VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT` feature with `VK_IMAGE_TILING_OPTIMAL`,
508    /// if they support `VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT`:
509    ///
510    /// * [`vk::Format::R8_UNORM`]
511    /// * [`vk::Format::R8_SNORM`]
512    /// * [`vk::Format::R16_UNORM`]
513    /// * [`vk::Format::R16_SNORM`]
514    /// * [`vk::Format::R16_SFLOAT`]
515    /// * [`vk::Format::R32_SFLOAT`]
516    /// * [`vk::Format::D16_UNORM`]
517    /// * [`vk::Format::X8_D24_UNORM_PACK32`]
518    /// * [`vk::Format::D32_SFLOAT`]
519    /// * [`vk::Format::D16_UNORM_S8_UINT`]
520    /// * [`vk::Format::D24_UNORM_S8_UINT`]
521    /// * [`vk::Format::D32_SFLOAT_S8_UINT`]
522    ///
523    /// If the format is a depth/stencil format, this bit only specifies that the depth aspect (not
524    /// the stencil aspect) of an image of this format supports min/max filtering, and that min/max
525    /// filtering of the depth aspect is supported when depth compare is disabled in the sampler.
526    pub single_component_formats: bool,
527}
528
529impl From<vk::PhysicalDeviceSamplerFilterMinmaxProperties<'_>> for SamplerFilterMinmaxProperties {
530    fn from(value: vk::PhysicalDeviceSamplerFilterMinmaxProperties<'_>) -> Self {
531        Self {
532            image_component_mapping: value.filter_minmax_image_component_mapping == vk::TRUE,
533            single_component_formats: value.filter_minmax_single_component_formats == vk::TRUE,
534        }
535    }
536}
537
538/// Description of Vulkan features.
539///
540/// See
541/// [`VkPhysicalDeviceFeatures`](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceFeatures.html)
542/// manual page.
543#[derive(Debug)]
544pub struct Vulkan10Features {
545    /// Specifies that accesses to buffers are bounds-checked against the range of the buffer
546    /// descriptor.
547    pub robust_buffer_access: bool,
548
549    /// Specifies the full 32-bit range of indices is supported for indexed draw calls when using a
550    /// `VkIndexType` of `VK_INDEX_TYPE_UINT32`.
551    ///
552    /// `maxDrawIndexedIndexValue` is the maximum index value that may be used (aside from the
553    /// primitive restart index, which is always 2^32 - 1 when the VkIndexType is
554    /// `VK_INDEX_TYPE_UINT32`).
555    ///
556    /// If this feature is supported, `maxDrawIndexedIndexValue` must be 2^32 - 1; otherwise it must
557    /// be no smaller than 2^24 - 1. See maxDrawIndexedIndexValue.
558    pub full_draw_index_uint32: bool,
559
560    /// Specifies whether image views with a `VkImageViewType` of `VK_IMAGE_VIEW_TYPE_CUBE_ARRAY`
561    /// can be created, and that the corresponding `SampledCubeArray` and `ImageCubeArray` SPIR-V
562    /// capabilities can be used in shader code.
563    pub image_cube_array: bool,
564
565    /// Specifies whether the `VkPipelineColorBlendAttachmentState` settings are controlled
566    /// independently per-attachment.
567    ///
568    /// If this feature is not enabled, the `VkPipelineColorBlendAttachmentState` settings for all
569    /// color attachments must be identical. Otherwise, a different
570    /// `VkPipelineColorBlendAttachmentState` can be provided for each bound color attachment.
571    pub independent_blend: bool,
572
573    /// Specifies whether geometry shaders are supported.
574    ///
575    /// If this feature is not enabled, the `VK_SHADER_STAGE_GEOMETRY_BIT` and
576    /// `VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT` enum values must not be used.
577    ///
578    /// This also specifies whether shader modules can declare the `Geometry` capability.
579    pub geometry_shader: bool,
580
581    /// Specifies whether tessellation control and evaluation shaders are supported.
582    ///
583    /// If this feature is not enabled, the `VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT`,
584    /// `VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT`,
585    /// `VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT`,
586    /// `VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT`, and
587    /// `VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO` enum values must not be used.
588    ///
589    /// This also specifies whether shader modules can declare the `Tessellation` capability.
590    pub tessellation_shader: bool,
591
592    /// Specifies whether Sample Shading and multisample interpolation are supported.
593    ///
594    /// If this feature is not enabled, the `sampleShadingEnable` member of the
595    /// `VkPipelineMultisampleStateCreateInfo` structure must be set to `VK_FALSE` and the
596    /// `minSampleShading` member is ignored.
597    ///
598    /// This also specifies whether shader modules can declare the `SampleRateShading` capability.
599    pub sample_rate_shading: bool,
600
601    /// Specifies whether blend operations which take two sources are supported.
602    ///
603    /// If this feature is not enabled, the `VK_BLEND_FACTOR_SRC1_COLOR`,
604    /// `VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR`, `VK_BLEND_FACTOR_SRC1_ALPHA`, and
605    /// `VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA` enum values must not be used as source or destination
606    /// blending factors.
607    ///
608    /// See [dual-source blending](https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#framebuffer-dsb).
609    pub dual_src_blend: bool,
610
611    /// Specifies whether logic operations are supported.
612    ///
613    /// If this feature is not enabled, the `logicOpEnable` member of the
614    /// `VkPipelineColorBlendStateCreateInfo` structure must be set to `VK_FALSE`, and the `logicOp`
615    /// member is ignored.
616    pub logic_op: bool,
617
618    /// Specifies whether multiple draw indirect is supported.
619    ///
620    /// If this feature is not enabled, the `drawCount` parameter to the `vkCmdDrawIndirect` and
621    /// `vkCmdDrawIndexedIndirect` commands must be `0` or `1`. The `maxDrawIndirectCount` member of the
622    /// `VkPhysicalDeviceLimits` structure must also be `1` if this feature is not supported.
623    ///
624    /// See [maxDrawIndirectCount](https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#limits-maxDrawIndirectCount).
625    pub multi_draw_indirect: bool,
626
627    /// Specifies whether indirect drawing calls support the `firstInstance` parameter.
628    ///
629    /// If this feature is not enabled, the `firstInstance` member of all `VkDrawIndirectCommand`
630    /// and `VkDrawIndexedIndirectCommand` structures that are provided to the `vkCmdDrawIndirect`
631    /// and `vkCmdDrawIndexedIndirect` commands must be `0`.
632    pub draw_indirect_first_instance: bool,
633
634    /// Specifies whether depth clamping is supported.
635    ///
636    /// If this feature is not enabled, the `depthClampEnable` member of the
637    /// `VkPipelineRasterizationStateCreateInfo` structure must be set to `VK_FALSE`. Otherwise,
638    /// setting `depthClampEnable` to `VK_TRUE` will enable depth clamping.
639    pub depth_clamp: bool,
640
641    /// Specifies whether depth bias clamping is supported.
642    ///
643    /// If this feature is not enabled, the `depthBiasClamp` member of the
644    /// `VkPipelineRasterizationStateCreateInfo` structure must be set to `0.0` unless the
645    /// `VK_DYNAMIC_STATE_DEPTH_BIAS` dynamic state is enabled, and the `depthBiasClamp` parameter
646    /// to `vkCmdSetDepthBias` must be set to `0.0`.
647    pub depth_bias_clamp: bool,
648
649    /// Specifies whether point and wireframe fill modes are supported.
650    ///
651    /// If this feature is not enabled, the `VK_POLYGON_MODE_POINT` and `VK_POLYGON_MODE_LINE` enum
652    /// values must not be used.
653    pub fill_mode_non_solid: bool,
654
655    /// Specifies whether depth bounds tests are supported.
656    ///
657    /// If this feature is not enabled, the `depthBoundsTestEnable` member of the
658    /// `VkPipelineDepthStencilStateCreateInfo` structure must be set to `VK_FALSE`. When
659    /// `depthBoundsTestEnable` is set to `VK_FALSE`, the `minDepthBounds` and `maxDepthBounds`
660    /// members of the `VkPipelineDepthStencilStateCreateInfo` structure are ignored.
661    pub depth_bounds: bool,
662
663    /// Specifies whether lines with width other than `1.0` are supported.
664    ///
665    /// If this feature is not enabled, the `lineWidth` member of the
666    /// `VkPipelineRasterizationStateCreateInfo` structure must be set to `1.0` unless the
667    /// `VK_DYNAMIC_STATE_LINE_WIDTH` dynamic state is enabled, and the `lineWidth` parameter to
668    /// `vkCmdSetLineWidth` must be set to `1.0`.
669    ///
670    /// When this feature is supported, the range and granularity of supported line widths are
671    /// indicated by the `lineWidthRange` and `lineWidthGranularity` members of the
672    /// `VkPhysicalDeviceLimits` structure, respectively.
673    pub wide_lines: bool,
674
675    /// Specifies whether points with size greater than `1.0` are supported.
676    ///
677    /// If this feature is not enabled, only a point size of `1.0` written by a shader is supported.
678    ///
679    /// The range and granularity of supported point sizes are indicated by the `pointSizeRange` and
680    /// `pointSizeGranularity` members of the `VkPhysicalDeviceLimits` structure, respectively.
681    pub large_points: bool,
682
683    /// Specifies whether the implementation is able to replace the alpha value of the fragment
684    /// shader color output in the [multisample coverage](https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#fragops-covg)
685    /// fragment operation.
686    ///
687    /// If this feature is not enabled, then the `alphaToOneEnable` member of the
688    /// `VkPipelineMultisampleStateCreateInfo` structure must be set to `VK_FALSE`. Otherwise
689    /// setting `alphaToOneEnable` to `VK_TRUE` will enable alpha-to-one behavior.
690    pub alpha_to_one: bool,
691
692    /// Specifies whether more than one viewport is supported.
693    ///
694    /// If this feature is not enabled:
695    ///
696    /// - The `viewportCount` and `scissorCount` members of the `VkPipelineViewportStateCreateInfo`
697    ///   structure must be set to `1`.
698    /// - The `firstViewport` and `viewportCount` parameters to the `vkCmdSetViewport` command must
699    ///   be set to `0` and `1`, respectively.
700    /// - The `firstScissor` and `scissorCount` parameters to the `vkCmdSetScissor` command must be
701    ///   set to `0` and `1`, respectively.
702    pub multi_viewport: bool,
703
704    /// Specifies whether anisotropic filtering is supported.
705    ///
706    /// If this feature is not enabled, the `anisotropyEnable` member of the `VkSamplerCreateInfo`
707    /// structure must be `VK_FALSE`.
708    pub sampler_anisotropy: bool,
709
710    /// Specifies whether all of the ETC2 and EAC compressed texture formats are supported.
711    ///
712    /// If this feature is enabled, then the `VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT`,
713    /// `VK_FORMAT_FEATURE_BLIT_SRC_BIT` and `VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT`
714    /// features must be supported in `optimalTilingFeatures` for the following formats:
715    ///
716    /// - VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK
717    /// - VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK
718    /// - VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK
719    /// - VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK
720    /// - VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK
721    /// - VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK
722    /// - VK_FORMAT_EAC_R11_UNORM_BLOCK
723    /// - VK_FORMAT_EAC_R11_SNORM_BLOCK
724    /// - VK_FORMAT_EAC_R11G11_UNORM_BLOCK
725    /// - VK_FORMAT_EAC_R11G11_SNORM_BLOCK
726    ///
727    /// To query for additional properties, or if the feature is not enabled,
728    /// `vkGetPhysicalDeviceFormatProperties` and `vkGetPhysicalDeviceImageFormatProperties` can be
729    /// used to check for supported properties of individual formats as normal.
730    pub texture_compression_etc2: bool,
731
732    /// Specifies whether all of the ASTC LDR compressed texture formats are supported.
733    ///
734    /// If this feature is enabled, then the `VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT`,
735    /// `VK_FORMAT_FEATURE_BLIT_SRC_BIT` and `VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT`
736    /// features must be supported in `optimalTilingFeatures` for the following formats:
737    ///
738    /// - VK_FORMAT_ASTC_4x4_UNORM_BLOCK
739    /// - VK_FORMAT_ASTC_4x4_SRGB_BLOCK
740    /// - VK_FORMAT_ASTC_5x4_UNORM_BLOCK
741    /// - VK_FORMAT_ASTC_5x4_SRGB_BLOCK
742    /// - VK_FORMAT_ASTC_5x5_UNORM_BLOCK
743    /// - VK_FORMAT_ASTC_5x5_SRGB_BLOCK
744    /// - VK_FORMAT_ASTC_6x5_UNORM_BLOCK
745    /// - VK_FORMAT_ASTC_6x5_SRGB_BLOCK
746    /// - VK_FORMAT_ASTC_6x6_UNORM_BLOCK
747    /// - VK_FORMAT_ASTC_6x6_SRGB_BLOCK
748    /// - VK_FORMAT_ASTC_8x5_UNORM_BLOCK
749    /// - VK_FORMAT_ASTC_8x5_SRGB_BLOCK
750    /// - VK_FORMAT_ASTC_8x6_UNORM_BLOCK
751    /// - VK_FORMAT_ASTC_8x6_SRGB_BLOCK
752    /// - VK_FORMAT_ASTC_8x8_UNORM_BLOCK
753    /// - VK_FORMAT_ASTC_8x8_SRGB_BLOCK
754    /// - VK_FORMAT_ASTC_10x5_UNORM_BLOCK
755    /// - VK_FORMAT_ASTC_10x5_SRGB_BLOCK
756    /// - VK_FORMAT_ASTC_10x6_UNORM_BLOCK
757    /// - VK_FORMAT_ASTC_10x6_SRGB_BLOCK
758    /// - VK_FORMAT_ASTC_10x8_UNORM_BLOCK
759    /// - VK_FORMAT_ASTC_10x8_SRGB_BLOCK
760    /// - VK_FORMAT_ASTC_10x10_UNORM_BLOCK
761    /// - VK_FORMAT_ASTC_10x10_SRGB_BLOCK
762    /// - VK_FORMAT_ASTC_12x10_UNORM_BLOCK
763    /// - VK_FORMAT_ASTC_12x10_SRGB_BLOCK
764    /// - VK_FORMAT_ASTC_12x12_UNORM_BLOCK
765    /// - VK_FORMAT_ASTC_12x12_SRGB_BLOCK
766    ///
767    /// To query for additional properties, or if the feature is not enabled,
768    /// `vkGetPhysicalDeviceFormatProperties` and `vkGetPhysicalDeviceImageFormatProperties` can be
769    /// used to check for supported properties of individual formats as normal.
770    pub texture_compression_astc_ldr: bool,
771
772    /// Specifies whether all of the BC compressed texture formats are supported.
773    ///
774    /// If this feature is enabled, then the `VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT`,
775    /// `VK_FORMAT_FEATURE_BLIT_SRC_BIT` and `VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT`
776    /// features must be supported in `optimalTilingFeatures` for the following formats:
777    ///
778    /// - VK_FORMAT_BC1_RGB_UNORM_BLOCK
779    /// - VK_FORMAT_BC1_RGB_SRGB_BLOCK
780    /// - VK_FORMAT_BC1_RGBA_UNORM_BLOCK
781    /// - VK_FORMAT_BC1_RGBA_SRGB_BLOCK
782    /// - VK_FORMAT_BC2_UNORM_BLOCK
783    /// - VK_FORMAT_BC2_SRGB_BLOCK
784    /// - VK_FORMAT_BC3_UNORM_BLOCK
785    /// - VK_FORMAT_BC3_SRGB_BLOCK
786    /// - VK_FORMAT_BC4_UNORM_BLOCK
787    /// - VK_FORMAT_BC4_SNORM_BLOCK
788    /// - VK_FORMAT_BC5_UNORM_BLOCK
789    /// - VK_FORMAT_BC5_SNORM_BLOCK
790    /// - VK_FORMAT_BC6H_UFLOAT_BLOCK
791    /// - VK_FORMAT_BC6H_SFLOAT_BLOCK
792    /// - VK_FORMAT_BC7_UNORM_BLOCK
793    /// - VK_FORMAT_BC7_SRGB_BLOCK
794    ///
795    /// To query for additional properties, or if the feature is not enabled,
796    /// `vkGetPhysicalDeviceFormatProperties` and `vkGetPhysicalDeviceImageFormatProperties` can be
797    /// used to check for supported properties of individual formats as normal.
798    pub texture_compression_bc: bool,
799
800    /// Specifies whether storage buffers and images support stores and atomic operations in the
801    /// vertex, tessellation, and geometry shader stages.
802    ///
803    /// If this feature is not enabled, all storage image, storage texel buffer, and storage buffer
804    /// variables used by these stages in shader modules must be decorated with the `NonWritable`
805    /// decoration (or the `readonly` memory qualifier in GLSL).
806    pub vertex_pipeline_stores_and_atomics: bool,
807
808    /// Specifies whether storage buffers and images support stores and atomic operations in the
809    /// fragment shader stage.
810    ///
811    /// If this feature is not enabled, all storage image, storage texel buffer, and storage buffer
812    /// variables used by the fragment stage in shader modules must be decorated with the
813    /// `NonWritable` decoration (or the `readonly` memory qualifier in GLSL).
814    pub fragment_stores_and_atomics: bool,
815
816    /// Specifies whether the `PointSize` built-in decoration is available in the tessellation
817    /// control, tessellation evaluation, and geometry shader stages.
818    ///
819    /// If this feature is not enabled, members decorated with the `PointSize` built-in decoration
820    /// must not be read from or written to and all points written from a tessellation or geometry
821    /// shader will have a size of `1.0`.
822    ///
823    /// This also specifies whether shader modules can declare the `TessellationPointSize`
824    /// capability for tessellation control and evaluation shaders, or if the shader modules can
825    /// declare the `GeometryPointSize` capability for geometry shaders.
826    ///
827    /// An implementation supporting this feature must also support one or both of the
828    /// `tessellationShader` or `geometryShader` features.
829    pub shader_tessellation_and_geometry_point_size: bool,
830
831    /// Specifies whether the extended set of image gather instructions are available in shader
832    /// code.
833    ///
834    /// If this feature is not enabled, the `OpImage*Gather` instructions do not support the
835    /// `Offset` and `ConstOffsets` operands.
836    ///
837    /// This also specifies whether shader modules can declare the `ImageGatherExtended` capability.
838    pub shader_image_gather_extended: bool,
839
840    /// Specifies whether all the “storage image extended formats” below are supported.
841    ///
842    /// If this feature is supported, then the `VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT` must be
843    /// supported in `optimalTilingFeatures` for the following formats:
844    ///
845    /// - VK_FORMAT_R16G16_SFLOAT
846    /// - VK_FORMAT_B10G11R11_UFLOAT_PACK32
847    /// - VK_FORMAT_R16_SFLOAT
848    /// - VK_FORMAT_R16G16B16A16_UNORM
849    /// - VK_FORMAT_A2B10G10R10_UNORM_PACK32
850    /// - VK_FORMAT_R16G16_UNORM
851    /// - VK_FORMAT_R8G8_UNORM
852    /// - VK_FORMAT_R16_UNORM
853    /// - VK_FORMAT_R8_UNORM
854    /// - VK_FORMAT_R16G16B16A16_SNORM
855    /// - VK_FORMAT_R16G16_SNORM
856    /// - VK_FORMAT_R8G8_SNORM
857    /// - VK_FORMAT_R16_SNORM
858    /// - VK_FORMAT_R8_SNORM
859    /// - VK_FORMAT_R16G16_SINT
860    /// - VK_FORMAT_R8G8_SINT
861    /// - VK_FORMAT_R16_SINT
862    /// - VK_FORMAT_R8_SINT
863    /// - VK_FORMAT_A2B10G10R10_UINT_PACK32
864    /// - VK_FORMAT_R16G16_UINT
865    /// - VK_FORMAT_R8G8_UINT
866    /// - VK_FORMAT_R16_UINT
867    /// - VK_FORMAT_R8_UINT
868    ///
869    /// _Note:_ `shaderStorageImageExtendedFormats` feature only adds a guarantee of format support,
870    /// which is specified for the whole physical device. Therefore enabling or disabling the
871    /// feature via vkCreateDevice has no practical effect.
872    ///
873    /// To query for additional properties, or if the feature is not supported,
874    /// `vkGetPhysicalDeviceFormatProperties` and `vkGetPhysicalDeviceImageFormatProperties` can be
875    /// used to check for supported properties of individual formats, as usual rules allow.
876    ///
877    /// `VK_FORMAT_R32G32_UINT`, `VK_FORMAT_R32G32_SINT`, and `VK_FORMAT_R32G32_SFLOAT` from
878    /// `StorageImageExtendedFormats` SPIR-V capability, are already covered by core Vulkan
879    /// [mandatory format support](https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#formats-mandatory-features-32bit).
880    pub shader_storage_image_extended_formats: bool,
881
882    /// Specifies whether multisampled storage images are supported.
883    ///
884    /// If this feature is not enabled, images that are created with a usage that includes
885    /// `VK_IMAGE_USAGE_STORAGE_BIT` must be created with samples equal to `VK_SAMPLE_COUNT_1_BIT`.
886    ///
887    /// This also specifies whether shader modules can declare the `StorageImageMultisample` and
888    /// `ImageMSArray` capabilities.
889    pub shader_storage_image_multisample: bool,
890
891    /// Specifies whether storage images and storage texel buffers require a format qualifier to be
892    /// specified when reading.
893    ///
894    /// `shaderStorageImageReadWithoutFormat` applies only to formats listed in the
895    /// [storage without format](https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#formats-without-shader-storage-format)
896    /// list.
897    pub shader_storage_image_read_without_format: bool,
898
899    /// Specifies whether storage images and storage texel buffers require a format qualifier to be
900    /// specified when writing.
901    ///
902    /// `shaderStorageImageWriteWithoutFormat` applies only to formats listed in the
903    /// [storage without format](https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#formats-without-shader-storage-format)
904    /// list.
905    pub shader_storage_image_write_without_format: bool,
906
907    /// Specifies whether arrays of uniform buffers can be indexed by dynamically uniform integer
908    /// expressions in shader code.
909    ///
910    /// If this feature is not enabled, resources with a descriptor type of
911    /// `VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER` or `VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC` must be
912    /// indexed only by constant integral expressions when aggregated into arrays in shader code.
913    ///
914    /// This also specifies whether shader modules can declare the
915    /// `UniformBufferArrayDynamicIndexing` capability.
916    pub shader_uniform_buffer_array_dynamic_indexing: bool,
917
918    /// Specifies whether arrays of samplers or sampled images can be indexed by dynamically uniform
919    /// integer expressions in shader code.
920    ///
921    /// If this feature is not enabled, resources with a descriptor type of
922    /// `VK_DESCRIPTOR_TYPE_SAMPLER`, `VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER`, or
923    /// `VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE` must be indexed only by constant integral expressions
924    /// when aggregated into arrays in shader code.
925    ///
926    /// This also specifies whether shader modules can declare the
927    /// `SampledImageArrayDynamicIndexing` capability.
928    pub shader_sampled_image_array_dynamic_indexing: bool,
929
930    /// Specifies whether arrays of storage buffers can be indexed by dynamically uniform integer
931    /// expressions in shader code.
932    ///
933    /// If this feature is not enabled, resources with a descriptor type of
934    /// `VK_DESCRIPTOR_TYPE_STORAGE_BUFFER` or `VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC` must be
935    /// indexed only by constant integral expressions when aggregated into arrays in shader code.
936    ///
937    /// This also specifies whether shader modules can declare the
938    /// `StorageBufferArrayDynamicIndexing` capability.
939    pub shader_storage_buffer_array_dynamic_indexing: bool,
940
941    /// Specifies whether arrays of storage images can be indexed by dynamically uniform integer
942    /// expressions in shader code.
943    ///
944    /// If this feature is not enabled, resources with a descriptor type of
945    /// `VK_DESCRIPTOR_TYPE_STORAGE_IMAGE` must be indexed only by constant integral expressions
946    /// when aggregated into arrays in shader code.
947    ///
948    /// This also specifies whether shader modules can declare the
949    /// `StorageImageArrayDynamicIndexing` capability.
950    pub shader_storage_image_array_dynamic_indexing: bool,
951
952    /// Specifies whether clip distances are supported in shader code.
953    ///
954    /// If this feature is not enabled, any members decorated with the `ClipDistance` built-in
955    /// decoration must not be read from or written to in shader modules.
956    ///
957    /// This also specifies whether shader modules can declare the `ClipDistance` capability.
958    pub shader_clip_distance: bool,
959
960    /// Specifies whether cull distances are supported in shader code.
961    ///
962    /// If this feature is not enabled, any members decorated with the `CullDistance` built-in
963    /// decoration must not be read from or written to in shader modules.
964    ///
965    /// This also specifies whether shader modules can declare the `CullDistance` capability.
966    pub shader_cull_distance: bool,
967
968    /// Specifies whether 64-bit floats (doubles) are supported in shader code.
969    ///
970    /// If this feature is not enabled, 64-bit floating-point types must not be used in shader code.
971    ///
972    /// This also specifies whether shader modules can declare the `Float64` capability. Declaring
973    /// and using 64-bit floats is enabled for all storage classes that SPIR-V allows with the
974    /// `Float64` capability.
975    pub shader_float64: bool,
976
977    /// Specifies whether 64-bit integers (signed and unsigned) are supported in shader code.
978    ///
979    /// If this feature is not enabled, 64-bit integer types must not be used in shader code.
980    ///
981    /// This also specifies whether shader modules can declare the `Int64` capability. Declaring and
982    /// using 64-bit integers is enabled for all storage classes that SPIR-V allows with the `Int64`
983    /// capability.
984    pub shader_int64: bool,
985
986    /// Specifies whether 16-bit integers (signed and unsigned) are supported in shader code.
987    ///
988    /// If this feature is not enabled, 16-bit integer types must not be used in shader code.
989    ///
990    /// This also specifies whether shader modules can declare the `Int16` capability. However, this
991    /// only enables a subset of the storage classes that SPIR-V allows for the `Int16` SPIR-V
992    /// capability: Declaring and using 16-bit integers in the `Private`, `Workgroup` (for non-Block
993    /// variables), and `Function` storage classes is enabled, while declaring them in the interface
994    /// storage classes (e.g., `UniformConstant`, `Uniform`, `StorageBuffer`, `Input`, `Output`, and
995    /// `PushConstant`) is not enabled.
996    pub shader_int16: bool,
997
998    /// Specifies whether image operations specifying the minimum resource LOD are supported in
999    /// shader code.
1000    ///
1001    /// If this feature is not enabled, the `MinLod` image operand must not be used in shader code.
1002    ///
1003    /// This also specifies whether shader modules can declare the `MinLod` capability.
1004    pub shader_resource_min_lod: bool,
1005
1006    /// Specifies whether all pipelines that will be bound to a command buffer during a subpass
1007    /// which uses no attachments must have the same value for
1008    /// `VkPipelineMultisampleStateCreateInfo::rasterizationSamples`.
1009    ///
1010    /// If set to `VK_TRUE`, the implementation supports variable multisample rates in a subpass
1011    /// which uses no attachments.
1012    ///
1013    /// If set to `VK_FALSE`, then all pipelines bound in such a subpass must have the same
1014    /// multisample rate.
1015    ///
1016    /// This has no effect in situations where a subpass uses any attachments.
1017    pub variable_multisample_rate: bool,
1018    // Unsupported (queries):
1019    // pub occlusion_query_precise: bool,
1020    // pub pipeline_statistics_query: bool,
1021    // pub inherited_queries: bool,
1022
1023    // Unsupported (sparse residency):
1024    // pub shader_resource_residency: bool,
1025    // pub sparse_binding: bool,
1026    // pub sparse_residency_buffer: bool,
1027    // pub sparse_residency_image2_d: bool,
1028    // pub sparse_residency_image3_d: bool,
1029    // pub sparse_residency2_samples: bool,
1030    // pub sparse_residency4_samples: bool,
1031    // pub sparse_residency8_samples: bool,
1032    // pub sparse_residency16_samples: bool,
1033    // pub sparse_residency_aliased: bool,
1034}
1035
1036impl From<vk::PhysicalDeviceFeatures> for Vulkan10Features {
1037    fn from(features: vk::PhysicalDeviceFeatures) -> Self {
1038        Self {
1039            robust_buffer_access: features.robust_buffer_access == vk::TRUE,
1040            full_draw_index_uint32: features.full_draw_index_uint32 == vk::TRUE,
1041            image_cube_array: features.image_cube_array == vk::TRUE,
1042            independent_blend: features.independent_blend == vk::TRUE,
1043            geometry_shader: features.geometry_shader == vk::TRUE,
1044            tessellation_shader: features.tessellation_shader == vk::TRUE,
1045            sample_rate_shading: features.sample_rate_shading == vk::TRUE,
1046            dual_src_blend: features.dual_src_blend == vk::TRUE,
1047            logic_op: features.logic_op == vk::TRUE,
1048            multi_draw_indirect: features.multi_draw_indirect == vk::TRUE,
1049            draw_indirect_first_instance: features.draw_indirect_first_instance == vk::TRUE,
1050            depth_clamp: features.depth_clamp == vk::TRUE,
1051            depth_bias_clamp: features.depth_bias_clamp == vk::TRUE,
1052            fill_mode_non_solid: features.fill_mode_non_solid == vk::TRUE,
1053            depth_bounds: features.depth_bounds == vk::TRUE,
1054            wide_lines: features.wide_lines == vk::TRUE,
1055            large_points: features.large_points == vk::TRUE,
1056            alpha_to_one: features.alpha_to_one == vk::TRUE,
1057            multi_viewport: features.multi_viewport == vk::TRUE,
1058            sampler_anisotropy: features.sampler_anisotropy == vk::TRUE,
1059            texture_compression_etc2: features.texture_compression_etc2 == vk::TRUE,
1060            texture_compression_astc_ldr: features.texture_compression_astc_ldr == vk::TRUE,
1061            texture_compression_bc: features.texture_compression_bc == vk::TRUE,
1062            vertex_pipeline_stores_and_atomics: features.vertex_pipeline_stores_and_atomics
1063                == vk::TRUE,
1064            fragment_stores_and_atomics: features.fragment_stores_and_atomics == vk::TRUE,
1065            shader_tessellation_and_geometry_point_size: features
1066                .shader_tessellation_and_geometry_point_size
1067                == vk::TRUE,
1068            shader_image_gather_extended: features.shader_image_gather_extended == vk::TRUE,
1069            shader_storage_image_extended_formats: features.shader_storage_image_extended_formats
1070                == vk::TRUE,
1071            shader_storage_image_multisample: features.shader_storage_image_multisample == vk::TRUE,
1072            shader_storage_image_read_without_format: features
1073                .shader_storage_image_read_without_format
1074                == vk::TRUE,
1075            shader_storage_image_write_without_format: features
1076                .shader_storage_image_write_without_format
1077                == vk::TRUE,
1078            shader_uniform_buffer_array_dynamic_indexing: features
1079                .shader_uniform_buffer_array_dynamic_indexing
1080                == vk::TRUE,
1081            shader_sampled_image_array_dynamic_indexing: features
1082                .shader_sampled_image_array_dynamic_indexing
1083                == vk::TRUE,
1084            shader_storage_buffer_array_dynamic_indexing: features
1085                .shader_storage_buffer_array_dynamic_indexing
1086                == vk::TRUE,
1087            shader_storage_image_array_dynamic_indexing: features
1088                .shader_storage_image_array_dynamic_indexing
1089                == vk::TRUE,
1090            shader_clip_distance: features.shader_clip_distance == vk::TRUE,
1091            shader_cull_distance: features.shader_cull_distance == vk::TRUE,
1092            shader_float64: features.shader_float64 == vk::TRUE,
1093            shader_int64: features.shader_int64 == vk::TRUE,
1094            shader_int16: features.shader_int16 == vk::TRUE,
1095            shader_resource_min_lod: features.shader_resource_min_lod == vk::TRUE,
1096            variable_multisample_rate: features.variable_multisample_rate == vk::TRUE,
1097        }
1098    }
1099}
1100
1101/// Description of Vulkan limitations.
1102///
1103/// See
1104/// [`VkPhysicalDeviceLimits`](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceLimits.html)
1105/// manual page.
1106#[allow(missing_docs)] // TODO: Finish docs!
1107#[derive(Debug)]
1108pub struct Vulkan10Limits {
1109    /// The largest dimension (width) that is guaranteed to be supported for all images created with
1110    /// an image type of [`ImageType::Texture1D`](super::image::ImageType).
1111    ///
1112    /// Some combinations of image parameters (format, usage, etc.) may allow support for larger
1113    /// dimensions, which can be queried using
1114    /// [`Device::image_format_properties`](super::device::Device::image_format_properties).
1115    pub max_image_dimension1_d: u32,
1116
1117    /// The largest dimension (width or height) that is guaranteed to be supported for all images
1118    /// created with an image type of [`ImageType::Texture2D`](super::image::ImageType) and without
1119    /// [`vk::ImageCreateFlags::CUBE_COMPATIBLE`] set in
1120    /// [`ImageInfo::flags`](super::image::ImageInfo::flags).
1121    ///
1122    /// Some combinations of image parameters (format, usage, etc.) may allow support for larger
1123    /// dimensions, which can be queried using
1124    /// [`Device::image_format_properties`](super::device::Device::image_format_properties).
1125    pub max_image_dimension2_d: u32,
1126
1127    /// The largest dimension (width, height, or depth) that is guaranteed to be supported for all
1128    /// images created with an image type of [`ImageType::Texture3D`](super::image::ImageType).
1129    ///
1130    /// Some combinations of image parameters (format, usage, etc.) may allow support for larger
1131    /// dimensions, which can be queried using
1132    /// [`Device::image_format_properties`](super::device::Device::image_format_properties).
1133    pub max_image_dimension3_d: u32,
1134
1135    /// The largest dimension (width or height) that is guaranteed to be supported for all images
1136    /// created with an image type of [`ImageType::Texture2D`](super::image::ImageType) and with
1137    /// [`vk::ImageCreateFlags::CUBE_COMPATIBLE`] set in
1138    /// [`ImageInfo::flags`](super::image::ImageInfo::flags).
1139    ///
1140    /// Some combinations of image parameters (format, usage, etc.) may allow support for larger
1141    /// dimensions, which can be queried using
1142    /// [`Device::image_format_properties`](super::device::Device::image_format_properties).
1143    pub max_image_dimension_cube: u32,
1144
1145    /// The maximum number of layers
1146    /// ([`ImageInfo::array_elements`](super::image::ImageInfo::array_elements)) for an image.
1147    pub max_image_array_layers: u32,
1148
1149    /// The maximum number of addressable texels for a buffer view created on a buffer which was
1150    /// created with the [`vk::BufferUsageFlags::UNIFORM_TEXEL_BUFFER`] or
1151    /// [`vk::BufferUsageFlags::STORAGE_TEXEL_BUFFER`] set in
1152    /// [`BufferInfo::usage`](super::buffer::BufferInfo::usage).
1153    pub max_texel_buffer_elements: u32,
1154    pub max_uniform_buffer_range: u32,
1155    pub max_storage_buffer_range: u32,
1156    pub max_push_constants_size: u32,
1157    pub max_memory_allocation_count: u32,
1158    pub max_sampler_allocation_count: u32,
1159    pub buffer_image_granularity: vk::DeviceSize,
1160    pub sparse_address_space_size: vk::DeviceSize,
1161    pub max_bound_descriptor_sets: u32,
1162    pub max_per_stage_descriptor_samplers: u32,
1163    pub max_per_stage_descriptor_uniform_buffers: u32,
1164    pub max_per_stage_descriptor_storage_buffers: u32,
1165    pub max_per_stage_descriptor_sampled_images: u32,
1166    pub max_per_stage_descriptor_storage_images: u32,
1167    pub max_per_stage_descriptor_input_attachments: u32,
1168    pub max_per_stage_resources: u32,
1169    pub max_descriptor_set_samplers: u32,
1170    pub max_descriptor_set_uniform_buffers: u32,
1171    pub max_descriptor_set_uniform_buffers_dynamic: u32,
1172    pub max_descriptor_set_storage_buffers: u32,
1173    pub max_descriptor_set_storage_buffers_dynamic: u32,
1174    pub max_descriptor_set_sampled_images: u32,
1175    pub max_descriptor_set_storage_images: u32,
1176    pub max_descriptor_set_input_attachments: u32,
1177    pub max_vertex_input_attributes: u32,
1178    pub max_vertex_input_bindings: u32,
1179    pub max_vertex_input_attribute_offset: u32,
1180    pub max_vertex_input_binding_stride: u32,
1181    pub max_vertex_output_components: u32,
1182    pub max_tessellation_generation_level: u32,
1183    pub max_tessellation_patch_size: u32,
1184    pub max_tessellation_control_per_vertex_input_components: u32,
1185    pub max_tessellation_control_per_vertex_output_components: u32,
1186    pub max_tessellation_control_per_patch_output_components: u32,
1187    pub max_tessellation_control_total_output_components: u32,
1188    pub max_tessellation_evaluation_input_components: u32,
1189    pub max_tessellation_evaluation_output_components: u32,
1190    pub max_geometry_shader_invocations: u32,
1191    pub max_geometry_input_components: u32,
1192    pub max_geometry_output_components: u32,
1193    pub max_geometry_output_vertices: u32,
1194    pub max_geometry_total_output_components: u32,
1195    pub max_fragment_input_components: u32,
1196    pub max_fragment_output_attachments: u32,
1197    pub max_fragment_dual_src_attachments: u32,
1198    pub max_fragment_combined_output_resources: u32,
1199    pub max_compute_shared_memory_size: u32,
1200    pub max_compute_work_group_count: [u32; 3],
1201    pub max_compute_work_group_invocations: u32,
1202    pub max_compute_work_group_size: [u32; 3],
1203    pub sub_pixel_precision_bits: u32,
1204    pub sub_texel_precision_bits: u32,
1205    pub mipmap_precision_bits: u32,
1206    pub max_draw_indexed_index_value: u32,
1207    pub max_draw_indirect_count: u32,
1208    pub max_sampler_lod_bias: f32,
1209    pub max_sampler_anisotropy: f32,
1210    pub max_viewports: u32,
1211    pub max_viewport_dimensions: [u32; 2],
1212    pub viewport_bounds_range: [f32; 2],
1213    pub viewport_sub_pixel_bits: u32,
1214    pub min_memory_map_alignment: usize,
1215    pub min_texel_buffer_offset_alignment: vk::DeviceSize,
1216    pub min_uniform_buffer_offset_alignment: vk::DeviceSize,
1217    pub min_storage_buffer_offset_alignment: vk::DeviceSize,
1218    pub min_texel_offset: i32,
1219    pub max_texel_offset: u32,
1220    pub min_texel_gather_offset: i32,
1221    pub max_texel_gather_offset: u32,
1222    pub min_interpolation_offset: f32,
1223    pub max_interpolation_offset: f32,
1224    pub sub_pixel_interpolation_offset_bits: u32,
1225    pub max_framebuffer_width: u32,
1226    pub max_framebuffer_height: u32,
1227    pub max_framebuffer_layers: u32,
1228    pub framebuffer_color_sample_counts: vk::SampleCountFlags,
1229    pub framebuffer_depth_sample_counts: vk::SampleCountFlags,
1230    pub framebuffer_stencil_sample_counts: vk::SampleCountFlags,
1231    pub framebuffer_no_attachments_sample_counts: vk::SampleCountFlags,
1232    pub max_color_attachments: u32,
1233    pub sampled_image_color_sample_counts: vk::SampleCountFlags,
1234    pub sampled_image_integer_sample_counts: vk::SampleCountFlags,
1235    pub sampled_image_depth_sample_counts: vk::SampleCountFlags,
1236    pub sampled_image_stencil_sample_counts: vk::SampleCountFlags,
1237    pub storage_image_sample_counts: vk::SampleCountFlags,
1238    pub max_sample_mask_words: u32,
1239    pub timestamp_compute_and_graphics: bool,
1240    pub timestamp_period: f32,
1241    pub max_clip_distances: u32,
1242    pub max_cull_distances: u32,
1243    pub max_combined_clip_and_cull_distances: u32,
1244    pub discrete_queue_priorities: u32,
1245    pub point_size_range: [f32; 2],
1246    pub line_width_range: [f32; 2],
1247    pub point_size_granularity: f32,
1248    pub line_width_granularity: f32,
1249    pub strict_lines: bool,
1250    pub standard_sample_locations: bool,
1251    pub optimal_buffer_copy_offset_alignment: vk::DeviceSize,
1252    pub optimal_buffer_copy_row_pitch_alignment: vk::DeviceSize,
1253    pub non_coherent_atom_size: vk::DeviceSize,
1254}
1255
1256impl From<vk::PhysicalDeviceLimits> for Vulkan10Limits {
1257    fn from(limits: vk::PhysicalDeviceLimits) -> Self {
1258        Self {
1259            max_image_dimension1_d: limits.max_image_dimension1_d,
1260            max_image_dimension2_d: limits.max_image_dimension2_d,
1261            max_image_dimension3_d: limits.max_image_dimension3_d,
1262            max_image_dimension_cube: limits.max_image_dimension_cube,
1263            max_image_array_layers: limits.max_image_array_layers,
1264            max_texel_buffer_elements: limits.max_texel_buffer_elements,
1265            max_uniform_buffer_range: limits.max_uniform_buffer_range,
1266            max_storage_buffer_range: limits.max_storage_buffer_range,
1267            max_push_constants_size: limits.max_push_constants_size,
1268            max_memory_allocation_count: limits.max_memory_allocation_count,
1269            max_sampler_allocation_count: limits.max_sampler_allocation_count,
1270            buffer_image_granularity: limits.buffer_image_granularity,
1271            sparse_address_space_size: limits.sparse_address_space_size,
1272            max_bound_descriptor_sets: limits.max_bound_descriptor_sets,
1273            max_per_stage_descriptor_samplers: limits.max_per_stage_descriptor_samplers,
1274            max_per_stage_descriptor_uniform_buffers: limits
1275                .max_per_stage_descriptor_uniform_buffers,
1276            max_per_stage_descriptor_storage_buffers: limits
1277                .max_per_stage_descriptor_storage_buffers,
1278            max_per_stage_descriptor_sampled_images: limits.max_per_stage_descriptor_sampled_images,
1279            max_per_stage_descriptor_storage_images: limits.max_per_stage_descriptor_storage_images,
1280            max_per_stage_descriptor_input_attachments: limits
1281                .max_per_stage_descriptor_input_attachments,
1282            max_per_stage_resources: limits.max_per_stage_resources,
1283            max_descriptor_set_samplers: limits.max_descriptor_set_samplers,
1284            max_descriptor_set_uniform_buffers: limits.max_descriptor_set_uniform_buffers,
1285            max_descriptor_set_uniform_buffers_dynamic: limits
1286                .max_descriptor_set_uniform_buffers_dynamic,
1287            max_descriptor_set_storage_buffers: limits.max_descriptor_set_storage_buffers,
1288            max_descriptor_set_storage_buffers_dynamic: limits
1289                .max_descriptor_set_storage_buffers_dynamic,
1290            max_descriptor_set_sampled_images: limits.max_descriptor_set_sampled_images,
1291            max_descriptor_set_storage_images: limits.max_descriptor_set_storage_images,
1292            max_descriptor_set_input_attachments: limits.max_descriptor_set_input_attachments,
1293            max_vertex_input_attributes: limits.max_vertex_input_attributes,
1294            max_vertex_input_bindings: limits.max_vertex_input_bindings,
1295            max_vertex_input_attribute_offset: limits.max_vertex_input_attribute_offset,
1296            max_vertex_input_binding_stride: limits.max_vertex_input_binding_stride,
1297            max_vertex_output_components: limits.max_vertex_output_components,
1298            max_tessellation_generation_level: limits.max_tessellation_generation_level,
1299            max_tessellation_patch_size: limits.max_tessellation_patch_size,
1300            max_tessellation_control_per_vertex_input_components: limits
1301                .max_tessellation_control_per_vertex_input_components,
1302            max_tessellation_control_per_vertex_output_components: limits
1303                .max_tessellation_control_per_vertex_output_components,
1304            max_tessellation_control_per_patch_output_components: limits
1305                .max_tessellation_control_per_patch_output_components,
1306            max_tessellation_control_total_output_components: limits
1307                .max_tessellation_control_total_output_components,
1308            max_tessellation_evaluation_input_components: limits
1309                .max_tessellation_evaluation_input_components,
1310            max_tessellation_evaluation_output_components: limits
1311                .max_tessellation_evaluation_output_components,
1312            max_geometry_shader_invocations: limits.max_geometry_shader_invocations,
1313            max_geometry_input_components: limits.max_geometry_input_components,
1314            max_geometry_output_components: limits.max_geometry_output_components,
1315            max_geometry_output_vertices: limits.max_geometry_output_vertices,
1316            max_geometry_total_output_components: limits.max_geometry_total_output_components,
1317            max_fragment_input_components: limits.max_fragment_input_components,
1318            max_fragment_output_attachments: limits.max_fragment_output_attachments,
1319            max_fragment_dual_src_attachments: limits.max_fragment_dual_src_attachments,
1320            max_fragment_combined_output_resources: limits.max_fragment_combined_output_resources,
1321            max_compute_shared_memory_size: limits.max_compute_shared_memory_size,
1322            max_compute_work_group_count: limits.max_compute_work_group_count,
1323            max_compute_work_group_invocations: limits.max_compute_work_group_invocations,
1324            max_compute_work_group_size: limits.max_compute_work_group_size,
1325            sub_pixel_precision_bits: limits.sub_pixel_precision_bits,
1326            sub_texel_precision_bits: limits.sub_texel_precision_bits,
1327            mipmap_precision_bits: limits.mipmap_precision_bits,
1328            max_draw_indexed_index_value: limits.max_draw_indexed_index_value,
1329            max_draw_indirect_count: limits.max_draw_indirect_count,
1330            max_sampler_lod_bias: limits.max_sampler_lod_bias,
1331            max_sampler_anisotropy: limits.max_sampler_anisotropy,
1332            max_viewports: limits.max_viewports,
1333            max_viewport_dimensions: limits.max_viewport_dimensions,
1334            viewport_bounds_range: limits.viewport_bounds_range,
1335            viewport_sub_pixel_bits: limits.viewport_sub_pixel_bits,
1336            min_memory_map_alignment: limits.min_memory_map_alignment,
1337            min_texel_buffer_offset_alignment: limits.min_texel_buffer_offset_alignment,
1338            min_uniform_buffer_offset_alignment: limits.min_uniform_buffer_offset_alignment,
1339            min_storage_buffer_offset_alignment: limits.min_storage_buffer_offset_alignment,
1340            min_texel_offset: limits.min_texel_offset,
1341            max_texel_offset: limits.max_texel_offset,
1342            min_texel_gather_offset: limits.min_texel_gather_offset,
1343            max_texel_gather_offset: limits.max_texel_gather_offset,
1344            min_interpolation_offset: limits.min_interpolation_offset,
1345            max_interpolation_offset: limits.max_interpolation_offset,
1346            sub_pixel_interpolation_offset_bits: limits.sub_pixel_interpolation_offset_bits,
1347            max_framebuffer_width: limits.max_framebuffer_width,
1348            max_framebuffer_height: limits.max_framebuffer_height,
1349            max_framebuffer_layers: limits.max_framebuffer_layers,
1350            framebuffer_color_sample_counts: limits.framebuffer_color_sample_counts,
1351            framebuffer_depth_sample_counts: limits.framebuffer_depth_sample_counts,
1352            framebuffer_stencil_sample_counts: limits.framebuffer_stencil_sample_counts,
1353            framebuffer_no_attachments_sample_counts: limits
1354                .framebuffer_no_attachments_sample_counts,
1355            max_color_attachments: limits.max_color_attachments,
1356            sampled_image_color_sample_counts: limits.sampled_image_color_sample_counts,
1357            sampled_image_integer_sample_counts: limits.sampled_image_integer_sample_counts,
1358            sampled_image_depth_sample_counts: limits.sampled_image_depth_sample_counts,
1359            sampled_image_stencil_sample_counts: limits.sampled_image_stencil_sample_counts,
1360            storage_image_sample_counts: limits.storage_image_sample_counts,
1361            max_sample_mask_words: limits.max_sample_mask_words,
1362            timestamp_compute_and_graphics: limits.timestamp_compute_and_graphics == vk::TRUE,
1363            timestamp_period: limits.timestamp_period,
1364            max_clip_distances: limits.max_clip_distances,
1365            max_cull_distances: limits.max_cull_distances,
1366            max_combined_clip_and_cull_distances: limits.max_combined_clip_and_cull_distances,
1367            discrete_queue_priorities: limits.discrete_queue_priorities,
1368            point_size_range: limits.point_size_range,
1369            line_width_range: limits.line_width_range,
1370            point_size_granularity: limits.point_size_granularity,
1371            line_width_granularity: limits.line_width_granularity,
1372            strict_lines: limits.strict_lines == vk::TRUE,
1373            standard_sample_locations: limits.standard_sample_locations == vk::TRUE,
1374            optimal_buffer_copy_offset_alignment: limits.optimal_buffer_copy_offset_alignment,
1375            optimal_buffer_copy_row_pitch_alignment: limits.optimal_buffer_copy_row_pitch_alignment,
1376            non_coherent_atom_size: limits.non_coherent_atom_size,
1377        }
1378    }
1379}
1380
1381/// Description of Vulkan 1.0 properties.
1382///
1383/// See
1384/// [`VkPhysicalDeviceProperties`](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceProperties.html)
1385/// manual page.
1386#[derive(Debug)]
1387pub struct Vulkan10Properties {
1388    /// The version of Vulkan supported by the device, encoded as described
1389    /// [here](https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#extendingvulkan-coreversions-versionnumbers).
1390    pub api_version: u32,
1391
1392    /// The vendor-specified version of the driver.
1393    pub driver_version: u32,
1394
1395    /// A unique identifier for the vendor (see
1396    /// [note](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceProperties.html#_description))
1397    /// of the physical device.
1398    pub vendor_id: u32,
1399
1400    /// A unique identifier for the physical device among devices available from the vendor.
1401    pub device_id: u32,
1402
1403    /// a
1404    /// [VkPhysicalDeviceType](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceType.html)
1405    /// specifying the type of device.
1406    pub device_type: vk::PhysicalDeviceType,
1407
1408    /// A UTF-8 string which is the name of the device.
1409    pub device_name: String,
1410
1411    /// An array of VK_UUID_SIZE `u8` values representing a universally unique identifier for the
1412    /// device.
1413    pub pipeline_cache_uuid: [u8; vk::UUID_SIZE],
1414
1415    /// The [`Vulkan10Limits`] structure specifying device-specific limits of the physical device.
1416    /// See
1417    /// [Limits](https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#limits)
1418    /// for details.
1419    pub limits: Vulkan10Limits,
1420    // Unsupported (sparse residency):
1421    // pub sparse_properties: vk::PhysicalDeviceSparseProperties,
1422}
1423
1424impl From<vk::PhysicalDeviceProperties> for Vulkan10Properties {
1425    fn from(properties: vk::PhysicalDeviceProperties) -> Self {
1426        Self {
1427            api_version: properties.api_version,
1428            driver_version: properties.driver_version,
1429            vendor_id: properties.vendor_id,
1430            device_id: properties.device_id,
1431            device_type: properties.device_type,
1432            device_name: vk_cstr_to_string_lossy(&properties.device_name),
1433            pipeline_cache_uuid: properties.pipeline_cache_uuid,
1434            limits: properties.limits.into(),
1435        }
1436    }
1437}
1438
1439/// Description of Vulkan 1.1 features.
1440///
1441/// See
1442/// [`VkPhysicalDeviceVulkan11Features`](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceVulkan11Features.html)
1443/// manual page.
1444#[derive(Debug)]
1445pub struct Vulkan11Features {
1446    /// Specifies whether objects in the StorageBuffer, ShaderRecordBufferKHR, or
1447    /// PhysicalStorageBuffer storage class with the Block decoration can have 16-bit integer and
1448    /// 16-bit floating-point members.
1449    ///
1450    /// If this feature is not enabled, 16-bit integer or 16-bit floating-point members must not be
1451    /// used in such objects. This also specifies whether shader modules can declare the
1452    /// StorageBuffer16BitAccess capability.
1453    pub storage_buffer16_bit_access: bool,
1454
1455    /// Specifies whether objects in the Uniform storage class with the Block decoration can have
1456    /// 16-bit integer and 16-bit floating-point members.
1457    ///
1458    /// If this feature is not enabled, 16-bit integer or 16-bit floating-point members must not be
1459    /// used in such objects. This also specifies whether shader modules can declare the
1460    /// UniformAndStorageBuffer16BitAccess capability.
1461    pub uniform_and_storage_buffer16_bit_access: bool,
1462
1463    /// Specifies whether objects in the PushConstant storage class can have 16-bit integer and
1464    /// 16-bit floating-point members.
1465    ///
1466    /// If this feature is not enabled, 16-bit integer or floating-point members must not be used in
1467    /// such objects. This also specifies whether shader modules can declare the
1468    /// StoragePushConstant16 capability.
1469    pub storage_push_constant16: bool,
1470
1471    /// Specifies whether objects in the Input and Output storage classes can have 16-bit integer
1472    /// and 16-bit floating-point members.
1473    ///
1474    /// If this feature is not enabled, 16-bit integer or 16-bit floating-point members must not be
1475    /// used in such objects. This also specifies whether shader modules can declare the
1476    /// StorageInputOutput16 capability.
1477    pub storage_input_output16: bool,
1478
1479    /// Specifies whether the implementation supports multiview rendering within a render pass.
1480    ///
1481    /// If this feature is not enabled, the view mask of each subpass must always be zero.
1482    pub multiview: bool,
1483
1484    /// Specifies whether the implementation supports multiview rendering within a render pass, with
1485    /// geometry shaders.
1486    ///
1487    /// If this feature is not enabled, then a pipeline compiled against a subpass with a non-zero
1488    /// view mask must not include a geometry shader.
1489    pub multiview_geometry_shader: bool,
1490
1491    /// Specifies whether the implementation supports multiview rendering within a render pass, with
1492    /// tessellation shaders.
1493    ///
1494    /// If this feature is not enabled, then a pipeline compiled against a subpass with a non-zero
1495    /// view mask must not include any tessellation shaders.
1496    pub multiview_tessellation_shader: bool,
1497
1498    /// Specifies whether the implementation supports the SPIR-V VariablePointersStorageBuffer
1499    /// capability.
1500    ///
1501    /// When this feature is not enabled, shader modules must not declare the
1502    /// SPV_KHR_variable_pointers extension or the VariablePointersStorageBuffer capability.
1503    pub variable_pointers_storage_buffer: bool,
1504
1505    /// Specifies whether the implementation supports the SPIR-V VariablePointers capability.
1506    ///
1507    /// When this feature is not enabled, shader modules must not declare the VariablePointers
1508    /// capability.
1509    pub variable_pointers: bool,
1510
1511    /// Specifies whether protected memory is supported.
1512    pub protected_memory: bool,
1513
1514    /// Specifies whether the implementation supports sampler Y′CBCR conversion.
1515    ///
1516    /// If `sampler_ycbcr_conversion` is `false`, sampler Y′CBCR conversion is not supported, and
1517    /// samplers using sampler Y′CBCR conversion must not be used.
1518    pub sampler_ycbcr_conversion: bool,
1519
1520    /// Specifies whether the implementation supports the SPIR-V DrawParameters capability.
1521    ///
1522    /// When this feature is not enabled, shader modules must not declare the
1523    /// SPV_KHR_shader_draw_parameters extension or the DrawParameters capability.
1524    pub shader_draw_parameters: bool,
1525}
1526
1527impl From<vk::PhysicalDeviceVulkan11Features<'_>> for Vulkan11Features {
1528    fn from(features: vk::PhysicalDeviceVulkan11Features<'_>) -> Self {
1529        Self {
1530            storage_buffer16_bit_access: features.storage_buffer16_bit_access == vk::TRUE,
1531            uniform_and_storage_buffer16_bit_access: features
1532                .uniform_and_storage_buffer16_bit_access
1533                == vk::TRUE,
1534            storage_push_constant16: features.storage_push_constant16 == vk::TRUE,
1535            storage_input_output16: features.storage_input_output16 == vk::TRUE,
1536            multiview: features.multiview == vk::TRUE,
1537            multiview_geometry_shader: features.multiview_geometry_shader == vk::TRUE,
1538            multiview_tessellation_shader: features.multiview_tessellation_shader == vk::TRUE,
1539            variable_pointers_storage_buffer: features.variable_pointers_storage_buffer == vk::TRUE,
1540            variable_pointers: features.variable_pointers == vk::TRUE,
1541            protected_memory: features.protected_memory == vk::TRUE,
1542            sampler_ycbcr_conversion: features.sampler_ycbcr_conversion == vk::TRUE,
1543            shader_draw_parameters: features.shader_draw_parameters == vk::TRUE,
1544        }
1545    }
1546}
1547
1548/// Description of Vulkan 1.1 properties.
1549///
1550/// See
1551/// [`VkPhysicalDeviceVulkan11Properties`](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceVulkan11Properties.html)
1552/// manual page.
1553#[derive(Debug)]
1554pub struct Vulkan11Properties {
1555    /// An array of `VK_UUID_SIZE` `u8` values representing a universally unique identifier for
1556    /// the device
1557    pub device_uuid: [u8; vk::UUID_SIZE],
1558
1559    /// An array of `VK_UUID_SIZE` `u8` values representing a universally unique identifier for the
1560    /// driver build in use by the device.
1561    pub driver_uuid: [u8; vk::UUID_SIZE],
1562
1563    /// An array of `VK_LUID_SIZE` `u8` values representing a locally unique identifier for the
1564    /// device
1565    pub device_luid: [u8; vk::LUID_SIZE],
1566
1567    /// A `u32` bitfield identifying the node within a linked device adapter corresponding to the
1568    /// device.
1569    pub device_node_mask: u32,
1570
1571    /// A `bool` value that will be `true` if `device_luid` contains a valid LUID and
1572    /// `device_node_mask` contains a valid node mask, and `false` if they do not.
1573    pub device_luid_valid: bool,
1574
1575    /// The default number of invocations in each subgroup. `subgroup_size` is at least `1` if any
1576    /// of the physical device’s queues support `VK_QUEUE_GRAPHICS_BIT` or `VK_QUEUE_COMPUTE_BIT`.
1577    /// `subgroup_size` is a power-of-two.
1578    pub subgroup_size: u32,
1579
1580    /// A bitfield of `vk::ShaderStageFlagBits` describing the shader stages that group operations
1581    /// with subgroup scope are supported in. `subgroup_supported_stages` will have the
1582    /// `VK_SHADER_STAGE_COMPUTE_BIT` bit set if any of the physical device’s queues support
1583    /// `VK_QUEUE_COMPUTE_BIT`.
1584    pub subgroup_supported_stages: vk::ShaderStageFlags,
1585
1586    /// A bitmask of `vk::SubgroupFeatureFlagBits` specifying the sets of group operations with
1587    /// subgroup scope supported on this device. `subgroup_supported_operations` will have the
1588    /// `VK_SUBGROUP_FEATURE_BASIC_BIT` bit set if any of the physical device’s queues support
1589    /// `VK_QUEUE_GRAPHICS_BIT` or `VK_QUEUE_COMPUTE_BIT`.
1590    pub subgroup_supported_operations: vk::SubgroupFeatureFlags,
1591
1592    /// A `bool` specifying whether quad group operations are available in all stages, or are
1593    /// restricted to fragment and compute stages.
1594    pub subgroup_quad_operations_in_all_stages: bool,
1595
1596    /// A `vk::PointClippingBehavior` value specifying the point clipping behavior supported by the
1597    /// implementation.
1598    pub point_clipping_behavior: vk::PointClippingBehavior,
1599
1600    /// `max_multiview_view_count` is one greater than the maximum view index that can be used in a
1601    /// subpass.
1602    pub max_multiview_view_count: u32,
1603
1604    /// The maximum valid value of instance index allowed to be generated by a drawing command
1605    /// recorded within a subpass of a multiview render pass instance.
1606    pub max_multiview_instance_index: u32,
1607
1608    /// Specifies how an implementation behaves when an application attempts to write to unprotected
1609    /// memory in a protected queue operation, read from protected memory in an unprotected queue
1610    /// operation, or perform a query in a protected queue operation.
1611    ///
1612    /// If this limit is `true`, such writes will be discarded or have undefined values written,
1613    /// reads and queries will return undefined values.
1614    ///
1615    /// If this limit is `false`, applications must not perform these operations.
1616    ///
1617    /// See [memory-protected-access-rules](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceVulkan11Properties.html#memory-protected-access-rules)
1618    /// for more information.
1619    pub protected_no_fault: bool,
1620
1621    /// A maximum number of descriptors (summed over all descriptor types) in a single descriptor
1622    /// set that is guaranteed to satisfy any implementation-dependent constraints on the size of a
1623    /// descriptor set itself.
1624    ///
1625    /// Applications can query whether a descriptor set that goes beyond this limit is supported
1626    /// using `vkGetDescriptorSetLayoutSupport`.
1627    pub max_per_set_descriptors: u32,
1628
1629    /// The maximum size of a memory allocation that can be created, even if there is more space
1630    /// available in the heap.
1631    pub max_memory_allocation_size: vk::DeviceSize,
1632}
1633
1634impl From<vk::PhysicalDeviceVulkan11Properties<'_>> for Vulkan11Properties {
1635    fn from(props: vk::PhysicalDeviceVulkan11Properties<'_>) -> Self {
1636        Self {
1637            device_uuid: props.device_uuid,
1638            driver_uuid: props.driver_uuid,
1639            device_luid: props.device_luid,
1640            device_node_mask: props.device_node_mask,
1641            device_luid_valid: props.device_luid_valid == vk::TRUE,
1642            subgroup_size: props.subgroup_size,
1643            subgroup_supported_stages: props.subgroup_supported_stages,
1644            subgroup_supported_operations: props.subgroup_supported_operations,
1645            subgroup_quad_operations_in_all_stages: props.subgroup_quad_operations_in_all_stages
1646                == vk::TRUE,
1647            point_clipping_behavior: props.point_clipping_behavior,
1648            max_multiview_view_count: props.max_multiview_view_count,
1649            max_multiview_instance_index: props.max_multiview_instance_index,
1650            protected_no_fault: props.protected_no_fault == vk::TRUE,
1651            max_per_set_descriptors: props.max_per_set_descriptors,
1652            max_memory_allocation_size: props.max_memory_allocation_size,
1653        }
1654    }
1655}
1656
1657/// Description of Vulkan 1.2 features.
1658///
1659/// See
1660/// [`VkPhysicalDeviceVulkan12Features`](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceVulkan12Features.html)
1661/// manual page.
1662#[derive(Debug)]
1663pub struct Vulkan12Features {
1664    /// Indicates whether the implementation supports the
1665    /// `VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE` sampler address mode.
1666    ///
1667    /// If this feature is not enabled, the `VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE` sampler
1668    /// address mode must not be used.
1669    pub sampler_mirror_clamp_to_edge: bool,
1670
1671    /// Indicates whether the implementation supports the vkCmdDrawIndirectCount and
1672    /// vkCmdDrawIndexedIndirectCount functions.
1673    ///
1674    /// If this feature is not enabled, these functions must not be used.
1675    pub draw_indirect_count: bool,
1676
1677    /// Indicates whether objects in the StorageBuffer, ShaderRecordBufferKHR, or
1678    /// PhysicalStorageBuffer storage class with the Block decoration can have 8-bit integer
1679    /// members.
1680    ///
1681    /// If this feature is not enabled, 8-bit integer members must not be used in such objects. This
1682    /// also indicates whether shader modules can declare the StorageBuffer8BitAccess capability.
1683    pub storage_buffer8_bit_access: bool,
1684
1685    /// Indicates whether objects in the Uniform storage class with the Block decoration can have
1686    /// 8-bit integer members.
1687    ///
1688    /// If this feature is not enabled, 8-bit integer members must not be used in such objects. This
1689    /// also indicates whether shader modules can declare the UniformAndStorageBuffer8BitAccess
1690    /// capability.
1691    pub uniform_and_storage_buffer8_bit_access: bool,
1692
1693    /// Indicates whether objects in the PushConstant storage class can have 8-bit integer members.
1694    ///
1695    /// If this feature is not enabled, 8-bit integer members must not be used in such objects. This
1696    /// also indicates whether shader modules can declare the StoragePushConstant8 capability.
1697    pub storage_push_constant8: bool,
1698
1699    /// Indicates whether shaders can perform 64-bit unsigned and signed integer atomic operations
1700    /// on buffers.
1701    pub shader_buffer_int64_atomics: bool,
1702
1703    /// Indicates whether shaders can perform 64-bit unsigned and signed integer atomic operations
1704    /// on shared and payload memory.
1705    pub shader_shared_int64_atomics: bool,
1706
1707    /// Indicates whether 16-bit floats (halfs) are supported in shader code.
1708    ///
1709    /// This also indicates whether shader modules can declare the Float16 capability. However, this
1710    /// only enables a subset of the storage classes that SPIR-V allows for the Float16 SPIR-V
1711    /// capability: Declaring and using 16-bit floats in the Private, Workgroup (for non-Block
1712    /// variables), and Function storage classes is enabled, while declaring them in the interface
1713    /// storage classes (e.g., UniformConstant, Uniform, StorageBuffer, Input, Output, and
1714    /// PushConstant) is not enabled.
1715    pub shader_float16: bool,
1716
1717    /// Indicates whether 8-bit integers (signed and unsigned) are supported in shader code.
1718    ///
1719    /// This also indicates whether shader modules can declare the Int8 capability. However, this
1720    /// only enables a subset of the storage classes that SPIR-V allows for the Int8 SPIR-V
1721    /// capability: Declaring and using 8-bit integers in the Private, Workgroup (for non-Block
1722    /// variables), and Function storage classes is enabled, while declaring them in the interface
1723    /// storage classes (e.g., UniformConstant, Uniform, StorageBuffer, Input, Output, and
1724    /// PushConstant) is not enabled.
1725    pub shader_int8: bool,
1726
1727    /// Indicates whether the implementation supports the minimum set of descriptor indexing
1728    /// features as described in the [Feature Requirements] section. Enabling the descriptorIndexing
1729    /// member when vkCreateDevice is called does not imply the other minimum descriptor indexing
1730    /// features are also enabled. Those other descriptor indexing features must be enabled
1731    /// individually as needed by the application.
1732    ///
1733    /// [Feature Requirements]: https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-requirements
1734    pub descriptor_indexing: bool,
1735
1736    /// Indicates whether arrays of input attachments can be indexed by dynamically uniform integer
1737    /// expressions in shader code.
1738    ///
1739    /// If this feature is not enabled, resources with a descriptor type of
1740    /// VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT must be indexed only by constant integral expressions
1741    /// when aggregated into arrays in shader code. This also indicates whether shader modules can
1742    /// declare the InputAttachmentArrayDynamicIndexing capability.
1743    pub shader_input_attachment_array_dynamic_indexing: bool,
1744
1745    /// Indicates whether arrays of uniform texel buffers can be indexed by dynamically uniform
1746    /// integer expressions in shader code.
1747    ///
1748    /// If this feature is not enabled, resources with a descriptor type of
1749    /// VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER must be indexed only by constant integral
1750    /// expressions when aggregated into arrays in shader code. This also indicates whether shader
1751    /// modules can declare the UniformTexelBufferArrayDynamicIndexing capability.
1752    pub shader_uniform_texel_buffer_array_dynamic_indexing: bool,
1753
1754    /// Indicates whether arrays of storage texel buffers can be indexed by dynamically uniform
1755    /// integer expressions in shader code.
1756    ///
1757    /// If this feature is not enabled, resources with a descriptor type of
1758    /// VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER must be indexed only by constant integral
1759    /// expressions when aggregated into arrays in shader code. This also indicates whether shader
1760    /// modules can declare the StorageTexelBufferArrayDynamicIndexing capability.
1761    pub shader_storage_texel_buffer_array_dynamic_indexing: bool,
1762
1763    /// Indicates whether arrays of uniform buffers can be indexed by non-uniform integer
1764    /// expressions in shader code.
1765    ///
1766    /// If this feature is not enabled, resources with a descriptor type of
1767    /// VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER or VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC must not be
1768    /// indexed by non-uniform integer expressions when aggregated into arrays in shader code. This
1769    /// also indicates whether shader modules can declare the UniformBufferArrayNonUniformIndexing
1770    /// capability.
1771    pub shader_uniform_buffer_array_non_uniform_indexing: bool,
1772
1773    /// Indicates whether arrays of samplers or sampled images can be indexed by non-uniform integer
1774    /// expressions in shader code.
1775    ///
1776    /// If this feature is not enabled, resources with a descriptor type of
1777    /// VK_DESCRIPTOR_TYPE_SAMPLER, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, or
1778    /// VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE must not be indexed by non-uniform integer expressions when
1779    /// aggregated into arrays in shader code. This also indicates whether shader modules can
1780    /// declare the SampledImageArrayNonUniformIndexing capability.
1781    pub shader_sampled_image_array_non_uniform_indexing: bool,
1782
1783    /// Indicates whether arrays of storage buffers can be indexed by non-uniform integer
1784    /// expressions in shader code.
1785    ///
1786    /// If this feature is not enabled, resources with a descriptor type of
1787    /// VK_DESCRIPTOR_TYPE_STORAGE_BUFFER or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC must not be
1788    /// indexed by non-uniform integer expressions when aggregated into arrays in shader code. This
1789    /// also indicates whether shader modules can declare the StorageBufferArrayNonUniformIndexing
1790    /// capability.
1791    pub shader_storage_buffer_array_non_uniform_indexing: bool,
1792
1793    /// Indicates whether arrays of storage images can be indexed by non-uniform integer expressions
1794    /// in shader code.
1795    ///
1796    /// If this feature is not enabled, resources with a descriptor type of
1797    /// VK_DESCRIPTOR_TYPE_STORAGE_IMAGE must not be indexed by non-uniform integer expressions when
1798    /// aggregated into arrays in shader code. This also indicates whether shader modules can
1799    /// declare the StorageImageArrayNonUniformIndexing capability.
1800    pub shader_storage_image_array_non_uniform_indexing: bool,
1801
1802    /// Indicates whether arrays of input attachments can be indexed by non-uniform integer
1803    /// expressions in shader code.
1804    ///
1805    /// If this feature is not enabled, resources with a descriptor type of
1806    /// VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT must not be indexed by non-uniform integer expressions
1807    /// when aggregated into arrays in shader code. This also indicates whether shader modules can
1808    /// declare the InputAttachmentArrayNonUniformIndexing capability.
1809    pub shader_input_attachment_array_non_uniform_indexing: bool,
1810
1811    /// Indicates whether arrays of uniform texel buffers can be indexed by non-uniform integer
1812    /// expressions in shader code.
1813    ///
1814    /// If this feature is not enabled, resources with a descriptor type of
1815    /// VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER must not be indexed by non-uniform integer
1816    /// expressions when aggregated into arrays in shader code. This also indicates whether shader
1817    /// modules can declare the UniformTexelBufferArrayNonUniformIndexing capability.
1818    pub shader_uniform_texel_buffer_array_non_uniform_indexing: bool,
1819
1820    /// Indicates whether arrays of storage texel buffers can be indexed by non-uniform integer
1821    /// expressions in shader code.
1822    ///
1823    /// If this feature is not enabled, resources with a descriptor type of
1824    /// VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER must not be indexed by non-uniform integer
1825    /// expressions when aggregated into arrays in shader code. This also indicates whether shader
1826    /// modules can declare the StorageTexelBufferArrayNonUniformIndexing capability.
1827    pub shader_storage_texel_buffer_array_non_uniform_indexing: bool,
1828
1829    /// Indicates whether the implementation supports updating uniform buffer descriptors after a
1830    /// set is bound.
1831    ///
1832    /// If this feature is not enabled, VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT must not be used
1833    /// with VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER.
1834    pub descriptor_binding_uniform_buffer_update_after_bind: bool,
1835
1836    /// Indicates whether the implementation supports updating sampled image descriptors after a set
1837    /// is bound.
1838    ///
1839    /// If this feature is not enabled, VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT must not be used
1840    /// with VK_DESCRIPTOR_TYPE_SAMPLER, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, or
1841    /// VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE.
1842    pub descriptor_binding_sampled_image_update_after_bind: bool,
1843
1844    /// Indicates whether the implementation supports updating storage image descriptors after a set
1845    /// is bound.
1846    ///
1847    /// If this feature is not enabled, VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT must not be used
1848    /// with VK_DESCRIPTOR_TYPE_STORAGE_IMAGE.
1849    pub descriptor_binding_storage_image_update_after_bind: bool,
1850
1851    /// Indicates whether the implementation supports updating storage buffer descriptors after a
1852    /// set is bound.
1853    ///
1854    /// If this feature is not enabled, VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT must not be used
1855    /// with VK_DESCRIPTOR_TYPE_STORAGE_BUFFER.
1856    pub descriptor_binding_storage_buffer_update_after_bind: bool,
1857
1858    /// Indicates whether the implementation supports updating uniform texel buffer descriptors
1859    /// after a set is bound.
1860    ///
1861    /// If this feature is not enabled, VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT must not be used
1862    /// with VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER.
1863    pub descriptor_binding_uniform_texel_buffer_update_after_bind: bool,
1864
1865    /// Indicates whether the implementation supports updating storage texel buffer descriptors
1866    /// after a set is bound.
1867    ///
1868    /// If this feature is not enabled, VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT must not be used
1869    /// with VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER.
1870    pub descriptor_binding_storage_texel_buffer_update_after_bind: bool,
1871
1872    /// Indicates whether the implementation supports updating descriptors while the set is in use.
1873    ///
1874    /// If this feature is not enabled, VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT must
1875    /// not be used.
1876    pub descriptor_binding_update_unused_while_pending: bool,
1877
1878    /// Indicates whether the implementation supports statically using a descriptor set binding in
1879    /// which some descriptors are not valid. If this feature is not enabled,
1880    /// VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT must not be used.
1881    pub descriptor_binding_partially_bound: bool,
1882
1883    /// Indicates whether the implementation supports descriptor sets with a variable-sized last
1884    /// binding. If this feature is not enabled, VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT
1885    /// must not be used.
1886    pub descriptor_binding_variable_descriptor_count: bool,
1887
1888    /// Indicates whether the implementation supports the SPIR-V RuntimeDescriptorArray capability.
1889    ///
1890    /// If this feature is not enabled, descriptors must not be declared in runtime arrays.
1891    pub runtime_descriptor_array: bool,
1892
1893    /// Indicates whether the implementation supports a minimum set of required formats supporting
1894    /// min/max filtering as defined by the filterMinmaxSingleComponentFormats property minimum
1895    /// requirements.
1896    ///
1897    /// If this feature is not enabled, then VkSamplerReductionModeCreateInfo must only use
1898    /// VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE.
1899    pub sampler_filter_minmax: bool,
1900
1901    /// Indicates that the implementation supports the layout of resource blocks in shaders using
1902    /// scalar alignment.
1903    pub scalar_block_layout: bool,
1904
1905    /// Indicates that the implementation supports specifying the image view for attachments at
1906    /// render pass begin time via VkRenderPassAttachmentBeginInfo.
1907    pub imageless_framebuffer: bool,
1908
1909    /// Indicates that the implementation supports the same layouts for uniform buffers as for
1910    /// storage and other kinds of buffers.
1911    ///
1912    /// See [Standard Buffer Layout].
1913    ///
1914    /// [Standard Buffer Layout]: https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#interfaces-resources-layout
1915    pub uniform_buffer_standard_layout: bool,
1916
1917    /// A boolean specifying whether subgroup operations can use 8-bit integer, 16-bit integer,
1918    /// 64-bit integer, 16-bit floating-point, and vectors of these types in group operations with
1919    /// subgroup scope, if the implementation supports the types.
1920    pub shader_subgroup_extended_types: bool,
1921
1922    /// Indicates whether the implementation supports a VkImageMemoryBarrier for a depth/stencil
1923    /// image with only one of VK_IMAGE_ASPECT_DEPTH_BIT or VK_IMAGE_ASPECT_STENCIL_BIT set, and
1924    /// whether VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL,
1925    /// VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, or VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL can
1926    /// be used.
1927    pub separate_depth_stencil_layouts: bool,
1928
1929    /// Indicates that the implementation supports resetting queries from the host with
1930    /// vkResetQueryPool.
1931    pub host_query_reset: bool,
1932
1933    /// Indicates whether semaphores created with a VkSemaphoreType of VK_SEMAPHORE_TYPE_TIMELINE
1934    /// are supported.
1935    pub timeline_semaphore: bool,
1936
1937    /// Indicates that the implementation supports accessing buffer memory in shaders as storage
1938    /// buffers via an address queried from vkGetBufferDeviceAddress.
1939    pub buffer_device_address: bool,
1940
1941    /// Indicates that the implementation supports saving and reusing buffer and device addresses,
1942    /// e.g. for trace capture and replay.
1943    pub buffer_device_address_capture_replay: bool,
1944
1945    /// Indicates that the implementation supports the bufferDeviceAddress, rayTracingPipeline and
1946    /// rayQuery features for logical devices created with multiple physical devices.
1947    ///
1948    /// If this feature is not supported, buffer and acceleration structure addresses must not be
1949    /// queried on a logical device created with more than one physical device.
1950    pub buffer_device_address_multi_device: bool,
1951
1952    /// Indicates whether the [Vulkan Memory Model] is supported.
1953    ///
1954    /// This also indicates whether shader modules can declare the VulkanMemoryModel capability.
1955    ///
1956    /// [Vulkan Memory Model]: https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#memory-model
1957    pub vulkan_memory_model: bool,
1958
1959    /// Indicates whether the [Vulkan Memory Model] can use Device scope synchronization.
1960    ///
1961    /// This also indicates whether shader modules can declare the VulkanMemoryModelDeviceScope
1962    /// capability.
1963    ///
1964    /// [Vulkan Memory Model]: https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#memory-model
1965    pub vulkan_memory_model_device_scope: bool,
1966
1967    /// Indicates whether the [Vulkan Memory Model] can use availability and visibility chains with
1968    /// more than one element.
1969    ///
1970    /// [Vulkan Memory Model]: https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#memory-model
1971    pub vulkan_memory_model_availability_visibility_chains: bool,
1972
1973    /// Indicates whether the implementation supports the ShaderViewportIndex SPIR-V capability
1974    /// enabling variables decorated with the ViewportIndex built-in to be exported from mesh,
1975    /// vertex or tessellation evaluation shaders.
1976    ///
1977    /// If this feature is not enabled, the ViewportIndex built-in decoration must not be used on
1978    /// outputs in mesh, vertex or tessellation evaluation shaders.
1979    pub shader_output_viewport_index: bool,
1980
1981    /// Indicates whether the implementation supports the ShaderLayer SPIR-V capability enabling
1982    /// variables decorated with the Layer built-in to be exported from mesh, vertex or tessellation
1983    /// evaluation shaders.
1984    ///
1985    /// If this feature is not enabled, the Layer built-in decoration must not be used on outputs in
1986    /// mesh, vertex or tessellation evaluation shaders.
1987    pub shader_output_layer: bool,
1988
1989    /// If `true`, the “Id” operand of OpGroupNonUniformBroadcast can be dynamically uniform within
1990    /// a subgroup, and the “Index” operand of OpGroupNonUniformQuadBroadcast can be dynamically
1991    /// uniform within the derivative group.
1992    ///
1993    /// If `false`, these operands must be constants.
1994    pub subgroup_broadcast_dynamic_id: bool,
1995}
1996
1997impl From<vk::PhysicalDeviceVulkan12Features<'_>> for Vulkan12Features {
1998    fn from(features: vk::PhysicalDeviceVulkan12Features<'_>) -> Self {
1999        Self {
2000            sampler_mirror_clamp_to_edge: features.sampler_mirror_clamp_to_edge == vk::TRUE,
2001            draw_indirect_count: features.draw_indirect_count == vk::TRUE,
2002            storage_buffer8_bit_access: features.storage_buffer8_bit_access == vk::TRUE,
2003            uniform_and_storage_buffer8_bit_access: features.uniform_and_storage_buffer8_bit_access
2004                == vk::TRUE,
2005            storage_push_constant8: features.storage_push_constant8 == vk::TRUE,
2006            shader_buffer_int64_atomics: features.shader_buffer_int64_atomics == vk::TRUE,
2007            shader_shared_int64_atomics: features.shader_shared_int64_atomics == vk::TRUE,
2008            shader_float16: features.shader_float16 == vk::TRUE,
2009            shader_int8: features.shader_int8 == vk::TRUE,
2010            descriptor_indexing: features.descriptor_indexing == vk::TRUE,
2011            shader_input_attachment_array_dynamic_indexing: features
2012                .shader_input_attachment_array_dynamic_indexing
2013                == vk::TRUE,
2014            shader_uniform_texel_buffer_array_dynamic_indexing: features
2015                .shader_uniform_texel_buffer_array_dynamic_indexing
2016                == vk::TRUE,
2017            shader_storage_texel_buffer_array_dynamic_indexing: features
2018                .shader_storage_texel_buffer_array_dynamic_indexing
2019                == vk::TRUE,
2020            shader_uniform_buffer_array_non_uniform_indexing: features
2021                .shader_uniform_buffer_array_non_uniform_indexing
2022                == vk::TRUE,
2023            shader_sampled_image_array_non_uniform_indexing: features
2024                .shader_sampled_image_array_non_uniform_indexing
2025                == vk::TRUE,
2026            shader_storage_buffer_array_non_uniform_indexing: features
2027                .shader_storage_buffer_array_non_uniform_indexing
2028                == vk::TRUE,
2029            shader_storage_image_array_non_uniform_indexing: features
2030                .shader_storage_image_array_non_uniform_indexing
2031                == vk::TRUE,
2032            shader_input_attachment_array_non_uniform_indexing: features
2033                .shader_input_attachment_array_non_uniform_indexing
2034                == vk::TRUE,
2035            shader_uniform_texel_buffer_array_non_uniform_indexing: features
2036                .shader_uniform_texel_buffer_array_non_uniform_indexing
2037                == vk::TRUE,
2038            shader_storage_texel_buffer_array_non_uniform_indexing: features
2039                .shader_storage_texel_buffer_array_non_uniform_indexing
2040                == vk::TRUE,
2041            descriptor_binding_uniform_buffer_update_after_bind: features
2042                .descriptor_binding_uniform_buffer_update_after_bind
2043                == vk::TRUE,
2044            descriptor_binding_sampled_image_update_after_bind: features
2045                .descriptor_binding_sampled_image_update_after_bind
2046                == vk::TRUE,
2047            descriptor_binding_storage_image_update_after_bind: features
2048                .descriptor_binding_storage_image_update_after_bind
2049                == vk::TRUE,
2050            descriptor_binding_storage_buffer_update_after_bind: features
2051                .descriptor_binding_storage_buffer_update_after_bind
2052                == vk::TRUE,
2053            descriptor_binding_uniform_texel_buffer_update_after_bind: features
2054                .descriptor_binding_uniform_texel_buffer_update_after_bind
2055                == vk::TRUE,
2056            descriptor_binding_storage_texel_buffer_update_after_bind: features
2057                .descriptor_binding_storage_texel_buffer_update_after_bind
2058                == vk::TRUE,
2059            descriptor_binding_update_unused_while_pending: features
2060                .descriptor_binding_update_unused_while_pending
2061                == vk::TRUE,
2062            descriptor_binding_partially_bound: features.descriptor_binding_partially_bound
2063                == vk::TRUE,
2064            descriptor_binding_variable_descriptor_count: features
2065                .descriptor_binding_variable_descriptor_count
2066                == vk::TRUE,
2067            runtime_descriptor_array: features.runtime_descriptor_array == vk::TRUE,
2068            sampler_filter_minmax: features.sampler_filter_minmax == vk::TRUE,
2069            scalar_block_layout: features.scalar_block_layout == vk::TRUE,
2070            imageless_framebuffer: features.imageless_framebuffer == vk::TRUE,
2071            uniform_buffer_standard_layout: features.uniform_buffer_standard_layout == vk::TRUE,
2072            shader_subgroup_extended_types: features.shader_subgroup_extended_types == vk::TRUE,
2073            separate_depth_stencil_layouts: features.separate_depth_stencil_layouts == vk::TRUE,
2074            host_query_reset: features.host_query_reset == vk::TRUE,
2075            timeline_semaphore: features.timeline_semaphore == vk::TRUE,
2076            buffer_device_address: features.buffer_device_address == vk::TRUE,
2077            buffer_device_address_capture_replay: features.buffer_device_address_capture_replay
2078                == vk::TRUE,
2079            buffer_device_address_multi_device: features.buffer_device_address_multi_device
2080                == vk::TRUE,
2081            vulkan_memory_model: features.vulkan_memory_model == vk::TRUE,
2082            vulkan_memory_model_device_scope: features.vulkan_memory_model_device_scope == vk::TRUE,
2083            vulkan_memory_model_availability_visibility_chains: features
2084                .vulkan_memory_model_availability_visibility_chains
2085                == vk::TRUE,
2086            shader_output_viewport_index: features.shader_output_viewport_index == vk::TRUE,
2087            shader_output_layer: features.shader_output_layer == vk::TRUE,
2088            subgroup_broadcast_dynamic_id: features.subgroup_broadcast_dynamic_id == vk::TRUE,
2089        }
2090    }
2091}
2092
2093/// Description of Vulkan 1.2 properties.
2094///
2095/// See
2096/// [`VkPhysicalDeviceVulkan12Properties`](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceVulkan12Properties.html)
2097/// manual page.
2098#[derive(Debug)]
2099pub struct Vulkan12Properties {
2100    /// A unique identifier for the driver of the physical device.
2101    pub driver_id: vk::DriverId,
2102
2103    /// An array of `VK_MAX_DRIVER_NAME_SIZE` char containing a null-terminated UTF-8 string which
2104    /// is the name of the driver.
2105    pub driver_name: String,
2106
2107    /// An array of `VK_MAX_DRIVER_INFO_SIZE` char containing a null-terminated UTF-8 string with
2108    /// additional information about the driver.
2109    pub driver_info: String,
2110
2111    /// The version of the Vulkan conformance test this driver is conformant against (see
2112    /// [`VkConformanceVersion`](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkConformanceVersion.html)).
2113    pub conformance_version: vk::ConformanceVersion,
2114
2115    /// A `vk::ShaderFloatControlsIndependence` value indicating whether, and how, denorm behavior
2116    /// can be set independently for different bit widths.
2117    pub denorm_behavior_independence: vk::ShaderFloatControlsIndependence,
2118
2119    /// A `vk::ShaderFloatControlsIndependence` value indicating whether, and how, rounding modes
2120    /// can be set independently for different bit widths.
2121    pub rounding_mode_independence: vk::ShaderFloatControlsIndependence,
2122
2123    /// A `bool` value indicating whether sign of a zero, Nans and ±∞ can be preserved in 16-bit
2124    /// floating-point computations.
2125    ///
2126    /// It also indicates whether the SignedZeroInfNanPreserve execution mode can be used for 16-bit
2127    /// floating-point types.
2128    pub shader_signed_zero_inf_nan_preserve_float16: bool,
2129
2130    /// A `bool` value indicating whether sign of a zero, Nans and ±∞ can be preserved in 32-bit
2131    /// floating-point computations.
2132    ///
2133    /// It also indicates whether the SignedZeroInfNanPreserve execution mode can be used for 32-bit
2134    /// floating-point types.
2135    pub shader_signed_zero_inf_nan_preserve_float32: bool,
2136
2137    /// A `bool` value indicating whether sign of a zero, Nans and ±∞ can be preserved in 64-bit
2138    /// floating-point computations.
2139    ///
2140    /// It also indicates whether the SignedZeroInfNanPreserve execution mode can be used for 64-bit
2141    /// floating-point types.
2142    pub shader_signed_zero_inf_nan_preserve_float64: bool,
2143
2144    /// A `bool` value indicating whether denormals can be preserved in 16-bit floating-point
2145    /// computations.
2146    ///
2147    /// It also indicates whether the DenormPreserve execution mode can be used for 16-bit
2148    /// floating-point types.
2149    pub shader_denorm_preserve_float16: bool,
2150
2151    /// A `bool` value indicating whether denormals can be preserved in 32-bit floating-point
2152    /// computations.
2153    ///
2154    /// It also indicates whether the DenormPreserve execution mode can be used for 32-bit
2155    /// floating-point types.
2156    pub shader_denorm_preserve_float32: bool,
2157
2158    /// A `bool` value indicating whether denormals can be preserved in 64-bit floating-point
2159    /// computations.
2160    ///
2161    /// It also indicates whether the DenormPreserve execution mode can be used for 64-bit
2162    /// floating-point types.
2163    pub shader_denorm_preserve_float64: bool,
2164
2165    /// A `bool` value indicating whether denormals can be flushed to zero in 16-bit floating-point
2166    /// computations.
2167    ///
2168    /// It also indicates whether the DenormFlushToZero execution mode can be used for 16-bit
2169    /// floating-point types.
2170    pub shader_denorm_flush_to_zero_float16: bool,
2171
2172    /// A `bool` value indicating whether denormals can be flushed to zero in 32-bit floating-point
2173    /// computations.
2174    ///
2175    /// It also indicates whether the DenormFlushToZero execution mode can be used for 32-bit
2176    /// floating-point types.
2177    pub shader_denorm_flush_to_zero_float32: bool,
2178
2179    /// A `bool` value indicating whether denormals can be flushed to zero in 64-bit floating-point
2180    /// computations.
2181    ///
2182    /// It also indicates whether the DenormFlushToZero execution mode can be used for 64-bit
2183    /// floating-point types.
2184    pub shader_denorm_flush_to_zero_float64: bool,
2185
2186    /// A `bool` value indicating whether an implementation supports the round-to-nearest-even
2187    /// rounding mode for 16-bit floating-point arithmetic and conversion instructions.
2188    ///
2189    /// It also indicates whether the RoundingModeRTE execution mode can be used for 16-bit
2190    /// floating-point types.
2191    pub shader_rounding_mode_rte_float16: bool,
2192
2193    /// A `bool` value indicating whether an implementation supports the round-to-nearest-even
2194    /// rounding mode for 32-bit floating-point arithmetic and conversion instructions.
2195    ///
2196    /// It also indicates whether the RoundingModeRTE execution mode can be used for 32-bit
2197    /// floating-point types.
2198    pub shader_rounding_mode_rte_float32: bool,
2199
2200    /// A `bool` value indicating whether an implementation supports the round-to-nearest-even
2201    /// rounding mode for 64-bit floating-point arithmetic and conversion instructions.
2202    ///
2203    /// It also indicates whether the RoundingModeRTE execution mode can be used for 64-bit
2204    /// floating-point types.
2205    pub shader_rounding_mode_rte_float64: bool,
2206
2207    /// A `bool` value indicating whether an implementation supports the round-towards-zero rounding
2208    /// mode for 16-bit floating-point arithmetic and conversion instructions.
2209    ///
2210    /// It also indicates whether the RoundingModeRTZ execution mode can be used for 16-bit
2211    /// floating-point types.
2212    pub shader_rounding_mode_rtz_float16: bool,
2213
2214    /// A `bool` value indicating whether an implementation supports the round-towards-zero rounding
2215    /// mode for 32-bit floating-point arithmetic and conversion instructions.
2216    ///
2217    /// It also indicates whether the RoundingModeRTZ execution mode can be used for 32-bit
2218    /// floating-point types.
2219    pub shader_rounding_mode_rtz_float32: bool,
2220
2221    /// A `bool` value indicating whether an implementation supports the round-towards-zero rounding
2222    /// mode for 64-bit floating-point arithmetic and conversion instructions.
2223    ///
2224    /// It also indicates whether the RoundingModeRTZ execution mode can be used for 64-bit
2225    /// floating-point types.
2226    pub shader_rounding_mode_rtz_float64: bool,
2227
2228    /// The maximum number of descriptors (summed over all descriptor types) that can be created
2229    /// across all pools that are created with the VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT
2230    /// bit set.
2231    ///
2232    /// Pool creation may fail when this limit is exceeded, or when the space this limit represents
2233    /// is unable to satisfy a pool creation due to fragmentation.
2234    pub max_update_after_bind_descriptors_in_all_pools: u32,
2235
2236    /// A `bool` value indicating whether uniform buffer descriptors natively support nonuniform
2237    /// indexing.
2238    ///
2239    /// If this is `false`, then a single dynamic instance of an instruction that nonuniformly
2240    /// indexes an array of uniform buffers may execute multiple times in order to access all the
2241    /// descriptors.
2242    pub shader_uniform_buffer_array_non_uniform_indexing_native: bool,
2243
2244    /// A `bool` value indicating whether sampler and image descriptors natively support nonuniform
2245    /// indexing.
2246    ///
2247    /// If this is `false`, then a single dynamic instance of an instruction that nonuniformly
2248    /// indexes an array of samplers or images may execute multiple times in order to access all the
2249    /// descriptors.
2250    pub shader_sampled_image_array_non_uniform_indexing_native: bool,
2251
2252    /// A `bool` value indicating whether storage buffer descriptors natively support nonuniform
2253    /// indexing.
2254    ///
2255    /// If this is `false`, then a single dynamic instance of an instruction that nonuniformly
2256    /// indexes an array of storage buffers may execute multiple times in order to access all the
2257    /// descriptors.
2258    pub shader_storage_buffer_array_non_uniform_indexing_native: bool,
2259
2260    /// A `bool` value indicating whether storage image descriptors natively support nonuniform
2261    /// indexing.
2262    ///
2263    /// If this is `false`, then a single dynamic instance of an instruction that nonuniformly
2264    /// indexes an array of storage images may execute multiple times in order to access all the
2265    /// descriptors.
2266    pub shader_storage_image_array_non_uniform_indexing_native: bool,
2267
2268    /// A `bool` value indicating whether input attachment descriptors natively support nonuniform
2269    /// indexing.
2270    ///
2271    /// If this is `false`, then a single dynamic instance of an instruction that nonuniformly
2272    /// indexes an array of input attachments may execute multiple times in order to access all the
2273    /// descriptors.
2274    pub shader_input_attachment_array_non_uniform_indexing_native: bool,
2275
2276    /// A `bool` value indicating whether `robustBufferAccess` can be enabled on a device
2277    /// simultaneously with `descriptorBindingUniformBufferUpdateAfterBind`,
2278    /// `descriptorBindingStorageBufferUpdateAfterBind`,
2279    /// `descriptorBindingUniformTexelBufferUpdateAfterBind`, and/or
2280    /// `descriptorBindingStorageTexelBufferUpdateAfterBind`.
2281    ///
2282    /// If this is `false`, then either `robustBufferAccess` must be disabled or all of these
2283    /// update-after-bind features must be disabled.
2284    pub robust_buffer_access_update_after_bind: bool,
2285
2286    /// A `bool` value indicating whether implicit level of detail calculations for image operations
2287    /// have well-defined results when the image and/or sampler objects used for the instruction are
2288    /// not uniform within a quad.
2289    ///
2290    /// See [Derivative Image Operations](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceVulkan12Properties.html#textures-derivative-image-operations).
2291    pub quad_divergent_implicit_lod: bool,
2292
2293    /// Similar to `maxPerStageDescriptorSamplers` but counts descriptors from descriptor sets
2294    /// created with or without the `VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT` bit
2295    /// set.
2296    pub max_per_stage_descriptor_update_after_bind_samplers: u32,
2297
2298    /// Similar to `maxPerStageDescriptorUniformBuffers` but counts descriptors from descriptor sets
2299    /// created with or without the `VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT` bit
2300    /// set.
2301    pub max_per_stage_descriptor_update_after_bind_uniform_buffers: u32,
2302
2303    /// Similar to `maxPerStageDescriptorStorageBuffers` but counts descriptors from descriptor sets
2304    /// created with or without the `VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT` bit
2305    /// set.
2306    pub max_per_stage_descriptor_update_after_bind_storage_buffers: u32,
2307
2308    /// Similar to `maxPerStageDescriptorSampledImages` but counts descriptors from descriptor sets
2309    /// created with or without the `VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT` bit
2310    /// set.
2311    pub max_per_stage_descriptor_update_after_bind_sampled_images: u32,
2312
2313    /// Similar to `maxPerStageDescriptorStorageImages` but counts descriptors from descriptor sets
2314    /// created with or without the `VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT` bit
2315    /// set.
2316    pub max_per_stage_descriptor_update_after_bind_storage_images: u32,
2317
2318    /// Similar to `maxPerStageDescriptorInputAttachments` but counts descriptors from descriptor
2319    /// sets created with or without the
2320    /// `VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT` bit set.
2321    pub max_per_stage_descriptor_update_after_bind_input_attachments: u32,
2322
2323    /// Similar to `maxPerStageResources` but counts descriptors from descriptor sets created with
2324    /// or without the `VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT` bit set.
2325    pub max_per_stage_update_after_bind_resources: u32,
2326
2327    /// Similar to `maxDescriptorSetSamplers` but counts descriptors from descriptor sets created
2328    /// with or without the `VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT` bit set.
2329    pub max_descriptor_set_update_after_bind_samplers: u32,
2330
2331    /// Similar to `maxDescriptorSetUniformBuffers` but counts descriptors from descriptor sets
2332    /// created with or without the `VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT` bit
2333    /// set.
2334    pub max_descriptor_set_update_after_bind_uniform_buffers: u32,
2335
2336    /// Similar to `maxDescriptorSetUniformBuffersDynamic` but counts descriptors from descriptor
2337    /// sets created with or without the
2338    /// `VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT` bit set.
2339    ///
2340    /// While an application can allocate dynamic uniform buffer descriptors from a pool created
2341    /// with the `VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT`, bindings for these
2342    /// descriptors must not be present in any descriptor set layout that includes bindings created
2343    /// with `VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT`.
2344    pub max_descriptor_set_update_after_bind_uniform_buffers_dynamic: u32,
2345
2346    /// Similar to `maxDescriptorSetStorageBuffers` but counts descriptors from descriptor sets
2347    /// created with or without the `VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT` bit
2348    /// set.
2349    pub max_descriptor_set_update_after_bind_storage_buffers: u32,
2350
2351    /// Similar to `maxDescriptorSetStorageBuffersDynamic` but counts descriptors from descriptor
2352    /// sets created with or without the
2353    /// `VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT` bit set.
2354    ///
2355    /// While an application can allocate dynamic storage buffer descriptors from a pool created
2356    /// with the `VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT`, bindings for these
2357    /// descriptors must not be present in any descriptor set layout that includes bindings created
2358    /// with `VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT`.
2359    pub max_descriptor_set_update_after_bind_storage_buffers_dynamic: u32,
2360
2361    /// Similar to `maxDescriptorSetSampledImages` but counts descriptors from descriptor sets
2362    /// created with or without the `VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT` bit
2363    /// set.
2364    pub max_descriptor_set_update_after_bind_sampled_images: u32,
2365
2366    /// Similar to `maxDescriptorSetStorageImages` but counts descriptors from descriptor sets
2367    /// created with or without the `VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT` bit
2368    /// set.
2369    pub max_descriptor_set_update_after_bind_storage_images: u32,
2370
2371    /// Similar to `maxDescriptorSetInputAttachments` but counts descriptors from descriptor sets
2372    /// created with or without the `VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT` bit
2373    /// set.
2374    pub max_descriptor_set_update_after_bind_input_attachments: u32,
2375
2376    /// A bitmask of `vk::ResolveModeFlagBits` indicating the set of supported depth resolve modes.
2377    ///
2378    /// `VK_RESOLVE_MODE_SAMPLE_ZERO_BIT` must be included in the set but implementations may
2379    /// support additional modes.
2380    pub supported_depth_resolve_modes: vk::ResolveModeFlags,
2381
2382    /// A bitmask of `vk::ResolveModeFlagBits` indicating the set of supported stencil resolve
2383    /// modes.
2384    ///
2385    /// `VK_RESOLVE_MODE_SAMPLE_ZERO_BIT` must be included in the set but implementations may
2386    /// support additional modes. `VK_RESOLVE_MODE_AVERAGE_BIT` must not be included in the set.
2387    pub supported_stencil_resolve_modes: vk::ResolveModeFlags,
2388
2389    /// `true` if the implementation supports setting the depth and stencil resolve modes to
2390    /// different values when one of those modes is `VK_RESOLVE_MODE_NONE`.
2391    ///
2392    /// Otherwise the implementation only supports setting both modes to the same value.
2393    pub independent_resolve_none: bool,
2394
2395    /// `true` if the implementation supports all combinations of the supported depth and stencil
2396    /// resolve modes, including setting either depth or stencil resolve mode to
2397    /// `VK_RESOLVE_MODE_NONE`.
2398    ///
2399    /// An implementation that supports `independent_resolve` must also support
2400    /// `independent_resolve_none`.
2401    pub independent_resolve: bool,
2402
2403    /// A `bool` value indicating whether a minimum set of required formats support min/max
2404    /// filtering.
2405    pub filter_minmax_single_component_formats: bool,
2406
2407    /// A `bool` value indicating whether the implementation supports non-identity component mapping
2408    /// of the image when doing min/max filtering.
2409    pub filter_minmax_image_component_mapping: bool,
2410
2411    /// Indicates the maximum difference allowed by the implementation between the current value of
2412    /// a timeline semaphore and any pending signal or wait operations.
2413    pub max_timeline_semaphore_value_difference: u64,
2414
2415    /// A bitmask of `vk::SampleCountFlagBits` indicating the color sample counts that are supported
2416    /// for all framebuffer color attachments with integer formats.
2417    pub framebuffer_integer_color_sample_counts: vk::SampleCountFlags,
2418}
2419
2420impl From<vk::PhysicalDeviceVulkan12Properties<'_>> for Vulkan12Properties {
2421    fn from(properties: vk::PhysicalDeviceVulkan12Properties<'_>) -> Self {
2422        Self {
2423            driver_id: properties.driver_id,
2424            driver_name: vk_cstr_to_string_lossy(&properties.driver_name),
2425            driver_info: vk_cstr_to_string_lossy(&properties.driver_info),
2426            conformance_version: properties.conformance_version,
2427            denorm_behavior_independence: properties.denorm_behavior_independence,
2428            rounding_mode_independence: properties.rounding_mode_independence,
2429            shader_signed_zero_inf_nan_preserve_float16: properties
2430                .shader_signed_zero_inf_nan_preserve_float16
2431                == vk::TRUE,
2432            shader_signed_zero_inf_nan_preserve_float32: properties
2433                .shader_signed_zero_inf_nan_preserve_float32
2434                == vk::TRUE,
2435            shader_signed_zero_inf_nan_preserve_float64: properties
2436                .shader_signed_zero_inf_nan_preserve_float64
2437                == vk::TRUE,
2438            shader_denorm_preserve_float16: properties.shader_denorm_preserve_float16 == vk::TRUE,
2439            shader_denorm_preserve_float32: properties.shader_denorm_preserve_float32 == vk::TRUE,
2440            shader_denorm_preserve_float64: properties.shader_denorm_preserve_float64 == vk::TRUE,
2441            shader_denorm_flush_to_zero_float16: properties.shader_denorm_flush_to_zero_float16
2442                == vk::TRUE,
2443            shader_denorm_flush_to_zero_float32: properties.shader_denorm_flush_to_zero_float32
2444                == vk::TRUE,
2445            shader_denorm_flush_to_zero_float64: properties.shader_denorm_flush_to_zero_float64
2446                == vk::TRUE,
2447            shader_rounding_mode_rte_float16: properties.shader_rounding_mode_rte_float16
2448                == vk::TRUE,
2449            shader_rounding_mode_rte_float32: properties.shader_rounding_mode_rte_float32
2450                == vk::TRUE,
2451            shader_rounding_mode_rte_float64: properties.shader_rounding_mode_rte_float64
2452                == vk::TRUE,
2453            shader_rounding_mode_rtz_float16: properties.shader_rounding_mode_rtz_float16
2454                == vk::TRUE,
2455            shader_rounding_mode_rtz_float32: properties.shader_rounding_mode_rtz_float32
2456                == vk::TRUE,
2457            shader_rounding_mode_rtz_float64: properties.shader_rounding_mode_rtz_float64
2458                == vk::TRUE,
2459            max_update_after_bind_descriptors_in_all_pools: properties
2460                .max_update_after_bind_descriptors_in_all_pools,
2461            shader_uniform_buffer_array_non_uniform_indexing_native: properties
2462                .shader_uniform_buffer_array_non_uniform_indexing_native
2463                == vk::TRUE,
2464            shader_sampled_image_array_non_uniform_indexing_native: properties
2465                .shader_sampled_image_array_non_uniform_indexing_native
2466                == vk::TRUE,
2467            shader_storage_buffer_array_non_uniform_indexing_native: properties
2468                .shader_storage_buffer_array_non_uniform_indexing_native
2469                == vk::TRUE,
2470            shader_storage_image_array_non_uniform_indexing_native: properties
2471                .shader_storage_image_array_non_uniform_indexing_native
2472                == vk::TRUE,
2473            shader_input_attachment_array_non_uniform_indexing_native: properties
2474                .shader_input_attachment_array_non_uniform_indexing_native
2475                == vk::TRUE,
2476            robust_buffer_access_update_after_bind: properties
2477                .robust_buffer_access_update_after_bind
2478                == vk::TRUE,
2479            quad_divergent_implicit_lod: properties.quad_divergent_implicit_lod == vk::TRUE,
2480            max_per_stage_descriptor_update_after_bind_samplers: properties
2481                .max_per_stage_descriptor_update_after_bind_samplers,
2482            max_per_stage_descriptor_update_after_bind_uniform_buffers: properties
2483                .max_per_stage_descriptor_update_after_bind_uniform_buffers,
2484            max_per_stage_descriptor_update_after_bind_storage_buffers: properties
2485                .max_per_stage_descriptor_update_after_bind_storage_buffers,
2486            max_per_stage_descriptor_update_after_bind_sampled_images: properties
2487                .max_per_stage_descriptor_update_after_bind_sampled_images,
2488            max_per_stage_descriptor_update_after_bind_storage_images: properties
2489                .max_per_stage_descriptor_update_after_bind_storage_images,
2490            max_per_stage_descriptor_update_after_bind_input_attachments: properties
2491                .max_per_stage_descriptor_update_after_bind_input_attachments,
2492            max_per_stage_update_after_bind_resources: properties
2493                .max_per_stage_update_after_bind_resources,
2494            max_descriptor_set_update_after_bind_samplers: properties
2495                .max_descriptor_set_update_after_bind_samplers,
2496            max_descriptor_set_update_after_bind_uniform_buffers: properties
2497                .max_descriptor_set_update_after_bind_uniform_buffers,
2498            max_descriptor_set_update_after_bind_uniform_buffers_dynamic: properties
2499                .max_descriptor_set_update_after_bind_uniform_buffers_dynamic,
2500            max_descriptor_set_update_after_bind_storage_buffers: properties
2501                .max_descriptor_set_update_after_bind_storage_buffers,
2502            max_descriptor_set_update_after_bind_storage_buffers_dynamic: properties
2503                .max_descriptor_set_update_after_bind_storage_buffers_dynamic,
2504            max_descriptor_set_update_after_bind_sampled_images: properties
2505                .max_descriptor_set_update_after_bind_sampled_images,
2506            max_descriptor_set_update_after_bind_storage_images: properties
2507                .max_descriptor_set_update_after_bind_storage_images,
2508            max_descriptor_set_update_after_bind_input_attachments: properties
2509                .max_descriptor_set_update_after_bind_input_attachments,
2510            supported_depth_resolve_modes: properties.supported_depth_resolve_modes,
2511            supported_stencil_resolve_modes: properties.supported_stencil_resolve_modes,
2512            independent_resolve_none: properties.independent_resolve_none == vk::TRUE,
2513            independent_resolve: properties.independent_resolve == vk::TRUE,
2514            filter_minmax_single_component_formats: properties
2515                .filter_minmax_single_component_formats
2516                == vk::TRUE,
2517            filter_minmax_image_component_mapping: properties.filter_minmax_image_component_mapping
2518                == vk::TRUE,
2519            max_timeline_semaphore_value_difference: properties
2520                .max_timeline_semaphore_value_difference,
2521            framebuffer_integer_color_sample_counts: properties
2522                .framebuffer_integer_color_sample_counts,
2523        }
2524    }
2525}