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