vulkan_rust/generated/instance_wrappers.rs
1#![allow(unused_imports)]
2#![allow(clippy::too_many_arguments)]
3use crate::error::{VkResult, check, enumerate_two_call, fill_two_call};
4use crate::vk::*;
5impl crate::Instance {
6 ///Wraps [`vkDestroyInstance`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyInstance.html).
7 /**
8 Provided by **VK_BASE_VERSION_1_0**.*/
9 ///
10 ///# Safety
11 ///- `instance` (self) must be valid and not destroyed.
12 ///- `instance` must be externally synchronized.
13 ///
14 ///# Panics
15 ///Panics if `vkDestroyInstance` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16 ///
17 ///# Usage Notes
18 ///
19 ///Destroys a Vulkan instance and frees all instance-level resources.
20 ///All devices created from this instance must be destroyed first.
21 ///
22 ///Safe teardown order:
23 ///
24 ///1. Destroy all `Device` objects (which destroys all device-child
25 /// objects).
26 ///2. Destroy any debug messengers or debug report callbacks.
27 ///3. Destroy any surfaces.
28 ///4. `destroy_instance`.
29 ///
30 ///After this call the instance handle and all physical device handles
31 ///obtained from it are invalid.
32 ///
33 ///# Guide
34 ///
35 ///See [The Vulkan Object Model](https://hiddentale.github.io/vulkan_rust/concepts/object-model.html) in the vulkan_rust guide.
36 pub unsafe fn destroy_instance(&self, allocator: Option<&AllocationCallbacks>) {
37 let fp = self
38 .commands()
39 .destroy_instance
40 .expect("vkDestroyInstance not loaded");
41 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
42 unsafe { fp(self.handle(), alloc_ptr) };
43 }
44 ///Wraps [`vkEnumeratePhysicalDevices`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkEnumeratePhysicalDevices.html).
45 /**
46 Provided by **VK_BASE_VERSION_1_0**.*/
47 ///
48 ///# Errors
49 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
50 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
51 ///- `VK_ERROR_INITIALIZATION_FAILED`
52 ///- `VK_ERROR_UNKNOWN`
53 ///- `VK_ERROR_VALIDATION_FAILED`
54 ///
55 ///# Safety
56 ///- `instance` (self) must be valid and not destroyed.
57 ///
58 ///# Panics
59 ///Panics if `vkEnumeratePhysicalDevices` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
60 ///
61 ///# Usage Notes
62 ///
63 ///Returns a list of all physical devices (GPUs) available to the
64 ///instance. This is typically the first call after instance creation,
65 ///you need a physical device to query capabilities and create a
66 ///logical device.
67 ///
68 ///The order of physical devices is driver-dependent and not guaranteed
69 ///to be stable across runs. To pick the right GPU:
70 ///
71 ///1. Enumerate all devices.
72 ///2. Query `get_physical_device_properties` for each.
73 ///3. Prefer `PHYSICAL_DEVICE_TYPE_DISCRETE_GPU` for performance, or
74 /// `INTEGRATED_GPU` for power efficiency.
75 ///4. Check queue families, memory heaps, and required features.
76 ///
77 ///On systems with multiple GPUs (e.g. a discrete + integrated), this
78 ///returns all of them. Vulkan does not have a concept of a "default"
79 ///GPU, your application must choose.
80 ///
81 ///# Guide
82 ///
83 ///See [Hello Triangle, Part 1](https://hiddentale.github.io/vulkan_rust/getting-started/hello-triangle-1.html) in the vulkan_rust guide.
84 pub unsafe fn enumerate_physical_devices(&self) -> VkResult<Vec<PhysicalDevice>> {
85 let fp = self
86 .commands()
87 .enumerate_physical_devices
88 .expect("vkEnumeratePhysicalDevices not loaded");
89 enumerate_two_call(|count, data| unsafe { fp(self.handle(), count, data) })
90 }
91 ///Wraps [`vkGetInstanceProcAddr`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetInstanceProcAddr.html).
92 /**
93 Provided by **VK_BASE_VERSION_1_0**.*/
94 ///
95 ///# Safety
96 ///- `instance` (self) must be valid and not destroyed.
97 ///
98 ///# Panics
99 ///Panics if `vkGetInstanceProcAddr` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
100 ///
101 ///# Usage Notes
102 ///
103 ///Returns a function pointer for an instance-level or device-level
104 ///Vulkan command. This is the root of the Vulkan function pointer
105 ///loading chain.
106 ///
107 ///In normal usage you do not need to call this yourself, `Instance`
108 ///and `Device` load all function pointers automatically. This is
109 ///primarily useful for:
110 ///
111 ///- Loading commands that are not yet exposed as wrapper methods.
112 ///- Raw interop with other Vulkan libraries (e.g. OpenXR).
113 ///- Implementing custom loaders.
114 ///
115 ///When called with a null instance, returns pointers for global
116 ///commands (`vkEnumerateInstanceVersion`,
117 ///`vkEnumerateInstanceExtensionProperties`, etc.).
118 ///
119 ///The returned pointer may go through a loader trampoline. For
120 ///device-level commands, `get_device_proc_addr` returns a
121 ///driver-direct pointer that is slightly faster.
122 pub unsafe fn get_instance_proc_addr(
123 &self,
124 p_name: *const core::ffi::c_char,
125 ) -> PFN_vkVoidFunction {
126 let fp = self
127 .commands()
128 .get_instance_proc_addr
129 .expect("vkGetInstanceProcAddr not loaded");
130 unsafe { fp(self.handle(), p_name) }
131 }
132 ///Wraps [`vkGetPhysicalDeviceProperties`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceProperties.html).
133 /**
134 Provided by **VK_BASE_VERSION_1_0**.*/
135 ///
136 ///# Safety
137 ///- `physicalDevice` (self) must be valid and not destroyed.
138 ///
139 ///# Panics
140 ///Panics if `vkGetPhysicalDeviceProperties` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
141 ///
142 ///# Usage Notes
143 ///
144 ///Returns general properties of a physical device: device name, vendor
145 ///ID, driver version, API version, device type, and device limits.
146 ///
147 ///Key fields to check during device selection:
148 ///
149 ///- **`device_type`**: `DISCRETE_GPU`, `INTEGRATED_GPU`, `VIRTUAL_GPU`,
150 /// `CPU`, or `OTHER`. Discrete GPUs typically offer the best
151 /// performance.
152 ///- **`api_version`**: the highest Vulkan version the device supports.
153 ///- **`limits`**: contains hundreds of device limits like
154 /// `max_image_dimension_2d`, `max_push_constants_size`,
155 /// `timestamp_period`, `non_coherent_atom_size`, etc.
156 ///- **`pipeline_cache_uuid`**: used to validate pipeline cache data
157 /// across sessions.
158 ///
159 ///For extended properties (Vulkan 1.1+), use
160 ///`get_physical_device_properties2` which supports chaining additional
161 ///property structs like `PhysicalDeviceVulkan12Properties`.
162 ///
163 ///# Guide
164 ///
165 ///See [Hello Triangle, Part 1](https://hiddentale.github.io/vulkan_rust/getting-started/hello-triangle-1.html) in the vulkan_rust guide.
166 pub unsafe fn get_physical_device_properties(
167 &self,
168 physical_device: PhysicalDevice,
169 ) -> PhysicalDeviceProperties {
170 let fp = self
171 .commands()
172 .get_physical_device_properties
173 .expect("vkGetPhysicalDeviceProperties not loaded");
174 let mut out = unsafe { core::mem::zeroed() };
175 unsafe { fp(physical_device, &mut out) };
176 out
177 }
178 ///Wraps [`vkGetPhysicalDeviceQueueFamilyProperties`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceQueueFamilyProperties.html).
179 /**
180 Provided by **VK_BASE_VERSION_1_0**.*/
181 ///
182 ///# Safety
183 ///- `physicalDevice` (self) must be valid and not destroyed.
184 ///
185 ///# Panics
186 ///Panics if `vkGetPhysicalDeviceQueueFamilyProperties` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
187 ///
188 ///# Usage Notes
189 ///
190 ///Returns the list of queue families supported by a physical device.
191 ///Each queue family has a set of capabilities (graphics, compute,
192 ///transfer, sparse binding) and a count of available queues.
193 ///
194 ///You must query this before creating a device to determine which
195 ///queue family indices to request.
196 ///
197 ///**Common queue family selection**:
198 ///
199 ///- **Graphics + compute**: most desktop GPUs have a single family
200 /// that supports both. Use it for all rendering and compute work.
201 ///- **Dedicated transfer**: some GPUs expose a transfer-only family
202 /// backed by a DMA engine. Use it for async uploads to overlap with
203 /// rendering.
204 ///- **Dedicated compute**: some GPUs expose a compute-only family
205 /// for async compute.
206 ///
207 ///Check `queue_flags` for `QUEUE_GRAPHICS`, `QUEUE_COMPUTE`,
208 ///`QUEUE_TRANSFER`, and `QUEUE_SPARSE_BINDING`. Also check
209 ///`timestamp_valid_bits` if you need GPU timestamps on that queue.
210 ///
211 ///For extended properties (Vulkan 1.1+), use
212 ///`get_physical_device_queue_family_properties2`.
213 ///
214 ///# Guide
215 ///
216 ///See [Hello Triangle, Part 1](https://hiddentale.github.io/vulkan_rust/getting-started/hello-triangle-1.html) in the vulkan_rust guide.
217 pub unsafe fn get_physical_device_queue_family_properties(
218 &self,
219 physical_device: PhysicalDevice,
220 ) -> Vec<QueueFamilyProperties> {
221 let fp = self
222 .commands()
223 .get_physical_device_queue_family_properties
224 .expect("vkGetPhysicalDeviceQueueFamilyProperties not loaded");
225 fill_two_call(|count, data| unsafe { fp(physical_device, count, data) })
226 }
227 ///Wraps [`vkGetPhysicalDeviceMemoryProperties`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceMemoryProperties.html).
228 /**
229 Provided by **VK_BASE_VERSION_1_0**.*/
230 ///
231 ///# Safety
232 ///- `physicalDevice` (self) must be valid and not destroyed.
233 ///
234 ///# Panics
235 ///Panics if `vkGetPhysicalDeviceMemoryProperties` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
236 ///
237 ///# Usage Notes
238 ///
239 ///Returns the memory heaps and memory types available on the physical
240 ///device. Essential for choosing the right memory type when allocating
241 ///device memory.
242 ///
243 ///**Memory heaps**: represent physical memory pools (e.g. VRAM, system
244 ///RAM). Each heap has a size and flags (`DEVICE_LOCAL` for GPU memory).
245 ///
246 ///**Memory types**: each type references a heap and has property flags:
247 ///
248 ///- `DEVICE_LOCAL`: fast GPU access. Preferred for images, vertex
249 /// buffers, and anything the GPU reads frequently.
250 ///- `HOST_VISIBLE`: can be mapped for CPU access. Required for staging
251 /// buffers and any CPU-written data.
252 ///- `HOST_COHERENT`: mapped writes are automatically visible to the
253 /// GPU without explicit flushes.
254 ///- `HOST_CACHED`: CPU reads are fast (cached). Useful for readback
255 /// buffers.
256 ///- `LAZILY_ALLOCATED`: memory may not be backed until used. For
257 /// transient attachments on tile-based GPUs.
258 ///
259 ///**Choosing a memory type**: AND the `memory_type_bits` from
260 ///`get_buffer_memory_requirements` or `get_image_memory_requirements`
261 ///with your desired property flags. Pick the first matching type.
262 ///
263 ///For extended properties (Vulkan 1.1+), use
264 ///`get_physical_device_memory_properties2`.
265 pub unsafe fn get_physical_device_memory_properties(
266 &self,
267 physical_device: PhysicalDevice,
268 ) -> PhysicalDeviceMemoryProperties {
269 let fp = self
270 .commands()
271 .get_physical_device_memory_properties
272 .expect("vkGetPhysicalDeviceMemoryProperties not loaded");
273 let mut out = unsafe { core::mem::zeroed() };
274 unsafe { fp(physical_device, &mut out) };
275 out
276 }
277 ///Wraps [`vkGetPhysicalDeviceFeatures`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceFeatures.html).
278 /**
279 Provided by **VK_BASE_VERSION_1_0**.*/
280 ///
281 ///# Safety
282 ///- `physicalDevice` (self) must be valid and not destroyed.
283 ///
284 ///# Panics
285 ///Panics if `vkGetPhysicalDeviceFeatures` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
286 ///
287 ///# Usage Notes
288 ///
289 ///Returns the optional features supported by a physical device. Each
290 ///field is a boolean indicating whether the feature is available.
291 ///
292 ///Query this before device creation to check whether features your
293 ///application needs are supported. Then enable only the features you
294 ///actually use in `DeviceCreateInfo::enabled_features`.
295 ///
296 ///Commonly checked features:
297 ///
298 ///- `sampler_anisotropy`: anisotropic texture filtering.
299 ///- `fill_mode_non_solid`: wireframe rendering.
300 ///- `wide_lines`: line widths other than 1.0.
301 ///- `geometry_shader`, `tessellation_shader`: optional shader stages.
302 ///- `multi_draw_indirect`: indirect draw with count > 1.
303 ///- `pipeline_statistics_query`: pipeline statistics queries.
304 ///
305 ///Enabling a feature that is not supported causes device creation to
306 ///fail. Never blindly enable all features, only request what you need.
307 ///
308 ///For extended features (Vulkan 1.1+), use
309 ///`get_physical_device_features2` with chained feature structs.
310 pub unsafe fn get_physical_device_features(
311 &self,
312 physical_device: PhysicalDevice,
313 ) -> PhysicalDeviceFeatures {
314 let fp = self
315 .commands()
316 .get_physical_device_features
317 .expect("vkGetPhysicalDeviceFeatures not loaded");
318 let mut out = unsafe { core::mem::zeroed() };
319 unsafe { fp(physical_device, &mut out) };
320 out
321 }
322 ///Wraps [`vkGetPhysicalDeviceFormatProperties`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceFormatProperties.html).
323 /**
324 Provided by **VK_BASE_VERSION_1_0**.*/
325 ///
326 ///# Safety
327 ///- `physicalDevice` (self) must be valid and not destroyed.
328 ///
329 ///# Panics
330 ///Panics if `vkGetPhysicalDeviceFormatProperties` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
331 ///
332 ///# Usage Notes
333 ///
334 ///Queries which operations a format supports on this device for
335 ///linear tiling, optimal tiling, and buffer usage.
336 ///
337 ///The returned `FormatProperties` contains three `FormatFeatureFlags`
338 ///fields:
339 ///
340 ///- **`linear_tiling_features`**: capabilities when the image uses
341 /// `IMAGE_TILING_LINEAR`.
342 ///- **`optimal_tiling_features`**: capabilities when the image uses
343 /// `IMAGE_TILING_OPTIMAL` (the common case).
344 ///- **`buffer_features`**: capabilities when used in a buffer view
345 /// (e.g. uniform texel buffer, storage texel buffer).
346 ///
347 ///Check the relevant feature bits before creating an image or buffer
348 ///view with a particular format. For example, verify
349 ///`FORMAT_FEATURE_COLOR_ATTACHMENT` before using a format as a render
350 ///target, or `FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR` before
351 ///enabling linear filtering.
352 ///
353 ///For extended format properties (Vulkan 1.1+), use
354 ///`get_physical_device_format_properties2`.
355 pub unsafe fn get_physical_device_format_properties(
356 &self,
357 physical_device: PhysicalDevice,
358 format: Format,
359 ) -> FormatProperties {
360 let fp = self
361 .commands()
362 .get_physical_device_format_properties
363 .expect("vkGetPhysicalDeviceFormatProperties not loaded");
364 let mut out = unsafe { core::mem::zeroed() };
365 unsafe { fp(physical_device, format, &mut out) };
366 out
367 }
368 ///Wraps [`vkGetPhysicalDeviceImageFormatProperties`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceImageFormatProperties.html).
369 /**
370 Provided by **VK_BASE_VERSION_1_0**.*/
371 ///
372 ///# Errors
373 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
374 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
375 ///- `VK_ERROR_FORMAT_NOT_SUPPORTED`
376 ///- `VK_ERROR_UNKNOWN`
377 ///- `VK_ERROR_VALIDATION_FAILED`
378 ///
379 ///# Safety
380 ///- `physicalDevice` (self) must be valid and not destroyed.
381 ///
382 ///# Panics
383 ///Panics if `vkGetPhysicalDeviceImageFormatProperties` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
384 ///
385 ///# Usage Notes
386 ///
387 ///Queries whether a specific combination of image format, type, tiling,
388 ///usage, and flags is supported on this device, and if so, what limits
389 ///apply.
390 ///
391 ///Use this to validate image creation parameters before calling
392 ///`create_image`. For example, check whether a format supports the
393 ///`COLOR_ATTACHMENT` usage with optimal tiling at your desired
394 ///resolution.
395 ///
396 ///The returned `ImageFormatProperties` includes:
397 ///
398 ///- **`max_extent`**: maximum dimensions for this combination.
399 ///- **`max_mip_levels`**: maximum mipmap levels.
400 ///- **`max_array_layers`**: maximum array layers.
401 ///- **`sample_counts`**: supported multisample counts.
402 ///- **`max_resource_size`**: maximum total bytes.
403 ///
404 ///Returns `VK_ERROR_FORMAT_NOT_SUPPORTED` if the combination is not
405 ///supported at all, this is not a fatal error, just a "no".
406 ///
407 ///For extended queries (Vulkan 1.1+), use
408 ///`get_physical_device_image_format_properties2` which supports
409 ///chaining external memory and YCBCR properties.
410 pub unsafe fn get_physical_device_image_format_properties(
411 &self,
412 physical_device: PhysicalDevice,
413 format: Format,
414 r#type: ImageType,
415 tiling: ImageTiling,
416 usage: ImageUsageFlags,
417 flags: ImageCreateFlags,
418 ) -> VkResult<ImageFormatProperties> {
419 let fp = self
420 .commands()
421 .get_physical_device_image_format_properties
422 .expect("vkGetPhysicalDeviceImageFormatProperties not loaded");
423 let mut out = unsafe { core::mem::zeroed() };
424 check(unsafe {
425 fp(
426 physical_device,
427 format,
428 r#type,
429 tiling,
430 usage,
431 flags,
432 &mut out,
433 )
434 })?;
435 Ok(out)
436 }
437 ///Wraps [`vkEnumerateDeviceLayerProperties`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkEnumerateDeviceLayerProperties.html).
438 /**
439 Provided by **VK_BASE_VERSION_1_0**.*/
440 ///
441 ///# Errors
442 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
443 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
444 ///- `VK_ERROR_UNKNOWN`
445 ///- `VK_ERROR_VALIDATION_FAILED`
446 ///
447 ///# Safety
448 ///- `physicalDevice` (self) must be valid and not destroyed.
449 ///
450 ///# Panics
451 ///Panics if `vkEnumerateDeviceLayerProperties` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
452 ///
453 ///# Usage Notes
454 ///
455 ///Enumerates the available device-level validation layers. In modern
456 ///Vulkan (1.0.13+), device layers are deprecated in favour of
457 ///instance layers, this function exists for backwards compatibility
458 ///and typically returns the same list as instance layer enumeration.
459 ///
460 ///Most applications do not need to call this. Enable validation layers
461 ///at instance creation via `InstanceCreateInfo::enabled_layer_names`
462 ///instead.
463 pub unsafe fn enumerate_device_layer_properties(
464 &self,
465 physical_device: PhysicalDevice,
466 ) -> VkResult<Vec<LayerProperties>> {
467 let fp = self
468 .commands()
469 .enumerate_device_layer_properties
470 .expect("vkEnumerateDeviceLayerProperties not loaded");
471 enumerate_two_call(|count, data| unsafe { fp(physical_device, count, data) })
472 }
473 ///Wraps [`vkEnumerateDeviceExtensionProperties`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkEnumerateDeviceExtensionProperties.html).
474 /**
475 Provided by **VK_BASE_VERSION_1_0**.*/
476 ///
477 ///# Errors
478 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
479 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
480 ///- `VK_ERROR_LAYER_NOT_PRESENT`
481 ///- `VK_ERROR_UNKNOWN`
482 ///- `VK_ERROR_VALIDATION_FAILED`
483 ///
484 ///# Safety
485 ///- `physicalDevice` (self) must be valid and not destroyed.
486 ///
487 ///# Panics
488 ///Panics if `vkEnumerateDeviceExtensionProperties` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
489 ///
490 ///# Usage Notes
491 ///
492 ///Returns the list of extensions supported by a physical device. Call
493 ///this to verify that required extensions are available before
494 ///requesting them in `DeviceCreateInfo::enabled_extension_names`.
495 ///
496 ///Common extensions to check for:
497 ///
498 ///- `VK_KHR_swapchain`: presentation to a surface (required for
499 /// rendering to a window).
500 ///- `VK_KHR_dynamic_rendering`: render pass-less rendering (core in
501 /// 1.3).
502 ///- `VK_KHR_ray_tracing_pipeline`: hardware ray tracing.
503 ///- `VK_EXT_descriptor_indexing`: bindless descriptors (core in 1.2).
504 ///
505 ///Pass `None` for `layer_name` to enumerate extensions provided by the
506 ///driver itself. Passing a layer name enumerates extensions provided by
507 ///that specific layer (rarely needed).
508 ///
509 ///Requesting an unsupported extension at device creation causes
510 ///`VK_ERROR_EXTENSION_NOT_PRESENT`.
511 pub unsafe fn enumerate_device_extension_properties(
512 &self,
513 physical_device: PhysicalDevice,
514 p_layer_name: Option<&core::ffi::CStr>,
515 ) -> VkResult<Vec<ExtensionProperties>> {
516 let fp = self
517 .commands()
518 .enumerate_device_extension_properties
519 .expect("vkEnumerateDeviceExtensionProperties not loaded");
520 let p_layer_name_ptr = p_layer_name.map_or(core::ptr::null(), core::ffi::CStr::as_ptr);
521 enumerate_two_call(|count, data| unsafe {
522 fp(physical_device, p_layer_name_ptr, count, data)
523 })
524 }
525 ///Wraps [`vkGetPhysicalDeviceSparseImageFormatProperties`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceSparseImageFormatProperties.html).
526 /**
527 Provided by **VK_BASE_VERSION_1_0**.*/
528 ///
529 ///# Safety
530 ///- `physicalDevice` (self) must be valid and not destroyed.
531 ///
532 ///# Panics
533 ///Panics if `vkGetPhysicalDeviceSparseImageFormatProperties` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
534 ///
535 ///# Usage Notes
536 ///
537 ///Queries the sparse image format properties for a specific format,
538 ///image type, sample count, usage, and tiling combination. Returns
539 ///information about the sparse texel block dimensions and flags.
540 ///
541 ///Only relevant if you intend to use sparse images
542 ///(`IMAGE_CREATE_SPARSE_*`). For non-sparse images, this is not
543 ///needed.
544 ///
545 ///If the combination does not support sparse residency, an empty list
546 ///is returned. Check `physical_device_features.sparse_residency_*`
547 ///features before attempting sparse image creation.
548 ///
549 ///For extended queries (Vulkan 1.1+), use
550 ///`get_physical_device_sparse_image_format_properties2`.
551 pub unsafe fn get_physical_device_sparse_image_format_properties(
552 &self,
553 physical_device: PhysicalDevice,
554 format: Format,
555 r#type: ImageType,
556 samples: SampleCountFlagBits,
557 usage: ImageUsageFlags,
558 tiling: ImageTiling,
559 ) -> Vec<SparseImageFormatProperties> {
560 let fp = self
561 .commands()
562 .get_physical_device_sparse_image_format_properties
563 .expect("vkGetPhysicalDeviceSparseImageFormatProperties not loaded");
564 fill_two_call(|count, data| unsafe {
565 fp(
566 physical_device,
567 format,
568 r#type,
569 samples,
570 usage,
571 tiling,
572 count,
573 data,
574 )
575 })
576 }
577 ///Wraps [`vkCreateSurfaceOHOS`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateSurfaceOHOS.html).
578 /**
579 Provided by **VK_OHOS_surface**.*/
580 ///
581 ///# Errors
582 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
583 ///- `VK_ERROR_SURFACE_LOST_KHR`
584 ///- `VK_ERROR_UNKNOWN`
585 ///- `VK_ERROR_VALIDATION_FAILED`
586 ///
587 ///# Safety
588 ///- `instance` (self) must be valid and not destroyed.
589 ///
590 ///# Panics
591 ///Panics if `vkCreateSurfaceOHOS` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
592 ///
593 ///# Usage Notes
594 ///
595 ///Creates a Vulkan surface for an OpenHarmony OS native window.
596 ///OHOS only. The create info references the `OHNativeWindow`
597 ///handle.
598 ///
599 ///Requires `VK_OHOS_surface`.
600 pub unsafe fn create_surface_ohos(
601 &self,
602 p_create_info: &SurfaceCreateInfoOHOS,
603 allocator: Option<&AllocationCallbacks>,
604 ) -> VkResult<SurfaceKHR> {
605 let fp = self
606 .commands()
607 .create_surface_ohos
608 .expect("vkCreateSurfaceOHOS not loaded");
609 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
610 let mut out = unsafe { core::mem::zeroed() };
611 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
612 Ok(out)
613 }
614 ///Wraps [`vkGetPhysicalDeviceDisplayPropertiesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceDisplayPropertiesKHR.html).
615 /**
616 Provided by **VK_KHR_display**.*/
617 ///
618 ///# Errors
619 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
620 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
621 ///- `VK_ERROR_UNKNOWN`
622 ///- `VK_ERROR_VALIDATION_FAILED`
623 ///
624 ///# Safety
625 ///- `physicalDevice` (self) must be valid and not destroyed.
626 ///
627 ///# Panics
628 ///Panics if `vkGetPhysicalDeviceDisplayPropertiesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
629 ///
630 ///# Usage Notes
631 ///
632 ///Enumerates displays attached to a physical device. Each returned
633 ///`DisplayPropertiesKHR` contains the display handle, name,
634 ///physical dimensions, resolution, supported transforms, and
635 ///whether the display supports per-plane reordering.
636 ///
637 ///This is the entry point for the `VK_KHR_display` extension,
638 ///which provides direct display output without a window system
639 ///(useful for embedded, VR, kiosk, and fullscreen applications).
640 ///
641 ///After enumerating displays, query their modes with
642 ///`get_display_mode_properties_khr` and planes with
643 ///`get_physical_device_display_plane_properties_khr`.
644 ///
645 ///Prefer `get_physical_device_display_properties2_khr` when
646 ///`VK_KHR_get_display_properties2` is available, it supports
647 ///extensible output via `pNext`.
648 pub unsafe fn get_physical_device_display_properties_khr(
649 &self,
650 physical_device: PhysicalDevice,
651 ) -> VkResult<Vec<DisplayPropertiesKHR>> {
652 let fp = self
653 .commands()
654 .get_physical_device_display_properties_khr
655 .expect("vkGetPhysicalDeviceDisplayPropertiesKHR not loaded");
656 enumerate_two_call(|count, data| unsafe { fp(physical_device, count, data) })
657 }
658 ///Wraps [`vkGetPhysicalDeviceDisplayPlanePropertiesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceDisplayPlanePropertiesKHR.html).
659 /**
660 Provided by **VK_KHR_display**.*/
661 ///
662 ///# Errors
663 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
664 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
665 ///- `VK_ERROR_UNKNOWN`
666 ///- `VK_ERROR_VALIDATION_FAILED`
667 ///
668 ///# Safety
669 ///- `physicalDevice` (self) must be valid and not destroyed.
670 ///
671 ///# Panics
672 ///Panics if `vkGetPhysicalDeviceDisplayPlanePropertiesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
673 ///
674 ///# Usage Notes
675 ///
676 ///Enumerates display planes supported by a physical device. Each
677 ///plane is a compositing layer that can show a portion of a display
678 ///surface, multiple planes allow hardware overlay composition.
679 ///
680 ///Each returned `DisplayPlanePropertiesKHR` contains the display
681 ///currently connected to the plane and its current stack index.
682 ///
683 ///Use the plane index with `get_display_plane_supported_displays_khr`
684 ///to find which displays a given plane can target, and with
685 ///`get_display_plane_capabilities_khr` to query positioning and
686 ///scaling limits.
687 pub unsafe fn get_physical_device_display_plane_properties_khr(
688 &self,
689 physical_device: PhysicalDevice,
690 ) -> VkResult<Vec<DisplayPlanePropertiesKHR>> {
691 let fp = self
692 .commands()
693 .get_physical_device_display_plane_properties_khr
694 .expect("vkGetPhysicalDeviceDisplayPlanePropertiesKHR not loaded");
695 enumerate_two_call(|count, data| unsafe { fp(physical_device, count, data) })
696 }
697 ///Wraps [`vkGetDisplayPlaneSupportedDisplaysKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDisplayPlaneSupportedDisplaysKHR.html).
698 /**
699 Provided by **VK_KHR_display**.*/
700 ///
701 ///# Errors
702 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
703 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
704 ///- `VK_ERROR_UNKNOWN`
705 ///- `VK_ERROR_VALIDATION_FAILED`
706 ///
707 ///# Safety
708 ///- `physicalDevice` (self) must be valid and not destroyed.
709 ///
710 ///# Panics
711 ///Panics if `vkGetDisplayPlaneSupportedDisplaysKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
712 ///
713 ///# Usage Notes
714 ///
715 ///Returns the list of displays that a given display plane can be
716 ///used with. Not all planes can target all displays, this query
717 ///lets you find valid plane-display pairings.
718 ///
719 ///`plane_index` is an index into the array returned by
720 ///`get_physical_device_display_plane_properties_khr`.
721 ///
722 ///After finding a compatible display, query its modes with
723 ///`get_display_mode_properties_khr` and configure the plane via
724 ///`DisplaySurfaceCreateInfoKHR`.
725 pub unsafe fn get_display_plane_supported_displays_khr(
726 &self,
727 physical_device: PhysicalDevice,
728 plane_index: u32,
729 ) -> VkResult<Vec<DisplayKHR>> {
730 let fp = self
731 .commands()
732 .get_display_plane_supported_displays_khr
733 .expect("vkGetDisplayPlaneSupportedDisplaysKHR not loaded");
734 enumerate_two_call(|count, data| unsafe { fp(physical_device, plane_index, count, data) })
735 }
736 ///Wraps [`vkGetDisplayModePropertiesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDisplayModePropertiesKHR.html).
737 /**
738 Provided by **VK_KHR_display**.*/
739 ///
740 ///# Errors
741 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
742 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
743 ///- `VK_ERROR_UNKNOWN`
744 ///- `VK_ERROR_VALIDATION_FAILED`
745 ///
746 ///# Safety
747 ///- `physicalDevice` (self) must be valid and not destroyed.
748 ///
749 ///# Panics
750 ///Panics if `vkGetDisplayModePropertiesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
751 ///
752 ///# Usage Notes
753 ///
754 ///Enumerates the display modes supported by a display. Each
755 ///`DisplayModePropertiesKHR` contains a mode handle and its
756 ///parameters (visible region resolution and refresh rate).
757 ///
758 ///Use these to select an appropriate mode for
759 ///`DisplaySurfaceCreateInfoKHR`, or create a custom mode with
760 ///`create_display_mode_khr` if the desired parameters are not
761 ///listed.
762 ///
763 ///Prefer `get_display_mode_properties2_khr` when
764 ///`VK_KHR_get_display_properties2` is available.
765 pub unsafe fn get_display_mode_properties_khr(
766 &self,
767 physical_device: PhysicalDevice,
768 display: DisplayKHR,
769 ) -> VkResult<Vec<DisplayModePropertiesKHR>> {
770 let fp = self
771 .commands()
772 .get_display_mode_properties_khr
773 .expect("vkGetDisplayModePropertiesKHR not loaded");
774 enumerate_two_call(|count, data| unsafe { fp(physical_device, display, count, data) })
775 }
776 ///Wraps [`vkCreateDisplayModeKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateDisplayModeKHR.html).
777 /**
778 Provided by **VK_KHR_display**.*/
779 ///
780 ///# Errors
781 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
782 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
783 ///- `VK_ERROR_INITIALIZATION_FAILED`
784 ///- `VK_ERROR_UNKNOWN`
785 ///- `VK_ERROR_VALIDATION_FAILED`
786 ///
787 ///# Safety
788 ///- `physicalDevice` (self) must be valid and not destroyed.
789 ///- `display` must be externally synchronized.
790 ///
791 ///# Panics
792 ///Panics if `vkCreateDisplayModeKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
793 ///
794 ///# Usage Notes
795 ///
796 ///Creates a custom display mode with a specific resolution and
797 ///refresh rate. Use this when the built-in modes from
798 ///`get_display_mode_properties_khr` don't match your requirements.
799 ///
800 ///The `DisplayModeCreateInfoKHR` specifies the visible region
801 ///(width/height in pixels) and refresh rate (in millihertz, e.g.,
802 ///60000 for 60 Hz).
803 ///
804 ///Not all parameter combinations are valid, the driver may reject
805 ///modes it cannot support. If creation fails, fall back to a
806 ///built-in mode.
807 pub unsafe fn create_display_mode_khr(
808 &self,
809 physical_device: PhysicalDevice,
810 display: DisplayKHR,
811 p_create_info: &DisplayModeCreateInfoKHR,
812 allocator: Option<&AllocationCallbacks>,
813 ) -> VkResult<DisplayModeKHR> {
814 let fp = self
815 .commands()
816 .create_display_mode_khr
817 .expect("vkCreateDisplayModeKHR not loaded");
818 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
819 let mut out = unsafe { core::mem::zeroed() };
820 check(unsafe { fp(physical_device, display, p_create_info, alloc_ptr, &mut out) })?;
821 Ok(out)
822 }
823 ///Wraps [`vkGetDisplayPlaneCapabilitiesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDisplayPlaneCapabilitiesKHR.html).
824 /**
825 Provided by **VK_KHR_display**.*/
826 ///
827 ///# Errors
828 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
829 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
830 ///- `VK_ERROR_UNKNOWN`
831 ///- `VK_ERROR_VALIDATION_FAILED`
832 ///
833 ///# Safety
834 ///- `physicalDevice` (self) must be valid and not destroyed.
835 ///- `mode` must be externally synchronized.
836 ///
837 ///# Panics
838 ///Panics if `vkGetDisplayPlaneCapabilitiesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
839 ///
840 ///# Usage Notes
841 ///
842 ///Queries the capabilities of a display plane when used with a
843 ///specific display mode. The returned `DisplayPlaneCapabilitiesKHR`
844 ///describes:
845 ///
846 ///- Supported alpha modes (opaque, global, per-pixel).
847 ///- Min/max source and destination extents, the range of scaling
848 /// the plane supports.
849 ///- Min/max source and destination positions, how the plane
850 /// image can be positioned.
851 ///
852 ///Use these limits to configure `DisplaySurfaceCreateInfoKHR`
853 ///correctly. Exceeding the reported limits results in validation
854 ///errors.
855 pub unsafe fn get_display_plane_capabilities_khr(
856 &self,
857 physical_device: PhysicalDevice,
858 mode: DisplayModeKHR,
859 plane_index: u32,
860 ) -> VkResult<DisplayPlaneCapabilitiesKHR> {
861 let fp = self
862 .commands()
863 .get_display_plane_capabilities_khr
864 .expect("vkGetDisplayPlaneCapabilitiesKHR not loaded");
865 let mut out = unsafe { core::mem::zeroed() };
866 check(unsafe { fp(physical_device, mode, plane_index, &mut out) })?;
867 Ok(out)
868 }
869 ///Wraps [`vkCreateDisplayPlaneSurfaceKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateDisplayPlaneSurfaceKHR.html).
870 /**
871 Provided by **VK_KHR_display**.*/
872 ///
873 ///# Errors
874 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
875 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
876 ///- `VK_ERROR_UNKNOWN`
877 ///- `VK_ERROR_VALIDATION_FAILED`
878 ///
879 ///# Safety
880 ///- `instance` (self) must be valid and not destroyed.
881 ///
882 ///# Panics
883 ///Panics if `vkCreateDisplayPlaneSurfaceKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
884 ///
885 ///# Usage Notes
886 ///
887 ///Creates a `SurfaceKHR` for direct display output, bypassing the
888 ///window system. The surface is presented directly on a display
889 ///plane.
890 ///
891 ///Configure via `DisplaySurfaceCreateInfoKHR`:
892 ///
893 ///- `display_mode`: a mode from `get_display_mode_properties_khr`
894 /// or `create_display_mode_khr`.
895 ///- `plane_index`: which display plane to use.
896 ///- `plane_stack_index`: z-ordering among planes.
897 ///- `transform`: rotation/mirroring.
898 ///- `alpha_mode`: how alpha is handled (opaque, global, per-pixel).
899 ///- `image_extent`: the surface resolution.
900 ///
901 ///After creation, use the surface with `create_swapchain_khr` like
902 ///any other surface. Destroy with `destroy_surface_khr`.
903 pub unsafe fn create_display_plane_surface_khr(
904 &self,
905 p_create_info: &DisplaySurfaceCreateInfoKHR,
906 allocator: Option<&AllocationCallbacks>,
907 ) -> VkResult<SurfaceKHR> {
908 let fp = self
909 .commands()
910 .create_display_plane_surface_khr
911 .expect("vkCreateDisplayPlaneSurfaceKHR not loaded");
912 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
913 let mut out = unsafe { core::mem::zeroed() };
914 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
915 Ok(out)
916 }
917 ///Wraps [`vkGetPhysicalDeviceSurfaceSupportKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceSurfaceSupportKHR.html).
918 /**
919 Provided by **VK_KHR_surface**.*/
920 ///
921 ///# Errors
922 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
923 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
924 ///- `VK_ERROR_SURFACE_LOST_KHR`
925 ///- `VK_ERROR_UNKNOWN`
926 ///- `VK_ERROR_VALIDATION_FAILED`
927 ///
928 ///# Safety
929 ///- `physicalDevice` (self) must be valid and not destroyed.
930 ///
931 ///# Panics
932 ///Panics if `vkGetPhysicalDeviceSurfaceSupportKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
933 ///
934 ///# Usage Notes
935 ///
936 ///Checks whether a queue family on a physical device supports
937 ///presentation to a surface. Not all queue families can present,
938 ///a graphics queue that supports rendering may not support
939 ///presentation on all platforms.
940 ///
941 ///Call this for each queue family when selecting your present queue.
942 ///Often the graphics queue family also supports presentation, but
943 ///this is not guaranteed.
944 ///
945 ///Returns `VK_TRUE` if the queue family can present to the surface.
946 pub unsafe fn get_physical_device_surface_support_khr(
947 &self,
948 physical_device: PhysicalDevice,
949 queue_family_index: u32,
950 surface: SurfaceKHR,
951 ) -> VkResult<bool> {
952 let fp = self
953 .commands()
954 .get_physical_device_surface_support_khr
955 .expect("vkGetPhysicalDeviceSurfaceSupportKHR not loaded");
956 let mut out = unsafe { core::mem::zeroed() };
957 check(unsafe { fp(physical_device, queue_family_index, surface, &mut out) })?;
958 Ok(out != 0)
959 }
960 ///Wraps [`vkGetPhysicalDeviceSurfaceCapabilitiesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceSurfaceCapabilitiesKHR.html).
961 /**
962 Provided by **VK_KHR_surface**.*/
963 ///
964 ///# Errors
965 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
966 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
967 ///- `VK_ERROR_SURFACE_LOST_KHR`
968 ///- `VK_ERROR_UNKNOWN`
969 ///- `VK_ERROR_VALIDATION_FAILED`
970 ///
971 ///# Safety
972 ///- `physicalDevice` (self) must be valid and not destroyed.
973 ///
974 ///# Panics
975 ///Panics if `vkGetPhysicalDeviceSurfaceCapabilitiesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
976 ///
977 ///# Usage Notes
978 ///
979 ///Queries the surface capabilities for a physical device: supported
980 ///image count range, current extent, supported transforms, composite
981 ///alpha modes, and supported image usage flags.
982 ///
983 ///**Key fields**:
984 ///
985 ///- **`current_extent`**: the current surface size. If `0xFFFFFFFF`,
986 /// the surface size is determined by the swapchain extent.
987 ///- **`min/max_image_count`**: the supported range for swapchain
988 /// image count.
989 ///- **`current_transform`**: pass this as `pre_transform` in
990 /// swapchain creation to avoid extra composition overhead.
991 ///- **`supported_usage_flags`**: which image usage bits the swapchain
992 /// images support (always includes `COLOR_ATTACHMENT`).
993 ///
994 ///Call this before creating a swapchain and again before recreating
995 ///after a resize, the capabilities may have changed.
996 pub unsafe fn get_physical_device_surface_capabilities_khr(
997 &self,
998 physical_device: PhysicalDevice,
999 surface: SurfaceKHR,
1000 ) -> VkResult<SurfaceCapabilitiesKHR> {
1001 let fp = self
1002 .commands()
1003 .get_physical_device_surface_capabilities_khr
1004 .expect("vkGetPhysicalDeviceSurfaceCapabilitiesKHR not loaded");
1005 let mut out = unsafe { core::mem::zeroed() };
1006 check(unsafe { fp(physical_device, surface, &mut out) })?;
1007 Ok(out)
1008 }
1009 ///Wraps [`vkGetPhysicalDeviceSurfaceFormatsKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceSurfaceFormatsKHR.html).
1010 /**
1011 Provided by **VK_KHR_surface**.*/
1012 ///
1013 ///# Errors
1014 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1015 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1016 ///- `VK_ERROR_SURFACE_LOST_KHR`
1017 ///- `VK_ERROR_UNKNOWN`
1018 ///- `VK_ERROR_VALIDATION_FAILED`
1019 ///
1020 ///# Safety
1021 ///- `physicalDevice` (self) must be valid and not destroyed.
1022 ///
1023 ///# Panics
1024 ///Panics if `vkGetPhysicalDeviceSurfaceFormatsKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1025 ///
1026 ///# Usage Notes
1027 ///
1028 ///Returns the list of supported format + colour space pairs for a
1029 ///surface. Pick one of these pairs for swapchain creation.
1030 ///
1031 ///The most portable choice is `FORMAT_B8G8R8A8_SRGB` +
1032 ///`COLOR_SPACE_SRGB_NONLINEAR`. If your preferred format is not
1033 ///listed, fall back to the first available pair.
1034 ///
1035 ///If the list contains a single entry with `FORMAT_UNDEFINED`, the
1036 ///surface has no preferred format and any format is acceptable.
1037 ///
1038 ///For HDR output, look for `COLOR_SPACE_HDR10_ST2084_EXT` or similar
1039 ///extended colour spaces.
1040 pub unsafe fn get_physical_device_surface_formats_khr(
1041 &self,
1042 physical_device: PhysicalDevice,
1043 surface: SurfaceKHR,
1044 ) -> VkResult<Vec<SurfaceFormatKHR>> {
1045 let fp = self
1046 .commands()
1047 .get_physical_device_surface_formats_khr
1048 .expect("vkGetPhysicalDeviceSurfaceFormatsKHR not loaded");
1049 enumerate_two_call(|count, data| unsafe { fp(physical_device, surface, count, data) })
1050 }
1051 ///Wraps [`vkGetPhysicalDeviceSurfacePresentModesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceSurfacePresentModesKHR.html).
1052 /**
1053 Provided by **VK_KHR_surface**.*/
1054 ///
1055 ///# Errors
1056 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1057 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1058 ///- `VK_ERROR_SURFACE_LOST_KHR`
1059 ///- `VK_ERROR_UNKNOWN`
1060 ///- `VK_ERROR_VALIDATION_FAILED`
1061 ///
1062 ///# Safety
1063 ///- `physicalDevice` (self) must be valid and not destroyed.
1064 ///
1065 ///# Panics
1066 ///Panics if `vkGetPhysicalDeviceSurfacePresentModesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1067 ///
1068 ///# Usage Notes
1069 ///
1070 ///Returns the list of supported present modes for a surface.
1071 ///
1072 ///**Present modes**:
1073 ///
1074 ///- `FIFO`: vsync. Guaranteed to be supported on all implementations.
1075 /// Frames are queued and presented at the display refresh rate.
1076 ///- `FIFO_RELAXED`: vsync with late frame allowance. If a frame
1077 /// arrives late, it is presented immediately (may cause tearing).
1078 ///- `MAILBOX`: triple buffering. The driver keeps only the latest
1079 /// frame in the queue, lower latency than FIFO with no tearing.
1080 ///- `IMMEDIATE`: no vsync. Frames are presented as soon as possible.
1081 /// Lowest latency but may cause visible tearing.
1082 ///
1083 ///Common strategy: prefer `MAILBOX` for low-latency rendering, fall
1084 ///back to `FIFO` if unavailable.
1085 pub unsafe fn get_physical_device_surface_present_modes_khr(
1086 &self,
1087 physical_device: PhysicalDevice,
1088 surface: SurfaceKHR,
1089 ) -> VkResult<Vec<PresentModeKHR>> {
1090 let fp = self
1091 .commands()
1092 .get_physical_device_surface_present_modes_khr
1093 .expect("vkGetPhysicalDeviceSurfacePresentModesKHR not loaded");
1094 enumerate_two_call(|count, data| unsafe { fp(physical_device, surface, count, data) })
1095 }
1096 ///Wraps [`vkCreateViSurfaceNN`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateViSurfaceNN.html).
1097 /**
1098 Provided by **VK_NN_vi_surface**.*/
1099 ///
1100 ///# Errors
1101 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1102 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1103 ///- `VK_ERROR_NATIVE_WINDOW_IN_USE_KHR`
1104 ///- `VK_ERROR_UNKNOWN`
1105 ///- `VK_ERROR_VALIDATION_FAILED`
1106 ///
1107 ///# Safety
1108 ///- `instance` (self) must be valid and not destroyed.
1109 ///
1110 ///# Panics
1111 ///Panics if `vkCreateViSurfaceNN` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1112 ///
1113 ///# Usage Notes
1114 ///
1115 ///Creates a Vulkan surface for a Nintendo Vi layer. Nintendo
1116 ///Switch only.
1117 ///
1118 ///Requires `VK_NN_vi_surface`.
1119 pub unsafe fn create_vi_surface_nn(
1120 &self,
1121 p_create_info: &ViSurfaceCreateInfoNN,
1122 allocator: Option<&AllocationCallbacks>,
1123 ) -> VkResult<SurfaceKHR> {
1124 let fp = self
1125 .commands()
1126 .create_vi_surface_nn
1127 .expect("vkCreateViSurfaceNN not loaded");
1128 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1129 let mut out = unsafe { core::mem::zeroed() };
1130 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1131 Ok(out)
1132 }
1133 ///Wraps [`vkGetPhysicalDeviceWaylandPresentationSupportKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceWaylandPresentationSupportKHR.html).
1134 /**
1135 Provided by **VK_KHR_wayland_surface**.*/
1136 ///
1137 ///# Safety
1138 ///- `physicalDevice` (self) must be valid and not destroyed.
1139 ///
1140 ///# Panics
1141 ///Panics if `vkGetPhysicalDeviceWaylandPresentationSupportKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1142 ///
1143 ///# Usage Notes
1144 ///
1145 ///Queries whether a queue family supports presentation to a
1146 ///Wayland compositor. Linux/Wayland only. Check this before
1147 ///creating a swapchain to ensure the queue can present.
1148 ///
1149 ///Requires `VK_KHR_wayland_surface`.
1150 pub unsafe fn get_physical_device_wayland_presentation_support_khr(
1151 &self,
1152 physical_device: PhysicalDevice,
1153 queue_family_index: u32,
1154 ) -> core::ffi::c_void {
1155 let fp = self
1156 .commands()
1157 .get_physical_device_wayland_presentation_support_khr
1158 .expect("vkGetPhysicalDeviceWaylandPresentationSupportKHR not loaded");
1159 let mut out = unsafe { core::mem::zeroed() };
1160 unsafe { fp(physical_device, queue_family_index, &mut out) };
1161 out
1162 }
1163 ///Wraps [`vkCreateUbmSurfaceSEC`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateUbmSurfaceSEC.html).
1164 /**
1165 Provided by **VK_SEC_ubm_surface**.*/
1166 ///
1167 ///# Errors
1168 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1169 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1170 ///- `VK_ERROR_UNKNOWN`
1171 ///- `VK_ERROR_VALIDATION_FAILED`
1172 ///
1173 ///# Safety
1174 ///- `instance` (self) must be valid and not destroyed.
1175 ///
1176 ///# Panics
1177 ///Panics if `vkCreateUbmSurfaceSEC` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1178 ///
1179 ///# Usage Notes
1180 ///
1181 ///Creates a Vulkan surface for a Samsung UBM (Unified Buffer
1182 ///Manager) window. Samsung platform only.
1183 ///
1184 ///Requires `VK_SEC_ubm_surface`.
1185 pub unsafe fn create_ubm_surface_sec(
1186 &self,
1187 p_create_info: &UbmSurfaceCreateInfoSEC,
1188 allocator: Option<&AllocationCallbacks>,
1189 ) -> VkResult<SurfaceKHR> {
1190 let fp = self
1191 .commands()
1192 .create_ubm_surface_sec
1193 .expect("vkCreateUbmSurfaceSEC not loaded");
1194 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1195 let mut out = unsafe { core::mem::zeroed() };
1196 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1197 Ok(out)
1198 }
1199 ///Wraps [`vkGetPhysicalDeviceUbmPresentationSupportSEC`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceUbmPresentationSupportSEC.html).
1200 /**
1201 Provided by **VK_SEC_ubm_surface**.*/
1202 ///
1203 ///# Safety
1204 ///- `physicalDevice` (self) must be valid and not destroyed.
1205 ///
1206 ///# Panics
1207 ///Panics if `vkGetPhysicalDeviceUbmPresentationSupportSEC` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1208 ///
1209 ///# Usage Notes
1210 ///
1211 ///Queries whether a queue family supports presentation to a
1212 ///Samsung UBM surface. Samsung platform only.
1213 ///
1214 ///Requires `VK_SEC_ubm_surface`.
1215 pub unsafe fn get_physical_device_ubm_presentation_support_sec(
1216 &self,
1217 physical_device: PhysicalDevice,
1218 queue_family_index: u32,
1219 ) -> core::ffi::c_void {
1220 let fp = self
1221 .commands()
1222 .get_physical_device_ubm_presentation_support_sec
1223 .expect("vkGetPhysicalDeviceUbmPresentationSupportSEC not loaded");
1224 let mut out = unsafe { core::mem::zeroed() };
1225 unsafe { fp(physical_device, queue_family_index, &mut out) };
1226 out
1227 }
1228 ///Wraps [`vkGetPhysicalDeviceWin32PresentationSupportKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceWin32PresentationSupportKHR.html).
1229 /**
1230 Provided by **VK_KHR_win32_surface**.*/
1231 ///
1232 ///# Safety
1233 ///- `physicalDevice` (self) must be valid and not destroyed.
1234 ///
1235 ///# Panics
1236 ///Panics if `vkGetPhysicalDeviceWin32PresentationSupportKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1237 ///
1238 ///# Usage Notes
1239 ///
1240 ///Queries whether a queue family on the physical device supports
1241 ///presentation to the Win32 desktop compositor. Windows only.
1242 ///Check this before creating a swapchain to ensure the queue can
1243 ///present.
1244 ///
1245 ///Requires `VK_KHR_win32_surface`.
1246 pub unsafe fn get_physical_device_win32_presentation_support_khr(
1247 &self,
1248 physical_device: PhysicalDevice,
1249 queue_family_index: u32,
1250 ) -> bool {
1251 let fp = self
1252 .commands()
1253 .get_physical_device_win32_presentation_support_khr
1254 .expect("vkGetPhysicalDeviceWin32PresentationSupportKHR not loaded");
1255 (unsafe { fp(physical_device, queue_family_index) }) != 0
1256 }
1257 ///Wraps [`vkGetPhysicalDeviceXlibPresentationSupportKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceXlibPresentationSupportKHR.html).
1258 /**
1259 Provided by **VK_KHR_xlib_surface**.*/
1260 ///
1261 ///# Safety
1262 ///- `physicalDevice` (self) must be valid and not destroyed.
1263 ///
1264 ///# Panics
1265 ///Panics if `vkGetPhysicalDeviceXlibPresentationSupportKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1266 ///
1267 ///# Usage Notes
1268 ///
1269 ///Queries whether a queue family supports presentation to an X11
1270 ///display via Xlib for the given visual ID. Linux/X11 only.
1271 ///
1272 ///Requires `VK_KHR_xlib_surface`.
1273 pub unsafe fn get_physical_device_xlib_presentation_support_khr(
1274 &self,
1275 physical_device: PhysicalDevice,
1276 queue_family_index: u32,
1277 visual_id: core::ffi::c_ulong,
1278 ) -> core::ffi::c_void {
1279 let fp = self
1280 .commands()
1281 .get_physical_device_xlib_presentation_support_khr
1282 .expect("vkGetPhysicalDeviceXlibPresentationSupportKHR not loaded");
1283 let mut out = unsafe { core::mem::zeroed() };
1284 unsafe { fp(physical_device, queue_family_index, &mut out, visual_id) };
1285 out
1286 }
1287 ///Wraps [`vkGetPhysicalDeviceXcbPresentationSupportKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceXcbPresentationSupportKHR.html).
1288 /**
1289 Provided by **VK_KHR_xcb_surface**.*/
1290 ///
1291 ///# Safety
1292 ///- `physicalDevice` (self) must be valid and not destroyed.
1293 ///
1294 ///# Panics
1295 ///Panics if `vkGetPhysicalDeviceXcbPresentationSupportKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1296 ///
1297 ///# Usage Notes
1298 ///
1299 ///Queries whether a queue family supports presentation to an X11
1300 ///display via XCB for the given visual ID. Linux/X11 only.
1301 ///
1302 ///Requires `VK_KHR_xcb_surface`.
1303 pub unsafe fn get_physical_device_xcb_presentation_support_khr(
1304 &self,
1305 physical_device: PhysicalDevice,
1306 queue_family_index: u32,
1307 visual_id: u32,
1308 ) -> core::ffi::c_void {
1309 let fp = self
1310 .commands()
1311 .get_physical_device_xcb_presentation_support_khr
1312 .expect("vkGetPhysicalDeviceXcbPresentationSupportKHR not loaded");
1313 let mut out = unsafe { core::mem::zeroed() };
1314 unsafe { fp(physical_device, queue_family_index, &mut out, visual_id) };
1315 out
1316 }
1317 ///Wraps [`vkCreateDirectFBSurfaceEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateDirectFBSurfaceEXT.html).
1318 /**
1319 Provided by **VK_EXT_directfb_surface**.*/
1320 ///
1321 ///# Errors
1322 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1323 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1324 ///- `VK_ERROR_UNKNOWN`
1325 ///- `VK_ERROR_VALIDATION_FAILED`
1326 ///
1327 ///# Safety
1328 ///- `instance` (self) must be valid and not destroyed.
1329 ///
1330 ///# Panics
1331 ///Panics if `vkCreateDirectFBSurfaceEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1332 ///
1333 ///# Usage Notes
1334 ///
1335 ///Creates a Vulkan surface for a DirectFB window. Linux/DirectFB
1336 ///only. The create info references the DirectFB instance and
1337 ///surface handles.
1338 ///
1339 ///Requires `VK_EXT_directfb_surface`.
1340 pub unsafe fn create_direct_fb_surface_ext(
1341 &self,
1342 p_create_info: &DirectFBSurfaceCreateInfoEXT,
1343 allocator: Option<&AllocationCallbacks>,
1344 ) -> VkResult<SurfaceKHR> {
1345 let fp = self
1346 .commands()
1347 .create_direct_fb_surface_ext
1348 .expect("vkCreateDirectFBSurfaceEXT not loaded");
1349 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1350 let mut out = unsafe { core::mem::zeroed() };
1351 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1352 Ok(out)
1353 }
1354 ///Wraps [`vkGetPhysicalDeviceDirectFBPresentationSupportEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceDirectFBPresentationSupportEXT.html).
1355 /**
1356 Provided by **VK_EXT_directfb_surface**.*/
1357 ///
1358 ///# Safety
1359 ///- `physicalDevice` (self) must be valid and not destroyed.
1360 ///
1361 ///# Panics
1362 ///Panics if `vkGetPhysicalDeviceDirectFBPresentationSupportEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1363 ///
1364 ///# Usage Notes
1365 ///
1366 ///Queries whether a queue family supports presentation to a
1367 ///DirectFB surface. Linux/DirectFB only.
1368 ///
1369 ///Requires `VK_EXT_directfb_surface`.
1370 pub unsafe fn get_physical_device_direct_fb_presentation_support_ext(
1371 &self,
1372 physical_device: PhysicalDevice,
1373 queue_family_index: u32,
1374 ) -> core::ffi::c_void {
1375 let fp = self
1376 .commands()
1377 .get_physical_device_direct_fb_presentation_support_ext
1378 .expect("vkGetPhysicalDeviceDirectFBPresentationSupportEXT not loaded");
1379 let mut out = unsafe { core::mem::zeroed() };
1380 unsafe { fp(physical_device, queue_family_index, &mut out) };
1381 out
1382 }
1383 ///Wraps [`vkCreateImagePipeSurfaceFUCHSIA`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateImagePipeSurfaceFUCHSIA.html).
1384 /**
1385 Provided by **VK_FUCHSIA_imagepipe_surface**.*/
1386 ///
1387 ///# Errors
1388 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1389 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1390 ///- `VK_ERROR_UNKNOWN`
1391 ///- `VK_ERROR_VALIDATION_FAILED`
1392 ///
1393 ///# Safety
1394 ///- `instance` (self) must be valid and not destroyed.
1395 ///
1396 ///# Panics
1397 ///Panics if `vkCreateImagePipeSurfaceFUCHSIA` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1398 ///
1399 ///# Usage Notes
1400 ///
1401 ///Creates a Vulkan surface backed by a Fuchsia ImagePipe. Fuchsia
1402 ///OS only. The create info references the ImagePipe handle from
1403 ///the Fuchsia scenic compositor.
1404 ///
1405 ///Requires `VK_FUCHSIA_imagepipe_surface`.
1406 pub unsafe fn create_image_pipe_surface_fuchsia(
1407 &self,
1408 p_create_info: &ImagePipeSurfaceCreateInfoFUCHSIA,
1409 allocator: Option<&AllocationCallbacks>,
1410 ) -> VkResult<SurfaceKHR> {
1411 let fp = self
1412 .commands()
1413 .create_image_pipe_surface_fuchsia
1414 .expect("vkCreateImagePipeSurfaceFUCHSIA not loaded");
1415 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1416 let mut out = unsafe { core::mem::zeroed() };
1417 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1418 Ok(out)
1419 }
1420 ///Wraps [`vkCreateStreamDescriptorSurfaceGGP`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateStreamDescriptorSurfaceGGP.html).
1421 /**
1422 Provided by **VK_GGP_stream_descriptor_surface**.*/
1423 ///
1424 ///# Errors
1425 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1426 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1427 ///- `VK_ERROR_NATIVE_WINDOW_IN_USE_KHR`
1428 ///- `VK_ERROR_UNKNOWN`
1429 ///- `VK_ERROR_VALIDATION_FAILED`
1430 ///
1431 ///# Safety
1432 ///- `instance` (self) must be valid and not destroyed.
1433 ///
1434 ///# Panics
1435 ///Panics if `vkCreateStreamDescriptorSurfaceGGP` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1436 ///
1437 ///# Usage Notes
1438 ///
1439 ///Creates a Vulkan surface from a Google Games Platform (Stadia)
1440 ///stream descriptor. GGP only. The platform has been discontinued.
1441 ///
1442 ///Requires `VK_GGP_stream_descriptor_surface`.
1443 pub unsafe fn create_stream_descriptor_surface_ggp(
1444 &self,
1445 p_create_info: &StreamDescriptorSurfaceCreateInfoGGP,
1446 allocator: Option<&AllocationCallbacks>,
1447 ) -> VkResult<SurfaceKHR> {
1448 let fp = self
1449 .commands()
1450 .create_stream_descriptor_surface_ggp
1451 .expect("vkCreateStreamDescriptorSurfaceGGP not loaded");
1452 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1453 let mut out = unsafe { core::mem::zeroed() };
1454 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1455 Ok(out)
1456 }
1457 ///Wraps [`vkCreateScreenSurfaceQNX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateScreenSurfaceQNX.html).
1458 /**
1459 Provided by **VK_QNX_screen_surface**.*/
1460 ///
1461 ///# Errors
1462 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1463 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1464 ///- `VK_ERROR_UNKNOWN`
1465 ///- `VK_ERROR_VALIDATION_FAILED`
1466 ///
1467 ///# Safety
1468 ///- `instance` (self) must be valid and not destroyed.
1469 ///
1470 ///# Panics
1471 ///Panics if `vkCreateScreenSurfaceQNX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1472 ///
1473 ///# Usage Notes
1474 ///
1475 ///Creates a Vulkan surface for a QNX Screen window. QNX only.
1476 ///The create info references the QNX screen context and window.
1477 ///
1478 ///Requires `VK_QNX_screen_surface`.
1479 pub unsafe fn create_screen_surface_qnx(
1480 &self,
1481 p_create_info: &ScreenSurfaceCreateInfoQNX,
1482 allocator: Option<&AllocationCallbacks>,
1483 ) -> VkResult<SurfaceKHR> {
1484 let fp = self
1485 .commands()
1486 .create_screen_surface_qnx
1487 .expect("vkCreateScreenSurfaceQNX not loaded");
1488 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1489 let mut out = unsafe { core::mem::zeroed() };
1490 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1491 Ok(out)
1492 }
1493 ///Wraps [`vkGetPhysicalDeviceScreenPresentationSupportQNX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceScreenPresentationSupportQNX.html).
1494 /**
1495 Provided by **VK_QNX_screen_surface**.*/
1496 ///
1497 ///# Safety
1498 ///- `physicalDevice` (self) must be valid and not destroyed.
1499 ///
1500 ///# Panics
1501 ///Panics if `vkGetPhysicalDeviceScreenPresentationSupportQNX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1502 ///
1503 ///# Usage Notes
1504 ///
1505 ///Queries whether a queue family supports presentation on QNX
1506 ///Screen. QNX only.
1507 ///
1508 ///Requires `VK_QNX_screen_surface`.
1509 pub unsafe fn get_physical_device_screen_presentation_support_qnx(
1510 &self,
1511 physical_device: PhysicalDevice,
1512 queue_family_index: u32,
1513 ) -> core::ffi::c_void {
1514 let fp = self
1515 .commands()
1516 .get_physical_device_screen_presentation_support_qnx
1517 .expect("vkGetPhysicalDeviceScreenPresentationSupportQNX not loaded");
1518 let mut out = unsafe { core::mem::zeroed() };
1519 unsafe { fp(physical_device, queue_family_index, &mut out) };
1520 out
1521 }
1522 ///Wraps [`vkCreateDebugReportCallbackEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateDebugReportCallbackEXT.html).
1523 /**
1524 Provided by **VK_EXT_debug_report**.*/
1525 ///
1526 ///# Errors
1527 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1528 ///- `VK_ERROR_UNKNOWN`
1529 ///- `VK_ERROR_VALIDATION_FAILED`
1530 ///
1531 ///# Safety
1532 ///- `instance` (self) must be valid and not destroyed.
1533 ///
1534 ///# Panics
1535 ///Panics if `vkCreateDebugReportCallbackEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1536 ///
1537 ///# Usage Notes
1538 ///
1539 ///Creates a legacy debug report callback. Superseded by
1540 ///`create_debug_utils_messenger_ext` (`VK_EXT_debug_utils`),
1541 ///which provides richer message data and object labeling.
1542 ///
1543 ///The callback receives validation messages filtered by the
1544 ///`flags` bitmask (error, warning, performance, info, debug).
1545 ///
1546 ///Destroy with `destroy_debug_report_callback_ext`.
1547 ///
1548 ///Requires `VK_EXT_debug_report`. Prefer `VK_EXT_debug_utils`
1549 ///for new code.
1550 pub unsafe fn create_debug_report_callback_ext(
1551 &self,
1552 p_create_info: &DebugReportCallbackCreateInfoEXT,
1553 allocator: Option<&AllocationCallbacks>,
1554 ) -> VkResult<DebugReportCallbackEXT> {
1555 let fp = self
1556 .commands()
1557 .create_debug_report_callback_ext
1558 .expect("vkCreateDebugReportCallbackEXT not loaded");
1559 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1560 let mut out = unsafe { core::mem::zeroed() };
1561 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1562 Ok(out)
1563 }
1564 ///Wraps [`vkDestroyDebugReportCallbackEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyDebugReportCallbackEXT.html).
1565 /**
1566 Provided by **VK_EXT_debug_report**.*/
1567 ///
1568 ///# Safety
1569 ///- `instance` (self) must be valid and not destroyed.
1570 ///- `callback` must be externally synchronized.
1571 ///
1572 ///# Panics
1573 ///Panics if `vkDestroyDebugReportCallbackEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1574 ///
1575 ///# Usage Notes
1576 ///
1577 ///Destroys a legacy debug report callback created with
1578 ///`create_debug_report_callback_ext`.
1579 ///
1580 ///Destroy before the instance is destroyed.
1581 ///
1582 ///Requires `VK_EXT_debug_report`.
1583 pub unsafe fn destroy_debug_report_callback_ext(
1584 &self,
1585 callback: DebugReportCallbackEXT,
1586 allocator: Option<&AllocationCallbacks>,
1587 ) {
1588 let fp = self
1589 .commands()
1590 .destroy_debug_report_callback_ext
1591 .expect("vkDestroyDebugReportCallbackEXT not loaded");
1592 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1593 unsafe { fp(self.handle(), callback, alloc_ptr) };
1594 }
1595 ///Wraps [`vkDebugReportMessageEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDebugReportMessageEXT.html).
1596 /**
1597 Provided by **VK_EXT_debug_report**.*/
1598 ///
1599 ///# Safety
1600 ///- `instance` (self) must be valid and not destroyed.
1601 ///
1602 ///# Panics
1603 ///Panics if `vkDebugReportMessageEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1604 ///
1605 ///# Usage Notes
1606 ///
1607 ///Manually injects a message into the legacy debug report callback
1608 ///chain. All registered callbacks matching the specified `flags`
1609 ///will receive the message.
1610 ///
1611 ///`p_layer_prefix` and `p_message` are C strings. `object` is the
1612 ///raw handle of the relevant Vulkan object (or 0 if none).
1613 ///
1614 ///Superseded by `submit_debug_utils_message_ext`.
1615 ///
1616 ///Requires `VK_EXT_debug_report`.
1617 pub unsafe fn debug_report_message_ext(
1618 &self,
1619 flags: DebugReportFlagsEXT,
1620 object_type: DebugReportObjectTypeEXT,
1621 object: u64,
1622 location: usize,
1623 message_code: i32,
1624 p_layer_prefix: *const core::ffi::c_char,
1625 p_message: *const core::ffi::c_char,
1626 ) {
1627 let fp = self
1628 .commands()
1629 .debug_report_message_ext
1630 .expect("vkDebugReportMessageEXT not loaded");
1631 unsafe {
1632 fp(
1633 self.handle(),
1634 flags,
1635 object_type,
1636 object,
1637 location,
1638 message_code,
1639 p_layer_prefix,
1640 p_message,
1641 )
1642 };
1643 }
1644 ///Wraps [`vkGetPhysicalDeviceExternalImageFormatPropertiesNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceExternalImageFormatPropertiesNV.html).
1645 /**
1646 Provided by **VK_NV_external_memory_capabilities**.*/
1647 ///
1648 ///# Errors
1649 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1650 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1651 ///- `VK_ERROR_FORMAT_NOT_SUPPORTED`
1652 ///- `VK_ERROR_UNKNOWN`
1653 ///- `VK_ERROR_VALIDATION_FAILED`
1654 ///
1655 ///# Safety
1656 ///- `physicalDevice` (self) must be valid and not destroyed.
1657 ///
1658 ///# Panics
1659 ///Panics if `vkGetPhysicalDeviceExternalImageFormatPropertiesNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1660 ///
1661 ///# Usage Notes
1662 ///
1663 ///Legacy NV path for querying external image format properties.
1664 ///Takes the full set of image creation parameters plus an external
1665 ///handle type and returns compatibility information. Prefer the
1666 ///core `get_physical_device_image_format_properties2` with
1667 ///`PhysicalDeviceExternalImageFormatInfo` in the pNext chain.
1668 ///
1669 ///Requires `VK_NV_external_memory_capabilities`.
1670 pub unsafe fn get_physical_device_external_image_format_properties_nv(
1671 &self,
1672 physical_device: PhysicalDevice,
1673 format: Format,
1674 r#type: ImageType,
1675 tiling: ImageTiling,
1676 usage: ImageUsageFlags,
1677 flags: ImageCreateFlags,
1678 external_handle_type: ExternalMemoryHandleTypeFlagsNV,
1679 ) -> VkResult<ExternalImageFormatPropertiesNV> {
1680 let fp = self
1681 .commands()
1682 .get_physical_device_external_image_format_properties_nv
1683 .expect("vkGetPhysicalDeviceExternalImageFormatPropertiesNV not loaded");
1684 let mut out = unsafe { core::mem::zeroed() };
1685 check(unsafe {
1686 fp(
1687 physical_device,
1688 format,
1689 r#type,
1690 tiling,
1691 usage,
1692 flags,
1693 external_handle_type,
1694 &mut out,
1695 )
1696 })?;
1697 Ok(out)
1698 }
1699 ///Wraps [`vkGetPhysicalDeviceFeatures2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceFeatures2.html).
1700 /**
1701 Provided by **VK_BASE_VERSION_1_1**.*/
1702 ///
1703 ///# Safety
1704 ///- `physicalDevice` (self) must be valid and not destroyed.
1705 ///
1706 ///# Panics
1707 ///Panics if `vkGetPhysicalDeviceFeatures2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1708 ///
1709 ///# Usage Notes
1710 ///
1711 ///Vulkan 1.1 version of `get_physical_device_features` that supports
1712 ///chaining additional feature structs via pNext.
1713 ///
1714 ///Chain version-specific and extension feature structs to query their
1715 ///availability:
1716 ///
1717 ///- `PhysicalDeviceVulkan11Features`
1718 ///- `PhysicalDeviceVulkan12Features`
1719 ///- `PhysicalDeviceVulkan13Features`
1720 ///- Extension-specific structs like
1721 /// `PhysicalDeviceRayTracingPipelineFeaturesKHR`
1722 ///
1723 ///Then pass the same chain (with desired features enabled) to
1724 ///`DeviceCreateInfo` to enable them at device creation.
1725 ///
1726 ///Always query before enabling, requesting an unsupported feature
1727 ///fails device creation.
1728 pub unsafe fn get_physical_device_features2(
1729 &self,
1730 physical_device: PhysicalDevice,
1731 p_features: &mut PhysicalDeviceFeatures2,
1732 ) {
1733 let fp = self
1734 .commands()
1735 .get_physical_device_features2
1736 .expect("vkGetPhysicalDeviceFeatures2 not loaded");
1737 unsafe { fp(physical_device, p_features) };
1738 }
1739 ///Wraps [`vkGetPhysicalDeviceProperties2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceProperties2.html).
1740 /**
1741 Provided by **VK_BASE_VERSION_1_1**.*/
1742 ///
1743 ///# Safety
1744 ///- `physicalDevice` (self) must be valid and not destroyed.
1745 ///
1746 ///# Panics
1747 ///Panics if `vkGetPhysicalDeviceProperties2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1748 ///
1749 ///# Usage Notes
1750 ///
1751 ///Vulkan 1.1 version of `get_physical_device_properties` that supports
1752 ///chaining additional property structs via pNext.
1753 ///
1754 ///Chain version-specific and extension property structs to query
1755 ///extended limits and capabilities:
1756 ///
1757 ///- `PhysicalDeviceVulkan11Properties`: subgroup properties, point
1758 /// clipping, protected memory.
1759 ///- `PhysicalDeviceVulkan12Properties`: driver conformance, denorm
1760 /// behaviour, float controls, descriptor indexing limits, timeline
1761 /// semaphore properties.
1762 ///- `PhysicalDeviceVulkan13Properties`: subgroup size control,
1763 /// inline uniform block limits, dynamic rendering limits.
1764 ///- Extension structs like
1765 /// `PhysicalDeviceRayTracingPipelinePropertiesKHR`.
1766 ///
1767 ///The base `PhysicalDeviceProperties` is identical to what
1768 ///`get_physical_device_properties` returns.
1769 pub unsafe fn get_physical_device_properties2(
1770 &self,
1771 physical_device: PhysicalDevice,
1772 p_properties: &mut PhysicalDeviceProperties2,
1773 ) {
1774 let fp = self
1775 .commands()
1776 .get_physical_device_properties2
1777 .expect("vkGetPhysicalDeviceProperties2 not loaded");
1778 unsafe { fp(physical_device, p_properties) };
1779 }
1780 ///Wraps [`vkGetPhysicalDeviceFormatProperties2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceFormatProperties2.html).
1781 /**
1782 Provided by **VK_BASE_VERSION_1_1**.*/
1783 ///
1784 ///# Safety
1785 ///- `physicalDevice` (self) must be valid and not destroyed.
1786 ///
1787 ///# Panics
1788 ///Panics if `vkGetPhysicalDeviceFormatProperties2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1789 ///
1790 ///# Usage Notes
1791 ///
1792 ///Vulkan 1.1 version of `get_physical_device_format_properties` that
1793 ///supports extensible output via pNext.
1794 ///
1795 ///Chain `DrmFormatModifierPropertiesListEXT` to query DRM format
1796 ///modifier support, or `FormatProperties3` (Vulkan 1.3) for extended
1797 ///format feature flags that do not fit in the original 32-bit fields.
1798 ///
1799 ///The base `FormatProperties` (linear, optimal, buffer features) is
1800 ///identical to what `get_physical_device_format_properties` returns.
1801 pub unsafe fn get_physical_device_format_properties2(
1802 &self,
1803 physical_device: PhysicalDevice,
1804 format: Format,
1805 p_format_properties: &mut FormatProperties2,
1806 ) {
1807 let fp = self
1808 .commands()
1809 .get_physical_device_format_properties2
1810 .expect("vkGetPhysicalDeviceFormatProperties2 not loaded");
1811 unsafe { fp(physical_device, format, p_format_properties) };
1812 }
1813 ///Wraps [`vkGetPhysicalDeviceImageFormatProperties2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceImageFormatProperties2.html).
1814 /**
1815 Provided by **VK_BASE_VERSION_1_1**.*/
1816 ///
1817 ///# Errors
1818 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1819 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1820 ///- `VK_ERROR_FORMAT_NOT_SUPPORTED`
1821 ///- `VK_ERROR_IMAGE_USAGE_NOT_SUPPORTED_KHR`
1822 ///- `VK_ERROR_VIDEO_PROFILE_OPERATION_NOT_SUPPORTED_KHR`
1823 ///- `VK_ERROR_VIDEO_PROFILE_FORMAT_NOT_SUPPORTED_KHR`
1824 ///- `VK_ERROR_VIDEO_PICTURE_LAYOUT_NOT_SUPPORTED_KHR`
1825 ///- `VK_ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR`
1826 ///- `VK_ERROR_UNKNOWN`
1827 ///- `VK_ERROR_VALIDATION_FAILED`
1828 ///
1829 ///# Safety
1830 ///- `physicalDevice` (self) must be valid and not destroyed.
1831 ///
1832 ///# Panics
1833 ///Panics if `vkGetPhysicalDeviceImageFormatProperties2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1834 ///
1835 ///# Usage Notes
1836 ///
1837 ///Vulkan 1.1 version of `get_physical_device_image_format_properties`
1838 ///that supports extensible input and output via pNext.
1839 ///
1840 ///Chain in the input:
1841 ///
1842 ///- `PhysicalDeviceExternalImageFormatInfo`: query external memory
1843 /// compatibility for the image.
1844 ///- `PhysicalDeviceImageDrmFormatModifierInfoEXT`: query DRM modifier
1845 /// support.
1846 ///
1847 ///Chain in the output:
1848 ///
1849 ///- `ExternalImageFormatProperties`: external memory capabilities.
1850 ///- `SamplerYcbcrConversionImageFormatProperties`: YCBCR support.
1851 ///
1852 ///Returns `VK_ERROR_FORMAT_NOT_SUPPORTED` if the combination is not
1853 ///supported.
1854 pub unsafe fn get_physical_device_image_format_properties2(
1855 &self,
1856 physical_device: PhysicalDevice,
1857 p_image_format_info: &PhysicalDeviceImageFormatInfo2,
1858 p_image_format_properties: &mut ImageFormatProperties2,
1859 ) -> VkResult<()> {
1860 let fp = self
1861 .commands()
1862 .get_physical_device_image_format_properties2
1863 .expect("vkGetPhysicalDeviceImageFormatProperties2 not loaded");
1864 check(unsafe {
1865 fp(
1866 physical_device,
1867 p_image_format_info,
1868 p_image_format_properties,
1869 )
1870 })
1871 }
1872 ///Wraps [`vkGetPhysicalDeviceQueueFamilyProperties2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceQueueFamilyProperties2.html).
1873 /**
1874 Provided by **VK_BASE_VERSION_1_1**.*/
1875 ///
1876 ///# Safety
1877 ///- `physicalDevice` (self) must be valid and not destroyed.
1878 ///
1879 ///# Panics
1880 ///Panics if `vkGetPhysicalDeviceQueueFamilyProperties2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1881 ///
1882 ///# Usage Notes
1883 ///
1884 ///Vulkan 1.1 version of `get_physical_device_queue_family_properties`
1885 ///that supports extensible output via pNext.
1886 ///
1887 ///Chain `QueueFamilyCheckpointPropertiesNV` for diagnostic checkpoint
1888 ///support, or `QueueFamilyGlobalPriorityPropertiesKHR` for
1889 ///global priority scheduling capabilities.
1890 ///
1891 ///The base `QueueFamilyProperties` is identical to what
1892 ///`get_physical_device_queue_family_properties` returns.
1893 pub unsafe fn get_physical_device_queue_family_properties2(
1894 &self,
1895 physical_device: PhysicalDevice,
1896 ) -> Vec<QueueFamilyProperties2> {
1897 let fp = self
1898 .commands()
1899 .get_physical_device_queue_family_properties2
1900 .expect("vkGetPhysicalDeviceQueueFamilyProperties2 not loaded");
1901 fill_two_call(|count, data| unsafe { fp(physical_device, count, data) })
1902 }
1903 ///Wraps [`vkGetPhysicalDeviceMemoryProperties2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceMemoryProperties2.html).
1904 /**
1905 Provided by **VK_BASE_VERSION_1_1**.*/
1906 ///
1907 ///# Safety
1908 ///- `physicalDevice` (self) must be valid and not destroyed.
1909 ///
1910 ///# Panics
1911 ///Panics if `vkGetPhysicalDeviceMemoryProperties2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1912 ///
1913 ///# Usage Notes
1914 ///
1915 ///Vulkan 1.1 version of `get_physical_device_memory_properties` that
1916 ///supports extensible output via pNext.
1917 ///
1918 ///Chain `PhysicalDeviceMemoryBudgetPropertiesEXT` (if the
1919 ///`VK_EXT_memory_budget` extension is available) to query per-heap
1920 ///budget and current usage. This is essential for managing memory
1921 ///pressure on systems with unified memory or limited VRAM.
1922 ///
1923 ///The base `PhysicalDeviceMemoryProperties` (heaps and types) is
1924 ///identical to what `get_physical_device_memory_properties` returns.
1925 pub unsafe fn get_physical_device_memory_properties2(
1926 &self,
1927 physical_device: PhysicalDevice,
1928 p_memory_properties: &mut PhysicalDeviceMemoryProperties2,
1929 ) {
1930 let fp = self
1931 .commands()
1932 .get_physical_device_memory_properties2
1933 .expect("vkGetPhysicalDeviceMemoryProperties2 not loaded");
1934 unsafe { fp(physical_device, p_memory_properties) };
1935 }
1936 ///Wraps [`vkGetPhysicalDeviceSparseImageFormatProperties2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceSparseImageFormatProperties2.html).
1937 /**
1938 Provided by **VK_BASE_VERSION_1_1**.*/
1939 ///
1940 ///# Safety
1941 ///- `physicalDevice` (self) must be valid and not destroyed.
1942 ///
1943 ///# Panics
1944 ///Panics if `vkGetPhysicalDeviceSparseImageFormatProperties2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1945 ///
1946 ///# Usage Notes
1947 ///
1948 ///Vulkan 1.1 version of
1949 ///`get_physical_device_sparse_image_format_properties` that supports
1950 ///extensible output via pNext.
1951 ///
1952 ///Only relevant for sparse images. Returns the same base sparse format
1953 ///properties as the 1.0 version.
1954 pub unsafe fn get_physical_device_sparse_image_format_properties2(
1955 &self,
1956 physical_device: PhysicalDevice,
1957 p_format_info: &PhysicalDeviceSparseImageFormatInfo2,
1958 ) -> Vec<SparseImageFormatProperties2> {
1959 let fp = self
1960 .commands()
1961 .get_physical_device_sparse_image_format_properties2
1962 .expect("vkGetPhysicalDeviceSparseImageFormatProperties2 not loaded");
1963 fill_two_call(|count, data| unsafe { fp(physical_device, p_format_info, count, data) })
1964 }
1965 ///Wraps [`vkGetPhysicalDeviceExternalBufferProperties`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceExternalBufferProperties.html).
1966 /**
1967 Provided by **VK_BASE_VERSION_1_1**.*/
1968 ///
1969 ///# Safety
1970 ///- `physicalDevice` (self) must be valid and not destroyed.
1971 ///
1972 ///# Panics
1973 ///Panics if `vkGetPhysicalDeviceExternalBufferProperties` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1974 ///
1975 ///# Usage Notes
1976 ///
1977 ///Queries whether a buffer with the given usage and flags can be
1978 ///exported to or imported from an external handle type (e.g. POSIX
1979 ///file descriptor, Win32 handle, or DMA-BUF).
1980 ///
1981 ///The returned `ExternalBufferProperties` indicates:
1982 ///
1983 ///- Whether the external handle type is compatible.
1984 ///- Whether dedicated allocation is required.
1985 ///- Which other handle types the memory can be exported to
1986 /// simultaneously.
1987 ///
1988 ///Use this before creating a buffer intended for cross-process or
1989 ///cross-API sharing to verify the external memory capabilities.
1990 pub unsafe fn get_physical_device_external_buffer_properties(
1991 &self,
1992 physical_device: PhysicalDevice,
1993 p_external_buffer_info: &PhysicalDeviceExternalBufferInfo,
1994 p_external_buffer_properties: &mut ExternalBufferProperties,
1995 ) {
1996 let fp = self
1997 .commands()
1998 .get_physical_device_external_buffer_properties
1999 .expect("vkGetPhysicalDeviceExternalBufferProperties not loaded");
2000 unsafe {
2001 fp(
2002 physical_device,
2003 p_external_buffer_info,
2004 p_external_buffer_properties,
2005 )
2006 };
2007 }
2008 ///Wraps [`vkGetPhysicalDeviceExternalMemorySciBufPropertiesNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceExternalMemorySciBufPropertiesNV.html).
2009 ///
2010 ///# Errors
2011 ///- `VK_ERROR_INITIALIZATION_FAILED`
2012 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
2013 ///- `VK_ERROR_UNKNOWN`
2014 ///- `VK_ERROR_VALIDATION_FAILED`
2015 ///
2016 ///# Safety
2017 ///- `physicalDevice` (self) must be valid and not destroyed.
2018 ///
2019 ///# Panics
2020 ///Panics if `vkGetPhysicalDeviceExternalMemorySciBufPropertiesNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2021 ///
2022 ///# Usage Notes
2023 ///
2024 ///Queries compatibility of external NvSciBuf memory handles with
2025 ///Vulkan on NVIDIA platforms (primarily automotive / embedded). Returns
2026 ///the compatible memory types for a given NvSciBuf attribute list.
2027 ///
2028 ///This is a platform-specific extension for NVIDIA's Safety Critical
2029 ///ecosystem. Not available on desktop or mobile platforms.
2030 pub unsafe fn get_physical_device_external_memory_sci_buf_properties_nv(
2031 &self,
2032 physical_device: PhysicalDevice,
2033 handle_type: ExternalMemoryHandleTypeFlagBits,
2034 handle: *const core::ffi::c_void,
2035 p_memory_sci_buf_properties: &mut MemorySciBufPropertiesNV,
2036 ) -> VkResult<()> {
2037 let fp = self
2038 .commands()
2039 .get_physical_device_external_memory_sci_buf_properties_nv
2040 .expect("vkGetPhysicalDeviceExternalMemorySciBufPropertiesNV not loaded");
2041 check(unsafe {
2042 fp(
2043 physical_device,
2044 handle_type,
2045 handle,
2046 p_memory_sci_buf_properties,
2047 )
2048 })
2049 }
2050 ///Wraps [`vkGetPhysicalDeviceSciBufAttributesNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceSciBufAttributesNV.html).
2051 ///
2052 ///# Errors
2053 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2054 ///- `VK_ERROR_INITIALIZATION_FAILED`
2055 ///- `VK_ERROR_UNKNOWN`
2056 ///- `VK_ERROR_VALIDATION_FAILED`
2057 ///
2058 ///# Safety
2059 ///- `physicalDevice` (self) must be valid and not destroyed.
2060 ///
2061 ///# Panics
2062 ///Panics if `vkGetPhysicalDeviceSciBufAttributesNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2063 ///
2064 ///# Usage Notes
2065 ///
2066 ///Fills an NvSciBuf attribute list with Vulkan's requirements for
2067 ///a given image or buffer creation info. Used to negotiate buffer
2068 ///attributes when sharing memory between Vulkan and other NvSciBuf
2069 ///consumers.
2070 ///
2071 ///This is a platform-specific extension for NVIDIA's Safety Critical
2072 ///ecosystem. Not available on desktop or mobile platforms.
2073 pub unsafe fn get_physical_device_sci_buf_attributes_nv(
2074 &self,
2075 physical_device: PhysicalDevice,
2076 p_attributes: *const core::ffi::c_void,
2077 ) -> VkResult<()> {
2078 let fp = self
2079 .commands()
2080 .get_physical_device_sci_buf_attributes_nv
2081 .expect("vkGetPhysicalDeviceSciBufAttributesNV not loaded");
2082 check(unsafe { fp(physical_device, p_attributes) })
2083 }
2084 ///Wraps [`vkGetPhysicalDeviceExternalSemaphoreProperties`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceExternalSemaphoreProperties.html).
2085 /**
2086 Provided by **VK_BASE_VERSION_1_1**.*/
2087 ///
2088 ///# Safety
2089 ///- `physicalDevice` (self) must be valid and not destroyed.
2090 ///
2091 ///# Panics
2092 ///Panics if `vkGetPhysicalDeviceExternalSemaphoreProperties` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2093 ///
2094 ///# Usage Notes
2095 ///
2096 ///Queries whether a semaphore can be exported to or imported from an
2097 ///external handle type (e.g. POSIX file descriptor, Win32 handle,
2098 ///sync file, or Zircon event).
2099 ///
2100 ///The returned properties indicate:
2101 ///
2102 ///- Whether the external handle type is compatible with semaphores.
2103 ///- Whether the handle is a copy or a reference.
2104 ///- Which other handle types the semaphore can be exported to.
2105 ///
2106 ///External semaphores are the primary cross-process and cross-API
2107 ///synchronisation mechanism, for example, synchronising Vulkan
2108 ///rendering with an OpenGL or DirectX consumer.
2109 pub unsafe fn get_physical_device_external_semaphore_properties(
2110 &self,
2111 physical_device: PhysicalDevice,
2112 p_external_semaphore_info: &PhysicalDeviceExternalSemaphoreInfo,
2113 p_external_semaphore_properties: &mut ExternalSemaphoreProperties,
2114 ) {
2115 let fp = self
2116 .commands()
2117 .get_physical_device_external_semaphore_properties
2118 .expect("vkGetPhysicalDeviceExternalSemaphoreProperties not loaded");
2119 unsafe {
2120 fp(
2121 physical_device,
2122 p_external_semaphore_info,
2123 p_external_semaphore_properties,
2124 )
2125 };
2126 }
2127 ///Wraps [`vkGetPhysicalDeviceExternalFenceProperties`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceExternalFenceProperties.html).
2128 /**
2129 Provided by **VK_BASE_VERSION_1_1**.*/
2130 ///
2131 ///# Safety
2132 ///- `physicalDevice` (self) must be valid and not destroyed.
2133 ///
2134 ///# Panics
2135 ///Panics if `vkGetPhysicalDeviceExternalFenceProperties` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2136 ///
2137 ///# Usage Notes
2138 ///
2139 ///Queries whether a fence can be exported to or imported from an
2140 ///external handle type (e.g. POSIX file descriptor, Win32 handle,
2141 ///or sync file).
2142 ///
2143 ///The returned properties indicate:
2144 ///
2145 ///- Whether the external handle type is compatible with fences.
2146 ///- Whether the handle is a copy or a reference to the fence state.
2147 ///- Which other handle types the fence can be exported to.
2148 ///
2149 ///Use this before creating a fence intended for cross-process
2150 ///synchronisation.
2151 pub unsafe fn get_physical_device_external_fence_properties(
2152 &self,
2153 physical_device: PhysicalDevice,
2154 p_external_fence_info: &PhysicalDeviceExternalFenceInfo,
2155 p_external_fence_properties: &mut ExternalFenceProperties,
2156 ) {
2157 let fp = self
2158 .commands()
2159 .get_physical_device_external_fence_properties
2160 .expect("vkGetPhysicalDeviceExternalFenceProperties not loaded");
2161 unsafe {
2162 fp(
2163 physical_device,
2164 p_external_fence_info,
2165 p_external_fence_properties,
2166 )
2167 };
2168 }
2169 ///Wraps [`vkGetPhysicalDeviceSciSyncAttributesNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceSciSyncAttributesNV.html).
2170 ///
2171 ///# Errors
2172 ///- `VK_ERROR_INITIALIZATION_FAILED`
2173 ///- `VK_ERROR_UNKNOWN`
2174 ///- `VK_ERROR_VALIDATION_FAILED`
2175 ///
2176 ///# Safety
2177 ///- `physicalDevice` (self) must be valid and not destroyed.
2178 ///
2179 ///# Panics
2180 ///Panics if `vkGetPhysicalDeviceSciSyncAttributesNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2181 ///
2182 ///# Usage Notes
2183 ///
2184 ///Fills an NvSciSync attribute list with Vulkan's requirements for
2185 ///synchronisation. Used to negotiate sync object attributes when
2186 ///sharing synchronisation primitives between Vulkan and other NvSciSync
2187 ///consumers (e.g. camera, display, or compute pipelines).
2188 ///
2189 ///This is a platform-specific extension for NVIDIA's Safety Critical
2190 ///ecosystem. Not available on desktop or mobile platforms.
2191 pub unsafe fn get_physical_device_sci_sync_attributes_nv(
2192 &self,
2193 physical_device: PhysicalDevice,
2194 p_sci_sync_attributes_info: &SciSyncAttributesInfoNV,
2195 p_attributes: *const core::ffi::c_void,
2196 ) -> VkResult<()> {
2197 let fp = self
2198 .commands()
2199 .get_physical_device_sci_sync_attributes_nv
2200 .expect("vkGetPhysicalDeviceSciSyncAttributesNV not loaded");
2201 check(unsafe { fp(physical_device, p_sci_sync_attributes_info, p_attributes) })
2202 }
2203 ///Wraps [`vkReleaseDisplayEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkReleaseDisplayEXT.html).
2204 /**
2205 Provided by **VK_EXT_direct_mode_display**.*/
2206 ///
2207 ///# Errors
2208 ///- `VK_ERROR_UNKNOWN`
2209 ///- `VK_ERROR_VALIDATION_FAILED`
2210 ///
2211 ///# Safety
2212 ///- `physicalDevice` (self) must be valid and not destroyed.
2213 ///
2214 ///# Panics
2215 ///Panics if `vkReleaseDisplayEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2216 ///
2217 ///# Usage Notes
2218 ///
2219 ///Releases a previously acquired display, returning control to the
2220 ///platform's display manager. Call this when done with direct
2221 ///display rendering.
2222 ///
2223 ///Requires `VK_EXT_direct_mode_display`.
2224 pub unsafe fn release_display_ext(
2225 &self,
2226 physical_device: PhysicalDevice,
2227 display: DisplayKHR,
2228 ) -> VkResult<()> {
2229 let fp = self
2230 .commands()
2231 .release_display_ext
2232 .expect("vkReleaseDisplayEXT not loaded");
2233 check(unsafe { fp(physical_device, display) })
2234 }
2235 ///Wraps [`vkAcquireXlibDisplayEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAcquireXlibDisplayEXT.html).
2236 /**
2237 Provided by **VK_EXT_acquire_xlib_display**.*/
2238 ///
2239 ///# Errors
2240 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2241 ///- `VK_ERROR_INITIALIZATION_FAILED`
2242 ///- `VK_ERROR_UNKNOWN`
2243 ///- `VK_ERROR_VALIDATION_FAILED`
2244 ///
2245 ///# Safety
2246 ///- `physicalDevice` (self) must be valid and not destroyed.
2247 ///
2248 ///# Panics
2249 ///Panics if `vkAcquireXlibDisplayEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2250 ///
2251 ///# Usage Notes
2252 ///
2253 ///Acquires exclusive control of an X11 display for direct rendering,
2254 ///bypassing the X server's compositor. The display must be released
2255 ///with `release_display_ext` when finished.
2256 ///
2257 ///Requires `VK_EXT_acquire_xlib_display`. Linux/X11 only.
2258 pub unsafe fn acquire_xlib_display_ext(
2259 &self,
2260 physical_device: PhysicalDevice,
2261 display: DisplayKHR,
2262 ) -> VkResult<core::ffi::c_void> {
2263 let fp = self
2264 .commands()
2265 .acquire_xlib_display_ext
2266 .expect("vkAcquireXlibDisplayEXT not loaded");
2267 let mut out = unsafe { core::mem::zeroed() };
2268 check(unsafe { fp(physical_device, &mut out, display) })?;
2269 Ok(out)
2270 }
2271 ///Wraps [`vkGetRandROutputDisplayEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetRandROutputDisplayEXT.html).
2272 /**
2273 Provided by **VK_EXT_acquire_xlib_display**.*/
2274 ///
2275 ///# Errors
2276 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2277 ///- `VK_ERROR_UNKNOWN`
2278 ///- `VK_ERROR_VALIDATION_FAILED`
2279 ///
2280 ///# Safety
2281 ///- `physicalDevice` (self) must be valid and not destroyed.
2282 ///
2283 ///# Panics
2284 ///Panics if `vkGetRandROutputDisplayEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2285 ///
2286 ///# Usage Notes
2287 ///
2288 ///Maps an X11 RandR output to a Vulkan `DisplayKHR` handle. Use
2289 ///this to identify which Vulkan display corresponds to a specific
2290 ///RandR output when doing direct display rendering.
2291 ///
2292 ///Requires `VK_EXT_acquire_xlib_display`. Linux/X11 only.
2293 pub unsafe fn get_rand_r_output_display_ext(
2294 &self,
2295 physical_device: PhysicalDevice,
2296 dpy: *mut core::ffi::c_void,
2297 rr_output: core::ffi::c_ulong,
2298 ) -> VkResult<DisplayKHR> {
2299 let fp = self
2300 .commands()
2301 .get_rand_r_output_display_ext
2302 .expect("vkGetRandROutputDisplayEXT not loaded");
2303 let mut out = unsafe { core::mem::zeroed() };
2304 check(unsafe { fp(physical_device, dpy, rr_output, &mut out) })?;
2305 Ok(out)
2306 }
2307 ///Wraps [`vkAcquireWinrtDisplayNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAcquireWinrtDisplayNV.html).
2308 /**
2309 Provided by **VK_NV_acquire_winrt_display**.*/
2310 ///
2311 ///# Errors
2312 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2313 ///- `VK_ERROR_DEVICE_LOST`
2314 ///- `VK_ERROR_INITIALIZATION_FAILED`
2315 ///- `VK_ERROR_UNKNOWN`
2316 ///- `VK_ERROR_VALIDATION_FAILED`
2317 ///
2318 ///# Safety
2319 ///- `physicalDevice` (self) must be valid and not destroyed.
2320 ///
2321 ///# Panics
2322 ///Panics if `vkAcquireWinrtDisplayNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2323 ///
2324 ///# Usage Notes
2325 ///
2326 ///Acquires exclusive ownership of a display using the Windows
2327 ///Runtime (WinRT) display interface. Windows only. The display
2328 ///must be released before another application can use it.
2329 ///
2330 ///Requires `VK_NV_acquire_winrt_display`.
2331 pub unsafe fn acquire_winrt_display_nv(
2332 &self,
2333 physical_device: PhysicalDevice,
2334 display: DisplayKHR,
2335 ) -> VkResult<()> {
2336 let fp = self
2337 .commands()
2338 .acquire_winrt_display_nv
2339 .expect("vkAcquireWinrtDisplayNV not loaded");
2340 check(unsafe { fp(physical_device, display) })
2341 }
2342 ///Wraps [`vkGetWinrtDisplayNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetWinrtDisplayNV.html).
2343 /**
2344 Provided by **VK_NV_acquire_winrt_display**.*/
2345 ///
2346 ///# Errors
2347 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2348 ///- `VK_ERROR_DEVICE_LOST`
2349 ///- `VK_ERROR_INITIALIZATION_FAILED`
2350 ///- `VK_ERROR_UNKNOWN`
2351 ///- `VK_ERROR_VALIDATION_FAILED`
2352 ///
2353 ///# Safety
2354 ///- `physicalDevice` (self) must be valid and not destroyed.
2355 ///
2356 ///# Panics
2357 ///Panics if `vkGetWinrtDisplayNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2358 ///
2359 ///# Usage Notes
2360 ///
2361 ///Gets a `DisplayKHR` handle for a WinRT display identified by
2362 ///its device-relative ID. Windows only. Use with
2363 ///`acquire_winrt_display_nv` for direct display access.
2364 ///
2365 ///Requires `VK_NV_acquire_winrt_display`.
2366 pub unsafe fn get_winrt_display_nv(
2367 &self,
2368 physical_device: PhysicalDevice,
2369 device_relative_id: u32,
2370 ) -> VkResult<DisplayKHR> {
2371 let fp = self
2372 .commands()
2373 .get_winrt_display_nv
2374 .expect("vkGetWinrtDisplayNV not loaded");
2375 let mut out = unsafe { core::mem::zeroed() };
2376 check(unsafe { fp(physical_device, device_relative_id, &mut out) })?;
2377 Ok(out)
2378 }
2379 ///Wraps [`vkGetPhysicalDeviceSurfaceCapabilities2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceSurfaceCapabilities2EXT.html).
2380 /**
2381 Provided by **VK_EXT_display_surface_counter**.*/
2382 ///
2383 ///# Errors
2384 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2385 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2386 ///- `VK_ERROR_SURFACE_LOST_KHR`
2387 ///- `VK_ERROR_UNKNOWN`
2388 ///- `VK_ERROR_VALIDATION_FAILED`
2389 ///
2390 ///# Safety
2391 ///- `physicalDevice` (self) must be valid and not destroyed.
2392 ///
2393 ///# Panics
2394 ///Panics if `vkGetPhysicalDeviceSurfaceCapabilities2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2395 ///
2396 ///# Usage Notes
2397 ///
2398 ///Queries surface capabilities with additional output fields
2399 ///compared to `get_physical_device_surface_capabilities_khr`.
2400 ///Returns a `SurfaceCapabilities2EXT` that includes shared
2401 ///present mode support flags.
2402 ///
2403 ///Prefer `get_physical_device_surface_capabilities2_khr` (KHR)
2404 ///for general use; this EXT variant is primarily for
2405 ///`VK_EXT_display_surface_counter` integration.
2406 ///
2407 ///Requires `VK_EXT_display_surface_counter`.
2408 pub unsafe fn get_physical_device_surface_capabilities2_ext(
2409 &self,
2410 physical_device: PhysicalDevice,
2411 surface: SurfaceKHR,
2412 p_surface_capabilities: &mut SurfaceCapabilities2EXT,
2413 ) -> VkResult<()> {
2414 let fp = self
2415 .commands()
2416 .get_physical_device_surface_capabilities2_ext
2417 .expect("vkGetPhysicalDeviceSurfaceCapabilities2EXT not loaded");
2418 check(unsafe { fp(physical_device, surface, p_surface_capabilities) })
2419 }
2420 ///Wraps [`vkEnumeratePhysicalDeviceGroups`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkEnumeratePhysicalDeviceGroups.html).
2421 /**
2422 Provided by **VK_BASE_VERSION_1_1**.*/
2423 ///
2424 ///# Errors
2425 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2426 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2427 ///- `VK_ERROR_INITIALIZATION_FAILED`
2428 ///- `VK_ERROR_UNKNOWN`
2429 ///- `VK_ERROR_VALIDATION_FAILED`
2430 ///
2431 ///# Safety
2432 ///- `instance` (self) must be valid and not destroyed.
2433 ///
2434 ///# Panics
2435 ///Panics if `vkEnumeratePhysicalDeviceGroups` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2436 ///
2437 ///# Usage Notes
2438 ///
2439 ///Enumerates the available device groups, sets of physical devices
2440 ///that can be used together as a single logical device for multi-GPU
2441 ///rendering (e.g. SLI/CrossFire).
2442 ///
2443 ///Each `PhysicalDeviceGroupProperties` lists the physical devices in
2444 ///the group and whether the group supports memory allocation that
2445 ///spans all devices (`subset_allocation`).
2446 ///
2447 ///On single-GPU systems, this returns one group containing one device.
2448 ///
2449 ///To use a device group, pass `DeviceGroupDeviceCreateInfo` in the
2450 ///pNext chain of `DeviceCreateInfo` with the desired physical devices.
2451 ///This is an advanced multi-GPU feature; most applications use a
2452 ///single physical device.
2453 pub unsafe fn enumerate_physical_device_groups(
2454 &self,
2455 ) -> VkResult<Vec<PhysicalDeviceGroupProperties>> {
2456 let fp = self
2457 .commands()
2458 .enumerate_physical_device_groups
2459 .expect("vkEnumeratePhysicalDeviceGroups not loaded");
2460 enumerate_two_call(|count, data| unsafe { fp(self.handle(), count, data) })
2461 }
2462 ///Wraps [`vkGetPhysicalDevicePresentRectanglesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDevicePresentRectanglesKHR.html).
2463 /**
2464 Provided by **VK_KHR_swapchain**.*/
2465 ///
2466 ///# Errors
2467 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2468 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2469 ///- `VK_ERROR_UNKNOWN`
2470 ///- `VK_ERROR_VALIDATION_FAILED`
2471 ///
2472 ///# Safety
2473 ///- `physicalDevice` (self) must be valid and not destroyed.
2474 ///- `surface` must be externally synchronized.
2475 ///
2476 ///# Panics
2477 ///Panics if `vkGetPhysicalDevicePresentRectanglesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2478 ///
2479 ///# Usage Notes
2480 ///
2481 ///Returns the set of rectangular regions that cover the presentable
2482 ///area of a surface for a device group. Each rectangle represents a
2483 ///region that one physical device in the group is responsible for
2484 ///presenting.
2485 ///
2486 ///Only relevant for multi-GPU device groups with
2487 ///`DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE`. On single-GPU
2488 ///systems, this returns a single rectangle covering the entire
2489 ///surface.
2490 pub unsafe fn get_physical_device_present_rectangles_khr(
2491 &self,
2492 physical_device: PhysicalDevice,
2493 surface: SurfaceKHR,
2494 ) -> VkResult<Vec<Rect2D>> {
2495 let fp = self
2496 .commands()
2497 .get_physical_device_present_rectangles_khr
2498 .expect("vkGetPhysicalDevicePresentRectanglesKHR not loaded");
2499 enumerate_two_call(|count, data| unsafe { fp(physical_device, surface, count, data) })
2500 }
2501 ///Wraps [`vkCreateIOSSurfaceMVK`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateIOSSurfaceMVK.html).
2502 /**
2503 Provided by **VK_MVK_ios_surface**.*/
2504 ///
2505 ///# Errors
2506 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2507 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2508 ///- `VK_ERROR_NATIVE_WINDOW_IN_USE_KHR`
2509 ///- `VK_ERROR_UNKNOWN`
2510 ///- `VK_ERROR_VALIDATION_FAILED`
2511 ///
2512 ///# Safety
2513 ///- `instance` (self) must be valid and not destroyed.
2514 ///
2515 ///# Panics
2516 ///Panics if `vkCreateIOSSurfaceMVK` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2517 ///
2518 ///# Usage Notes
2519 ///
2520 ///Creates a Vulkan surface for an iOS `UIView`. iOS only. Legacy
2521 ///MoltenVK path, prefer `VK_EXT_metal_surface` with
2522 ///`create_metal_surface_ext` on modern MoltenVK.
2523 ///
2524 ///Requires `VK_MVK_ios_surface`.
2525 pub unsafe fn create_ios_surface_mvk(
2526 &self,
2527 p_create_info: &IOSSurfaceCreateInfoMVK,
2528 allocator: Option<&AllocationCallbacks>,
2529 ) -> VkResult<SurfaceKHR> {
2530 let fp = self
2531 .commands()
2532 .create_ios_surface_mvk
2533 .expect("vkCreateIOSSurfaceMVK not loaded");
2534 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2535 let mut out = unsafe { core::mem::zeroed() };
2536 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
2537 Ok(out)
2538 }
2539 ///Wraps [`vkCreateMacOSSurfaceMVK`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateMacOSSurfaceMVK.html).
2540 /**
2541 Provided by **VK_MVK_macos_surface**.*/
2542 ///
2543 ///# Errors
2544 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2545 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2546 ///- `VK_ERROR_NATIVE_WINDOW_IN_USE_KHR`
2547 ///- `VK_ERROR_UNKNOWN`
2548 ///- `VK_ERROR_VALIDATION_FAILED`
2549 ///
2550 ///# Safety
2551 ///- `instance` (self) must be valid and not destroyed.
2552 ///
2553 ///# Panics
2554 ///Panics if `vkCreateMacOSSurfaceMVK` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2555 ///
2556 ///# Usage Notes
2557 ///
2558 ///Creates a Vulkan surface for a macOS `NSView`. macOS only.
2559 ///Legacy MoltenVK path, prefer `VK_EXT_metal_surface` with
2560 ///`create_metal_surface_ext` on modern MoltenVK.
2561 ///
2562 ///Requires `VK_MVK_macos_surface`.
2563 pub unsafe fn create_mac_os_surface_mvk(
2564 &self,
2565 p_create_info: &MacOSSurfaceCreateInfoMVK,
2566 allocator: Option<&AllocationCallbacks>,
2567 ) -> VkResult<SurfaceKHR> {
2568 let fp = self
2569 .commands()
2570 .create_mac_os_surface_mvk
2571 .expect("vkCreateMacOSSurfaceMVK not loaded");
2572 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2573 let mut out = unsafe { core::mem::zeroed() };
2574 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
2575 Ok(out)
2576 }
2577 ///Wraps [`vkGetPhysicalDeviceMultisamplePropertiesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceMultisamplePropertiesEXT.html).
2578 /**
2579 Provided by **VK_EXT_sample_locations**.*/
2580 ///
2581 ///# Safety
2582 ///- `physicalDevice` (self) must be valid and not destroyed.
2583 ///
2584 ///# Panics
2585 ///Panics if `vkGetPhysicalDeviceMultisamplePropertiesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2586 ///
2587 ///# Usage Notes
2588 ///
2589 ///Queries the multisample properties for a specific sample count
2590 ///on the physical device. Returns the maximum sample location grid
2591 ///size in `MultisamplePropertiesEXT`.
2592 ///
2593 ///Use this to determine valid grid sizes for
2594 ///`cmd_set_sample_locations_ext`.
2595 ///
2596 ///Requires `VK_EXT_sample_locations`.
2597 pub unsafe fn get_physical_device_multisample_properties_ext(
2598 &self,
2599 physical_device: PhysicalDevice,
2600 samples: SampleCountFlagBits,
2601 p_multisample_properties: &mut MultisamplePropertiesEXT,
2602 ) {
2603 let fp = self
2604 .commands()
2605 .get_physical_device_multisample_properties_ext
2606 .expect("vkGetPhysicalDeviceMultisamplePropertiesEXT not loaded");
2607 unsafe { fp(physical_device, samples, p_multisample_properties) };
2608 }
2609 ///Wraps [`vkGetPhysicalDeviceSurfaceCapabilities2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceSurfaceCapabilities2KHR.html).
2610 /**
2611 Provided by **VK_KHR_get_surface_capabilities2**.*/
2612 ///
2613 ///# Errors
2614 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2615 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2616 ///- `VK_ERROR_SURFACE_LOST_KHR`
2617 ///- `VK_ERROR_UNKNOWN`
2618 ///- `VK_ERROR_VALIDATION_FAILED`
2619 ///
2620 ///# Safety
2621 ///- `physicalDevice` (self) must be valid and not destroyed.
2622 ///
2623 ///# Panics
2624 ///Panics if `vkGetPhysicalDeviceSurfaceCapabilities2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2625 ///
2626 ///# Usage Notes
2627 ///
2628 ///Extensible version of
2629 ///`get_physical_device_surface_capabilities_khr`. Takes a
2630 ///`PhysicalDeviceSurfaceInfo2KHR` input and writes to
2631 ///`SurfaceCapabilities2KHR`, both supporting `pNext` chains.
2632 ///
2633 ///Chain `SurfaceProtectedCapabilitiesKHR` or other extension
2634 ///structs into the output `pNext` to query additional capabilities
2635 ///not available through the v1 query.
2636 ///
2637 ///Provided by `VK_KHR_get_surface_capabilities2`. Prefer this over
2638 ///the v1 query when available.
2639 pub unsafe fn get_physical_device_surface_capabilities2_khr(
2640 &self,
2641 physical_device: PhysicalDevice,
2642 p_surface_info: &PhysicalDeviceSurfaceInfo2KHR,
2643 p_surface_capabilities: &mut SurfaceCapabilities2KHR,
2644 ) -> VkResult<()> {
2645 let fp = self
2646 .commands()
2647 .get_physical_device_surface_capabilities2_khr
2648 .expect("vkGetPhysicalDeviceSurfaceCapabilities2KHR not loaded");
2649 check(unsafe { fp(physical_device, p_surface_info, p_surface_capabilities) })
2650 }
2651 ///Wraps [`vkGetPhysicalDeviceSurfaceFormats2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceSurfaceFormats2KHR.html).
2652 /**
2653 Provided by **VK_KHR_get_surface_capabilities2**.*/
2654 ///
2655 ///# Errors
2656 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2657 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2658 ///- `VK_ERROR_SURFACE_LOST_KHR`
2659 ///- `VK_ERROR_UNKNOWN`
2660 ///- `VK_ERROR_VALIDATION_FAILED`
2661 ///
2662 ///# Safety
2663 ///- `physicalDevice` (self) must be valid and not destroyed.
2664 ///
2665 ///# Panics
2666 ///Panics if `vkGetPhysicalDeviceSurfaceFormats2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2667 ///
2668 ///# Usage Notes
2669 ///
2670 ///Extensible version of
2671 ///`get_physical_device_surface_formats_khr`. Returns
2672 ///`SurfaceFormat2KHR` with `pNext` support, allowing extensions
2673 ///to attach additional per-format information.
2674 ///
2675 ///Takes `PhysicalDeviceSurfaceInfo2KHR` as input so you can query
2676 ///formats for a specific surface configuration (e.g., with
2677 ///full-screen exclusive info chained in).
2678 ///
2679 ///Provided by `VK_KHR_get_surface_capabilities2`. Prefer this over
2680 ///the v1 query when available.
2681 pub unsafe fn get_physical_device_surface_formats2_khr(
2682 &self,
2683 physical_device: PhysicalDevice,
2684 p_surface_info: &PhysicalDeviceSurfaceInfo2KHR,
2685 ) -> VkResult<Vec<SurfaceFormat2KHR>> {
2686 let fp = self
2687 .commands()
2688 .get_physical_device_surface_formats2_khr
2689 .expect("vkGetPhysicalDeviceSurfaceFormats2KHR not loaded");
2690 enumerate_two_call(|count, data| unsafe {
2691 fp(physical_device, p_surface_info, count, data)
2692 })
2693 }
2694 ///Wraps [`vkGetPhysicalDeviceDisplayProperties2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceDisplayProperties2KHR.html).
2695 /**
2696 Provided by **VK_KHR_get_display_properties2**.*/
2697 ///
2698 ///# Errors
2699 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2700 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2701 ///- `VK_ERROR_UNKNOWN`
2702 ///- `VK_ERROR_VALIDATION_FAILED`
2703 ///
2704 ///# Safety
2705 ///- `physicalDevice` (self) must be valid and not destroyed.
2706 ///
2707 ///# Panics
2708 ///Panics if `vkGetPhysicalDeviceDisplayProperties2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2709 ///
2710 ///# Usage Notes
2711 ///
2712 ///Extensible version of `get_physical_device_display_properties_khr`.
2713 ///Returns `DisplayProperties2KHR` which wraps the original
2714 ///properties and supports `pNext` extensions.
2715 ///
2716 ///Provided by `VK_KHR_get_display_properties2`. Prefer this over
2717 ///the v1 query when available.
2718 pub unsafe fn get_physical_device_display_properties2_khr(
2719 &self,
2720 physical_device: PhysicalDevice,
2721 ) -> VkResult<Vec<DisplayProperties2KHR>> {
2722 let fp = self
2723 .commands()
2724 .get_physical_device_display_properties2_khr
2725 .expect("vkGetPhysicalDeviceDisplayProperties2KHR not loaded");
2726 enumerate_two_call(|count, data| unsafe { fp(physical_device, count, data) })
2727 }
2728 ///Wraps [`vkGetPhysicalDeviceDisplayPlaneProperties2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceDisplayPlaneProperties2KHR.html).
2729 /**
2730 Provided by **VK_KHR_get_display_properties2**.*/
2731 ///
2732 ///# Errors
2733 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2734 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2735 ///- `VK_ERROR_UNKNOWN`
2736 ///- `VK_ERROR_VALIDATION_FAILED`
2737 ///
2738 ///# Safety
2739 ///- `physicalDevice` (self) must be valid and not destroyed.
2740 ///
2741 ///# Panics
2742 ///Panics if `vkGetPhysicalDeviceDisplayPlaneProperties2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2743 ///
2744 ///# Usage Notes
2745 ///
2746 ///Extensible version of
2747 ///`get_physical_device_display_plane_properties_khr`. Returns
2748 ///`DisplayPlaneProperties2KHR` with `pNext` support.
2749 ///
2750 ///Provided by `VK_KHR_get_display_properties2`. Prefer this over
2751 ///the v1 query when available.
2752 pub unsafe fn get_physical_device_display_plane_properties2_khr(
2753 &self,
2754 physical_device: PhysicalDevice,
2755 ) -> VkResult<Vec<DisplayPlaneProperties2KHR>> {
2756 let fp = self
2757 .commands()
2758 .get_physical_device_display_plane_properties2_khr
2759 .expect("vkGetPhysicalDeviceDisplayPlaneProperties2KHR not loaded");
2760 enumerate_two_call(|count, data| unsafe { fp(physical_device, count, data) })
2761 }
2762 ///Wraps [`vkGetDisplayModeProperties2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDisplayModeProperties2KHR.html).
2763 /**
2764 Provided by **VK_KHR_get_display_properties2**.*/
2765 ///
2766 ///# Errors
2767 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2768 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2769 ///- `VK_ERROR_UNKNOWN`
2770 ///- `VK_ERROR_VALIDATION_FAILED`
2771 ///
2772 ///# Safety
2773 ///- `physicalDevice` (self) must be valid and not destroyed.
2774 ///
2775 ///# Panics
2776 ///Panics if `vkGetDisplayModeProperties2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2777 ///
2778 ///# Usage Notes
2779 ///
2780 ///Extensible version of `get_display_mode_properties_khr`. Returns
2781 ///`DisplayModeProperties2KHR` with `pNext` support.
2782 ///
2783 ///Provided by `VK_KHR_get_display_properties2`. Prefer this over
2784 ///the v1 query when available.
2785 pub unsafe fn get_display_mode_properties2_khr(
2786 &self,
2787 physical_device: PhysicalDevice,
2788 display: DisplayKHR,
2789 ) -> VkResult<Vec<DisplayModeProperties2KHR>> {
2790 let fp = self
2791 .commands()
2792 .get_display_mode_properties2_khr
2793 .expect("vkGetDisplayModeProperties2KHR not loaded");
2794 enumerate_two_call(|count, data| unsafe { fp(physical_device, display, count, data) })
2795 }
2796 ///Wraps [`vkGetDisplayPlaneCapabilities2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDisplayPlaneCapabilities2KHR.html).
2797 /**
2798 Provided by **VK_KHR_get_display_properties2**.*/
2799 ///
2800 ///# Errors
2801 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2802 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2803 ///- `VK_ERROR_UNKNOWN`
2804 ///- `VK_ERROR_VALIDATION_FAILED`
2805 ///
2806 ///# Safety
2807 ///- `physicalDevice` (self) must be valid and not destroyed.
2808 ///
2809 ///# Panics
2810 ///Panics if `vkGetDisplayPlaneCapabilities2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2811 ///
2812 ///# Usage Notes
2813 ///
2814 ///Extensible version of `get_display_plane_capabilities_khr`.
2815 ///Takes `DisplayPlaneInfo2KHR` (with `pNext` for input extensions)
2816 ///and writes to `DisplayPlaneCapabilities2KHR` (with `pNext` for
2817 ///output extensions).
2818 ///
2819 ///Provided by `VK_KHR_get_display_properties2`. Prefer this over
2820 ///the v1 query when available.
2821 pub unsafe fn get_display_plane_capabilities2_khr(
2822 &self,
2823 physical_device: PhysicalDevice,
2824 p_display_plane_info: &DisplayPlaneInfo2KHR,
2825 p_capabilities: &mut DisplayPlaneCapabilities2KHR,
2826 ) -> VkResult<()> {
2827 let fp = self
2828 .commands()
2829 .get_display_plane_capabilities2_khr
2830 .expect("vkGetDisplayPlaneCapabilities2KHR not loaded");
2831 check(unsafe { fp(physical_device, p_display_plane_info, p_capabilities) })
2832 }
2833 ///Wraps [`vkGetPhysicalDeviceCalibrateableTimeDomainsKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceCalibrateableTimeDomainsKHR.html).
2834 /**
2835 Provided by **VK_KHR_calibrated_timestamps**.*/
2836 ///
2837 ///# Errors
2838 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2839 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2840 ///- `VK_ERROR_UNKNOWN`
2841 ///- `VK_ERROR_VALIDATION_FAILED`
2842 ///
2843 ///# Safety
2844 ///- `physicalDevice` (self) must be valid and not destroyed.
2845 ///
2846 ///# Panics
2847 ///Panics if `vkGetPhysicalDeviceCalibrateableTimeDomainsKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2848 ///
2849 ///# Usage Notes
2850 ///
2851 ///Enumerates the time domains that can be used with
2852 ///`get_calibrated_timestamps_khr` on this physical device.
2853 ///
2854 ///Common time domains include:
2855 ///
2856 ///- `DEVICE`: GPU timestamp counter (same as `cmd_write_timestamp2`).
2857 ///- `CLOCK_MONOTONIC` / `CLOCK_MONOTONIC_RAW`: Linux monotonic
2858 /// clocks.
2859 ///- `QUERY_PERFORMANCE_COUNTER`: Windows high-resolution timer.
2860 ///
2861 ///The device time domain is always available. Host time domains
2862 ///depend on the platform.
2863 pub unsafe fn get_physical_device_calibrateable_time_domains_khr(
2864 &self,
2865 physical_device: PhysicalDevice,
2866 ) -> VkResult<Vec<TimeDomainKHR>> {
2867 let fp = self
2868 .commands()
2869 .get_physical_device_calibrateable_time_domains_khr
2870 .expect("vkGetPhysicalDeviceCalibrateableTimeDomainsKHR not loaded");
2871 enumerate_two_call(|count, data| unsafe { fp(physical_device, count, data) })
2872 }
2873 ///Wraps [`vkCreateDebugUtilsMessengerEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateDebugUtilsMessengerEXT.html).
2874 /**
2875 Provided by **VK_EXT_debug_utils**.*/
2876 ///
2877 ///# Errors
2878 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2879 ///- `VK_ERROR_UNKNOWN`
2880 ///- `VK_ERROR_VALIDATION_FAILED`
2881 ///
2882 ///# Safety
2883 ///- `instance` (self) must be valid and not destroyed.
2884 ///
2885 ///# Panics
2886 ///Panics if `vkCreateDebugUtilsMessengerEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2887 ///
2888 ///# Usage Notes
2889 ///
2890 ///Creates a debug messenger that receives validation layer messages,
2891 ///performance warnings, and general debug info via a user-provided
2892 ///callback.
2893 ///
2894 ///`DebugUtilsMessengerCreateInfoEXT` configures:
2895 ///- `message_severity`: which severities to receive (verbose, info,
2896 /// warning, error).
2897 ///- `message_type`: which categories (general, validation,
2898 /// performance).
2899 ///- `pfn_user_callback`: your callback function.
2900 ///
2901 ///Create the messenger immediately after the instance for maximum
2902 ///coverage. Destroy with `destroy_debug_utils_messenger_ext`.
2903 ///
2904 ///Requires `VK_EXT_debug_utils`. Supersedes `VK_EXT_debug_report`.
2905 pub unsafe fn create_debug_utils_messenger_ext(
2906 &self,
2907 p_create_info: &DebugUtilsMessengerCreateInfoEXT,
2908 allocator: Option<&AllocationCallbacks>,
2909 ) -> VkResult<DebugUtilsMessengerEXT> {
2910 let fp = self
2911 .commands()
2912 .create_debug_utils_messenger_ext
2913 .expect("vkCreateDebugUtilsMessengerEXT not loaded");
2914 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2915 let mut out = unsafe { core::mem::zeroed() };
2916 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
2917 Ok(out)
2918 }
2919 ///Wraps [`vkDestroyDebugUtilsMessengerEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyDebugUtilsMessengerEXT.html).
2920 /**
2921 Provided by **VK_EXT_debug_utils**.*/
2922 ///
2923 ///# Safety
2924 ///- `instance` (self) must be valid and not destroyed.
2925 ///- `messenger` must be externally synchronized.
2926 ///
2927 ///# Panics
2928 ///Panics if `vkDestroyDebugUtilsMessengerEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2929 ///
2930 ///# Usage Notes
2931 ///
2932 ///Destroys a debug messenger created with
2933 ///`create_debug_utils_messenger_ext`. After this call, the
2934 ///messenger's callback will no longer be invoked.
2935 ///
2936 ///Destroy before the instance is destroyed.
2937 ///
2938 ///Requires `VK_EXT_debug_utils`.
2939 pub unsafe fn destroy_debug_utils_messenger_ext(
2940 &self,
2941 messenger: DebugUtilsMessengerEXT,
2942 allocator: Option<&AllocationCallbacks>,
2943 ) {
2944 let fp = self
2945 .commands()
2946 .destroy_debug_utils_messenger_ext
2947 .expect("vkDestroyDebugUtilsMessengerEXT not loaded");
2948 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2949 unsafe { fp(self.handle(), messenger, alloc_ptr) };
2950 }
2951 ///Wraps [`vkSubmitDebugUtilsMessageEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSubmitDebugUtilsMessageEXT.html).
2952 /**
2953 Provided by **VK_EXT_debug_utils**.*/
2954 ///
2955 ///# Safety
2956 ///- `instance` (self) must be valid and not destroyed.
2957 ///
2958 ///# Panics
2959 ///Panics if `vkSubmitDebugUtilsMessageEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2960 ///
2961 ///# Usage Notes
2962 ///
2963 ///Manually injects a debug message into the debug utils callback
2964 ///chain. The message is delivered to all active debug messengers
2965 ///that match the specified severity and type flags.
2966 ///
2967 ///Useful for application-level diagnostics, e.g., logging a
2968 ///warning when a resource limit is approached.
2969 ///
2970 ///The `DebugUtilsMessengerCallbackDataEXT` carries the message
2971 ///string, message ID, and optional object labels/queue labels for
2972 ///context.
2973 ///
2974 ///Requires `VK_EXT_debug_utils`.
2975 pub unsafe fn submit_debug_utils_message_ext(
2976 &self,
2977 message_severity: DebugUtilsMessageSeverityFlagBitsEXT,
2978 message_types: DebugUtilsMessageTypeFlagsEXT,
2979 p_callback_data: &DebugUtilsMessengerCallbackDataEXT,
2980 ) {
2981 let fp = self
2982 .commands()
2983 .submit_debug_utils_message_ext
2984 .expect("vkSubmitDebugUtilsMessageEXT not loaded");
2985 unsafe {
2986 fp(
2987 self.handle(),
2988 message_severity,
2989 message_types,
2990 p_callback_data,
2991 )
2992 };
2993 }
2994 ///Wraps [`vkGetPhysicalDeviceCooperativeMatrixPropertiesNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceCooperativeMatrixPropertiesNV.html).
2995 /**
2996 Provided by **VK_NV_cooperative_matrix**.*/
2997 ///
2998 ///# Errors
2999 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3000 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3001 ///- `VK_ERROR_UNKNOWN`
3002 ///- `VK_ERROR_VALIDATION_FAILED`
3003 ///
3004 ///# Safety
3005 ///- `physicalDevice` (self) must be valid and not destroyed.
3006 ///
3007 ///# Panics
3008 ///Panics if `vkGetPhysicalDeviceCooperativeMatrixPropertiesNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3009 ///
3010 ///# Usage Notes
3011 ///
3012 ///Enumerates the cooperative matrix types and sizes supported by
3013 ///the physical device. Uses the two-call idiom. Legacy NV path,
3014 ///prefer `get_physical_device_cooperative_matrix_properties_khr`.
3015 ///
3016 ///Requires `VK_NV_cooperative_matrix`.
3017 pub unsafe fn get_physical_device_cooperative_matrix_properties_nv(
3018 &self,
3019 physical_device: PhysicalDevice,
3020 ) -> VkResult<Vec<CooperativeMatrixPropertiesNV>> {
3021 let fp = self
3022 .commands()
3023 .get_physical_device_cooperative_matrix_properties_nv
3024 .expect("vkGetPhysicalDeviceCooperativeMatrixPropertiesNV not loaded");
3025 enumerate_two_call(|count, data| unsafe { fp(physical_device, count, data) })
3026 }
3027 ///Wraps [`vkGetPhysicalDeviceSurfacePresentModes2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceSurfacePresentModes2EXT.html).
3028 /**
3029 Provided by **VK_EXT_full_screen_exclusive**.*/
3030 ///
3031 ///# Errors
3032 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3033 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3034 ///- `VK_ERROR_SURFACE_LOST_KHR`
3035 ///- `VK_ERROR_UNKNOWN`
3036 ///- `VK_ERROR_VALIDATION_FAILED`
3037 ///
3038 ///# Safety
3039 ///- `physicalDevice` (self) must be valid and not destroyed.
3040 ///
3041 ///# Panics
3042 ///Panics if `vkGetPhysicalDeviceSurfacePresentModes2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3043 ///
3044 ///# Usage Notes
3045 ///
3046 ///Queries the supported present modes for a physical device and
3047 ///surface, using the extended surface info structure. This is the
3048 ///`VK_EXT_full_screen_exclusive` variant of
3049 ///`get_physical_device_surface_present_modes_khr`, allowing
3050 ///full-screen exclusive configuration to influence the result.
3051 ///
3052 ///Requires `VK_EXT_full_screen_exclusive`. Windows only.
3053 pub unsafe fn get_physical_device_surface_present_modes2_ext(
3054 &self,
3055 physical_device: PhysicalDevice,
3056 p_surface_info: &PhysicalDeviceSurfaceInfo2KHR,
3057 ) -> VkResult<Vec<PresentModeKHR>> {
3058 let fp = self
3059 .commands()
3060 .get_physical_device_surface_present_modes2_ext
3061 .expect("vkGetPhysicalDeviceSurfacePresentModes2EXT not loaded");
3062 enumerate_two_call(|count, data| unsafe {
3063 fp(physical_device, p_surface_info, count, data)
3064 })
3065 }
3066 ///Wraps [`vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR.html).
3067 /**
3068 Provided by **VK_KHR_performance_query**.*/
3069 ///
3070 ///# Errors
3071 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3072 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3073 ///- `VK_ERROR_INITIALIZATION_FAILED`
3074 ///- `VK_ERROR_UNKNOWN`
3075 ///- `VK_ERROR_VALIDATION_FAILED`
3076 ///
3077 ///# Safety
3078 ///- `physicalDevice` (self) must be valid and not destroyed.
3079 ///
3080 ///# Panics
3081 ///Panics if `vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3082 ///
3083 ///# Usage Notes
3084 ///
3085 ///Enumerates the performance counters available for a specific queue
3086 ///family on a physical device. Returns `PerformanceCounterKHR`
3087 ///structs (counter unit, storage type, UUID) and optionally fills
3088 ///`PerformanceCounterDescriptionKHR` with human-readable names and
3089 ///descriptions.
3090 ///
3091 ///Use the counter indices when creating a performance query pool
3092 ///with `QueryPoolPerformanceCreateInfoKHR`.
3093 ///
3094 ///Requires `VK_KHR_performance_query`.
3095 pub unsafe fn enumerate_physical_device_queue_family_performance_query_counters_khr(
3096 &self,
3097 physical_device: PhysicalDevice,
3098 queue_family_index: u32,
3099 p_counter_descriptions: *mut PerformanceCounterDescriptionKHR,
3100 ) -> VkResult<Vec<PerformanceCounterKHR>> {
3101 let fp = self
3102 .commands()
3103 .enumerate_physical_device_queue_family_performance_query_counters_khr
3104 .expect("vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR not loaded");
3105 enumerate_two_call(|count, data| unsafe {
3106 fp(
3107 physical_device,
3108 queue_family_index,
3109 count,
3110 data,
3111 p_counter_descriptions,
3112 )
3113 })
3114 }
3115 ///Wraps [`vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR.html).
3116 /**
3117 Provided by **VK_KHR_performance_query**.*/
3118 ///
3119 ///# Safety
3120 ///- `physicalDevice` (self) must be valid and not destroyed.
3121 ///
3122 ///# Panics
3123 ///Panics if `vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3124 ///
3125 ///# Usage Notes
3126 ///
3127 ///Returns the number of passes required to collect all the
3128 ///performance counters specified in
3129 ///`QueryPoolPerformanceCreateInfoKHR`.
3130 ///
3131 ///Hardware can typically sample only a limited number of counters
3132 ///per pass. If this returns N, you must submit the same command
3133 ///buffer N times (each with a different pass index set via
3134 ///`PerformanceQuerySubmitInfoKHR` in the pNext of
3135 ///`SubmitInfo`/`SubmitInfo2`) to collect all results.
3136 ///
3137 ///Requires `VK_KHR_performance_query`.
3138 pub unsafe fn get_physical_device_queue_family_performance_query_passes_khr(
3139 &self,
3140 physical_device: PhysicalDevice,
3141 p_performance_query_create_info: &QueryPoolPerformanceCreateInfoKHR,
3142 ) -> u32 {
3143 let fp = self
3144 .commands()
3145 .get_physical_device_queue_family_performance_query_passes_khr
3146 .expect("vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR not loaded");
3147 let mut out = unsafe { core::mem::zeroed() };
3148 unsafe { fp(physical_device, p_performance_query_create_info, &mut out) };
3149 out
3150 }
3151 ///Wraps [`vkCreateHeadlessSurfaceEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateHeadlessSurfaceEXT.html).
3152 /**
3153 Provided by **VK_EXT_headless_surface**.*/
3154 ///
3155 ///# Errors
3156 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3157 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3158 ///- `VK_ERROR_UNKNOWN`
3159 ///- `VK_ERROR_VALIDATION_FAILED`
3160 ///
3161 ///# Safety
3162 ///- `instance` (self) must be valid and not destroyed.
3163 ///
3164 ///# Panics
3165 ///Panics if `vkCreateHeadlessSurfaceEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3166 ///
3167 ///# Usage Notes
3168 ///
3169 ///Creates a headless surface that is not associated with any window
3170 ///system. Useful for off-screen rendering, compute-only workloads,
3171 ///and automated testing where no display is available.
3172 ///
3173 ///Destroy with `destroy_surface_khr`.
3174 ///
3175 ///Requires `VK_EXT_headless_surface`.
3176 pub unsafe fn create_headless_surface_ext(
3177 &self,
3178 p_create_info: &HeadlessSurfaceCreateInfoEXT,
3179 allocator: Option<&AllocationCallbacks>,
3180 ) -> VkResult<SurfaceKHR> {
3181 let fp = self
3182 .commands()
3183 .create_headless_surface_ext
3184 .expect("vkCreateHeadlessSurfaceEXT not loaded");
3185 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
3186 let mut out = unsafe { core::mem::zeroed() };
3187 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
3188 Ok(out)
3189 }
3190 ///Wraps [`vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV.html).
3191 /**
3192 Provided by **VK_NV_coverage_reduction_mode**.*/
3193 ///
3194 ///# Errors
3195 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3196 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3197 ///- `VK_ERROR_UNKNOWN`
3198 ///- `VK_ERROR_VALIDATION_FAILED`
3199 ///
3200 ///# Safety
3201 ///- `physicalDevice` (self) must be valid and not destroyed.
3202 ///
3203 ///# Panics
3204 ///Panics if `vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3205 ///
3206 ///# Usage Notes
3207 ///
3208 ///Enumerates the supported combinations of coverage reduction
3209 ///mode, rasterisation samples, and colour/depth sample counts for
3210 ///mixed-sample rendering. Uses the two-call idiom.
3211 ///
3212 ///Requires `VK_NV_coverage_reduction_mode`.
3213 pub unsafe fn get_physical_device_supported_framebuffer_mixed_samples_combinations_nv(
3214 &self,
3215 physical_device: PhysicalDevice,
3216 ) -> VkResult<Vec<FramebufferMixedSamplesCombinationNV>> {
3217 let fp = self
3218 .commands()
3219 .get_physical_device_supported_framebuffer_mixed_samples_combinations_nv
3220 .expect("vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV not loaded");
3221 enumerate_two_call(|count, data| unsafe { fp(physical_device, count, data) })
3222 }
3223 ///Wraps [`vkGetPhysicalDeviceToolProperties`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceToolProperties.html).
3224 /**
3225 Provided by **VK_BASE_VERSION_1_3**.*/
3226 ///
3227 ///# Errors
3228 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3229 ///- `VK_ERROR_UNKNOWN`
3230 ///- `VK_ERROR_VALIDATION_FAILED`
3231 ///
3232 ///# Safety
3233 ///- `physicalDevice` (self) must be valid and not destroyed.
3234 ///
3235 ///# Panics
3236 ///Panics if `vkGetPhysicalDeviceToolProperties` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3237 ///
3238 ///# Usage Notes
3239 ///
3240 ///Returns a list of active tools (validation layers, profilers,
3241 ///debuggers, crash dump utilities) that are currently intercepting
3242 ///Vulkan calls for this physical device.
3243 ///
3244 ///Each `PhysicalDeviceToolProperties` includes the tool's name,
3245 ///version, purposes (validation, profiling, tracing, etc.), and a
3246 ///description.
3247 ///
3248 ///Useful for diagnostics, log the active tools at startup to help
3249 ///debug performance issues or unexpected validation messages. If no
3250 ///tools are active, the list is empty.
3251 pub unsafe fn get_physical_device_tool_properties(
3252 &self,
3253 physical_device: PhysicalDevice,
3254 ) -> VkResult<Vec<PhysicalDeviceToolProperties>> {
3255 let fp = self
3256 .commands()
3257 .get_physical_device_tool_properties
3258 .expect("vkGetPhysicalDeviceToolProperties not loaded");
3259 enumerate_two_call(|count, data| unsafe { fp(physical_device, count, data) })
3260 }
3261 ///Wraps [`vkGetPhysicalDeviceRefreshableObjectTypesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceRefreshableObjectTypesKHR.html).
3262 ///
3263 ///# Errors
3264 ///- `VK_ERROR_UNKNOWN`
3265 ///- `VK_ERROR_VALIDATION_FAILED`
3266 ///
3267 ///# Safety
3268 ///- `physicalDevice` (self) must be valid and not destroyed.
3269 ///
3270 ///# Panics
3271 ///Panics if `vkGetPhysicalDeviceRefreshableObjectTypesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3272 ///
3273 ///# Usage Notes
3274 ///
3275 ///Enumerates the Vulkan object types that can be refreshed on the
3276 ///physical device. Part of Vulkan SC (Safety Critical) and the
3277 ///object refresh mechanism for long-running safety applications.
3278 ///Uses the two-call idiom.
3279 ///
3280 ///Requires `VK_KHR_object_refresh`.
3281 pub unsafe fn get_physical_device_refreshable_object_types_khr(
3282 &self,
3283 physical_device: PhysicalDevice,
3284 ) -> VkResult<Vec<ObjectType>> {
3285 let fp = self
3286 .commands()
3287 .get_physical_device_refreshable_object_types_khr
3288 .expect("vkGetPhysicalDeviceRefreshableObjectTypesKHR not loaded");
3289 enumerate_two_call(|count, data| unsafe { fp(physical_device, count, data) })
3290 }
3291 ///Wraps [`vkGetPhysicalDeviceFragmentShadingRatesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceFragmentShadingRatesKHR.html).
3292 /**
3293 Provided by **VK_KHR_fragment_shading_rate**.*/
3294 ///
3295 ///# Errors
3296 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3297 ///- `VK_ERROR_UNKNOWN`
3298 ///- `VK_ERROR_VALIDATION_FAILED`
3299 ///
3300 ///# Safety
3301 ///- `physicalDevice` (self) must be valid and not destroyed.
3302 ///
3303 ///# Panics
3304 ///Panics if `vkGetPhysicalDeviceFragmentShadingRatesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3305 ///
3306 ///# Usage Notes
3307 ///
3308 ///Enumerates the fragment shading rates supported by the physical
3309 ///device. Each entry reports a fragment size (e.g., 2x2, 4x4) and
3310 ///which sample counts are compatible with it.
3311 ///
3312 ///The results are sorted from largest to smallest fragment size.
3313 ///1x1 (full-rate shading) is always supported.
3314 ///
3315 ///Use these results to validate fragment sizes passed to
3316 ///`cmd_set_fragment_shading_rate_khr` or configured in a shading
3317 ///rate attachment.
3318 pub unsafe fn get_physical_device_fragment_shading_rates_khr(
3319 &self,
3320 physical_device: PhysicalDevice,
3321 ) -> VkResult<Vec<PhysicalDeviceFragmentShadingRateKHR>> {
3322 let fp = self
3323 .commands()
3324 .get_physical_device_fragment_shading_rates_khr
3325 .expect("vkGetPhysicalDeviceFragmentShadingRatesKHR not loaded");
3326 enumerate_two_call(|count, data| unsafe { fp(physical_device, count, data) })
3327 }
3328 ///Wraps [`vkGetPhysicalDeviceVideoCapabilitiesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceVideoCapabilitiesKHR.html).
3329 /**
3330 Provided by **VK_KHR_video_queue**.*/
3331 ///
3332 ///# Errors
3333 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3334 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3335 ///- `VK_ERROR_VIDEO_PROFILE_OPERATION_NOT_SUPPORTED_KHR`
3336 ///- `VK_ERROR_VIDEO_PROFILE_FORMAT_NOT_SUPPORTED_KHR`
3337 ///- `VK_ERROR_VIDEO_PICTURE_LAYOUT_NOT_SUPPORTED_KHR`
3338 ///- `VK_ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR`
3339 ///- `VK_ERROR_UNKNOWN`
3340 ///- `VK_ERROR_VALIDATION_FAILED`
3341 ///
3342 ///# Safety
3343 ///- `physicalDevice` (self) must be valid and not destroyed.
3344 ///
3345 ///# Panics
3346 ///Panics if `vkGetPhysicalDeviceVideoCapabilitiesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3347 ///
3348 ///# Usage Notes
3349 ///
3350 ///Queries video codec capabilities for a given video profile on a
3351 ///physical device. Returns `VideoCapabilitiesKHR` describing:
3352 ///
3353 ///- Supported coded extent range (min/max resolution).
3354 ///- Maximum DPB slot and active reference picture counts.
3355 ///- Bitstream buffer offset and size alignment requirements.
3356 ///- Supported standard header version.
3357 ///
3358 ///Chain codec-specific capability structs (e.g.,
3359 ///`VideoDecodeH264CapabilitiesKHR`) into the `pNext` of
3360 ///`p_capabilities` to receive additional codec details.
3361 ///
3362 ///This is the first query in the video workflow, use it to
3363 ///determine whether a codec profile is supported and what limits
3364 ///apply before creating a video session.
3365 pub unsafe fn get_physical_device_video_capabilities_khr(
3366 &self,
3367 physical_device: PhysicalDevice,
3368 p_video_profile: &VideoProfileInfoKHR,
3369 p_capabilities: &mut VideoCapabilitiesKHR,
3370 ) -> VkResult<()> {
3371 let fp = self
3372 .commands()
3373 .get_physical_device_video_capabilities_khr
3374 .expect("vkGetPhysicalDeviceVideoCapabilitiesKHR not loaded");
3375 check(unsafe { fp(physical_device, p_video_profile, p_capabilities) })
3376 }
3377 ///Wraps [`vkGetPhysicalDeviceVideoFormatPropertiesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceVideoFormatPropertiesKHR.html).
3378 /**
3379 Provided by **VK_KHR_video_queue**.*/
3380 ///
3381 ///# Errors
3382 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3383 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3384 ///- `VK_ERROR_IMAGE_USAGE_NOT_SUPPORTED_KHR`
3385 ///- `VK_ERROR_VIDEO_PROFILE_OPERATION_NOT_SUPPORTED_KHR`
3386 ///- `VK_ERROR_VIDEO_PROFILE_FORMAT_NOT_SUPPORTED_KHR`
3387 ///- `VK_ERROR_VIDEO_PICTURE_LAYOUT_NOT_SUPPORTED_KHR`
3388 ///- `VK_ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR`
3389 ///- `VK_ERROR_UNKNOWN`
3390 ///- `VK_ERROR_VALIDATION_FAILED`
3391 ///
3392 ///# Safety
3393 ///- `physicalDevice` (self) must be valid and not destroyed.
3394 ///
3395 ///# Panics
3396 ///Panics if `vkGetPhysicalDeviceVideoFormatPropertiesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3397 ///
3398 ///# Usage Notes
3399 ///
3400 ///Queries the image formats compatible with a video profile for
3401 ///decoded output, DPB reference, or encode input images.
3402 ///
3403 ///Specify the intended usage in `PhysicalDeviceVideoFormatInfoKHR`
3404 ///(image usage flags indicating decode output, DPB, or encode
3405 ///input). The returned `VideoFormatPropertiesKHR` list the
3406 ///compatible formats, image types, tiling modes, and usage flags.
3407 ///
3408 ///Use these results to create images that are compatible with the
3409 ///video session. Using an unsupported format results in validation
3410 ///errors.
3411 pub unsafe fn get_physical_device_video_format_properties_khr(
3412 &self,
3413 physical_device: PhysicalDevice,
3414 p_video_format_info: &PhysicalDeviceVideoFormatInfoKHR,
3415 ) -> VkResult<Vec<VideoFormatPropertiesKHR>> {
3416 let fp = self
3417 .commands()
3418 .get_physical_device_video_format_properties_khr
3419 .expect("vkGetPhysicalDeviceVideoFormatPropertiesKHR not loaded");
3420 enumerate_two_call(|count, data| unsafe {
3421 fp(physical_device, p_video_format_info, count, data)
3422 })
3423 }
3424 ///Wraps [`vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR.html).
3425 /**
3426 Provided by **VK_KHR_video_encode_queue**.*/
3427 ///
3428 ///# Errors
3429 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3430 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3431 ///- `VK_ERROR_VIDEO_PROFILE_OPERATION_NOT_SUPPORTED_KHR`
3432 ///- `VK_ERROR_VIDEO_PROFILE_FORMAT_NOT_SUPPORTED_KHR`
3433 ///- `VK_ERROR_VIDEO_PICTURE_LAYOUT_NOT_SUPPORTED_KHR`
3434 ///- `VK_ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR`
3435 ///- `VK_ERROR_UNKNOWN`
3436 ///- `VK_ERROR_VALIDATION_FAILED`
3437 ///
3438 ///# Safety
3439 ///- `physicalDevice` (self) must be valid and not destroyed.
3440 ///
3441 ///# Panics
3442 ///Panics if `vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3443 ///
3444 ///# Usage Notes
3445 ///
3446 ///Queries the properties of a specific video encode quality level.
3447 ///Quality levels range from 0 (lowest quality, fastest) to
3448 ///`maxQualityLevels - 1` (highest quality, slowest), as reported
3449 ///by `VideoEncodeCapabilitiesKHR`.
3450 ///
3451 ///The output `VideoEncodeQualityLevelPropertiesKHR` provides
3452 ///recommended encode settings for the requested quality level.
3453 ///Chain codec-specific quality level info (e.g.,
3454 ///`VideoEncodeH264QualityLevelPropertiesKHR`) into `pNext` to get
3455 ///codec-specific recommended parameters.
3456 ///
3457 ///Use these recommended settings as a starting point for
3458 ///`VideoEncodeInfoKHR` and rate control configuration.
3459 pub unsafe fn get_physical_device_video_encode_quality_level_properties_khr(
3460 &self,
3461 physical_device: PhysicalDevice,
3462 p_quality_level_info: &PhysicalDeviceVideoEncodeQualityLevelInfoKHR,
3463 p_quality_level_properties: &mut VideoEncodeQualityLevelPropertiesKHR,
3464 ) -> VkResult<()> {
3465 let fp = self
3466 .commands()
3467 .get_physical_device_video_encode_quality_level_properties_khr
3468 .expect("vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR not loaded");
3469 check(unsafe {
3470 fp(
3471 physical_device,
3472 p_quality_level_info,
3473 p_quality_level_properties,
3474 )
3475 })
3476 }
3477 ///Wraps [`vkAcquireDrmDisplayEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAcquireDrmDisplayEXT.html).
3478 /**
3479 Provided by **VK_EXT_acquire_drm_display**.*/
3480 ///
3481 ///# Errors
3482 ///- `VK_ERROR_INITIALIZATION_FAILED`
3483 ///- `VK_ERROR_UNKNOWN`
3484 ///- `VK_ERROR_VALIDATION_FAILED`
3485 ///
3486 ///# Safety
3487 ///- `physicalDevice` (self) must be valid and not destroyed.
3488 ///
3489 ///# Panics
3490 ///Panics if `vkAcquireDrmDisplayEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3491 ///
3492 ///# Usage Notes
3493 ///
3494 ///Acquires exclusive control of a DRM display for direct rendering.
3495 ///Takes a DRM file descriptor and a display handle. Release with
3496 ///`release_display_ext` when finished.
3497 ///
3498 ///Requires `VK_EXT_acquire_drm_display`. Linux only.
3499 pub unsafe fn acquire_drm_display_ext(
3500 &self,
3501 physical_device: PhysicalDevice,
3502 drm_fd: i32,
3503 display: DisplayKHR,
3504 ) -> VkResult<()> {
3505 let fp = self
3506 .commands()
3507 .acquire_drm_display_ext
3508 .expect("vkAcquireDrmDisplayEXT not loaded");
3509 check(unsafe { fp(physical_device, drm_fd, display) })
3510 }
3511 ///Wraps [`vkGetDrmDisplayEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDrmDisplayEXT.html).
3512 /**
3513 Provided by **VK_EXT_acquire_drm_display**.*/
3514 ///
3515 ///# Errors
3516 ///- `VK_ERROR_INITIALIZATION_FAILED`
3517 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3518 ///- `VK_ERROR_UNKNOWN`
3519 ///- `VK_ERROR_VALIDATION_FAILED`
3520 ///
3521 ///# Safety
3522 ///- `physicalDevice` (self) must be valid and not destroyed.
3523 ///
3524 ///# Panics
3525 ///Panics if `vkGetDrmDisplayEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3526 ///
3527 ///# Usage Notes
3528 ///
3529 ///Maps a DRM connector to a Vulkan `DisplayKHR` handle. Takes a
3530 ///DRM file descriptor and connector ID, and returns the
3531 ///corresponding display. Use this to identify which Vulkan display
3532 ///corresponds to a specific DRM output.
3533 ///
3534 ///Requires `VK_EXT_acquire_drm_display`. Linux only.
3535 pub unsafe fn get_drm_display_ext(
3536 &self,
3537 physical_device: PhysicalDevice,
3538 drm_fd: i32,
3539 connector_id: u32,
3540 ) -> VkResult<DisplayKHR> {
3541 let fp = self
3542 .commands()
3543 .get_drm_display_ext
3544 .expect("vkGetDrmDisplayEXT not loaded");
3545 let mut out = unsafe { core::mem::zeroed() };
3546 check(unsafe { fp(physical_device, drm_fd, connector_id, &mut out) })?;
3547 Ok(out)
3548 }
3549 ///Wraps [`vkGetPhysicalDeviceOpticalFlowImageFormatsNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceOpticalFlowImageFormatsNV.html).
3550 /**
3551 Provided by **VK_NV_optical_flow**.*/
3552 ///
3553 ///# Errors
3554 ///- `VK_ERROR_EXTENSION_NOT_PRESENT`
3555 ///- `VK_ERROR_INITIALIZATION_FAILED`
3556 ///- `VK_ERROR_FORMAT_NOT_SUPPORTED`
3557 ///- `VK_ERROR_UNKNOWN`
3558 ///- `VK_ERROR_VALIDATION_FAILED`
3559 ///
3560 ///# Safety
3561 ///- `physicalDevice` (self) must be valid and not destroyed.
3562 ///
3563 ///# Panics
3564 ///Panics if `vkGetPhysicalDeviceOpticalFlowImageFormatsNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3565 ///
3566 ///# Usage Notes
3567 ///
3568 ///Queries which image formats are supported for optical flow at a
3569 ///given resolution and usage. Use this to select compatible formats
3570 ///before creating images for the optical flow session.
3571 ///
3572 ///Requires `VK_NV_optical_flow`.
3573 pub unsafe fn get_physical_device_optical_flow_image_formats_nv(
3574 &self,
3575 physical_device: PhysicalDevice,
3576 p_optical_flow_image_format_info: &OpticalFlowImageFormatInfoNV,
3577 ) -> VkResult<Vec<OpticalFlowImageFormatPropertiesNV>> {
3578 let fp = self
3579 .commands()
3580 .get_physical_device_optical_flow_image_formats_nv
3581 .expect("vkGetPhysicalDeviceOpticalFlowImageFormatsNV not loaded");
3582 enumerate_two_call(|count, data| unsafe {
3583 fp(
3584 physical_device,
3585 p_optical_flow_image_format_info,
3586 count,
3587 data,
3588 )
3589 })
3590 }
3591 ///Wraps [`vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR.html).
3592 /**
3593 Provided by **VK_KHR_cooperative_matrix**.*/
3594 ///
3595 ///# Errors
3596 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3597 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3598 ///- `VK_ERROR_UNKNOWN`
3599 ///- `VK_ERROR_VALIDATION_FAILED`
3600 ///
3601 ///# Safety
3602 ///- `physicalDevice` (self) must be valid and not destroyed.
3603 ///
3604 ///# Panics
3605 ///Panics if `vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3606 ///
3607 ///# Usage Notes
3608 ///
3609 ///Enumerates the cooperative matrix types and configurations
3610 ///supported by the physical device. Each returned
3611 ///`CooperativeMatrixPropertiesKHR` describes a supported combination
3612 ///of matrix dimensions (M, N, K), component types (A, B, C, Result),
3613 ///and scope (subgroup or workgroup).
3614 ///
3615 ///Use these results to select valid cooperative matrix parameters
3616 ///for SPIR-V `OpCooperativeMatrixMulAddKHR` operations.
3617 ///
3618 ///Requires `VK_KHR_cooperative_matrix`.
3619 pub unsafe fn get_physical_device_cooperative_matrix_properties_khr(
3620 &self,
3621 physical_device: PhysicalDevice,
3622 ) -> VkResult<Vec<CooperativeMatrixPropertiesKHR>> {
3623 let fp = self
3624 .commands()
3625 .get_physical_device_cooperative_matrix_properties_khr
3626 .expect("vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR not loaded");
3627 enumerate_two_call(|count, data| unsafe { fp(physical_device, count, data) })
3628 }
3629 ///Wraps [`vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV.html).
3630 /**
3631 Provided by **VK_NV_cooperative_matrix2**.*/
3632 ///
3633 ///# Errors
3634 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3635 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3636 ///- `VK_ERROR_UNKNOWN`
3637 ///- `VK_ERROR_VALIDATION_FAILED`
3638 ///
3639 ///# Safety
3640 ///- `physicalDevice` (self) must be valid and not destroyed.
3641 ///
3642 ///# Panics
3643 ///Panics if `vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3644 ///
3645 ///# Usage Notes
3646 ///
3647 ///Enumerates the supported flexible-dimension cooperative matrix
3648 ///configurations on the physical device. Uses the two-call idiom.
3649 ///Flexible dimensions allow non-power-of-two matrix sizes for
3650 ///better utilisation of hardware matrix units.
3651 ///
3652 ///Requires `VK_NV_cooperative_matrix2`.
3653 pub unsafe fn get_physical_device_cooperative_matrix_flexible_dimensions_properties_nv(
3654 &self,
3655 physical_device: PhysicalDevice,
3656 ) -> VkResult<Vec<CooperativeMatrixFlexibleDimensionsPropertiesNV>> {
3657 let fp = self
3658 .commands()
3659 .get_physical_device_cooperative_matrix_flexible_dimensions_properties_nv
3660 .expect(
3661 "vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV not loaded",
3662 );
3663 enumerate_two_call(|count, data| unsafe { fp(physical_device, count, data) })
3664 }
3665 ///Wraps [`vkGetPhysicalDeviceCooperativeVectorPropertiesNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceCooperativeVectorPropertiesNV.html).
3666 /**
3667 Provided by **VK_NV_cooperative_vector**.*/
3668 ///
3669 ///# Errors
3670 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3671 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3672 ///- `VK_ERROR_UNKNOWN`
3673 ///- `VK_ERROR_VALIDATION_FAILED`
3674 ///
3675 ///# Safety
3676 ///- `physicalDevice` (self) must be valid and not destroyed.
3677 ///
3678 ///# Panics
3679 ///Panics if `vkGetPhysicalDeviceCooperativeVectorPropertiesNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3680 ///
3681 ///# Usage Notes
3682 ///
3683 ///Queries the supported cooperative vector properties (data types,
3684 ///matrix dimensions, operations) for a physical device. Use this
3685 ///to determine what cooperative vector configurations are available
3686 ///before creating pipelines that use them.
3687 ///
3688 ///Requires `VK_NV_cooperative_vector`.
3689 pub unsafe fn get_physical_device_cooperative_vector_properties_nv(
3690 &self,
3691 physical_device: PhysicalDevice,
3692 ) -> VkResult<Vec<CooperativeVectorPropertiesNV>> {
3693 let fp = self
3694 .commands()
3695 .get_physical_device_cooperative_vector_properties_nv
3696 .expect("vkGetPhysicalDeviceCooperativeVectorPropertiesNV not loaded");
3697 enumerate_two_call(|count, data| unsafe { fp(physical_device, count, data) })
3698 }
3699 ///Wraps [`vkEnumeratePhysicalDeviceShaderInstrumentationMetricsARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkEnumeratePhysicalDeviceShaderInstrumentationMetricsARM.html).
3700 /**
3701 Provided by **VK_ARM_shader_instrumentation**.*/
3702 ///
3703 ///# Errors
3704 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3705 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3706 ///- `VK_ERROR_INITIALIZATION_FAILED`
3707 ///- `VK_ERROR_UNKNOWN`
3708 ///- `VK_ERROR_VALIDATION_FAILED`
3709 ///
3710 ///# Safety
3711 ///- `physicalDevice` (self) must be valid and not destroyed.
3712 ///
3713 ///# Panics
3714 ///Panics if `vkEnumeratePhysicalDeviceShaderInstrumentationMetricsARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3715 ///
3716 ///# Usage Notes
3717 ///
3718 ///Enumerates the shader instrumentation metrics supported by a
3719 ///physical device. Uses the two-call idiom. Returns metric
3720 ///descriptions that can be selected when creating a shader
3721 ///instrumentation object.
3722 ///
3723 ///Requires `VK_ARM_shader_instrumentation`.
3724 pub unsafe fn enumerate_physical_device_shader_instrumentation_metrics_arm(
3725 &self,
3726 physical_device: PhysicalDevice,
3727 ) -> VkResult<Vec<ShaderInstrumentationMetricDescriptionARM>> {
3728 let fp = self
3729 .commands()
3730 .enumerate_physical_device_shader_instrumentation_metrics_arm
3731 .expect("vkEnumeratePhysicalDeviceShaderInstrumentationMetricsARM not loaded");
3732 enumerate_two_call(|count, data| unsafe { fp(physical_device, count, data) })
3733 }
3734 ///Wraps [`vkGetPhysicalDeviceExternalTensorPropertiesARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceExternalTensorPropertiesARM.html).
3735 /**
3736 Provided by **VK_ARM_tensors**.*/
3737 ///
3738 ///# Safety
3739 ///- `physicalDevice` (self) must be valid and not destroyed.
3740 ///
3741 ///# Panics
3742 ///Panics if `vkGetPhysicalDeviceExternalTensorPropertiesARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3743 ///
3744 ///# Usage Notes
3745 ///
3746 ///Queries whether a tensor with the given parameters can be
3747 ///exported to or imported from an external handle type. Returns
3748 ///compatibility and feature flags for external tensor sharing.
3749 ///
3750 ///Requires `VK_ARM_tensors`.
3751 pub unsafe fn get_physical_device_external_tensor_properties_arm(
3752 &self,
3753 physical_device: PhysicalDevice,
3754 p_external_tensor_info: &PhysicalDeviceExternalTensorInfoARM,
3755 p_external_tensor_properties: &mut ExternalTensorPropertiesARM,
3756 ) {
3757 let fp = self
3758 .commands()
3759 .get_physical_device_external_tensor_properties_arm
3760 .expect("vkGetPhysicalDeviceExternalTensorPropertiesARM not loaded");
3761 unsafe {
3762 fp(
3763 physical_device,
3764 p_external_tensor_info,
3765 p_external_tensor_properties,
3766 )
3767 };
3768 }
3769 ///Wraps [`vkGetPhysicalDeviceQueueFamilyDataGraphPropertiesARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceQueueFamilyDataGraphPropertiesARM.html).
3770 /**
3771 Provided by **VK_ARM_data_graph**.*/
3772 ///
3773 ///# Errors
3774 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3775 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3776 ///- `VK_ERROR_UNKNOWN`
3777 ///- `VK_ERROR_VALIDATION_FAILED`
3778 ///
3779 ///# Safety
3780 ///- `physicalDevice` (self) must be valid and not destroyed.
3781 ///
3782 ///# Panics
3783 ///Panics if `vkGetPhysicalDeviceQueueFamilyDataGraphPropertiesARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3784 ///
3785 ///# Usage Notes
3786 ///
3787 ///Enumerates the data graph pipeline properties supported by a
3788 ///specific queue family. Uses the two-call idiom. Use to determine
3789 ///which queue families can execute data graph pipelines.
3790 ///
3791 ///Requires `VK_ARM_data_graph`.
3792 pub unsafe fn get_physical_device_queue_family_data_graph_properties_arm(
3793 &self,
3794 physical_device: PhysicalDevice,
3795 queue_family_index: u32,
3796 ) -> VkResult<Vec<QueueFamilyDataGraphPropertiesARM>> {
3797 let fp = self
3798 .commands()
3799 .get_physical_device_queue_family_data_graph_properties_arm
3800 .expect("vkGetPhysicalDeviceQueueFamilyDataGraphPropertiesARM not loaded");
3801 enumerate_two_call(|count, data| unsafe {
3802 fp(physical_device, queue_family_index, count, data)
3803 })
3804 }
3805 ///Wraps [`vkGetPhysicalDeviceQueueFamilyDataGraphProcessingEnginePropertiesARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceQueueFamilyDataGraphProcessingEnginePropertiesARM.html).
3806 /**
3807 Provided by **VK_ARM_data_graph**.*/
3808 ///
3809 ///# Safety
3810 ///- `physicalDevice` (self) must be valid and not destroyed.
3811 ///
3812 ///# Panics
3813 ///Panics if `vkGetPhysicalDeviceQueueFamilyDataGraphProcessingEnginePropertiesARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3814 ///
3815 ///# Usage Notes
3816 ///
3817 ///Queries the data graph processing engine properties for a
3818 ///specific queue family. Returns hardware-specific engine
3819 ///capabilities such as supported data types and operations.
3820 ///
3821 ///Requires `VK_ARM_data_graph`.
3822 pub unsafe fn get_physical_device_queue_family_data_graph_processing_engine_properties_arm(
3823 &self,
3824 physical_device: PhysicalDevice,
3825 p_queue_family_data_graph_processing_engine_info: &PhysicalDeviceQueueFamilyDataGraphProcessingEngineInfoARM,
3826 p_queue_family_data_graph_processing_engine_properties: &mut QueueFamilyDataGraphProcessingEnginePropertiesARM,
3827 ) {
3828 let fp = self
3829 .commands()
3830 .get_physical_device_queue_family_data_graph_processing_engine_properties_arm
3831 .expect(
3832 "vkGetPhysicalDeviceQueueFamilyDataGraphProcessingEnginePropertiesARM not loaded",
3833 );
3834 unsafe {
3835 fp(
3836 physical_device,
3837 p_queue_family_data_graph_processing_engine_info,
3838 p_queue_family_data_graph_processing_engine_properties,
3839 )
3840 };
3841 }
3842 ///Wraps [`vkEnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkEnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM.html).
3843 /**
3844 Provided by **VK_ARM_performance_counters_by_region**.*/
3845 ///
3846 ///# Errors
3847 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3848 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3849 ///- `VK_ERROR_INITIALIZATION_FAILED`
3850 ///- `VK_ERROR_UNKNOWN`
3851 ///- `VK_ERROR_VALIDATION_FAILED`
3852 ///
3853 ///# Safety
3854 ///- `physicalDevice` (self) must be valid and not destroyed.
3855 ///
3856 ///# Panics
3857 ///Panics if `vkEnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3858 ///
3859 ///# Usage Notes
3860 ///
3861 ///Enumerates performance counters for a specific queue family on
3862 ///ARM GPUs, grouped by hardware region. Uses the two-call idiom
3863 ///for the counter array and also writes corresponding descriptions.
3864 ///
3865 ///Requires `VK_ARM_shader_instrumentation`.
3866 pub unsafe fn enumerate_physical_device_queue_family_performance_counters_by_region_arm(
3867 &self,
3868 physical_device: PhysicalDevice,
3869 queue_family_index: u32,
3870 p_counter_descriptions: *mut PerformanceCounterDescriptionARM,
3871 ) -> VkResult<Vec<PerformanceCounterARM>> {
3872 let fp = self
3873 .commands()
3874 .enumerate_physical_device_queue_family_performance_counters_by_region_arm
3875 .expect(
3876 "vkEnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM not loaded",
3877 );
3878 enumerate_two_call(|count, data| unsafe {
3879 fp(
3880 physical_device,
3881 queue_family_index,
3882 count,
3883 data,
3884 p_counter_descriptions,
3885 )
3886 })
3887 }
3888 ///Wraps [`vkGetPhysicalDeviceDescriptorSizeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPhysicalDeviceDescriptorSizeEXT.html).
3889 /**
3890 Provided by **VK_EXT_descriptor_heap**.*/
3891 ///
3892 ///# Safety
3893 ///- `physicalDevice` (self) must be valid and not destroyed.
3894 ///
3895 ///# Panics
3896 ///Panics if `vkGetPhysicalDeviceDescriptorSizeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3897 ///
3898 ///# Usage Notes
3899 ///
3900 ///Returns the byte size of a single descriptor of the specified
3901 ///type on this physical device.
3902 ///
3903 ///Use this to compute buffer sizes and offsets when working with
3904 ///the descriptor heap model.
3905 ///
3906 ///Provided by `VK_EXT_descriptor_heap`.
3907 pub unsafe fn get_physical_device_descriptor_size_ext(
3908 &self,
3909 physical_device: PhysicalDevice,
3910 descriptor_type: DescriptorType,
3911 ) -> u64 {
3912 let fp = self
3913 .commands()
3914 .get_physical_device_descriptor_size_ext
3915 .expect("vkGetPhysicalDeviceDescriptorSizeEXT not loaded");
3916 unsafe { fp(physical_device, descriptor_type) }
3917 }
3918}