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