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