vulkan_rust/generated/device_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::Device {
10 ///Wraps [`vkGetDeviceProcAddr`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceProcAddr.html).
11 /**
12 Provided by **VK_BASE_VERSION_1_0**.*/
13 ///
14 ///# Safety
15 ///- `device` (self) must be valid and not destroyed.
16 ///
17 ///# Panics
18 ///Panics if `vkGetDeviceProcAddr` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19 ///
20 ///# Usage Notes
21 ///
22 ///Returns a function pointer for a device-level command. This is the
23 ///device-specific equivalent of `get_instance_proc_addr` and returns
24 ///pointers dispatched directly through the device's driver, bypassing
25 ///the loader trampoline.
26 ///
27 ///In normal usage you do not need to call this yourself, `Device`
28 ///loads all function pointers automatically at creation time. Use this
29 ///only if you need a command that is not yet exposed as a wrapper
30 ///method, or for raw interop scenarios.
31 ///
32 ///The returned pointer is only valid for the device it was queried
33 ///from. Passing a command name that the device does not support
34 ///returns a null pointer.
35 pub unsafe fn get_device_proc_addr(&self, p_name: *const core::ffi::c_char) {
36 let fp = self
37 .commands()
38 .get_device_proc_addr
39 .expect("vkGetDeviceProcAddr not loaded");
40 unsafe { fp(self.handle(), p_name) };
41 }
42 ///Wraps [`vkDestroyDevice`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyDevice.html).
43 /**
44 Provided by **VK_BASE_VERSION_1_0**.*/
45 ///
46 ///# Safety
47 ///- `device` (self) must be valid and not destroyed.
48 ///- `device` must be externally synchronized.
49 ///
50 ///# Panics
51 ///Panics if `vkDestroyDevice` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
52 ///
53 ///# Usage Notes
54 ///
55 ///Destroys a logical device and frees its resources. All objects
56 ///created from this device (buffers, images, pipelines, command pools,
57 ///etc.) **must** be destroyed before calling this.
58 ///
59 ///A safe teardown order:
60 ///
61 ///1. `device_wait_idle`, ensure no GPU work is in flight.
62 ///2. Destroy all device-child objects (pipelines, buffers, images,
63 /// views, descriptor pools, command pools, fences, semaphores, etc.).
64 ///3. `free_memory` for all device memory allocations.
65 ///4. `destroy_device`.
66 ///
67 ///After this call the `Device` handle is invalid. Do not use it or any
68 ///object created from it.
69 ///
70 ///# Guide
71 ///
72 ///See [The Vulkan Object Model](https://hiddentale.github.io/vulkan_rust/concepts/object-model.html) in the vulkan_rust guide.
73 pub unsafe fn destroy_device(&self, allocator: Option<&AllocationCallbacks>) {
74 let fp = self
75 .commands()
76 .destroy_device
77 .expect("vkDestroyDevice not loaded");
78 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
79 unsafe { fp(self.handle(), alloc_ptr) };
80 }
81 ///Wraps [`vkGetDeviceQueue`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceQueue.html).
82 /**
83 Provided by **VK_BASE_VERSION_1_0**.*/
84 ///
85 ///# Safety
86 ///- `device` (self) must be valid and not destroyed.
87 ///
88 ///# Panics
89 ///Panics if `vkGetDeviceQueue` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
90 ///
91 ///# Usage Notes
92 ///
93 ///Retrieves a queue handle for a queue that was requested at device
94 ///creation time. The `queue_family_index` and `queue_index` must match
95 ///a family and index that was included in the `DeviceCreateInfo`'s
96 ///`queue_create_infos`.
97 ///
98 ///Queue handles are implicitly owned by the device, they do not need
99 ///to be destroyed and become invalid when the device is destroyed.
100 ///
101 ///Queues retrieved this way have no special flags. If you created
102 ///queues with `DeviceQueueCreateFlags` (e.g. protected queues), use
103 ///`get_device_queue2` instead.
104 ///
105 ///It is common to retrieve queues once after device creation and store
106 ///them for the lifetime of the device.
107 ///
108 ///# Guide
109 ///
110 ///See [Hello Triangle, Part 1](https://hiddentale.github.io/vulkan_rust/getting-started/hello-triangle-1.html) in the vulkan_rust guide.
111 pub unsafe fn get_device_queue(&self, queue_family_index: u32, queue_index: u32) -> Queue {
112 let fp = self
113 .commands()
114 .get_device_queue
115 .expect("vkGetDeviceQueue not loaded");
116 let mut out = unsafe { core::mem::zeroed() };
117 unsafe { fp(self.handle(), queue_family_index, queue_index, &mut out) };
118 out
119 }
120 ///Wraps [`vkQueueSubmit`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueSubmit.html).
121 /**
122 Provided by **VK_BASE_VERSION_1_0**.*/
123 ///
124 ///# Errors
125 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
126 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
127 ///- `VK_ERROR_DEVICE_LOST`
128 ///- `VK_ERROR_UNKNOWN`
129 ///- `VK_ERROR_VALIDATION_FAILED`
130 ///
131 ///# Safety
132 ///- `queue` (self) must be valid and not destroyed.
133 ///- `queue` must be externally synchronized.
134 ///- `fence` must be externally synchronized.
135 ///
136 ///# Panics
137 ///Panics if `vkQueueSubmit` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
138 ///
139 ///# Usage Notes
140 ///
141 ///`queue_submit` is the primary way to send recorded command buffers
142 ///to the GPU. Each `SubmitInfo` specifies:
143 ///
144 ///- **Wait semaphores + stage masks**: the submission waits on these
145 /// semaphores at the given pipeline stages before executing.
146 ///- **Command buffers**: executed in array order within the submission.
147 ///- **Signal semaphores**: signalled when all command buffers complete.
148 ///
149 ///**Fence**: pass a fence to know when the *entire batch* of submissions
150 ///completes on the CPU side. Passing `Fence::null()` means there is no
151 ///CPU-visible signal, you must use semaphores or `queue_wait_idle`
152 ///instead.
153 ///
154 ///Minimize `queue_submit` calls. Each call has driver overhead; batching
155 ///multiple `SubmitInfo` entries into one call is cheaper than separate
156 ///calls.
157 ///
158 ///**Thread safety**: a `Queue` must be externally synchronized. If
159 ///multiple threads submit to the same queue, you need a mutex.
160 ///
161 ///# Guide
162 ///
163 ///See [Synchronization](https://hiddentale.github.io/vulkan_rust/concepts/synchronization.html) in the vulkan_rust guide.
164 pub unsafe fn queue_submit(
165 &self,
166 queue: Queue,
167 p_submits: &[SubmitInfo],
168 fence: Fence,
169 ) -> VkResult<()> {
170 let fp = self
171 .commands()
172 .queue_submit
173 .expect("vkQueueSubmit not loaded");
174 check(unsafe { fp(queue, p_submits.len() as u32, p_submits.as_ptr(), fence) })
175 }
176 ///Wraps [`vkQueueWaitIdle`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueWaitIdle.html).
177 /**
178 Provided by **VK_BASE_VERSION_1_0**.*/
179 ///
180 ///# Errors
181 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
182 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
183 ///- `VK_ERROR_DEVICE_LOST`
184 ///- `VK_ERROR_UNKNOWN`
185 ///- `VK_ERROR_VALIDATION_FAILED`
186 ///
187 ///# Safety
188 ///- `queue` (self) must be valid and not destroyed.
189 ///- `queue` must be externally synchronized.
190 ///
191 ///# Panics
192 ///Panics if `vkQueueWaitIdle` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
193 ///
194 ///# Usage Notes
195 ///
196 ///Blocks the calling thread until all commands submitted to this queue
197 ///have completed. Equivalent to submitting a fence and immediately
198 ///waiting on it, but simpler.
199 ///
200 ///Use this for quick synchronization in non-performance-critical paths
201 ///(e.g. during teardown or after a one-shot transfer). In a render
202 ///loop, prefer fences or timeline semaphores for finer-grained
203 ///control, `queue_wait_idle` stalls the CPU and prevents overlap
204 ///between CPU and GPU work.
205 ///
206 ///The queue must be externally synchronized: do not call this while
207 ///another thread is submitting to the same queue.
208 pub unsafe fn queue_wait_idle(&self, queue: Queue) -> VkResult<()> {
209 let fp = self
210 .commands()
211 .queue_wait_idle
212 .expect("vkQueueWaitIdle not loaded");
213 check(unsafe { fp(queue) })
214 }
215 ///Wraps [`vkDeviceWaitIdle`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDeviceWaitIdle.html).
216 /**
217 Provided by **VK_BASE_VERSION_1_0**.*/
218 ///
219 ///# Errors
220 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
221 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
222 ///- `VK_ERROR_DEVICE_LOST`
223 ///- `VK_ERROR_UNKNOWN`
224 ///- `VK_ERROR_VALIDATION_FAILED`
225 ///
226 ///# Safety
227 ///- `device` (self) must be valid and not destroyed.
228 ///
229 ///# Panics
230 ///Panics if `vkDeviceWaitIdle` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
231 ///
232 ///# Usage Notes
233 ///
234 ///Blocks the calling thread until **all** queues on this device are
235 ///idle. This is the nuclear option for synchronization, it drains
236 ///every queue completely.
237 ///
238 ///Typical uses:
239 ///
240 ///- **Before destroying the device**: ensures no GPU work is in flight
241 /// before you start tearing down resources.
242 ///- **Before a swapchain resize**: guarantees all frames are done so
243 /// image views and framebuffers can be safely recreated.
244 ///
245 ///Avoid calling this in a render loop. It forces a full CPU–GPU
246 ///round-trip and prevents any overlap. Use per-frame fences or
247 ///timeline semaphores instead.
248 pub unsafe fn device_wait_idle(&self) -> VkResult<()> {
249 let fp = self
250 .commands()
251 .device_wait_idle
252 .expect("vkDeviceWaitIdle not loaded");
253 check(unsafe { fp(self.handle()) })
254 }
255 ///Wraps [`vkAllocateMemory`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAllocateMemory.html).
256 /**
257 Provided by **VK_BASE_VERSION_1_0**.*/
258 ///
259 ///# Errors
260 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
261 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
262 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
263 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
264 ///- `VK_ERROR_UNKNOWN`
265 ///- `VK_ERROR_VALIDATION_FAILED`
266 ///
267 ///# Safety
268 ///- `device` (self) must be valid and not destroyed.
269 ///
270 ///# Panics
271 ///Panics if `vkAllocateMemory` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
272 ///
273 ///# Usage Notes
274 ///
275 ///Memory allocation in Vulkan is expensive. Prefer sub-allocating from
276 ///large blocks using a memory allocator (e.g., `gpu-allocator`) rather
277 ///than calling this for every buffer or image.
278 ///
279 ///The returned `DeviceMemory` must be freed with `free_memory` when no
280 ///longer needed. Vulkan does not garbage-collect device memory.
281 ///
282 ///# Guide
283 ///
284 ///See [Memory Management](https://hiddentale.github.io/vulkan_rust/concepts/memory.html) in the vulkan_rust guide.
285 pub unsafe fn allocate_memory(
286 &self,
287 p_allocate_info: &MemoryAllocateInfo,
288 allocator: Option<&AllocationCallbacks>,
289 ) -> VkResult<DeviceMemory> {
290 let fp = self
291 .commands()
292 .allocate_memory
293 .expect("vkAllocateMemory not loaded");
294 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
295 let mut out = unsafe { core::mem::zeroed() };
296 check(unsafe { fp(self.handle(), p_allocate_info, alloc_ptr, &mut out) })?;
297 Ok(out)
298 }
299 ///Wraps [`vkFreeMemory`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkFreeMemory.html).
300 /**
301 Provided by **VK_BASE_VERSION_1_0**.*/
302 ///
303 ///# Safety
304 ///- `device` (self) must be valid and not destroyed.
305 ///- `memory` must be externally synchronized.
306 ///
307 ///# Panics
308 ///Panics if `vkFreeMemory` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
309 ///
310 ///# Usage Notes
311 ///
312 ///Frees a device memory allocation. All buffers and images bound to
313 ///this memory must already be destroyed, freeing memory while objects
314 ///are still bound is undefined behaviour.
315 ///
316 ///If the memory is currently mapped, it is implicitly unmapped before
317 ///being freed. You do not need to call `unmap_memory` first, although
318 ///doing so explicitly is a common defensive practice.
319 ///
320 ///Vulkan has a per-device allocation limit
321 ///(`max_memory_allocation_count`, often 4096). Sub-allocating from
322 ///large blocks and freeing them as a group keeps you well within this
323 ///limit.
324 pub unsafe fn free_memory(
325 &self,
326 memory: DeviceMemory,
327 allocator: Option<&AllocationCallbacks>,
328 ) {
329 let fp = self
330 .commands()
331 .free_memory
332 .expect("vkFreeMemory not loaded");
333 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
334 unsafe { fp(self.handle(), memory, alloc_ptr) };
335 }
336 ///Wraps [`vkUnmapMemory`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkUnmapMemory.html).
337 /**
338 Provided by **VK_BASE_VERSION_1_0**.*/
339 ///
340 ///# Safety
341 ///- `device` (self) must be valid and not destroyed.
342 ///- `memory` must be externally synchronized.
343 ///
344 ///# Panics
345 ///Panics if `vkUnmapMemory` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
346 ///
347 ///# Usage Notes
348 ///
349 ///Unmaps a previously mapped device memory region. After this call the
350 ///host pointer returned by `map_memory` is invalid.
351 ///
352 ///Unmapping is only strictly necessary before `free_memory` if you
353 ///want to be explicit. Freeing memory implicitly unmaps it.
354 ///
355 ///For persistently mapped memory (the recommended pattern), you
356 ///typically map once after allocation and unmap only during teardown.
357 ///There is no performance penalty for keeping memory mapped.
358 ///
359 ///If the memory type is not `HOST_COHERENT`, make sure to call
360 ///`flush_mapped_memory_ranges` after your final writes before
361 ///unmapping, to ensure the GPU sees the latest data.
362 pub unsafe fn unmap_memory(&self, memory: DeviceMemory) {
363 let fp = self
364 .commands()
365 .unmap_memory
366 .expect("vkUnmapMemory not loaded");
367 unsafe { fp(self.handle(), memory) };
368 }
369 ///Wraps [`vkFlushMappedMemoryRanges`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkFlushMappedMemoryRanges.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_UNKNOWN`
377 ///- `VK_ERROR_VALIDATION_FAILED`
378 ///
379 ///# Safety
380 ///- `device` (self) must be valid and not destroyed.
381 ///
382 ///# Panics
383 ///Panics if `vkFlushMappedMemoryRanges` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
384 ///
385 ///# Usage Notes
386 ///
387 ///Flushes CPU writes to mapped non-coherent memory so the GPU can see
388 ///them. Only needed when the memory type does **not** include
389 ///`MEMORY_PROPERTY_HOST_COHERENT`.
390 ///
391 ///Call this **after** writing data through the mapped pointer and
392 ///**before** the GPU reads it (i.e. before the relevant
393 ///`queue_submit`).
394 ///
395 ///**Alignment**: the `offset` and `size` of each range must be
396 ///multiples of `non_coherent_atom_size` (from physical device limits),
397 ///or `offset` must be zero and `size` must be `VK_WHOLE_SIZE`. Failing
398 ///to align causes undefined behaviour on some implementations.
399 ///
400 ///Multiple ranges can be flushed in a single call. Batch them when
401 ///updating several sub-allocations within the same memory object.
402 ///
403 ///If you are using host-coherent memory, this call is unnecessary and
404 ///can be skipped entirely.
405 pub unsafe fn flush_mapped_memory_ranges(
406 &self,
407 p_memory_ranges: &[MappedMemoryRange],
408 ) -> VkResult<()> {
409 let fp = self
410 .commands()
411 .flush_mapped_memory_ranges
412 .expect("vkFlushMappedMemoryRanges not loaded");
413 check(unsafe {
414 fp(
415 self.handle(),
416 p_memory_ranges.len() as u32,
417 p_memory_ranges.as_ptr(),
418 )
419 })
420 }
421 ///Wraps [`vkInvalidateMappedMemoryRanges`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkInvalidateMappedMemoryRanges.html).
422 /**
423 Provided by **VK_BASE_VERSION_1_0**.*/
424 ///
425 ///# Errors
426 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
427 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
428 ///- `VK_ERROR_UNKNOWN`
429 ///- `VK_ERROR_VALIDATION_FAILED`
430 ///
431 ///# Safety
432 ///- `device` (self) must be valid and not destroyed.
433 ///
434 ///# Panics
435 ///Panics if `vkInvalidateMappedMemoryRanges` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
436 ///
437 ///# Usage Notes
438 ///
439 ///Invalidates CPU caches for mapped non-coherent memory so the CPU
440 ///can see data written by the GPU. The counterpart to
441 ///`flush_mapped_memory_ranges`.
442 ///
443 ///Call this **after** the GPU has finished writing (e.g. after
444 ///`wait_for_fences` on the relevant submission) and **before** reading
445 ///the data through the mapped pointer.
446 ///
447 ///The same alignment rules apply: `offset` and `size` must be
448 ///multiples of `non_coherent_atom_size`, or use offset zero with
449 ///`VK_WHOLE_SIZE`.
450 ///
451 ///If you are using host-coherent memory, this call is unnecessary,
452 ///GPU writes are automatically visible to the CPU. Most desktop GPUs
453 ///offer host-coherent memory types for host-visible heaps.
454 pub unsafe fn invalidate_mapped_memory_ranges(
455 &self,
456 p_memory_ranges: &[MappedMemoryRange],
457 ) -> VkResult<()> {
458 let fp = self
459 .commands()
460 .invalidate_mapped_memory_ranges
461 .expect("vkInvalidateMappedMemoryRanges not loaded");
462 check(unsafe {
463 fp(
464 self.handle(),
465 p_memory_ranges.len() as u32,
466 p_memory_ranges.as_ptr(),
467 )
468 })
469 }
470 ///Wraps [`vkGetDeviceMemoryCommitment`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceMemoryCommitment.html).
471 /**
472 Provided by **VK_BASE_VERSION_1_0**.*/
473 ///
474 ///# Safety
475 ///- `device` (self) must be valid and not destroyed.
476 ///
477 ///# Panics
478 ///Panics if `vkGetDeviceMemoryCommitment` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
479 ///
480 ///# Usage Notes
481 ///
482 ///Queries how many bytes of a lazily-allocated memory object are
483 ///currently backed by physical storage. Only meaningful for memory
484 ///allocated with `MEMORY_PROPERTY_LAZILY_ALLOCATED`.
485 ///
486 ///Lazily-allocated memory is primarily used for transient framebuffer
487 ///attachments on tile-based GPUs (mobile). The driver may not back the
488 ///full allocation with physical memory until tiles actually need it.
489 ///
490 ///On desktop GPUs this typically returns the full allocation size since
491 ///lazy allocation is rarely supported. Check
492 ///`memory_properties.memory_types` for the `LAZILY_ALLOCATED` flag
493 ///before relying on this.
494 pub unsafe fn get_device_memory_commitment(&self, memory: DeviceMemory) -> u64 {
495 let fp = self
496 .commands()
497 .get_device_memory_commitment
498 .expect("vkGetDeviceMemoryCommitment not loaded");
499 let mut out = unsafe { core::mem::zeroed() };
500 unsafe { fp(self.handle(), memory, &mut out) };
501 out
502 }
503 ///Wraps [`vkGetBufferMemoryRequirements`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetBufferMemoryRequirements.html).
504 /**
505 Provided by **VK_BASE_VERSION_1_0**.*/
506 ///
507 ///# Safety
508 ///- `device` (self) must be valid and not destroyed.
509 ///
510 ///# Panics
511 ///Panics if `vkGetBufferMemoryRequirements` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
512 ///
513 ///# Usage Notes
514 ///
515 ///Returns the memory requirements (size, alignment, compatible memory
516 ///type bits) for a buffer. Must be called before `bind_buffer_memory`.
517 ///
518 ///The returned `memory_type_bits` is a bitmask where bit *i* is set if
519 ///memory type *i* (from `get_physical_device_memory_properties`) is
520 ///compatible. Pick a type that satisfies both this mask and your
521 ///desired properties (`HOST_VISIBLE`, `DEVICE_LOCAL`, etc.).
522 ///
523 ///The `alignment` value must be respected when sub-allocating: the
524 ///offset passed to `bind_buffer_memory` must be a multiple of it.
525 ///
526 ///For Vulkan 1.1+, prefer `get_buffer_memory_requirements2` which
527 ///supports dedicated allocation queries via
528 ///`MemoryDedicatedRequirements`.
529 pub unsafe fn get_buffer_memory_requirements(&self, buffer: Buffer) -> MemoryRequirements {
530 let fp = self
531 .commands()
532 .get_buffer_memory_requirements
533 .expect("vkGetBufferMemoryRequirements not loaded");
534 let mut out = unsafe { core::mem::zeroed() };
535 unsafe { fp(self.handle(), buffer, &mut out) };
536 out
537 }
538 ///Wraps [`vkBindBufferMemory`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBindBufferMemory.html).
539 /**
540 Provided by **VK_BASE_VERSION_1_0**.*/
541 ///
542 ///# Errors
543 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
544 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
545 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
546 ///- `VK_ERROR_UNKNOWN`
547 ///- `VK_ERROR_VALIDATION_FAILED`
548 ///
549 ///# Safety
550 ///- `device` (self) must be valid and not destroyed.
551 ///- `buffer` must be externally synchronized.
552 ///
553 ///# Panics
554 ///Panics if `vkBindBufferMemory` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
555 ///
556 ///# Usage Notes
557 ///
558 ///Binds a `DeviceMemory` allocation (or a region of one) to a buffer.
559 ///Must be called before the buffer is used in any command.
560 ///
561 ///**Requirements**:
562 ///
563 ///1. Call `get_buffer_memory_requirements` first.
564 ///2. The `memory_type_index` used for allocation must have a bit set
565 /// in the returned `memory_type_bits` mask.
566 ///3. `memory_offset` must be a multiple of the returned `alignment`.
567 ///4. `memory_offset + size` must not exceed the allocation size.
568 ///
569 ///**Sub-allocation**: multiple buffers can share one `DeviceMemory`
570 ///allocation at different offsets. This is strongly recommended,
571 ///drivers have a per-allocation limit (`max_memory_allocation_count`,
572 ///often 4096) and each allocation has overhead.
573 ///
574 ///Once bound, the memory binding cannot be changed for the lifetime of
575 ///the buffer. Destroy the buffer before freeing its backing memory.
576 pub unsafe fn bind_buffer_memory(
577 &self,
578 buffer: Buffer,
579 memory: DeviceMemory,
580 memory_offset: u64,
581 ) -> VkResult<()> {
582 let fp = self
583 .commands()
584 .bind_buffer_memory
585 .expect("vkBindBufferMemory not loaded");
586 check(unsafe { fp(self.handle(), buffer, memory, memory_offset) })
587 }
588 ///Wraps [`vkGetImageMemoryRequirements`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageMemoryRequirements.html).
589 /**
590 Provided by **VK_BASE_VERSION_1_0**.*/
591 ///
592 ///# Safety
593 ///- `device` (self) must be valid and not destroyed.
594 ///
595 ///# Panics
596 ///Panics if `vkGetImageMemoryRequirements` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
597 ///
598 ///# Usage Notes
599 ///
600 ///Returns the memory requirements (size, alignment, compatible memory
601 ///type bits) for an image. Must be called before `bind_image_memory`.
602 ///
603 ///Image memory requirements can differ significantly based on tiling,
604 ///format, and usage flags. An `IMAGE_TILING_OPTIMAL` image typically
605 ///requires `DEVICE_LOCAL` memory and has stricter alignment than a
606 ///linear image.
607 ///
608 ///When sub-allocating linear and optimal images from the same memory
609 ///object, the `buffer_image_granularity` device limit applies. You may
610 ///need extra padding between the two to satisfy this constraint.
611 ///
612 ///For Vulkan 1.1+, prefer `get_image_memory_requirements2` which
613 ///supports dedicated allocation queries.
614 pub unsafe fn get_image_memory_requirements(&self, image: Image) -> MemoryRequirements {
615 let fp = self
616 .commands()
617 .get_image_memory_requirements
618 .expect("vkGetImageMemoryRequirements not loaded");
619 let mut out = unsafe { core::mem::zeroed() };
620 unsafe { fp(self.handle(), image, &mut out) };
621 out
622 }
623 ///Wraps [`vkBindImageMemory`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBindImageMemory.html).
624 /**
625 Provided by **VK_BASE_VERSION_1_0**.*/
626 ///
627 ///# Errors
628 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
629 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
630 ///- `VK_ERROR_UNKNOWN`
631 ///- `VK_ERROR_VALIDATION_FAILED`
632 ///
633 ///# Safety
634 ///- `device` (self) must be valid and not destroyed.
635 ///- `image` must be externally synchronized.
636 ///
637 ///# Panics
638 ///Panics if `vkBindImageMemory` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
639 ///
640 ///# Usage Notes
641 ///
642 ///Binds a `DeviceMemory` allocation (or a region of one) to an image.
643 ///Must be called after `create_image` and before the image is used.
644 ///
645 ///**Requirements**:
646 ///
647 ///1. Call `get_image_memory_requirements` first.
648 ///2. The `memory_type_index` used for allocation must have a bit set
649 /// in the returned `memory_type_bits` mask.
650 ///3. `memory_offset` must be a multiple of the returned `alignment`.
651 ///
652 ///**Dedicated allocations**: some drivers perform better when certain
653 ///images (especially swapchain-sized color or depth targets) have their
654 ///own allocation. Query `get_image_memory_requirements2` with
655 ///`MemoryDedicatedRequirements` to check whether the driver prefers or
656 ///requires a dedicated allocation.
657 ///
658 ///**Sub-allocation**: like buffers, multiple images can share one
659 ///allocation at different offsets. Respect alignment from the memory
660 ///requirements, and note that linear and optimal-tiling images may
661 ///need `buffer_image_granularity` spacing between them.
662 ///
663 ///Once bound, the memory binding is permanent. Destroy the image
664 ///before freeing its backing memory.
665 pub unsafe fn bind_image_memory(
666 &self,
667 image: Image,
668 memory: DeviceMemory,
669 memory_offset: u64,
670 ) -> VkResult<()> {
671 let fp = self
672 .commands()
673 .bind_image_memory
674 .expect("vkBindImageMemory not loaded");
675 check(unsafe { fp(self.handle(), image, memory, memory_offset) })
676 }
677 ///Wraps [`vkGetImageSparseMemoryRequirements`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageSparseMemoryRequirements.html).
678 /**
679 Provided by **VK_BASE_VERSION_1_0**.*/
680 ///
681 ///# Safety
682 ///- `device` (self) must be valid and not destroyed.
683 ///
684 ///# Panics
685 ///Panics if `vkGetImageSparseMemoryRequirements` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
686 ///
687 ///# Usage Notes
688 ///
689 ///Queries the sparse memory requirements for an image created with
690 ///one of the `IMAGE_CREATE_SPARSE_*` flags. Returns a list of sparse
691 ///image format properties describing the memory layout for each
692 ///image aspect (color, depth, stencil, metadata).
693 ///
694 ///Sparse resources allow partially-resident textures where only some
695 ///mip levels or regions are backed by physical memory. This is an
696 ///advanced feature primarily used for virtual texturing and terrain
697 ///streaming.
698 ///
699 ///If the image was not created with sparse flags, this returns an
700 ///empty list. Check `physical_device_features.sparse_binding` before
701 ///using sparse resources.
702 pub unsafe fn get_image_sparse_memory_requirements(
703 &self,
704 image: Image,
705 ) -> Vec<SparseImageMemoryRequirements> {
706 let fp = self
707 .commands()
708 .get_image_sparse_memory_requirements
709 .expect("vkGetImageSparseMemoryRequirements not loaded");
710 fill_two_call(|count, data| unsafe { fp(self.handle(), image, count, data) })
711 }
712 ///Wraps [`vkQueueBindSparse`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueBindSparse.html).
713 /**
714 Provided by **VK_BASE_VERSION_1_0**.*/
715 ///
716 ///# Errors
717 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
718 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
719 ///- `VK_ERROR_DEVICE_LOST`
720 ///- `VK_ERROR_UNKNOWN`
721 ///- `VK_ERROR_VALIDATION_FAILED`
722 ///
723 ///# Safety
724 ///- `queue` (self) must be valid and not destroyed.
725 ///- `queue` must be externally synchronized.
726 ///- `fence` must be externally synchronized.
727 ///
728 ///# Panics
729 ///Panics if `vkQueueBindSparse` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
730 ///
731 ///# Usage Notes
732 ///
733 ///Binds sparse memory regions to sparse resources (buffers or images).
734 ///This is the only way to change the memory backing of a sparse
735 ///resource after creation.
736 ///
737 ///Sparse binding supports:
738 ///
739 ///- **Partial residency**: bind memory to individual mip tail regions
740 /// or image tiles, leaving others unbound.
741 ///- **Aliasing**: multiple sparse resources can alias the same memory
742 /// region (with `IMAGE_CREATE_SPARSE_ALIASED`).
743 ///- **Dynamic re-binding**: swap memory pages at runtime for virtual
744 /// texturing or streaming.
745 ///
746 ///The bind operation is asynchronous and can synchronize with
747 ///semaphores, similar to `queue_submit`. The queue must support sparse
748 ///binding (check `QUEUE_SPARSE_BINDING`).
749 ///
750 ///This is an advanced feature. Most applications use fully-bound
751 ///resources with `bind_buffer_memory` / `bind_image_memory` instead.
752 pub unsafe fn queue_bind_sparse(
753 &self,
754 queue: Queue,
755 p_bind_info: &[BindSparseInfo],
756 fence: Fence,
757 ) -> VkResult<()> {
758 let fp = self
759 .commands()
760 .queue_bind_sparse
761 .expect("vkQueueBindSparse not loaded");
762 check(unsafe { fp(queue, p_bind_info.len() as u32, p_bind_info.as_ptr(), fence) })
763 }
764 ///Wraps [`vkCreateFence`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateFence.html).
765 /**
766 Provided by **VK_BASE_VERSION_1_0**.*/
767 ///
768 ///# Errors
769 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
770 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
771 ///- `VK_ERROR_UNKNOWN`
772 ///- `VK_ERROR_VALIDATION_FAILED`
773 ///
774 ///# Safety
775 ///- `device` (self) must be valid and not destroyed.
776 ///
777 ///# Panics
778 ///Panics if `vkCreateFence` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
779 ///
780 ///# Usage Notes
781 ///
782 ///Fences are the primary CPU–GPU synchronization primitive. The CPU
783 ///blocks on `wait_for_fences` until the GPU signals the fence.
784 ///
785 ///**Initial state**: create with `FENCE_CREATE_SIGNALED` when the
786 ///fence is used in a frame loop that waits before the first submit.
787 ///Without this flag the first `wait_for_fences` would block forever.
788 ///
789 ///**Typical frame loop pattern**:
790 ///
791 ///1. `wait_for_fences`, block until the previous frame's GPU work
792 /// completes.
793 ///2. `reset_fences`, reset back to unsignaled.
794 ///3. Record and submit commands, passing the fence to `queue_submit`.
795 ///
796 ///A fence can only be associated with one submission at a time.
797 ///Submitting with a fence that is already pending is an error.
798 ///
799 ///For GPU–GPU synchronization (between queue submissions) use
800 ///semaphores instead. Fences are strictly for CPU-visible signalling.
801 ///
802 ///# Guide
803 ///
804 ///See [Synchronization](https://hiddentale.github.io/vulkan_rust/concepts/synchronization.html) in the vulkan_rust guide.
805 pub unsafe fn create_fence(
806 &self,
807 p_create_info: &FenceCreateInfo,
808 allocator: Option<&AllocationCallbacks>,
809 ) -> VkResult<Fence> {
810 let fp = self
811 .commands()
812 .create_fence
813 .expect("vkCreateFence not loaded");
814 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
815 let mut out = unsafe { core::mem::zeroed() };
816 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
817 Ok(out)
818 }
819 ///Wraps [`vkDestroyFence`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyFence.html).
820 /**
821 Provided by **VK_BASE_VERSION_1_0**.*/
822 ///
823 ///# Safety
824 ///- `device` (self) must be valid and not destroyed.
825 ///- `fence` must be externally synchronized.
826 ///
827 ///# Panics
828 ///Panics if `vkDestroyFence` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
829 ///
830 ///# Usage Notes
831 ///
832 ///Destroys a fence object. The fence must not be in use by any
833 ///pending `queue_submit` call, wait on it or call `device_wait_idle`
834 ///before destroying.
835 ///
836 ///Fences are lightweight objects but are still tracked by the driver.
837 ///Destroy them during teardown or when they are no longer part of your
838 ///synchronization scheme.
839 pub unsafe fn destroy_fence(&self, fence: Fence, allocator: Option<&AllocationCallbacks>) {
840 let fp = self
841 .commands()
842 .destroy_fence
843 .expect("vkDestroyFence not loaded");
844 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
845 unsafe { fp(self.handle(), fence, alloc_ptr) };
846 }
847 ///Wraps [`vkResetFences`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkResetFences.html).
848 /**
849 Provided by **VK_BASE_VERSION_1_0**.*/
850 ///
851 ///# Errors
852 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
853 ///- `VK_ERROR_UNKNOWN`
854 ///- `VK_ERROR_VALIDATION_FAILED`
855 ///
856 ///# Safety
857 ///- `device` (self) must be valid and not destroyed.
858 ///- `pFences` must be externally synchronized.
859 ///
860 ///# Panics
861 ///Panics if `vkResetFences` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
862 ///
863 ///# Usage Notes
864 ///
865 ///Resets one or more fences to the unsignaled state. Must be called
866 ///before reusing a fence in a new `queue_submit` call.
867 ///
868 ///The fence must not be currently waited on by `wait_for_fences` from
869 ///another thread. A common safe pattern:
870 ///
871 ///1. `wait_for_fences`, blocks until signaled.
872 ///2. `reset_fences`, immediately reset after the wait returns.
873 ///3. Submit new work with the fence.
874 ///
875 ///Resetting a fence that is already unsignaled is valid but wasteful.
876 ///Resetting a fence that is pending (submitted but not yet signaled)
877 ///is an error.
878 pub unsafe fn reset_fences(&self, p_fences: &[Fence]) -> VkResult<()> {
879 let fp = self
880 .commands()
881 .reset_fences
882 .expect("vkResetFences not loaded");
883 check(unsafe { fp(self.handle(), p_fences.len() as u32, p_fences.as_ptr()) })
884 }
885 ///Wraps [`vkGetFenceStatus`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetFenceStatus.html).
886 /**
887 Provided by **VK_BASE_VERSION_1_0**.*/
888 ///
889 ///# Errors
890 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
891 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
892 ///- `VK_ERROR_DEVICE_LOST`
893 ///- `VK_ERROR_UNKNOWN`
894 ///- `VK_ERROR_VALIDATION_FAILED`
895 ///
896 ///# Safety
897 ///- `device` (self) must be valid and not destroyed.
898 ///
899 ///# Panics
900 ///Panics if `vkGetFenceStatus` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
901 ///
902 ///# Usage Notes
903 ///
904 ///Non-blocking check of whether a fence is signaled. Returns
905 ///`VK_SUCCESS` if signaled, `VK_NOT_READY` if still pending.
906 ///
907 ///Use this for polling patterns where you want to do other work while
908 ///waiting:
909 ///
910 ///```text
911 ///loop {
912 /// if get_fence_status(fence) == VK_SUCCESS { break; }
913 /// // do other work...
914 ///}
915 ///```
916 ///
917 ///For blocking waits, prefer `wait_for_fences` which is more efficient
918 ///than a spin loop, it lets the CPU sleep until the driver signals.
919 ///
920 ///This call can also return device-lost errors, so check the result
921 ///even in non-error paths.
922 pub unsafe fn get_fence_status(&self, fence: Fence) -> VkResult<()> {
923 let fp = self
924 .commands()
925 .get_fence_status
926 .expect("vkGetFenceStatus not loaded");
927 check(unsafe { fp(self.handle(), fence) })
928 }
929 ///Wraps [`vkWaitForFences`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkWaitForFences.html).
930 /**
931 Provided by **VK_BASE_VERSION_1_0**.*/
932 ///
933 ///# Errors
934 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
935 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
936 ///- `VK_ERROR_DEVICE_LOST`
937 ///- `VK_ERROR_UNKNOWN`
938 ///- `VK_ERROR_VALIDATION_FAILED`
939 ///
940 ///# Safety
941 ///- `device` (self) must be valid and not destroyed.
942 ///
943 ///# Panics
944 ///Panics if `vkWaitForFences` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
945 ///
946 ///# Usage Notes
947 ///
948 ///Blocks the calling thread until one or all of the given fences are
949 ///signaled, or until the timeout expires.
950 ///
951 ///**`wait_all`**: when `true`, the call returns only after *every*
952 ///fence in the list is signaled. When `false`, it returns as soon as
953 ///*any* one fence is signaled.
954 ///
955 ///**Timeout**: specified in nanoseconds. `u64::MAX` means wait
956 ///indefinitely. A timeout of zero performs a non-blocking check
957 ///(equivalent to polling `get_fence_status` on each fence).
958 ///
959 ///Returns `VK_TIMEOUT` if the timeout expires before the condition is
960 ///met. This is not an error, check the return value and handle it
961 ///(e.g. log a warning or retry).
962 ///
963 ///**Typical frame loop**:
964 ///
965 ///```text
966 ///wait_for_fences(&[frame_fence], true, u64::MAX)
967 ///reset_fences(&[frame_fence])
968 #[doc = "// record and submit..."]
969 ///```
970 ///
971 ///After `wait_for_fences` returns successfully, all GPU work
972 ///associated with those fences is complete and the resources are safe
973 ///to reuse.
974 pub unsafe fn wait_for_fences(
975 &self,
976 p_fences: &[Fence],
977 wait_all: bool,
978 timeout: u64,
979 ) -> VkResult<()> {
980 let fp = self
981 .commands()
982 .wait_for_fences
983 .expect("vkWaitForFences not loaded");
984 check(unsafe {
985 fp(
986 self.handle(),
987 p_fences.len() as u32,
988 p_fences.as_ptr(),
989 wait_all as u32,
990 timeout,
991 )
992 })
993 }
994 ///Wraps [`vkCreateSemaphore`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateSemaphore.html).
995 /**
996 Provided by **VK_BASE_VERSION_1_0**.*/
997 ///
998 ///# Errors
999 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1000 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1001 ///- `VK_ERROR_UNKNOWN`
1002 ///- `VK_ERROR_VALIDATION_FAILED`
1003 ///
1004 ///# Safety
1005 ///- `device` (self) must be valid and not destroyed.
1006 ///
1007 ///# Panics
1008 ///Panics if `vkCreateSemaphore` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1009 ///
1010 ///# Usage Notes
1011 ///
1012 ///Creates a semaphore for GPU–GPU synchronization between queue
1013 ///submissions. Unlike fences (CPU–GPU), semaphores are invisible to
1014 ///the CPU, they are signaled and waited on entirely within
1015 ///`queue_submit` or `queue_present_khr`.
1016 ///
1017 ///**Binary semaphores** (the default) have two states: signaled and
1018 ///unsignaled. A submission signals the semaphore, and a later
1019 ///submission waits on it, which also resets it to unsignaled.
1020 ///
1021 ///**Timeline semaphores** (Vulkan 1.2+) have a monotonically
1022 ///increasing 64-bit counter. Create one by chaining
1023 ///`SemaphoreTypeCreateInfo` with `SEMAPHORE_TYPE_TIMELINE`. Timeline
1024 ///semaphores can be waited on and signaled from the CPU as well via
1025 ///`wait_semaphores` and `signal_semaphore`.
1026 ///
1027 ///Common uses:
1028 ///
1029 ///- Synchronize between a graphics queue submit and a present.
1030 ///- Order a transfer upload before a render pass that consumes it.
1031 ///- Coordinate work across different queue families.
1032 ///
1033 ///# Guide
1034 ///
1035 ///See [Synchronization](https://hiddentale.github.io/vulkan_rust/concepts/synchronization.html) in the vulkan_rust guide.
1036 pub unsafe fn create_semaphore(
1037 &self,
1038 p_create_info: &SemaphoreCreateInfo,
1039 allocator: Option<&AllocationCallbacks>,
1040 ) -> VkResult<Semaphore> {
1041 let fp = self
1042 .commands()
1043 .create_semaphore
1044 .expect("vkCreateSemaphore not loaded");
1045 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1046 let mut out = unsafe { core::mem::zeroed() };
1047 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1048 Ok(out)
1049 }
1050 ///Wraps [`vkDestroySemaphore`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroySemaphore.html).
1051 /**
1052 Provided by **VK_BASE_VERSION_1_0**.*/
1053 ///
1054 ///# Safety
1055 ///- `device` (self) must be valid and not destroyed.
1056 ///- `semaphore` must be externally synchronized.
1057 ///
1058 ///# Panics
1059 ///Panics if `vkDestroySemaphore` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1060 ///
1061 ///# Usage Notes
1062 ///
1063 ///Destroys a semaphore. The semaphore must not be referenced by any
1064 ///pending queue submission, either as a wait or signal semaphore.
1065 ///
1066 ///Wait for all submissions that use this semaphore to complete (via
1067 ///fences or `device_wait_idle`) before destroying it.
1068 pub unsafe fn destroy_semaphore(
1069 &self,
1070 semaphore: Semaphore,
1071 allocator: Option<&AllocationCallbacks>,
1072 ) {
1073 let fp = self
1074 .commands()
1075 .destroy_semaphore
1076 .expect("vkDestroySemaphore not loaded");
1077 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1078 unsafe { fp(self.handle(), semaphore, alloc_ptr) };
1079 }
1080 ///Wraps [`vkCreateEvent`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateEvent.html).
1081 /**
1082 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1083 ///
1084 ///# Errors
1085 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1086 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1087 ///- `VK_ERROR_UNKNOWN`
1088 ///- `VK_ERROR_VALIDATION_FAILED`
1089 ///
1090 ///# Safety
1091 ///- `device` (self) must be valid and not destroyed.
1092 ///
1093 ///# Panics
1094 ///Panics if `vkCreateEvent` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1095 ///
1096 ///# Usage Notes
1097 ///
1098 ///Creates an event, a fine-grained synchronisation primitive that
1099 ///can be signaled and waited on from both the host (CPU) and the
1100 ///device (GPU).
1101 ///
1102 ///Events are most useful for split barriers: signal an event at one
1103 ///point in a command buffer, do other work, then wait on it later.
1104 ///This gives the GPU more flexibility to overlap execution compared to
1105 ///a single `cmd_pipeline_barrier`.
1106 ///
1107 ///**Host-side usage**: `set_event` and `reset_event` signal and reset
1108 ///from the CPU. `get_event_status` polls the current state. However,
1109 ///host-signaled events cannot be reliably waited on by the GPU on all
1110 ///implementations, use them primarily for GPU–GPU sync within a
1111 ///queue.
1112 ///
1113 ///Events are lightweight and cheap to create.
1114 pub unsafe fn create_event(
1115 &self,
1116 p_create_info: &EventCreateInfo,
1117 allocator: Option<&AllocationCallbacks>,
1118 ) -> VkResult<Event> {
1119 let fp = self
1120 .commands()
1121 .create_event
1122 .expect("vkCreateEvent not loaded");
1123 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1124 let mut out = unsafe { core::mem::zeroed() };
1125 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1126 Ok(out)
1127 }
1128 ///Wraps [`vkDestroyEvent`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyEvent.html).
1129 /**
1130 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1131 ///
1132 ///# Safety
1133 ///- `device` (self) must be valid and not destroyed.
1134 ///- `event` must be externally synchronized.
1135 ///
1136 ///# Panics
1137 ///Panics if `vkDestroyEvent` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1138 ///
1139 ///# Usage Notes
1140 ///
1141 ///Destroys an event. The event must not be referenced by any pending
1142 ///command buffer. Wait for all relevant submissions to complete before
1143 ///destroying.
1144 pub unsafe fn destroy_event(&self, event: Event, allocator: Option<&AllocationCallbacks>) {
1145 let fp = self
1146 .commands()
1147 .destroy_event
1148 .expect("vkDestroyEvent not loaded");
1149 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1150 unsafe { fp(self.handle(), event, alloc_ptr) };
1151 }
1152 ///Wraps [`vkGetEventStatus`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetEventStatus.html).
1153 /**
1154 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1155 ///
1156 ///# Errors
1157 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1158 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1159 ///- `VK_ERROR_DEVICE_LOST`
1160 ///- `VK_ERROR_UNKNOWN`
1161 ///- `VK_ERROR_VALIDATION_FAILED`
1162 ///
1163 ///# Safety
1164 ///- `device` (self) must be valid and not destroyed.
1165 ///
1166 ///# Panics
1167 ///Panics if `vkGetEventStatus` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1168 ///
1169 ///# Usage Notes
1170 ///
1171 ///Returns whether an event is currently signaled or unsignaled.
1172 ///Returns `VK_EVENT_SET` if signaled, `VK_EVENT_RESET` if not.
1173 ///
1174 ///This is a non-blocking host-side query. Use it to poll for
1175 ///GPU-signaled events when you need to know the result without
1176 ///blocking. For blocking synchronisation, use fences instead.
1177 pub unsafe fn get_event_status(&self, event: Event) -> VkResult<()> {
1178 let fp = self
1179 .commands()
1180 .get_event_status
1181 .expect("vkGetEventStatus not loaded");
1182 check(unsafe { fp(self.handle(), event) })
1183 }
1184 ///Wraps [`vkSetEvent`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetEvent.html).
1185 /**
1186 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1187 ///
1188 ///# Errors
1189 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1190 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1191 ///- `VK_ERROR_UNKNOWN`
1192 ///- `VK_ERROR_VALIDATION_FAILED`
1193 ///
1194 ///# Safety
1195 ///- `device` (self) must be valid and not destroyed.
1196 ///- `event` must be externally synchronized.
1197 ///
1198 ///# Panics
1199 ///Panics if `vkSetEvent` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1200 ///
1201 ///# Usage Notes
1202 ///
1203 ///Signals an event from the host (CPU). After this call,
1204 ///`get_event_status` returns `VK_EVENT_SET`.
1205 ///
1206 ///Host-signaled events are primarily useful for host–host
1207 ///synchronisation or as a manual control mechanism. For GPU–GPU
1208 ///synchronisation, prefer `cmd_set_event` recorded in a command
1209 ///buffer.
1210 pub unsafe fn set_event(&self, event: Event) -> VkResult<()> {
1211 let fp = self.commands().set_event.expect("vkSetEvent not loaded");
1212 check(unsafe { fp(self.handle(), event) })
1213 }
1214 ///Wraps [`vkResetEvent`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkResetEvent.html).
1215 /**
1216 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1217 ///
1218 ///# Errors
1219 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1220 ///- `VK_ERROR_UNKNOWN`
1221 ///- `VK_ERROR_VALIDATION_FAILED`
1222 ///
1223 ///# Safety
1224 ///- `device` (self) must be valid and not destroyed.
1225 ///- `event` must be externally synchronized.
1226 ///
1227 ///# Panics
1228 ///Panics if `vkResetEvent` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1229 ///
1230 ///# Usage Notes
1231 ///
1232 ///Resets an event to the unsignaled state from the host (CPU). The
1233 ///event must not be waited on by any pending `cmd_wait_events` call.
1234 ///
1235 ///After resetting, the event can be signaled again by `set_event` or
1236 ///`cmd_set_event`.
1237 pub unsafe fn reset_event(&self, event: Event) -> VkResult<()> {
1238 let fp = self
1239 .commands()
1240 .reset_event
1241 .expect("vkResetEvent not loaded");
1242 check(unsafe { fp(self.handle(), event) })
1243 }
1244 ///Wraps [`vkCreateQueryPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateQueryPool.html).
1245 /**
1246 Provided by **VK_BASE_VERSION_1_0**.*/
1247 ///
1248 ///# Errors
1249 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1250 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1251 ///- `VK_ERROR_UNKNOWN`
1252 ///- `VK_ERROR_VALIDATION_FAILED`
1253 ///
1254 ///# Safety
1255 ///- `device` (self) must be valid and not destroyed.
1256 ///
1257 ///# Panics
1258 ///Panics if `vkCreateQueryPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1259 ///
1260 ///# Usage Notes
1261 ///
1262 ///Creates a pool of query slots. Queries let you measure GPU
1263 ///performance and gather statistics without stalling the pipeline.
1264 ///
1265 ///**Query types**:
1266 ///
1267 ///- `OCCLUSION`: counts how many samples pass the depth test. Useful
1268 /// for visibility culling, render a bounding box, check the count.
1269 ///- `PIPELINE_STATISTICS`: counts shader invocations, primitives,
1270 /// clipping, etc. Must be enabled via
1271 /// `pipeline_statistics_query` device feature.
1272 ///- `TIMESTAMP`: records a GPU timestamp. Use two timestamps and the
1273 /// `timestamp_period` device property to measure elapsed time.
1274 ///
1275 ///Queries must be reset before use with `cmd_reset_query_pool` (or
1276 ///`reset_query_pool` on Vulkan 1.2+). Results are retrieved with
1277 ///`get_query_pool_results` or copied into a buffer with
1278 ///`cmd_copy_query_pool_results`.
1279 pub unsafe fn create_query_pool(
1280 &self,
1281 p_create_info: &QueryPoolCreateInfo,
1282 allocator: Option<&AllocationCallbacks>,
1283 ) -> VkResult<QueryPool> {
1284 let fp = self
1285 .commands()
1286 .create_query_pool
1287 .expect("vkCreateQueryPool not loaded");
1288 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1289 let mut out = unsafe { core::mem::zeroed() };
1290 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1291 Ok(out)
1292 }
1293 ///Wraps [`vkDestroyQueryPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyQueryPool.html).
1294 /**
1295 Provided by **VK_BASE_VERSION_1_0**.*/
1296 ///
1297 ///# Safety
1298 ///- `device` (self) must be valid and not destroyed.
1299 ///- `queryPool` must be externally synchronized.
1300 ///
1301 ///# Panics
1302 ///Panics if `vkDestroyQueryPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1303 ///
1304 ///# Usage Notes
1305 ///
1306 ///Destroys a query pool and frees its resources. All command buffers
1307 ///that reference this pool must have completed execution before
1308 ///destroying it.
1309 pub unsafe fn destroy_query_pool(
1310 &self,
1311 query_pool: QueryPool,
1312 allocator: Option<&AllocationCallbacks>,
1313 ) {
1314 let fp = self
1315 .commands()
1316 .destroy_query_pool
1317 .expect("vkDestroyQueryPool not loaded");
1318 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1319 unsafe { fp(self.handle(), query_pool, alloc_ptr) };
1320 }
1321 ///Wraps [`vkGetQueryPoolResults`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetQueryPoolResults.html).
1322 /**
1323 Provided by **VK_BASE_VERSION_1_0**.*/
1324 ///
1325 ///# Errors
1326 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1327 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1328 ///- `VK_ERROR_DEVICE_LOST`
1329 ///- `VK_ERROR_UNKNOWN`
1330 ///- `VK_ERROR_VALIDATION_FAILED`
1331 ///
1332 ///# Safety
1333 ///- `device` (self) must be valid and not destroyed.
1334 ///
1335 ///# Panics
1336 ///Panics if `vkGetQueryPoolResults` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1337 ///
1338 ///# Usage Notes
1339 ///
1340 ///Reads query results from a query pool into a host buffer. This is
1341 ///the CPU-side retrieval path, for GPU-side copies into a device
1342 ///buffer, use `cmd_copy_query_pool_results` instead.
1343 ///
1344 ///**Key flags**:
1345 ///
1346 ///- `QUERY_RESULT_64`: return 64-bit results. Always use this for
1347 /// timestamp and pipeline statistics queries to avoid overflow.
1348 ///- `QUERY_RESULT_WAIT`: block until all requested queries are
1349 /// available. Without this flag, unavailable queries return
1350 /// `VK_NOT_READY` and their slots are left untouched.
1351 ///- `QUERY_RESULT_WITH_AVAILABILITY`: append an availability value
1352 /// after each result (non-zero if available). Useful for polling
1353 /// without blocking.
1354 ///- `QUERY_RESULT_PARTIAL`: return whatever data is available even
1355 /// for incomplete queries. Only meaningful for occlusion queries.
1356 ///
1357 ///**Stride**: the `stride` parameter is the byte distance between
1358 ///successive query results in your output buffer. It must be at least
1359 ///large enough to hold the result plus the optional availability value.
1360 ///
1361 ///Queries that have not been started or not yet completed return
1362 ///`VK_NOT_READY` unless `QUERY_RESULT_WAIT` is set.
1363 pub unsafe fn get_query_pool_results(
1364 &self,
1365 query_pool: QueryPool,
1366 first_query: u32,
1367 query_count: u32,
1368 data_size: usize,
1369 p_data: *mut core::ffi::c_void,
1370 stride: u64,
1371 flags: QueryResultFlags,
1372 ) -> VkResult<()> {
1373 let fp = self
1374 .commands()
1375 .get_query_pool_results
1376 .expect("vkGetQueryPoolResults not loaded");
1377 check(unsafe {
1378 fp(
1379 self.handle(),
1380 query_pool,
1381 first_query,
1382 query_count,
1383 data_size,
1384 p_data,
1385 stride,
1386 flags,
1387 )
1388 })
1389 }
1390 ///Wraps [`vkResetQueryPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkResetQueryPool.html).
1391 /**
1392 Provided by **VK_BASE_VERSION_1_2**.*/
1393 ///
1394 ///# Safety
1395 ///- `device` (self) must be valid and not destroyed.
1396 ///
1397 ///# Panics
1398 ///Panics if `vkResetQueryPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1399 ///
1400 ///# Usage Notes
1401 ///
1402 ///Resets a range of queries in a pool from the host (CPU). This is the
1403 ///Vulkan 1.2 host-side alternative to `cmd_reset_query_pool`, which
1404 ///resets queries from a command buffer.
1405 ///
1406 ///Host-side reset is simpler, call it directly without recording a
1407 ///command buffer. Requires the `host_query_reset` feature (core in
1408 ///Vulkan 1.2).
1409 ///
1410 ///Queries must be reset before use. Resetting a query that is in use
1411 ///by a pending command buffer is an error.
1412 pub unsafe fn reset_query_pool(
1413 &self,
1414 query_pool: QueryPool,
1415 first_query: u32,
1416 query_count: u32,
1417 ) {
1418 let fp = self
1419 .commands()
1420 .reset_query_pool
1421 .expect("vkResetQueryPool not loaded");
1422 unsafe { fp(self.handle(), query_pool, first_query, query_count) };
1423 }
1424 ///Wraps [`vkCreateBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateBuffer.html).
1425 /**
1426 Provided by **VK_BASE_VERSION_1_0**.*/
1427 ///
1428 ///# Errors
1429 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1430 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1431 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
1432 ///- `VK_ERROR_UNKNOWN`
1433 ///- `VK_ERROR_VALIDATION_FAILED`
1434 ///
1435 ///# Safety
1436 ///- `device` (self) must be valid and not destroyed.
1437 ///
1438 ///# Panics
1439 ///Panics if `vkCreateBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1440 ///
1441 ///# Examples
1442 ///
1443 ///```no_run
1444 ///# let (_, instance) = vulkan_rust::test_helpers::create_test_instance().expect("test setup");
1445 ///# let phys = unsafe { instance.enumerate_physical_devices() }.expect("no devices");
1446 ///# let p = [1.0f32];
1447 ///# let qi = vulkan_rust::vk::structs::DeviceQueueCreateInfo::builder().queue_priorities(&p);
1448 ///# let qis = [*qi];
1449 ///# let di = vulkan_rust::vk::structs::DeviceCreateInfo::builder().queue_create_infos(&qis);
1450 ///# let device = unsafe { instance.create_device(phys[0], &di, None) }.expect("device creation");
1451 ///use vulkan_rust::vk::structs::*;
1452 ///use vulkan_rust::vk::bitmasks::*;
1453 ///
1454 ///let info = BufferCreateInfo::builder()
1455 /// .size(1024)
1456 /// .usage(BufferUsageFlagBits::VERTEX_BUFFER)
1457 /// .sharing_mode(vulkan_rust::vk::enums::SharingMode::EXCLUSIVE);
1458 ///let buffer = unsafe { device.create_buffer(&info, None) }
1459 /// .expect("buffer creation failed");
1460 #[doc = "// Use buffer..."]
1461 ///unsafe { device.destroy_buffer(buffer, None) };
1462 ///# unsafe { device.destroy_device(None) };
1463 ///# unsafe { instance.destroy_instance(None) };
1464 ///```
1465 ///
1466 ///# Guide
1467 ///
1468 ///See [Memory Management](https://hiddentale.github.io/vulkan_rust/concepts/memory.html) in the vulkan_rust guide.
1469 pub unsafe fn create_buffer(
1470 &self,
1471 p_create_info: &BufferCreateInfo,
1472 allocator: Option<&AllocationCallbacks>,
1473 ) -> VkResult<Buffer> {
1474 let fp = self
1475 .commands()
1476 .create_buffer
1477 .expect("vkCreateBuffer not loaded");
1478 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1479 let mut out = unsafe { core::mem::zeroed() };
1480 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1481 Ok(out)
1482 }
1483 ///Wraps [`vkDestroyBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyBuffer.html).
1484 /**
1485 Provided by **VK_BASE_VERSION_1_0**.*/
1486 ///
1487 ///# Safety
1488 ///- `device` (self) must be valid and not destroyed.
1489 ///- `buffer` must be externally synchronized.
1490 ///
1491 ///# Panics
1492 ///Panics if `vkDestroyBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1493 ///
1494 ///# Usage Notes
1495 ///
1496 ///Destroys a buffer object. The buffer must not be in use by any
1497 ///pending GPU work, wait on the relevant fences or call
1498 ///`device_wait_idle` before destroying.
1499 ///
1500 ///Destroying a buffer does **not** free its backing memory. Call
1501 ///`free_memory` separately (or let your sub-allocator reclaim the
1502 ///region).
1503 ///
1504 ///Destroy order: destroy the buffer first, then free the memory. Not
1505 ///the reverse, freeing memory while a buffer is still bound to it is
1506 ///undefined behaviour.
1507 pub unsafe fn destroy_buffer(&self, buffer: Buffer, allocator: Option<&AllocationCallbacks>) {
1508 let fp = self
1509 .commands()
1510 .destroy_buffer
1511 .expect("vkDestroyBuffer not loaded");
1512 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1513 unsafe { fp(self.handle(), buffer, alloc_ptr) };
1514 }
1515 ///Wraps [`vkCreateBufferView`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateBufferView.html).
1516 /**
1517 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1518 ///
1519 ///# Errors
1520 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1521 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1522 ///- `VK_ERROR_UNKNOWN`
1523 ///- `VK_ERROR_VALIDATION_FAILED`
1524 ///
1525 ///# Safety
1526 ///- `device` (self) must be valid and not destroyed.
1527 ///
1528 ///# Panics
1529 ///Panics if `vkCreateBufferView` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1530 ///
1531 ///# Usage Notes
1532 ///
1533 ///Creates a view into a buffer that interprets its contents as a
1534 ///typed array of texels. Buffer views are used with:
1535 ///
1536 ///- **Uniform texel buffers** (`BUFFER_USAGE_UNIFORM_TEXEL_BUFFER`):
1537 /// read-only typed access from shaders via `samplerBuffer` /
1538 /// `textureBuffer` in GLSL.
1539 ///- **Storage texel buffers** (`BUFFER_USAGE_STORAGE_TEXEL_BUFFER`):
1540 /// read-write typed access from shaders via `imageBuffer` in GLSL.
1541 ///
1542 ///The format, offset, and range define the view window into the
1543 ///buffer. The format must be supported for the buffer view usage,
1544 ///check `format_properties.buffer_features`.
1545 ///
1546 ///Buffer views are less common than image views. They are mainly used
1547 ///for large, flat data arrays (e.g. particle attributes, lookup
1548 ///tables) that benefit from format conversion on read.
1549 pub unsafe fn create_buffer_view(
1550 &self,
1551 p_create_info: &BufferViewCreateInfo,
1552 allocator: Option<&AllocationCallbacks>,
1553 ) -> VkResult<BufferView> {
1554 let fp = self
1555 .commands()
1556 .create_buffer_view
1557 .expect("vkCreateBufferView not loaded");
1558 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1559 let mut out = unsafe { core::mem::zeroed() };
1560 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1561 Ok(out)
1562 }
1563 ///Wraps [`vkDestroyBufferView`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyBufferView.html).
1564 /**
1565 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1566 ///
1567 ///# Safety
1568 ///- `device` (self) must be valid and not destroyed.
1569 ///- `bufferView` must be externally synchronized.
1570 ///
1571 ///# Panics
1572 ///Panics if `vkDestroyBufferView` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1573 ///
1574 ///# Usage Notes
1575 ///
1576 ///Destroys a buffer view. The view must not be referenced by any
1577 ///descriptor set that is bound in a pending command buffer.
1578 ///
1579 ///Destroy buffer views before the underlying buffer.
1580 pub unsafe fn destroy_buffer_view(
1581 &self,
1582 buffer_view: BufferView,
1583 allocator: Option<&AllocationCallbacks>,
1584 ) {
1585 let fp = self
1586 .commands()
1587 .destroy_buffer_view
1588 .expect("vkDestroyBufferView not loaded");
1589 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1590 unsafe { fp(self.handle(), buffer_view, alloc_ptr) };
1591 }
1592 ///Wraps [`vkCreateImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateImage.html).
1593 /**
1594 Provided by **VK_BASE_VERSION_1_0**.*/
1595 ///
1596 ///# Errors
1597 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1598 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1599 ///- `VK_ERROR_COMPRESSION_EXHAUSTED_EXT`
1600 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
1601 ///- `VK_ERROR_UNKNOWN`
1602 ///- `VK_ERROR_VALIDATION_FAILED`
1603 ///
1604 ///# Safety
1605 ///- `device` (self) must be valid and not destroyed.
1606 ///
1607 ///# Panics
1608 ///Panics if `vkCreateImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1609 ///
1610 ///# Usage Notes
1611 ///
1612 ///After creating an image you must bind memory to it before use:
1613 ///
1614 ///1. Query requirements with `get_image_memory_requirements`.
1615 ///2. Allocate from a compatible memory type with `allocate_memory`.
1616 ///3. Bind with `bind_image_memory`.
1617 ///
1618 ///Choose `IMAGE_TILING_OPTIMAL` for GPU-side textures and render targets.
1619 ///Use `IMAGE_TILING_LINEAR` only when you need direct CPU access to the
1620 ///texel layout (e.g. CPU readback), and check format support first with
1621 ///`get_physical_device_image_format_properties`.
1622 ///
1623 ///The `initial_layout` must be `UNDEFINED` or `PREINITIALIZED`.
1624 ///Most applications use `UNDEFINED` and transition via a pipeline barrier.
1625 ///
1626 ///Destroy with `destroy_image` when no longer needed. Do not destroy an
1627 ///image that is still referenced by a framebuffer or image view.
1628 pub unsafe fn create_image(
1629 &self,
1630 p_create_info: &ImageCreateInfo,
1631 allocator: Option<&AllocationCallbacks>,
1632 ) -> VkResult<Image> {
1633 let fp = self
1634 .commands()
1635 .create_image
1636 .expect("vkCreateImage not loaded");
1637 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1638 let mut out = unsafe { core::mem::zeroed() };
1639 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1640 Ok(out)
1641 }
1642 ///Wraps [`vkDestroyImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyImage.html).
1643 /**
1644 Provided by **VK_BASE_VERSION_1_0**.*/
1645 ///
1646 ///# Safety
1647 ///- `device` (self) must be valid and not destroyed.
1648 ///- `image` must be externally synchronized.
1649 ///
1650 ///# Panics
1651 ///Panics if `vkDestroyImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1652 ///
1653 ///# Usage Notes
1654 ///
1655 ///Destroys an image object. The image must not be in use by any
1656 ///pending GPU work, and all image views referencing this image must
1657 ///already be destroyed.
1658 ///
1659 ///Destroying an image does **not** free its backing memory. Call
1660 ///`free_memory` separately after destroying the image.
1661 ///
1662 ///Safe teardown order for an image:
1663 ///
1664 ///1. Wait for all GPU work using the image to complete.
1665 ///2. Destroy all `ImageView` objects referencing the image.
1666 ///3. Destroy any `Framebuffer` objects that included those views.
1667 ///4. `destroy_image`.
1668 ///5. Free or reclaim the backing memory.
1669 pub unsafe fn destroy_image(&self, image: Image, allocator: Option<&AllocationCallbacks>) {
1670 let fp = self
1671 .commands()
1672 .destroy_image
1673 .expect("vkDestroyImage not loaded");
1674 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1675 unsafe { fp(self.handle(), image, alloc_ptr) };
1676 }
1677 ///Wraps [`vkGetImageSubresourceLayout`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageSubresourceLayout.html).
1678 /**
1679 Provided by **VK_BASE_VERSION_1_0**.*/
1680 ///
1681 ///# Safety
1682 ///- `device` (self) must be valid and not destroyed.
1683 ///
1684 ///# Panics
1685 ///Panics if `vkGetImageSubresourceLayout` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1686 ///
1687 ///# Usage Notes
1688 ///
1689 ///Queries the memory layout (offset, size, row pitch, array pitch,
1690 ///depth pitch) of a specific subresource within a linear-tiling
1691 ///image. Only valid for images created with `IMAGE_TILING_LINEAR`.
1692 ///For optimal-tiling images, use `get_image_subresource_layout2`.
1693 pub unsafe fn get_image_subresource_layout(
1694 &self,
1695 image: Image,
1696 p_subresource: &ImageSubresource,
1697 ) -> SubresourceLayout {
1698 let fp = self
1699 .commands()
1700 .get_image_subresource_layout
1701 .expect("vkGetImageSubresourceLayout not loaded");
1702 let mut out = unsafe { core::mem::zeroed() };
1703 unsafe { fp(self.handle(), image, p_subresource, &mut out) };
1704 out
1705 }
1706 ///Wraps [`vkCreateImageView`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateImageView.html).
1707 /**
1708 Provided by **VK_BASE_VERSION_1_0**.*/
1709 ///
1710 ///# Errors
1711 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1712 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1713 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
1714 ///- `VK_ERROR_UNKNOWN`
1715 ///- `VK_ERROR_VALIDATION_FAILED`
1716 ///
1717 ///# Safety
1718 ///- `device` (self) must be valid and not destroyed.
1719 ///
1720 ///# Panics
1721 ///Panics if `vkCreateImageView` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1722 ///
1723 ///# Usage Notes
1724 ///
1725 ///An image view selects a subset of an image's subresources and
1726 ///reinterprets them for a specific use (sampling, color attachment, etc.).
1727 ///
1728 ///Common pitfalls:
1729 ///
1730 ///- **Aspect mask**: use `COLOR` for color formats, `DEPTH` and/or
1731 /// `STENCIL` for depth/stencil formats. Getting this wrong causes
1732 /// validation errors that are not always obvious.
1733 ///- **Format compatibility**: the view format must be compatible with the
1734 /// image's format. Using `IMAGE_CREATE_MUTABLE_FORMAT` on the image
1735 /// relaxes this to any format in the same size-compatibility class.
1736 ///- **View type vs image type**: a 2D image can back a `VIEW_TYPE_2D` or
1737 /// `VIEW_TYPE_2D_ARRAY`. A 3D image cannot be viewed as 2D without
1738 /// `VK_EXT_image_2d_view_of_3d`.
1739 ///
1740 ///Destroy with `destroy_image_view` when no longer needed. Destroy image
1741 ///views *before* destroying the underlying image.
1742 pub unsafe fn create_image_view(
1743 &self,
1744 p_create_info: &ImageViewCreateInfo,
1745 allocator: Option<&AllocationCallbacks>,
1746 ) -> VkResult<ImageView> {
1747 let fp = self
1748 .commands()
1749 .create_image_view
1750 .expect("vkCreateImageView not loaded");
1751 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1752 let mut out = unsafe { core::mem::zeroed() };
1753 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1754 Ok(out)
1755 }
1756 ///Wraps [`vkDestroyImageView`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyImageView.html).
1757 /**
1758 Provided by **VK_BASE_VERSION_1_0**.*/
1759 ///
1760 ///# Safety
1761 ///- `device` (self) must be valid and not destroyed.
1762 ///- `imageView` must be externally synchronized.
1763 ///
1764 ///# Panics
1765 ///Panics if `vkDestroyImageView` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1766 ///
1767 ///# Usage Notes
1768 ///
1769 ///Destroys an image view. The view must not be referenced by any
1770 ///pending GPU work or by any framebuffer that is still in use.
1771 ///
1772 ///Destroy image views **before** the underlying image. Destroy any
1773 ///framebuffers that reference the view before destroying the view
1774 ///itself.
1775 pub unsafe fn destroy_image_view(
1776 &self,
1777 image_view: ImageView,
1778 allocator: Option<&AllocationCallbacks>,
1779 ) {
1780 let fp = self
1781 .commands()
1782 .destroy_image_view
1783 .expect("vkDestroyImageView not loaded");
1784 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1785 unsafe { fp(self.handle(), image_view, alloc_ptr) };
1786 }
1787 ///Wraps [`vkCreateShaderModule`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateShaderModule.html).
1788 /**
1789 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1790 ///
1791 ///# Errors
1792 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1793 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1794 ///- `VK_ERROR_INVALID_SHADER_NV`
1795 ///- `VK_ERROR_UNKNOWN`
1796 ///- `VK_ERROR_VALIDATION_FAILED`
1797 ///
1798 ///# Safety
1799 ///- `device` (self) must be valid and not destroyed.
1800 ///
1801 ///# Panics
1802 ///Panics if `vkCreateShaderModule` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1803 ///
1804 ///# Usage Notes
1805 ///
1806 ///The input must be valid SPIR-V bytecode. The `code` slice is `&[u32]`
1807 ///and must be aligned to 4 bytes, which Rust's `&[u32]` guarantees.
1808 ///
1809 ///Use the `bytecode::read_spv` helper to load a `.spv` file from disk
1810 ///with correct alignment.
1811 ///
1812 ///Shader modules can be destroyed immediately after pipeline creation;
1813 ///the driver copies what it needs during `create_graphics_pipelines` or
1814 ///`create_compute_pipelines`. Destroying early keeps the handle count
1815 ///low.
1816 ///
1817 ///# Guide
1818 ///
1819 ///See [Pipelines](https://hiddentale.github.io/vulkan_rust/concepts/pipelines.html) in the vulkan_rust guide.
1820 pub unsafe fn create_shader_module(
1821 &self,
1822 p_create_info: &ShaderModuleCreateInfo,
1823 allocator: Option<&AllocationCallbacks>,
1824 ) -> VkResult<ShaderModule> {
1825 let fp = self
1826 .commands()
1827 .create_shader_module
1828 .expect("vkCreateShaderModule not loaded");
1829 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1830 let mut out = unsafe { core::mem::zeroed() };
1831 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1832 Ok(out)
1833 }
1834 ///Wraps [`vkDestroyShaderModule`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyShaderModule.html).
1835 /**
1836 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1837 ///
1838 ///# Safety
1839 ///- `device` (self) must be valid and not destroyed.
1840 ///- `shaderModule` must be externally synchronized.
1841 ///
1842 ///# Panics
1843 ///Panics if `vkDestroyShaderModule` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1844 ///
1845 ///# Usage Notes
1846 ///
1847 ///Destroys a shader module. The module must not be in use by any
1848 ///pipeline. Shader modules can be safely destroyed after pipeline
1849 ///creation since the driver copies the SPIR-V at creation time.
1850 pub unsafe fn destroy_shader_module(
1851 &self,
1852 shader_module: ShaderModule,
1853 allocator: Option<&AllocationCallbacks>,
1854 ) {
1855 let fp = self
1856 .commands()
1857 .destroy_shader_module
1858 .expect("vkDestroyShaderModule not loaded");
1859 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1860 unsafe { fp(self.handle(), shader_module, alloc_ptr) };
1861 }
1862 ///Wraps [`vkCreatePipelineCache`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreatePipelineCache.html).
1863 /**
1864 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1865 ///
1866 ///# Errors
1867 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1868 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1869 ///- `VK_ERROR_UNKNOWN`
1870 ///- `VK_ERROR_VALIDATION_FAILED`
1871 ///
1872 ///# Safety
1873 ///- `device` (self) must be valid and not destroyed.
1874 ///
1875 ///# Panics
1876 ///Panics if `vkCreatePipelineCache` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1877 ///
1878 ///# Usage Notes
1879 ///
1880 ///Creates a pipeline cache that stores compiled pipeline state to
1881 ///speed up future pipeline creation.
1882 ///
1883 ///**Initial data**: pass previously serialized cache data (from
1884 ///`get_pipeline_cache_data`) to warm the cache on startup. The driver
1885 ///validates the header and silently ignores data from incompatible
1886 ///driver versions or hardware, it is always safe to pass stale data.
1887 ///
1888 ///A single cache can be shared across all pipeline creation calls in
1889 ///the application. Multiple threads can use the same cache
1890 ///concurrently, the driver handles internal synchronization.
1891 ///
1892 ///**Recommended workflow**:
1893 ///
1894 ///1. On startup, load cache data from disk and create the cache.
1895 ///2. Pass the cache to every `create_graphics_pipelines` and
1896 /// `create_compute_pipelines` call.
1897 ///3. On shutdown, serialize with `get_pipeline_cache_data` and write
1898 /// to disk.
1899 pub unsafe fn create_pipeline_cache(
1900 &self,
1901 p_create_info: &PipelineCacheCreateInfo,
1902 allocator: Option<&AllocationCallbacks>,
1903 ) -> VkResult<PipelineCache> {
1904 let fp = self
1905 .commands()
1906 .create_pipeline_cache
1907 .expect("vkCreatePipelineCache not loaded");
1908 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1909 let mut out = unsafe { core::mem::zeroed() };
1910 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1911 Ok(out)
1912 }
1913 ///Wraps [`vkDestroyPipelineCache`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyPipelineCache.html).
1914 /**
1915 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1916 ///
1917 ///# Safety
1918 ///- `device` (self) must be valid and not destroyed.
1919 ///- `pipelineCache` must be externally synchronized.
1920 ///
1921 ///# Panics
1922 ///Panics if `vkDestroyPipelineCache` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1923 ///
1924 ///# Usage Notes
1925 ///
1926 ///Destroys a pipeline cache. Pipelines that were created using this
1927 ///cache remain valid, the cache is only needed during creation, not
1928 ///at runtime.
1929 ///
1930 ///Serialize the cache with `get_pipeline_cache_data` before destroying
1931 ///if you want to persist it to disk for the next session.
1932 pub unsafe fn destroy_pipeline_cache(
1933 &self,
1934 pipeline_cache: PipelineCache,
1935 allocator: Option<&AllocationCallbacks>,
1936 ) {
1937 let fp = self
1938 .commands()
1939 .destroy_pipeline_cache
1940 .expect("vkDestroyPipelineCache not loaded");
1941 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1942 unsafe { fp(self.handle(), pipeline_cache, alloc_ptr) };
1943 }
1944 ///Wraps [`vkGetPipelineCacheData`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPipelineCacheData.html).
1945 /**
1946 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1947 ///
1948 ///# Errors
1949 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1950 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1951 ///- `VK_ERROR_UNKNOWN`
1952 ///- `VK_ERROR_VALIDATION_FAILED`
1953 ///
1954 ///# Safety
1955 ///- `device` (self) must be valid and not destroyed.
1956 ///
1957 ///# Panics
1958 ///Panics if `vkGetPipelineCacheData` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1959 ///
1960 ///# Usage Notes
1961 ///
1962 ///Serializes the contents of a pipeline cache into a byte buffer for
1963 ///storage on disk. The data includes a vendor-specific header that the
1964 ///driver uses to validate compatibility on reload.
1965 ///
1966 ///Call this with a null data pointer first to query the required buffer
1967 ///size, then allocate and call again. The wrapper handles this
1968 ///two-call pattern for you.
1969 ///
1970 ///The cache data is **not portable** across different GPU vendors,
1971 ///driver versions, or pipeline cache UUIDs. Always check the header
1972 ///or let the driver reject incompatible data silently on reload via
1973 ///`create_pipeline_cache`.
1974 ///
1975 ///Write the data to a file (e.g. `pipeline_cache.bin`) and load it on
1976 ///the next application start to avoid redundant shader compilation.
1977 pub unsafe fn get_pipeline_cache_data(
1978 &self,
1979 pipeline_cache: PipelineCache,
1980 p_data: *mut core::ffi::c_void,
1981 ) -> VkResult<usize> {
1982 let fp = self
1983 .commands()
1984 .get_pipeline_cache_data
1985 .expect("vkGetPipelineCacheData not loaded");
1986 let mut out = unsafe { core::mem::zeroed() };
1987 check(unsafe { fp(self.handle(), pipeline_cache, &mut out, p_data) })?;
1988 Ok(out)
1989 }
1990 ///Wraps [`vkMergePipelineCaches`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkMergePipelineCaches.html).
1991 /**
1992 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1993 ///
1994 ///# Errors
1995 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1996 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1997 ///- `VK_ERROR_UNKNOWN`
1998 ///- `VK_ERROR_VALIDATION_FAILED`
1999 ///
2000 ///# Safety
2001 ///- `device` (self) must be valid and not destroyed.
2002 ///- `dstCache` must be externally synchronized.
2003 ///
2004 ///# Panics
2005 ///Panics if `vkMergePipelineCaches` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2006 ///
2007 ///# Usage Notes
2008 ///
2009 ///Merges one or more source caches into a destination cache. Useful
2010 ///when multiple threads each use their own cache during parallel
2011 ///pipeline creation, merge them into a single cache before
2012 ///serializing to disk.
2013 ///
2014 ///The source caches are not modified or destroyed by this call. The
2015 ///destination cache receives all entries from the sources that it does
2016 ///not already contain. Duplicate entries are ignored.
2017 ///
2018 ///After merging, you can destroy the source caches if they are no
2019 ///longer needed.
2020 pub unsafe fn merge_pipeline_caches(
2021 &self,
2022 dst_cache: PipelineCache,
2023 p_src_caches: &[PipelineCache],
2024 ) -> VkResult<()> {
2025 let fp = self
2026 .commands()
2027 .merge_pipeline_caches
2028 .expect("vkMergePipelineCaches not loaded");
2029 check(unsafe {
2030 fp(
2031 self.handle(),
2032 dst_cache,
2033 p_src_caches.len() as u32,
2034 p_src_caches.as_ptr(),
2035 )
2036 })
2037 }
2038 ///Wraps [`vkCreatePipelineBinariesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreatePipelineBinariesKHR.html).
2039 /**
2040 Provided by **VK_KHR_pipeline_binary**.*/
2041 ///
2042 ///# Errors
2043 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2044 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2045 ///- `VK_ERROR_INITIALIZATION_FAILED`
2046 ///- `VK_ERROR_UNKNOWN`
2047 ///- `VK_ERROR_VALIDATION_FAILED`
2048 ///
2049 ///# Safety
2050 ///- `device` (self) must be valid and not destroyed.
2051 ///
2052 ///# Panics
2053 ///Panics if `vkCreatePipelineBinariesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2054 ///
2055 ///# Usage Notes
2056 ///
2057 ///Creates pipeline binary objects from either a pipeline create info
2058 ///or previously serialized binary data. Pipeline binaries capture
2059 ///compiled shader code in a device-specific format, enabling fast
2060 ///pipeline recreation without recompilation.
2061 ///
2062 ///Two creation paths via `PipelineBinaryCreateInfoKHR`:
2063 ///
2064 ///- **From pipeline create info + key**: compiles shaders and
2065 /// produces binaries. Use `get_pipeline_key_khr` to obtain the
2066 /// key first.
2067 ///- **From serialized data**: restores binaries saved with
2068 /// `get_pipeline_binary_data_khr` from a prior run. This skips
2069 /// compilation entirely.
2070 ///
2071 ///The output is written to `PipelineBinaryHandlesInfoKHR`. Call
2072 ///once with a null `pipelines` pointer to query the count, then
2073 ///again with an allocated array.
2074 ///
2075 ///Pipeline binaries are more portable than pipeline caches, they
2076 ///can be validated, versioned, and stored in application-managed
2077 ///files rather than opaque blobs.
2078 pub unsafe fn create_pipeline_binaries_khr(
2079 &self,
2080 p_create_info: &PipelineBinaryCreateInfoKHR,
2081 allocator: Option<&AllocationCallbacks>,
2082 p_binaries: &mut PipelineBinaryHandlesInfoKHR,
2083 ) -> VkResult<()> {
2084 let fp = self
2085 .commands()
2086 .create_pipeline_binaries_khr
2087 .expect("vkCreatePipelineBinariesKHR not loaded");
2088 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2089 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, p_binaries) })
2090 }
2091 ///Wraps [`vkDestroyPipelineBinaryKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyPipelineBinaryKHR.html).
2092 /**
2093 Provided by **VK_KHR_pipeline_binary**.*/
2094 ///
2095 ///# Safety
2096 ///- `device` (self) must be valid and not destroyed.
2097 ///- `pipelineBinary` must be externally synchronized.
2098 ///
2099 ///# Panics
2100 ///Panics if `vkDestroyPipelineBinaryKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2101 ///
2102 ///# Usage Notes
2103 ///
2104 ///Destroys a pipeline binary handle. After destruction, the binary
2105 ///cannot be used to create pipelines or retrieve data.
2106 ///
2107 ///Pipeline binaries are independent of the pipelines created from
2108 ///them, destroying a binary does not affect any pipeline that was
2109 ///already created using it.
2110 pub unsafe fn destroy_pipeline_binary_khr(
2111 &self,
2112 pipeline_binary: PipelineBinaryKHR,
2113 allocator: Option<&AllocationCallbacks>,
2114 ) {
2115 let fp = self
2116 .commands()
2117 .destroy_pipeline_binary_khr
2118 .expect("vkDestroyPipelineBinaryKHR not loaded");
2119 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2120 unsafe { fp(self.handle(), pipeline_binary, alloc_ptr) };
2121 }
2122 ///Wraps [`vkGetPipelineKeyKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPipelineKeyKHR.html).
2123 /**
2124 Provided by **VK_KHR_pipeline_binary**.*/
2125 ///
2126 ///# Errors
2127 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2128 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2129 ///- `VK_ERROR_UNKNOWN`
2130 ///- `VK_ERROR_VALIDATION_FAILED`
2131 ///
2132 ///# Safety
2133 ///- `device` (self) must be valid and not destroyed.
2134 ///
2135 ///# Panics
2136 ///Panics if `vkGetPipelineKeyKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2137 ///
2138 ///# Usage Notes
2139 ///
2140 ///Computes a pipeline key that identifies the pipeline configuration
2141 ///for use with pipeline binaries. The key is a hash of the pipeline
2142 ///create info that lets you look up previously cached binaries.
2143 ///
2144 ///Pass a `PipelineCreateInfoKHR` referencing the pipeline create
2145 ///info (graphics, compute, or ray tracing) to get its key. Pass
2146 ///`None` to get an empty key structure for use as an output
2147 ///parameter.
2148 ///
2149 ///Store the key alongside serialized binary data from
2150 ///`get_pipeline_binary_data_khr`. On subsequent runs, compute the
2151 ///key for the current pipeline configuration and check if a matching
2152 ///binary exists before falling back to full compilation.
2153 pub unsafe fn get_pipeline_key_khr(
2154 &self,
2155 p_pipeline_create_info: Option<&PipelineCreateInfoKHR>,
2156 p_pipeline_key: &mut PipelineBinaryKeyKHR,
2157 ) -> VkResult<()> {
2158 let fp = self
2159 .commands()
2160 .get_pipeline_key_khr
2161 .expect("vkGetPipelineKeyKHR not loaded");
2162 let p_pipeline_create_info_ptr =
2163 p_pipeline_create_info.map_or(core::ptr::null(), core::ptr::from_ref);
2164 check(unsafe { fp(self.handle(), p_pipeline_create_info_ptr, p_pipeline_key) })
2165 }
2166 ///Wraps [`vkGetPipelineBinaryDataKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPipelineBinaryDataKHR.html).
2167 /**
2168 Provided by **VK_KHR_pipeline_binary**.*/
2169 ///
2170 ///# Errors
2171 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2172 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2173 ///- `VK_ERROR_NOT_ENOUGH_SPACE_KHR`
2174 ///- `VK_ERROR_UNKNOWN`
2175 ///- `VK_ERROR_VALIDATION_FAILED`
2176 ///
2177 ///# Safety
2178 ///- `device` (self) must be valid and not destroyed.
2179 ///
2180 ///# Panics
2181 ///Panics if `vkGetPipelineBinaryDataKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2182 ///
2183 ///# Usage Notes
2184 ///
2185 ///Serializes a pipeline binary into a byte buffer for offline
2186 ///storage. The data can be saved to disk and later passed to
2187 ///`create_pipeline_binaries_khr` to skip shader compilation on
2188 ///subsequent application launches.
2189 ///
2190 ///Uses the two-call pattern: call with a null `p_pipeline_binary_data`
2191 ///to query the required `data_size`, allocate a buffer, then call
2192 ///again to fill it.
2193 ///
2194 ///The output also includes a `PipelineBinaryKeyKHR` that identifies
2195 ///the binary. Store the key alongside the data, it is required
2196 ///when recreating the binary.
2197 ///
2198 ///Serialized data is device-specific and may become invalid after
2199 ///driver updates. Applications should handle creation failure
2200 ///gracefully by falling back to full recompilation.
2201 pub unsafe fn get_pipeline_binary_data_khr(
2202 &self,
2203 p_info: &PipelineBinaryDataInfoKHR,
2204 p_pipeline_binary_key: &mut PipelineBinaryKeyKHR,
2205 p_pipeline_binary_data: *mut core::ffi::c_void,
2206 ) -> VkResult<usize> {
2207 let fp = self
2208 .commands()
2209 .get_pipeline_binary_data_khr
2210 .expect("vkGetPipelineBinaryDataKHR not loaded");
2211 let mut out = unsafe { core::mem::zeroed() };
2212 check(unsafe {
2213 fp(
2214 self.handle(),
2215 p_info,
2216 p_pipeline_binary_key,
2217 &mut out,
2218 p_pipeline_binary_data,
2219 )
2220 })?;
2221 Ok(out)
2222 }
2223 ///Wraps [`vkReleaseCapturedPipelineDataKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkReleaseCapturedPipelineDataKHR.html).
2224 /**
2225 Provided by **VK_KHR_pipeline_binary**.*/
2226 ///
2227 ///# Errors
2228 ///- `VK_ERROR_UNKNOWN`
2229 ///- `VK_ERROR_VALIDATION_FAILED`
2230 ///
2231 ///# Safety
2232 ///- `device` (self) must be valid and not destroyed.
2233 ///
2234 ///# Panics
2235 ///Panics if `vkReleaseCapturedPipelineDataKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2236 ///
2237 ///# Usage Notes
2238 ///
2239 ///Releases internal data captured during pipeline creation that was
2240 ///retained for binary extraction. Call this after you have finished
2241 ///calling `create_pipeline_binaries_khr` for a pipeline created
2242 ///with `PIPELINE_CREATE_CAPTURE_DATA`.
2243 ///
2244 ///The pipeline itself remains valid after this call, only the
2245 ///captured internal data is freed. This reduces memory usage when
2246 ///you no longer need to extract binaries from the pipeline.
2247 pub unsafe fn release_captured_pipeline_data_khr(
2248 &self,
2249 p_info: &ReleaseCapturedPipelineDataInfoKHR,
2250 allocator: Option<&AllocationCallbacks>,
2251 ) -> VkResult<()> {
2252 let fp = self
2253 .commands()
2254 .release_captured_pipeline_data_khr
2255 .expect("vkReleaseCapturedPipelineDataKHR not loaded");
2256 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2257 check(unsafe { fp(self.handle(), p_info, alloc_ptr) })
2258 }
2259 ///Wraps [`vkCreateGraphicsPipelines`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateGraphicsPipelines.html).
2260 /**
2261 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
2262 ///
2263 ///# Errors
2264 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2265 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2266 ///- `VK_ERROR_INVALID_SHADER_NV`
2267 ///- `VK_ERROR_UNKNOWN`
2268 ///- `VK_ERROR_VALIDATION_FAILED`
2269 ///
2270 ///# Safety
2271 ///- `device` (self) must be valid and not destroyed.
2272 ///- `pipelineCache` must be externally synchronized.
2273 ///
2274 ///# Panics
2275 ///Panics if `vkCreateGraphicsPipelines` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2276 ///
2277 ///# Usage Notes
2278 ///
2279 ///Graphics pipeline creation is the most expensive Vulkan object creation
2280 ///call. Batch multiple pipelines into a single call when possible,the
2281 ///driver can often parallelise compilation internally.
2282 ///
2283 ///**Pipeline cache**: always pass a `PipelineCache`. Even an empty cache
2284 ///helps on the first run; on subsequent runs it avoids redundant shader
2285 ///compilation entirely. Serialize the cache to disk between application
2286 ///sessions with `get_pipeline_cache_data`.
2287 ///
2288 ///**Dynamic state**: mark states like viewport, scissor, and blend
2289 ///constants as dynamic to reduce the number of pipeline permutations.
2290 ///Vulkan 1.3 makes viewport and scissor dynamic by default via
2291 ///`VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT` and
2292 ///`VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT`.
2293 ///
2294 ///If creation fails for one pipeline in a batch, the call returns an
2295 ///error but may still populate some output handles. Check
2296 ///`VK_PIPELINE_COMPILE_REQUIRED` when using
2297 ///`VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT`.
2298 ///
2299 ///# Guide
2300 ///
2301 ///See [Pipelines](https://hiddentale.github.io/vulkan_rust/concepts/pipelines.html) in the vulkan_rust guide.
2302 pub unsafe fn create_graphics_pipelines(
2303 &self,
2304 pipeline_cache: PipelineCache,
2305 p_create_infos: &[GraphicsPipelineCreateInfo],
2306 allocator: Option<&AllocationCallbacks>,
2307 ) -> VkResult<Vec<Pipeline>> {
2308 let fp = self
2309 .commands()
2310 .create_graphics_pipelines
2311 .expect("vkCreateGraphicsPipelines not loaded");
2312 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2313 let count = p_create_infos.len();
2314 let mut out = vec![unsafe { core::mem::zeroed() }; count];
2315 check(unsafe {
2316 fp(
2317 self.handle(),
2318 pipeline_cache,
2319 p_create_infos.len() as u32,
2320 p_create_infos.as_ptr(),
2321 alloc_ptr,
2322 out.as_mut_ptr(),
2323 )
2324 })?;
2325 Ok(out)
2326 }
2327 ///Wraps [`vkCreateComputePipelines`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateComputePipelines.html).
2328 /**
2329 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2330 ///
2331 ///# Errors
2332 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2333 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2334 ///- `VK_ERROR_INVALID_SHADER_NV`
2335 ///- `VK_ERROR_UNKNOWN`
2336 ///- `VK_ERROR_VALIDATION_FAILED`
2337 ///
2338 ///# Safety
2339 ///- `device` (self) must be valid and not destroyed.
2340 ///- `pipelineCache` must be externally synchronized.
2341 ///
2342 ///# Panics
2343 ///Panics if `vkCreateComputePipelines` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2344 ///
2345 ///# Usage Notes
2346 ///
2347 ///Creates one or more compute pipelines. Compute pipelines are simpler
2348 ///than graphics pipelines, they only need a single shader stage and a
2349 ///pipeline layout.
2350 ///
2351 ///**Pipeline cache**: pass a `PipelineCache` to speed up creation, the
2352 ///same way as with graphics pipelines. The cache is shared across both
2353 ///pipeline types.
2354 ///
2355 ///**Specialisation constants**: use `SpecializationInfo` on the shader
2356 ///stage to bake compile-time constants into the shader (e.g. workgroup
2357 ///size, algorithm variant). This produces optimised code without
2358 ///duplicating shader source.
2359 ///
2360 ///Batch multiple compute pipelines in a single call when possible.
2361 ///
2362 ///Compute pipelines can be created at any time and are not tied to a
2363 ///render pass. They are bound with `cmd_bind_pipeline` using
2364 ///`PIPELINE_BIND_POINT_COMPUTE` and dispatched with `cmd_dispatch`.
2365 pub unsafe fn create_compute_pipelines(
2366 &self,
2367 pipeline_cache: PipelineCache,
2368 p_create_infos: &[ComputePipelineCreateInfo],
2369 allocator: Option<&AllocationCallbacks>,
2370 ) -> VkResult<Vec<Pipeline>> {
2371 let fp = self
2372 .commands()
2373 .create_compute_pipelines
2374 .expect("vkCreateComputePipelines not loaded");
2375 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2376 let count = p_create_infos.len();
2377 let mut out = vec![unsafe { core::mem::zeroed() }; count];
2378 check(unsafe {
2379 fp(
2380 self.handle(),
2381 pipeline_cache,
2382 p_create_infos.len() as u32,
2383 p_create_infos.as_ptr(),
2384 alloc_ptr,
2385 out.as_mut_ptr(),
2386 )
2387 })?;
2388 Ok(out)
2389 }
2390 ///Wraps [`vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI.html).
2391 /**
2392 Provided by **VK_HUAWEI_subpass_shading**.*/
2393 ///
2394 ///# Errors
2395 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2396 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2397 ///- `VK_ERROR_SURFACE_LOST_KHR`
2398 ///- `VK_ERROR_UNKNOWN`
2399 ///- `VK_ERROR_VALIDATION_FAILED`
2400 ///
2401 ///# Safety
2402 ///- `device` (self) must be valid and not destroyed.
2403 ///
2404 ///# Panics
2405 ///Panics if `vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2406 ///
2407 ///# Usage Notes
2408 ///
2409 ///Queries the maximum workgroup size supported for subpass shading
2410 ///on the given render pass. Returns an `Extent2D` with the max
2411 ///width and height. Use this to configure subpass shading dispatch
2412 ///parameters.
2413 ///
2414 ///Requires `VK_HUAWEI_subpass_shading`.
2415 pub unsafe fn get_device_subpass_shading_max_workgroup_size_huawei(
2416 &self,
2417 renderpass: RenderPass,
2418 p_max_workgroup_size: *mut Extent2D,
2419 ) -> VkResult<()> {
2420 let fp = self
2421 .commands()
2422 .get_device_subpass_shading_max_workgroup_size_huawei
2423 .expect("vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI not loaded");
2424 check(unsafe { fp(self.handle(), renderpass, p_max_workgroup_size) })
2425 }
2426 ///Wraps [`vkDestroyPipeline`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyPipeline.html).
2427 /**
2428 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2429 ///
2430 ///# Safety
2431 ///- `device` (self) must be valid and not destroyed.
2432 ///- `pipeline` must be externally synchronized.
2433 ///
2434 ///# Panics
2435 ///Panics if `vkDestroyPipeline` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2436 ///
2437 ///# Usage Notes
2438 ///
2439 ///Destroys a graphics, compute, or ray tracing pipeline. The pipeline
2440 ///must not be bound in any command buffer that is still pending
2441 ///execution.
2442 ///
2443 ///Pipelines are expensive to create but cheap to keep around. Only
2444 ///destroy them when you are certain they will not be needed again
2445 ///(e.g. during level transitions or application shutdown).
2446 ///
2447 ///Shader modules used to create the pipeline can be destroyed
2448 ///independently, the pipeline retains its own copy of the compiled
2449 ///state.
2450 pub unsafe fn destroy_pipeline(
2451 &self,
2452 pipeline: Pipeline,
2453 allocator: Option<&AllocationCallbacks>,
2454 ) {
2455 let fp = self
2456 .commands()
2457 .destroy_pipeline
2458 .expect("vkDestroyPipeline not loaded");
2459 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2460 unsafe { fp(self.handle(), pipeline, alloc_ptr) };
2461 }
2462 ///Wraps [`vkCreatePipelineLayout`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreatePipelineLayout.html).
2463 /**
2464 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2465 ///
2466 ///# Errors
2467 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2468 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2469 ///- `VK_ERROR_UNKNOWN`
2470 ///- `VK_ERROR_VALIDATION_FAILED`
2471 ///
2472 ///# Safety
2473 ///- `device` (self) must be valid and not destroyed.
2474 ///
2475 ///# Panics
2476 ///Panics if `vkCreatePipelineLayout` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2477 ///
2478 ///# Usage Notes
2479 ///
2480 ///A pipeline layout defines the interface between shader stages and
2481 ///the descriptor sets and push constants that feed them. It specifies:
2482 ///
2483 ///- **Descriptor set layouts**: which bindings are available at each
2484 /// set index (0, 1, 2, ...).
2485 ///- **Push constant ranges**: byte ranges per shader stage for small,
2486 /// frequently-updated data.
2487 ///
2488 ///**Set layout ordering convention**: a common pattern is:
2489 ///
2490 ///- Set 0: per-frame data (camera, time).
2491 ///- Set 1: per-material data (textures, material params).
2492 ///- Set 2: per-object data (transforms).
2493 ///
2494 ///This lets you bind set 0 once per frame and only rebind sets 1–2
2495 ///as materials and objects change, minimising descriptor set switches.
2496 ///
2497 ///Pipeline layouts are immutable after creation. Two pipelines that
2498 ///share the same layout can share descriptor sets without rebinding.
2499 ///
2500 ///Push constants are limited to `max_push_constants_size` bytes
2501 ///(guaranteed at least 128). Use them for small per-draw data like
2502 ///transform matrices or material indices.
2503 ///
2504 ///# Guide
2505 ///
2506 ///See [Pipelines](https://hiddentale.github.io/vulkan_rust/concepts/pipelines.html) in the vulkan_rust guide.
2507 pub unsafe fn create_pipeline_layout(
2508 &self,
2509 p_create_info: &PipelineLayoutCreateInfo,
2510 allocator: Option<&AllocationCallbacks>,
2511 ) -> VkResult<PipelineLayout> {
2512 let fp = self
2513 .commands()
2514 .create_pipeline_layout
2515 .expect("vkCreatePipelineLayout not loaded");
2516 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2517 let mut out = unsafe { core::mem::zeroed() };
2518 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
2519 Ok(out)
2520 }
2521 ///Wraps [`vkDestroyPipelineLayout`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyPipelineLayout.html).
2522 /**
2523 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2524 ///
2525 ///# Safety
2526 ///- `device` (self) must be valid and not destroyed.
2527 ///- `pipelineLayout` must be externally synchronized.
2528 ///
2529 ///# Panics
2530 ///Panics if `vkDestroyPipelineLayout` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2531 ///
2532 ///# Usage Notes
2533 ///
2534 ///Destroys a pipeline layout. All pipelines and descriptor sets that
2535 ///were created with this layout must no longer be in use.
2536 ///
2537 ///In practice, pipeline layouts are typically created once and live for
2538 ///the duration of the application or a major rendering context. There
2539 ///is little reason to destroy them early.
2540 pub unsafe fn destroy_pipeline_layout(
2541 &self,
2542 pipeline_layout: PipelineLayout,
2543 allocator: Option<&AllocationCallbacks>,
2544 ) {
2545 let fp = self
2546 .commands()
2547 .destroy_pipeline_layout
2548 .expect("vkDestroyPipelineLayout not loaded");
2549 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2550 unsafe { fp(self.handle(), pipeline_layout, alloc_ptr) };
2551 }
2552 ///Wraps [`vkCreateSampler`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateSampler.html).
2553 /**
2554 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2555 ///
2556 ///# Errors
2557 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2558 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2559 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
2560 ///- `VK_ERROR_UNKNOWN`
2561 ///- `VK_ERROR_VALIDATION_FAILED`
2562 ///
2563 ///# Safety
2564 ///- `device` (self) must be valid and not destroyed.
2565 ///
2566 ///# Panics
2567 ///Panics if `vkCreateSampler` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2568 ///
2569 ///# Usage Notes
2570 ///
2571 ///Creates a sampler that controls how shaders read image data:
2572 ///filtering, addressing, mip level selection, and anisotropy.
2573 ///
2574 ///**Common configurations**:
2575 ///
2576 ///- **Nearest/point**: `MIN_FILTER_NEAREST`, `MAG_FILTER_NEAREST`.
2577 /// No interpolation, pixel art, data textures, or shadow map
2578 /// comparison.
2579 ///- **Bilinear**: `MIN_FILTER_LINEAR`, `MAG_FILTER_LINEAR`,
2580 /// `MIPMAP_MODE_NEAREST`. Smooth within a mip level but snaps
2581 /// between levels.
2582 ///- **Trilinear**: same as bilinear but with `MIPMAP_MODE_LINEAR`.
2583 /// Smooth transitions between mip levels. The default choice for
2584 /// most 3D textures.
2585 ///- **Anisotropic**: enable `anisotropy_enable` and set
2586 /// `max_anisotropy` (commonly 4–16). Improves quality at oblique
2587 /// viewing angles at a small GPU cost.
2588 ///
2589 ///**Address modes** (`REPEAT`, `MIRRORED_REPEAT`, `CLAMP_TO_EDGE`,
2590 ///`CLAMP_TO_BORDER`) control what happens when UVs go outside [0, 1].
2591 ///
2592 ///Samplers are immutable after creation and can be shared across any
2593 ///number of descriptor sets. Most applications need only a handful of
2594 ///samplers.
2595 pub unsafe fn create_sampler(
2596 &self,
2597 p_create_info: &SamplerCreateInfo,
2598 allocator: Option<&AllocationCallbacks>,
2599 ) -> VkResult<Sampler> {
2600 let fp = self
2601 .commands()
2602 .create_sampler
2603 .expect("vkCreateSampler not loaded");
2604 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2605 let mut out = unsafe { core::mem::zeroed() };
2606 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
2607 Ok(out)
2608 }
2609 ///Wraps [`vkDestroySampler`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroySampler.html).
2610 /**
2611 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2612 ///
2613 ///# Safety
2614 ///- `device` (self) must be valid and not destroyed.
2615 ///- `sampler` must be externally synchronized.
2616 ///
2617 ///# Panics
2618 ///Panics if `vkDestroySampler` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2619 ///
2620 ///# Usage Notes
2621 ///
2622 ///Destroys a sampler. The sampler must not be referenced by any
2623 ///descriptor set that is bound in a pending command buffer.
2624 ///
2625 ///Since most applications use a small fixed set of samplers, they are
2626 ///typically created once at startup and destroyed only during
2627 ///application shutdown.
2628 pub unsafe fn destroy_sampler(
2629 &self,
2630 sampler: Sampler,
2631 allocator: Option<&AllocationCallbacks>,
2632 ) {
2633 let fp = self
2634 .commands()
2635 .destroy_sampler
2636 .expect("vkDestroySampler not loaded");
2637 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2638 unsafe { fp(self.handle(), sampler, alloc_ptr) };
2639 }
2640 ///Wraps [`vkCreateDescriptorSetLayout`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateDescriptorSetLayout.html).
2641 /**
2642 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2643 ///
2644 ///# Errors
2645 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2646 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2647 ///- `VK_ERROR_UNKNOWN`
2648 ///- `VK_ERROR_VALIDATION_FAILED`
2649 ///
2650 ///# Safety
2651 ///- `device` (self) must be valid and not destroyed.
2652 ///
2653 ///# Panics
2654 ///Panics if `vkCreateDescriptorSetLayout` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2655 ///
2656 ///# Usage Notes
2657 ///
2658 ///A descriptor set layout defines the shape of a descriptor set: which
2659 ///binding numbers exist, what descriptor type each binding holds, and
2660 ///at which shader stages each binding is visible.
2661 ///
2662 ///**Binding tips**:
2663 ///
2664 ///- Keep `stage_flags` as narrow as possible. Declaring a binding
2665 /// visible to all stages when only the fragment shader uses it wastes
2666 /// driver resources on some implementations.
2667 ///- Use `DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER` for simple texture
2668 /// sampling. Separate sampler + sampled image bindings offer more
2669 /// flexibility when you want to reuse samplers across many textures.
2670 ///- Array descriptors (`descriptor_count > 1`) map to GLSL arrays.
2671 /// Useful for bindless or material-table patterns.
2672 ///
2673 ///Layouts are immutable after creation and can be shared across
2674 ///multiple pipeline layouts and descriptor set allocations.
2675 ///
2676 ///Destroy with `destroy_descriptor_set_layout` when no pipeline layout
2677 ///or pending descriptor set allocation still references it.
2678 pub unsafe fn create_descriptor_set_layout(
2679 &self,
2680 p_create_info: &DescriptorSetLayoutCreateInfo,
2681 allocator: Option<&AllocationCallbacks>,
2682 ) -> VkResult<DescriptorSetLayout> {
2683 let fp = self
2684 .commands()
2685 .create_descriptor_set_layout
2686 .expect("vkCreateDescriptorSetLayout not loaded");
2687 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2688 let mut out = unsafe { core::mem::zeroed() };
2689 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
2690 Ok(out)
2691 }
2692 ///Wraps [`vkDestroyDescriptorSetLayout`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyDescriptorSetLayout.html).
2693 /**
2694 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2695 ///
2696 ///# Safety
2697 ///- `device` (self) must be valid and not destroyed.
2698 ///- `descriptorSetLayout` must be externally synchronized.
2699 ///
2700 ///# Panics
2701 ///Panics if `vkDestroyDescriptorSetLayout` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2702 ///
2703 ///# Usage Notes
2704 ///
2705 ///Destroys a descriptor set layout. The layout must not be referenced
2706 ///by any pipeline layout or pending descriptor set allocation that is
2707 ///still in use.
2708 ///
2709 ///Descriptor set layouts are lightweight and typically long-lived.
2710 ///Destroy them during application shutdown after all dependent
2711 ///pipeline layouts and descriptor pools have been destroyed.
2712 pub unsafe fn destroy_descriptor_set_layout(
2713 &self,
2714 descriptor_set_layout: DescriptorSetLayout,
2715 allocator: Option<&AllocationCallbacks>,
2716 ) {
2717 let fp = self
2718 .commands()
2719 .destroy_descriptor_set_layout
2720 .expect("vkDestroyDescriptorSetLayout not loaded");
2721 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2722 unsafe { fp(self.handle(), descriptor_set_layout, alloc_ptr) };
2723 }
2724 ///Wraps [`vkCreateDescriptorPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateDescriptorPool.html).
2725 /**
2726 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2727 ///
2728 ///# Errors
2729 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2730 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2731 ///- `VK_ERROR_FRAGMENTATION_EXT`
2732 ///- `VK_ERROR_UNKNOWN`
2733 ///- `VK_ERROR_VALIDATION_FAILED`
2734 ///
2735 ///# Safety
2736 ///- `device` (self) must be valid and not destroyed.
2737 ///
2738 ///# Panics
2739 ///Panics if `vkCreateDescriptorPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2740 ///
2741 ///# Usage Notes
2742 ///
2743 ///Creates a pool from which descriptor sets are allocated. The pool
2744 ///must be sized to accommodate all the descriptor sets and individual
2745 ///descriptor types your application needs.
2746 ///
2747 ///**Sizing**: specify `max_sets` (total descriptor sets) and a list of
2748 ///`DescriptorPoolSize` entries that declare how many descriptors of
2749 ///each type the pool holds. Under-sizing causes
2750 ///`VK_ERROR_OUT_OF_POOL_MEMORY` at allocation time.
2751 ///
2752 ///**Flags**:
2753 ///
2754 ///- `FREE_DESCRIPTOR_SET`: allows individual sets to be freed with
2755 /// `free_descriptor_sets`. Without this flag, sets can only be
2756 /// reclaimed by resetting the entire pool.
2757 ///- `UPDATE_AFTER_BIND`: required if any allocated set uses
2758 /// update-after-bind bindings.
2759 ///
2760 ///**Common pattern**: create one pool per frame-in-flight. At the
2761 ///start of each frame, `reset_descriptor_pool` reclaims all sets at
2762 ///once, no individual tracking or freeing needed.
2763 pub unsafe fn create_descriptor_pool(
2764 &self,
2765 p_create_info: &DescriptorPoolCreateInfo,
2766 allocator: Option<&AllocationCallbacks>,
2767 ) -> VkResult<DescriptorPool> {
2768 let fp = self
2769 .commands()
2770 .create_descriptor_pool
2771 .expect("vkCreateDescriptorPool not loaded");
2772 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2773 let mut out = unsafe { core::mem::zeroed() };
2774 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
2775 Ok(out)
2776 }
2777 ///Wraps [`vkDestroyDescriptorPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyDescriptorPool.html).
2778 /**
2779 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2780 ///
2781 ///# Safety
2782 ///- `device` (self) must be valid and not destroyed.
2783 ///- `descriptorPool` must be externally synchronized.
2784 ///
2785 ///# Panics
2786 ///Panics if `vkDestroyDescriptorPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2787 ///
2788 ///# Usage Notes
2789 ///
2790 ///Destroys a descriptor pool and implicitly frees all descriptor sets
2791 ///allocated from it. You do not need to free individual sets before
2792 ///destroying the pool.
2793 ///
2794 ///Ensure no command buffer that references any set from this pool is
2795 ///still pending execution.
2796 pub unsafe fn destroy_descriptor_pool(
2797 &self,
2798 descriptor_pool: DescriptorPool,
2799 allocator: Option<&AllocationCallbacks>,
2800 ) {
2801 let fp = self
2802 .commands()
2803 .destroy_descriptor_pool
2804 .expect("vkDestroyDescriptorPool not loaded");
2805 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2806 unsafe { fp(self.handle(), descriptor_pool, alloc_ptr) };
2807 }
2808 ///Wraps [`vkResetDescriptorPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkResetDescriptorPool.html).
2809 /**
2810 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2811 ///
2812 ///# Errors
2813 ///- `VK_ERROR_UNKNOWN`
2814 ///- `VK_ERROR_VALIDATION_FAILED`
2815 ///
2816 ///# Safety
2817 ///- `device` (self) must be valid and not destroyed.
2818 ///- `descriptorPool` must be externally synchronized.
2819 ///
2820 ///# Panics
2821 ///Panics if `vkResetDescriptorPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2822 ///
2823 ///# Usage Notes
2824 ///
2825 ///Recycles all descriptor sets allocated from this pool back to the
2826 ///pool, without destroying the pool itself. After a reset, all
2827 ///previously allocated sets are invalid and must not be used.
2828 ///
2829 ///This is the fastest way to reclaim descriptor sets, much cheaper
2830 ///than freeing them individually. Ideal for the per-frame pool pattern
2831 ///where you allocate fresh sets every frame and reset the pool at the
2832 ///start of the next frame.
2833 ///
2834 ///No command buffer that references any set from this pool may be
2835 ///pending execution when you reset.
2836 pub unsafe fn reset_descriptor_pool(
2837 &self,
2838 descriptor_pool: DescriptorPool,
2839 flags: DescriptorPoolResetFlags,
2840 ) -> VkResult<()> {
2841 let fp = self
2842 .commands()
2843 .reset_descriptor_pool
2844 .expect("vkResetDescriptorPool not loaded");
2845 check(unsafe { fp(self.handle(), descriptor_pool, flags) })
2846 }
2847 ///Wraps [`vkAllocateDescriptorSets`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAllocateDescriptorSets.html).
2848 /**
2849 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2850 ///
2851 ///# Errors
2852 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2853 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2854 ///- `VK_ERROR_FRAGMENTED_POOL`
2855 ///- `VK_ERROR_OUT_OF_POOL_MEMORY`
2856 ///- `VK_ERROR_UNKNOWN`
2857 ///- `VK_ERROR_VALIDATION_FAILED`
2858 ///
2859 ///# Safety
2860 ///- `device` (self) must be valid and not destroyed.
2861 ///
2862 ///# Panics
2863 ///Panics if `vkAllocateDescriptorSets` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2864 ///
2865 ///# Usage Notes
2866 ///
2867 ///Allocates descriptor sets from a descriptor pool. Each set is backed
2868 ///by one of the `set_layouts` in the allocate info.
2869 ///
2870 ///Common failure causes:
2871 ///
2872 ///- **Pool exhaustion**: the pool does not have enough descriptors of
2873 /// the required types, or the maximum set count has been reached.
2874 /// Returns `VK_ERROR_OUT_OF_POOL_MEMORY`. Pre-calculate pool sizes
2875 /// carefully or use `VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT`
2876 /// to allow freeing and reallocation.
2877 ///- **Fragmentation**: even with enough total descriptors, internal
2878 /// fragmentation can cause allocation failure. Resetting the entire
2879 /// pool with `reset_descriptor_pool` defragments it.
2880 ///
2881 ///Descriptor sets become invalid when their parent pool is destroyed
2882 ///or reset. Do not submit command buffers that reference descriptor
2883 ///sets from a pool that has been reset.
2884 ///
2885 ///For frequently-updated descriptors, consider
2886 ///`VK_KHR_push_descriptor` which avoids set allocation entirely.
2887 pub unsafe fn allocate_descriptor_sets(
2888 &self,
2889 p_allocate_info: &DescriptorSetAllocateInfo,
2890 ) -> VkResult<Vec<DescriptorSet>> {
2891 let fp = self
2892 .commands()
2893 .allocate_descriptor_sets
2894 .expect("vkAllocateDescriptorSets not loaded");
2895 let count = p_allocate_info.descriptor_set_count as usize;
2896 let mut out = vec![unsafe { core::mem::zeroed() }; count];
2897 check(unsafe { fp(self.handle(), p_allocate_info, out.as_mut_ptr()) })?;
2898 Ok(out)
2899 }
2900 ///Wraps [`vkFreeDescriptorSets`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkFreeDescriptorSets.html).
2901 /**
2902 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2903 ///
2904 ///# Errors
2905 ///- `VK_ERROR_UNKNOWN`
2906 ///- `VK_ERROR_VALIDATION_FAILED`
2907 ///
2908 ///# Safety
2909 ///- `device` (self) must be valid and not destroyed.
2910 ///- `descriptorPool` must be externally synchronized.
2911 ///- `pDescriptorSets` must be externally synchronized.
2912 ///
2913 ///# Panics
2914 ///Panics if `vkFreeDescriptorSets` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2915 ///
2916 ///# Usage Notes
2917 ///
2918 ///Returns individual descriptor sets back to their parent pool. The
2919 ///pool must have been created with `FREE_DESCRIPTOR_SET`, without
2920 ///that flag this call is invalid.
2921 ///
2922 ///For most applications, resetting the entire pool with
2923 ///`reset_descriptor_pool` is simpler and faster than tracking and
2924 ///freeing individual sets. Use `free_descriptor_sets` only when you
2925 ///need fine-grained lifetime control over specific sets.
2926 ///
2927 ///Freed sets must not be referenced by any pending command buffer.
2928 pub unsafe fn free_descriptor_sets(
2929 &self,
2930 descriptor_pool: DescriptorPool,
2931 p_descriptor_sets: &[DescriptorSet],
2932 ) -> VkResult<()> {
2933 let fp = self
2934 .commands()
2935 .free_descriptor_sets
2936 .expect("vkFreeDescriptorSets not loaded");
2937 check(unsafe {
2938 fp(
2939 self.handle(),
2940 descriptor_pool,
2941 p_descriptor_sets.len() as u32,
2942 p_descriptor_sets.as_ptr(),
2943 )
2944 })
2945 }
2946 ///Wraps [`vkUpdateDescriptorSets`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkUpdateDescriptorSets.html).
2947 /**
2948 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2949 ///
2950 ///# Safety
2951 ///- `device` (self) must be valid and not destroyed.
2952 ///- `pDescriptorWrites` must be externally synchronized.
2953 ///
2954 ///# Panics
2955 ///Panics if `vkUpdateDescriptorSets` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2956 ///
2957 ///# Usage Notes
2958 ///
2959 ///Writes or copies resource bindings into descriptor sets. This is
2960 ///how you connect actual buffers, images, and samplers to the
2961 ///descriptor slots that shaders read from.
2962 ///
2963 ///**Writes** (`WriteDescriptorSet`): bind concrete resources to a
2964 ///specific set + binding + array element. Each write targets one
2965 ///descriptor type (uniform buffer, combined image sampler, storage
2966 ///buffer, etc.).
2967 ///
2968 ///**Copies** (`CopyDescriptorSet`): duplicate bindings from one set
2969 ///to another. Rarely used, writes cover nearly all cases.
2970 ///
2971 ///Updates take effect immediately and are visible to any command buffer
2972 ///recorded after the update. However, updating a set that is currently
2973 ///bound in a pending command buffer is undefined behaviour unless the
2974 ///set was allocated from a pool with `UPDATE_AFTER_BIND` and the
2975 ///binding is marked as update-after-bind in the layout.
2976 ///
2977 ///Batch multiple writes into a single call when possible, the driver
2978 ///can often process them more efficiently.
2979 pub unsafe fn update_descriptor_sets(
2980 &self,
2981 p_descriptor_writes: &[WriteDescriptorSet],
2982 p_descriptor_copies: &[CopyDescriptorSet],
2983 ) {
2984 let fp = self
2985 .commands()
2986 .update_descriptor_sets
2987 .expect("vkUpdateDescriptorSets not loaded");
2988 unsafe {
2989 fp(
2990 self.handle(),
2991 p_descriptor_writes.len() as u32,
2992 p_descriptor_writes.as_ptr(),
2993 p_descriptor_copies.len() as u32,
2994 p_descriptor_copies.as_ptr(),
2995 )
2996 };
2997 }
2998 ///Wraps [`vkCreateFramebuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateFramebuffer.html).
2999 /**
3000 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3001 ///
3002 ///# Errors
3003 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3004 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3005 ///- `VK_ERROR_UNKNOWN`
3006 ///- `VK_ERROR_VALIDATION_FAILED`
3007 ///
3008 ///# Safety
3009 ///- `device` (self) must be valid and not destroyed.
3010 ///
3011 ///# Panics
3012 ///Panics if `vkCreateFramebuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3013 ///
3014 ///# Usage Notes
3015 ///
3016 ///A framebuffer binds concrete image views to the attachment slots
3017 ///defined by a render pass. The number and format of attachments must
3018 ///match the render pass exactly, mismatches cause validation errors.
3019 ///
3020 ///**Dimensions**: `width`, `height`, and `layers` must be less than
3021 ///or equal to the corresponding dimensions of every attached image
3022 ///view. They define the renderable area for `cmd_begin_render_pass`.
3023 ///
3024 ///**Lifetime**: the framebuffer must stay alive for the entire
3025 ///duration of any render pass instance that uses it. In practice,
3026 ///framebuffers are typically recreated when the swapchain is resized.
3027 ///
3028 ///**Imageless framebuffers** (Vulkan 1.2+): create the framebuffer
3029 ///with `FRAMEBUFFER_CREATE_IMAGELESS` and no attachments. Concrete
3030 ///image views are then supplied at `cmd_begin_render_pass` time via
3031 ///`RenderPassAttachmentBeginInfo`. This avoids recreating framebuffers
3032 ///on swapchain resize.
3033 ///
3034 ///# Guide
3035 ///
3036 ///See [Render Passes & Framebuffers](https://hiddentale.github.io/vulkan_rust/concepts/render-passes.html) in the vulkan_rust guide.
3037 pub unsafe fn create_framebuffer(
3038 &self,
3039 p_create_info: &FramebufferCreateInfo,
3040 allocator: Option<&AllocationCallbacks>,
3041 ) -> VkResult<Framebuffer> {
3042 let fp = self
3043 .commands()
3044 .create_framebuffer
3045 .expect("vkCreateFramebuffer not loaded");
3046 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
3047 let mut out = unsafe { core::mem::zeroed() };
3048 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
3049 Ok(out)
3050 }
3051 ///Wraps [`vkDestroyFramebuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyFramebuffer.html).
3052 /**
3053 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3054 ///
3055 ///# Safety
3056 ///- `device` (self) must be valid and not destroyed.
3057 ///- `framebuffer` must be externally synchronized.
3058 ///
3059 ///# Panics
3060 ///Panics if `vkDestroyFramebuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3061 ///
3062 ///# Usage Notes
3063 ///
3064 ///Destroys a framebuffer. No render pass instance using this
3065 ///framebuffer may be pending execution.
3066 ///
3067 ///Framebuffers are typically recreated whenever the swapchain is
3068 ///resized, so they tend to have shorter lifetimes than most Vulkan
3069 ///objects. With imageless framebuffers (Vulkan 1.2+) you can avoid
3070 ///this churn entirely.
3071 pub unsafe fn destroy_framebuffer(
3072 &self,
3073 framebuffer: Framebuffer,
3074 allocator: Option<&AllocationCallbacks>,
3075 ) {
3076 let fp = self
3077 .commands()
3078 .destroy_framebuffer
3079 .expect("vkDestroyFramebuffer not loaded");
3080 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
3081 unsafe { fp(self.handle(), framebuffer, alloc_ptr) };
3082 }
3083 ///Wraps [`vkCreateRenderPass`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateRenderPass.html).
3084 /**
3085 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3086 ///
3087 ///# Errors
3088 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3089 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3090 ///- `VK_ERROR_UNKNOWN`
3091 ///- `VK_ERROR_VALIDATION_FAILED`
3092 ///
3093 ///# Safety
3094 ///- `device` (self) must be valid and not destroyed.
3095 ///
3096 ///# Panics
3097 ///Panics if `vkCreateRenderPass` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3098 ///
3099 ///# Usage Notes
3100 ///
3101 ///A render pass describes the attachments, subpasses, and dependencies
3102 ///used during rendering. It does not reference actual images, those
3103 ///are bound later via a framebuffer.
3104 ///
3105 ///Key design points:
3106 ///
3107 ///- **`load_op` / `store_op`**: use `DONT_CARE` for attachments whose
3108 /// prior contents are irrelevant (e.g. a transient depth buffer). This
3109 /// lets tile-based GPUs skip loads/stores, which is significant on
3110 /// mobile.
3111 ///- **`initial_layout` / `final_layout`**: Vulkan inserts implicit layout
3112 /// transitions at render pass boundaries. Set these to match your actual
3113 /// usage to avoid unnecessary transitions. `UNDEFINED` for `initial_layout`
3114 /// is fine when `load_op` is `CLEAR` or `DONT_CARE`.
3115 ///- **Subpass dependencies**: the implicit external dependencies
3116 /// (`VK_SUBPASS_EXTERNAL`) are often insufficient. Add explicit
3117 /// dependencies when subsequent passes read the output.
3118 ///
3119 ///For dynamic rendering (Vulkan 1.3+), consider `cmd_begin_rendering`
3120 ///instead, which avoids the need for render pass and framebuffer objects.
3121 ///
3122 ///# Guide
3123 ///
3124 ///See [Render Passes & Framebuffers](https://hiddentale.github.io/vulkan_rust/concepts/render-passes.html) in the vulkan_rust guide.
3125 pub unsafe fn create_render_pass(
3126 &self,
3127 p_create_info: &RenderPassCreateInfo,
3128 allocator: Option<&AllocationCallbacks>,
3129 ) -> VkResult<RenderPass> {
3130 let fp = self
3131 .commands()
3132 .create_render_pass
3133 .expect("vkCreateRenderPass not loaded");
3134 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
3135 let mut out = unsafe { core::mem::zeroed() };
3136 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
3137 Ok(out)
3138 }
3139 ///Wraps [`vkDestroyRenderPass`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyRenderPass.html).
3140 /**
3141 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3142 ///
3143 ///# Safety
3144 ///- `device` (self) must be valid and not destroyed.
3145 ///- `renderPass` must be externally synchronized.
3146 ///
3147 ///# Panics
3148 ///Panics if `vkDestroyRenderPass` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3149 ///
3150 ///# Usage Notes
3151 ///
3152 ///Destroys a render pass. All framebuffers and pipelines created with
3153 ///this render pass must no longer be in use.
3154 ///
3155 ///Render passes are typically long-lived, created once at startup
3156 ///and destroyed during shutdown. Destroying a render pass does not
3157 ///affect pipelines that were created with a compatible render pass
3158 ///(same attachment count, formats, and sample counts).
3159 pub unsafe fn destroy_render_pass(
3160 &self,
3161 render_pass: RenderPass,
3162 allocator: Option<&AllocationCallbacks>,
3163 ) {
3164 let fp = self
3165 .commands()
3166 .destroy_render_pass
3167 .expect("vkDestroyRenderPass not loaded");
3168 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
3169 unsafe { fp(self.handle(), render_pass, alloc_ptr) };
3170 }
3171 ///Wraps [`vkGetRenderAreaGranularity`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetRenderAreaGranularity.html).
3172 /**
3173 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3174 ///
3175 ///# Safety
3176 ///- `device` (self) must be valid and not destroyed.
3177 ///
3178 ///# Panics
3179 ///Panics if `vkGetRenderAreaGranularity` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3180 ///
3181 ///# Usage Notes
3182 ///
3183 ///Returns the granularity (in pixels) at which the render area should
3184 ///be aligned for optimal performance with this render pass.
3185 ///
3186 ///The render area passed to `cmd_begin_render_pass` should have its
3187 ///`offset` be a multiple of this granularity and its `extent` should
3188 ///either cover the full framebuffer or be rounded up to a multiple.
3189 ///
3190 ///On most desktop GPUs this returns (1, 1), meaning any alignment is
3191 ///fine. On tile-based GPUs this may return the tile size (e.g. 32×32),
3192 ///and misalignment can cause partial-tile overhead.
3193 ///
3194 ///In practice, most applications render to the full framebuffer extent
3195 ///and never need to worry about this.
3196 pub unsafe fn get_render_area_granularity(&self, render_pass: RenderPass) -> Extent2D {
3197 let fp = self
3198 .commands()
3199 .get_render_area_granularity
3200 .expect("vkGetRenderAreaGranularity not loaded");
3201 let mut out = unsafe { core::mem::zeroed() };
3202 unsafe { fp(self.handle(), render_pass, &mut out) };
3203 out
3204 }
3205 ///Wraps [`vkGetRenderingAreaGranularity`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetRenderingAreaGranularity.html).
3206 /**
3207 Provided by **VK_GRAPHICS_VERSION_1_4**.*/
3208 ///
3209 ///# Safety
3210 ///- `device` (self) must be valid and not destroyed.
3211 ///
3212 ///# Panics
3213 ///Panics if `vkGetRenderingAreaGranularity` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3214 ///
3215 ///# Usage Notes
3216 ///
3217 ///Vulkan 1.4 command that queries the optimal render area granularity
3218 ///for a given dynamic rendering configuration, without needing a
3219 ///render pass object.
3220 ///
3221 ///This is the dynamic rendering equivalent of
3222 ///`get_render_area_granularity`. Pass a `RenderingAreaInfo` describing
3223 ///the attachment formats and sample count, and receive the granularity
3224 ///(in pixels) at which the render area should be aligned.
3225 ///
3226 ///On most desktop GPUs this returns (1, 1). On tile-based GPUs the
3227 ///granularity may match the tile size.
3228 pub unsafe fn get_rendering_area_granularity(
3229 &self,
3230 p_rendering_area_info: &RenderingAreaInfo,
3231 ) -> Extent2D {
3232 let fp = self
3233 .commands()
3234 .get_rendering_area_granularity
3235 .expect("vkGetRenderingAreaGranularity not loaded");
3236 let mut out = unsafe { core::mem::zeroed() };
3237 unsafe { fp(self.handle(), p_rendering_area_info, &mut out) };
3238 out
3239 }
3240 ///Wraps [`vkCreateCommandPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateCommandPool.html).
3241 /**
3242 Provided by **VK_BASE_VERSION_1_0**.*/
3243 ///
3244 ///# Errors
3245 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3246 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3247 ///- `VK_ERROR_UNKNOWN`
3248 ///- `VK_ERROR_VALIDATION_FAILED`
3249 ///
3250 ///# Safety
3251 ///- `device` (self) must be valid and not destroyed.
3252 ///
3253 ///# Panics
3254 ///Panics if `vkCreateCommandPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3255 ///
3256 ///# Usage Notes
3257 ///
3258 ///A command pool provides the memory backing for command buffers
3259 ///allocated from it. Pools are tied to a single queue family, command
3260 ///buffers allocated from the pool can only be submitted to queues of
3261 ///that family.
3262 ///
3263 ///**Flags**:
3264 ///
3265 ///- `TRANSIENT`: hint that command buffers are short-lived and reset or
3266 /// freed frequently. Lets the driver use a faster allocation strategy.
3267 ///- `RESET_COMMAND_BUFFER`: allows individual command buffers to be
3268 /// reset via `reset_command_buffer`. Without this flag you must reset
3269 /// the entire pool with `reset_command_pool`.
3270 ///
3271 ///A common pattern is one pool per frame-in-flight per thread: reset the
3272 ///whole pool at the start of each frame instead of managing individual
3273 ///command buffer lifetimes.
3274 ///
3275 ///Command pools are **not thread-safe**. If multiple threads record
3276 ///commands concurrently, each thread needs its own pool.
3277 ///
3278 ///# Guide
3279 ///
3280 ///See [Command Buffers](https://hiddentale.github.io/vulkan_rust/concepts/command-buffers.html) in the vulkan_rust guide.
3281 pub unsafe fn create_command_pool(
3282 &self,
3283 p_create_info: &CommandPoolCreateInfo,
3284 allocator: Option<&AllocationCallbacks>,
3285 ) -> VkResult<CommandPool> {
3286 let fp = self
3287 .commands()
3288 .create_command_pool
3289 .expect("vkCreateCommandPool not loaded");
3290 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
3291 let mut out = unsafe { core::mem::zeroed() };
3292 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
3293 Ok(out)
3294 }
3295 ///Wraps [`vkDestroyCommandPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyCommandPool.html).
3296 /**
3297 Provided by **VK_BASE_VERSION_1_0**.*/
3298 ///
3299 ///# Safety
3300 ///- `device` (self) must be valid and not destroyed.
3301 ///- `commandPool` must be externally synchronized.
3302 ///
3303 ///# Panics
3304 ///Panics if `vkDestroyCommandPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3305 ///
3306 ///# Usage Notes
3307 ///
3308 ///Destroys a command pool and implicitly frees all command buffers
3309 ///allocated from it. You do not need to free individual command buffers
3310 ///before destroying the pool.
3311 ///
3312 ///All command buffers allocated from this pool must have completed
3313 ///execution before the pool is destroyed. Call `device_wait_idle` or
3314 ///wait on the relevant fences first.
3315 pub unsafe fn destroy_command_pool(
3316 &self,
3317 command_pool: CommandPool,
3318 allocator: Option<&AllocationCallbacks>,
3319 ) {
3320 let fp = self
3321 .commands()
3322 .destroy_command_pool
3323 .expect("vkDestroyCommandPool not loaded");
3324 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
3325 unsafe { fp(self.handle(), command_pool, alloc_ptr) };
3326 }
3327 ///Wraps [`vkResetCommandPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkResetCommandPool.html).
3328 /**
3329 Provided by **VK_BASE_VERSION_1_0**.*/
3330 ///
3331 ///# Errors
3332 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3333 ///- `VK_ERROR_UNKNOWN`
3334 ///- `VK_ERROR_VALIDATION_FAILED`
3335 ///
3336 ///# Safety
3337 ///- `device` (self) must be valid and not destroyed.
3338 ///- `commandPool` must be externally synchronized.
3339 ///
3340 ///# Panics
3341 ///Panics if `vkResetCommandPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3342 ///
3343 ///# Usage Notes
3344 ///
3345 ///Resets a command pool, recycling all command buffers allocated from
3346 ///it back to the initial state. This is faster than resetting
3347 ///individual command buffers.
3348 ///
3349 ///**Flags**:
3350 ///
3351 ///- `RELEASE_RESOURCES`: return memory to the system. Without this
3352 /// flag, the pool keeps its internal memory for reuse by future
3353 /// allocations, usually what you want in a frame loop.
3354 ///
3355 ///**Per-frame pattern**: reset the pool at the start of each frame
3356 ///(without `RELEASE_RESOURCES`), then re-record command buffers from
3357 ///the same pool. Memory is reused without reallocation overhead.
3358 ///
3359 ///All command buffers from this pool must have completed execution
3360 ///before resetting.
3361 pub unsafe fn reset_command_pool(
3362 &self,
3363 command_pool: CommandPool,
3364 flags: CommandPoolResetFlags,
3365 ) -> VkResult<()> {
3366 let fp = self
3367 .commands()
3368 .reset_command_pool
3369 .expect("vkResetCommandPool not loaded");
3370 check(unsafe { fp(self.handle(), command_pool, flags) })
3371 }
3372 ///Wraps [`vkAllocateCommandBuffers`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAllocateCommandBuffers.html).
3373 /**
3374 Provided by **VK_BASE_VERSION_1_0**.*/
3375 ///
3376 ///# Errors
3377 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3378 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3379 ///- `VK_ERROR_UNKNOWN`
3380 ///- `VK_ERROR_VALIDATION_FAILED`
3381 ///
3382 ///# Safety
3383 ///- `device` (self) must be valid and not destroyed.
3384 ///
3385 ///# Panics
3386 ///Panics if `vkAllocateCommandBuffers` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3387 ///
3388 ///# Usage Notes
3389 ///
3390 ///Allocates one or more command buffers from a command pool. The
3391 ///`command_buffer_count` and output slice length must match.
3392 ///
3393 ///**Level**:
3394 ///
3395 ///- `PRIMARY`: submitted directly to a queue via `queue_submit`.
3396 ///- `SECONDARY`: recorded separately and executed inside a primary
3397 /// buffer via `cmd_execute_commands`. Useful for pre-recording
3398 /// draw calls that are reused across frames.
3399 ///
3400 ///All allocated command buffers start in the *initial* state and must
3401 ///be recorded with `begin_command_buffer` before submission.
3402 ///
3403 ///Command buffers are freed either individually with
3404 ///`free_command_buffers` or implicitly when the parent pool is
3405 ///destroyed or reset.
3406 ///
3407 ///# Guide
3408 ///
3409 ///See [Command Buffers](https://hiddentale.github.io/vulkan_rust/concepts/command-buffers.html) in the vulkan_rust guide.
3410 pub unsafe fn allocate_command_buffers(
3411 &self,
3412 p_allocate_info: &CommandBufferAllocateInfo,
3413 ) -> VkResult<Vec<CommandBuffer>> {
3414 let fp = self
3415 .commands()
3416 .allocate_command_buffers
3417 .expect("vkAllocateCommandBuffers not loaded");
3418 let count = p_allocate_info.command_buffer_count as usize;
3419 let mut out = vec![unsafe { core::mem::zeroed() }; count];
3420 check(unsafe { fp(self.handle(), p_allocate_info, out.as_mut_ptr()) })?;
3421 Ok(out)
3422 }
3423 ///Wraps [`vkFreeCommandBuffers`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkFreeCommandBuffers.html).
3424 /**
3425 Provided by **VK_BASE_VERSION_1_0**.*/
3426 ///
3427 ///# Safety
3428 ///- `device` (self) must be valid and not destroyed.
3429 ///- `commandPool` must be externally synchronized.
3430 ///- `pCommandBuffers` must be externally synchronized.
3431 ///
3432 ///# Panics
3433 ///Panics if `vkFreeCommandBuffers` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3434 ///
3435 ///# Usage Notes
3436 ///
3437 ///Returns individual command buffers to their parent pool. The command
3438 ///buffers must not be pending execution.
3439 ///
3440 ///For most applications, resetting the entire pool with
3441 ///`reset_command_pool` is simpler. Use `free_command_buffers` only
3442 ///when you need fine-grained lifetime control, for example, freeing
3443 ///a one-shot transfer command buffer immediately after use while
3444 ///keeping other buffers from the same pool alive.
3445 ///
3446 ///Freed command buffer handles become invalid. Do not resubmit them.
3447 pub unsafe fn free_command_buffers(
3448 &self,
3449 command_pool: CommandPool,
3450 p_command_buffers: &[CommandBuffer],
3451 ) {
3452 let fp = self
3453 .commands()
3454 .free_command_buffers
3455 .expect("vkFreeCommandBuffers not loaded");
3456 unsafe {
3457 fp(
3458 self.handle(),
3459 command_pool,
3460 p_command_buffers.len() as u32,
3461 p_command_buffers.as_ptr(),
3462 )
3463 };
3464 }
3465 ///Wraps [`vkBeginCommandBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBeginCommandBuffer.html).
3466 /**
3467 Provided by **VK_BASE_VERSION_1_0**.*/
3468 ///
3469 ///# Errors
3470 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3471 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3472 ///- `VK_ERROR_UNKNOWN`
3473 ///- `VK_ERROR_VALIDATION_FAILED`
3474 ///
3475 ///# Safety
3476 ///- `commandBuffer` (self) must be valid and not destroyed.
3477 ///- `commandBuffer` must be externally synchronized.
3478 ///
3479 ///# Panics
3480 ///Panics if `vkBeginCommandBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3481 ///
3482 ///# Usage Notes
3483 ///
3484 ///Begins recording commands into a command buffer. The command buffer
3485 ///must be in the *initial* state, either freshly allocated, or reset
3486 ///via `reset_command_buffer` / `reset_command_pool`.
3487 ///
3488 ///**Flags**:
3489 ///
3490 ///- `ONE_TIME_SUBMIT`: the command buffer will be submitted once and
3491 /// then reset or freed. Lets the driver skip internal tracking it
3492 /// would otherwise need for resubmission.
3493 ///- `SIMULTANEOUS_USE`: the command buffer can be pending execution on
3494 /// multiple queues simultaneously. Required for secondary command
3495 /// buffers reused across multiple primary buffers.
3496 ///
3497 ///**Inheritance info**: only required for secondary command buffers.
3498 ///When recording a secondary buffer that will execute inside a render
3499 ///pass, set `render_pass`, `subpass`, and optionally `framebuffer` in
3500 ///the `CommandBufferInheritanceInfo`. For primary buffers the
3501 ///inheritance info is ignored.
3502 ///
3503 ///Calling `begin_command_buffer` on a buffer that is already recording
3504 ///is an error. Calling it on a buffer in the *executable* state
3505 ///implicitly resets it first (if the pool allows it).
3506 ///
3507 ///# Guide
3508 ///
3509 ///See [Command Buffers](https://hiddentale.github.io/vulkan_rust/concepts/command-buffers.html) in the vulkan_rust guide.
3510 pub unsafe fn begin_command_buffer(
3511 &self,
3512 command_buffer: CommandBuffer,
3513 p_begin_info: &CommandBufferBeginInfo,
3514 ) -> VkResult<()> {
3515 let fp = self
3516 .commands()
3517 .begin_command_buffer
3518 .expect("vkBeginCommandBuffer not loaded");
3519 check(unsafe { fp(command_buffer, p_begin_info) })
3520 }
3521 ///Wraps [`vkEndCommandBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkEndCommandBuffer.html).
3522 /**
3523 Provided by **VK_BASE_VERSION_1_0**.*/
3524 ///
3525 ///# Errors
3526 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3527 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3528 ///- `VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR`
3529 ///- `VK_ERROR_UNKNOWN`
3530 ///- `VK_ERROR_VALIDATION_FAILED`
3531 ///
3532 ///# Safety
3533 ///- `commandBuffer` (self) must be valid and not destroyed.
3534 ///- `commandBuffer` must be externally synchronized.
3535 ///
3536 ///# Panics
3537 ///Panics if `vkEndCommandBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3538 ///
3539 ///# Usage Notes
3540 ///
3541 ///Finishes recording a command buffer. After this call the command
3542 ///buffer moves from the *recording* state to the *executable* state
3543 ///and can be submitted via `queue_submit`.
3544 ///
3545 ///If an error occurred during recording (e.g. out of memory), this
3546 ///call returns the error. Always check the return value, a failed
3547 ///`end_command_buffer` means the command buffer is in an invalid state
3548 ///and must be reset before reuse.
3549 ///
3550 ///A command buffer that is inside a render pass must end the render
3551 ///pass with `cmd_end_render_pass` before calling `end_command_buffer`.
3552 ///
3553 ///# Guide
3554 ///
3555 ///See [Command Buffers](https://hiddentale.github.io/vulkan_rust/concepts/command-buffers.html) in the vulkan_rust guide.
3556 pub unsafe fn end_command_buffer(&self, command_buffer: CommandBuffer) -> VkResult<()> {
3557 let fp = self
3558 .commands()
3559 .end_command_buffer
3560 .expect("vkEndCommandBuffer not loaded");
3561 check(unsafe { fp(command_buffer) })
3562 }
3563 ///Wraps [`vkResetCommandBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkResetCommandBuffer.html).
3564 /**
3565 Provided by **VK_BASE_VERSION_1_0**.*/
3566 ///
3567 ///# Errors
3568 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3569 ///- `VK_ERROR_UNKNOWN`
3570 ///- `VK_ERROR_VALIDATION_FAILED`
3571 ///
3572 ///# Safety
3573 ///- `commandBuffer` (self) must be valid and not destroyed.
3574 ///- `commandBuffer` must be externally synchronized.
3575 ///
3576 ///# Panics
3577 ///Panics if `vkResetCommandBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3578 ///
3579 ///# Usage Notes
3580 ///
3581 ///Resets a single command buffer back to the initial state so it can
3582 ///be re-recorded. The command pool must have been created with
3583 ///`RESET_COMMAND_BUFFER` for this to be valid.
3584 ///
3585 ///**Flags**:
3586 ///
3587 ///- `RELEASE_RESOURCES`: return the command buffer's memory to the
3588 /// pool. Without this flag, memory is retained for reuse during the
3589 /// next recording, usually preferred in a frame loop.
3590 ///
3591 ///For bulk resets, `reset_command_pool` is more efficient than
3592 ///resetting buffers individually.
3593 ///
3594 ///The command buffer must not be pending execution when reset.
3595 pub unsafe fn reset_command_buffer(
3596 &self,
3597 command_buffer: CommandBuffer,
3598 flags: CommandBufferResetFlags,
3599 ) -> VkResult<()> {
3600 let fp = self
3601 .commands()
3602 .reset_command_buffer
3603 .expect("vkResetCommandBuffer not loaded");
3604 check(unsafe { fp(command_buffer, flags) })
3605 }
3606 ///Wraps [`vkCmdBindPipeline`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindPipeline.html).
3607 /**
3608 Provided by **VK_COMPUTE_VERSION_1_0**.*/
3609 ///
3610 ///# Safety
3611 ///- `commandBuffer` (self) must be valid and not destroyed.
3612 ///- `commandBuffer` must be externally synchronized.
3613 ///
3614 ///# Panics
3615 ///Panics if `vkCmdBindPipeline` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3616 ///
3617 ///# Usage Notes
3618 ///
3619 ///Binds a pipeline to a command buffer for subsequent draw or dispatch
3620 ///calls. The `pipeline_bind_point` must match the pipeline type:
3621 ///
3622 ///- `PIPELINE_BIND_POINT_GRAPHICS` for graphics pipelines.
3623 ///- `PIPELINE_BIND_POINT_COMPUTE` for compute pipelines.
3624 ///- `PIPELINE_BIND_POINT_RAY_TRACING_KHR` for ray tracing pipelines.
3625 ///
3626 ///Binding a pipeline invalidates any incompatible dynamic state. For
3627 ///example, binding a new graphics pipeline that uses dynamic viewport
3628 ///requires you to call `cmd_set_viewport` again before drawing.
3629 ///
3630 ///Pipeline binds are relatively cheap, the driver patches command
3631 ///state internally. Minimise binds by sorting draw calls by pipeline
3632 ///when possible, but do not over-optimise at the expense of code
3633 ///clarity.
3634 ///
3635 ///Graphics pipelines can only be bound inside a render pass (or
3636 ///dynamic rendering). Compute pipelines can be bound anywhere.
3637 ///
3638 ///# Guide
3639 ///
3640 ///See [Pipelines](https://hiddentale.github.io/vulkan_rust/concepts/pipelines.html) in the vulkan_rust guide.
3641 pub unsafe fn cmd_bind_pipeline(
3642 &self,
3643 command_buffer: CommandBuffer,
3644 pipeline_bind_point: PipelineBindPoint,
3645 pipeline: Pipeline,
3646 ) {
3647 let fp = self
3648 .commands()
3649 .cmd_bind_pipeline
3650 .expect("vkCmdBindPipeline not loaded");
3651 unsafe { fp(command_buffer, pipeline_bind_point, pipeline) };
3652 }
3653 ///Wraps [`vkCmdSetAttachmentFeedbackLoopEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetAttachmentFeedbackLoopEnableEXT.html).
3654 /**
3655 Provided by **VK_EXT_attachment_feedback_loop_dynamic_state**.*/
3656 ///
3657 ///# Safety
3658 ///- `commandBuffer` (self) must be valid and not destroyed.
3659 ///- `commandBuffer` must be externally synchronized.
3660 ///
3661 ///# Panics
3662 ///Panics if `vkCmdSetAttachmentFeedbackLoopEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3663 ///
3664 ///# Usage Notes
3665 ///
3666 ///Dynamically enables or disables attachment feedback loops for
3667 ///specific image aspects (color, depth, stencil). When enabled,
3668 ///shaders can both read from and write to the same attachment
3669 ///within a render pass.
3670 ///
3671 ///Use with care, feedback loops create read-after-write hazards.
3672 ///The implementation handles coherency when this flag is set.
3673 ///
3674 ///Requires `VK_EXT_attachment_feedback_loop_dynamic_state`.
3675 pub unsafe fn cmd_set_attachment_feedback_loop_enable_ext(
3676 &self,
3677 command_buffer: CommandBuffer,
3678 aspect_mask: ImageAspectFlags,
3679 ) {
3680 let fp = self
3681 .commands()
3682 .cmd_set_attachment_feedback_loop_enable_ext
3683 .expect("vkCmdSetAttachmentFeedbackLoopEnableEXT not loaded");
3684 unsafe { fp(command_buffer, aspect_mask) };
3685 }
3686 ///Wraps [`vkCmdSetViewport`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetViewport.html).
3687 /**
3688 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3689 ///
3690 ///# Safety
3691 ///- `commandBuffer` (self) must be valid and not destroyed.
3692 ///- `commandBuffer` must be externally synchronized.
3693 ///
3694 ///# Panics
3695 ///Panics if `vkCmdSetViewport` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3696 ///
3697 ///# Usage Notes
3698 ///
3699 ///Sets the viewport transform dynamically. Only takes effect if the
3700 ///pipeline was created with `DYNAMIC_STATE_VIEWPORT`.
3701 ///
3702 ///The viewport defines the mapping from normalised device coordinates
3703 ///to framebuffer coordinates. Most applications use a single viewport
3704 ///covering the full render target:
3705 ///
3706 ///```text
3707 ///Viewport { x: 0.0, y: 0.0, width: w, height: h, min_depth: 0.0, max_depth: 1.0 }
3708 ///```
3709 ///
3710 ///**Flipped Y**: Vulkan's clip space has Y pointing downward (unlike
3711 ///OpenGL). To match OpenGL conventions, use a negative height and
3712 ///offset Y by the framebuffer height:
3713 ///`Viewport { y: h, height: -h, ... }`. This requires Vulkan 1.1 or
3714 ///`VK_KHR_maintenance1`.
3715 ///
3716 ///Multiple viewports are supported for multi-view rendering (e.g.
3717 ///VR). The `first_viewport` parameter selects which viewport index to
3718 ///start writing at.
3719 pub unsafe fn cmd_set_viewport(
3720 &self,
3721 command_buffer: CommandBuffer,
3722 first_viewport: u32,
3723 p_viewports: &[Viewport],
3724 ) {
3725 let fp = self
3726 .commands()
3727 .cmd_set_viewport
3728 .expect("vkCmdSetViewport not loaded");
3729 unsafe {
3730 fp(
3731 command_buffer,
3732 first_viewport,
3733 p_viewports.len() as u32,
3734 p_viewports.as_ptr(),
3735 )
3736 };
3737 }
3738 ///Wraps [`vkCmdSetScissor`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetScissor.html).
3739 /**
3740 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3741 ///
3742 ///# Safety
3743 ///- `commandBuffer` (self) must be valid and not destroyed.
3744 ///- `commandBuffer` must be externally synchronized.
3745 ///
3746 ///# Panics
3747 ///Panics if `vkCmdSetScissor` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3748 ///
3749 ///# Usage Notes
3750 ///
3751 ///Sets the scissor rectangle dynamically. Only takes effect if the
3752 ///pipeline was created with `DYNAMIC_STATE_SCISSOR`.
3753 ///
3754 ///The scissor test discards fragments outside the rectangle. Unlike
3755 ///the viewport (which transforms coordinates), the scissor is a
3756 ///hard clip in framebuffer pixel coordinates.
3757 ///
3758 ///A common default is a scissor covering the full framebuffer:
3759 ///
3760 ///```text
3761 ///Rect2D { offset: { x: 0, y: 0 }, extent: { width: w, height: h } }
3762 ///```
3763 ///
3764 ///Scissor rectangles are useful for UI rendering, split-screen, or
3765 ///any case where you want to restrict rendering to a sub-region
3766 ///without changing the viewport transform.
3767 ///
3768 ///The scissor must be set before any draw call when using dynamic
3769 ///scissor state, even if it covers the full framebuffer.
3770 pub unsafe fn cmd_set_scissor(
3771 &self,
3772 command_buffer: CommandBuffer,
3773 first_scissor: u32,
3774 p_scissors: &[Rect2D],
3775 ) {
3776 let fp = self
3777 .commands()
3778 .cmd_set_scissor
3779 .expect("vkCmdSetScissor not loaded");
3780 unsafe {
3781 fp(
3782 command_buffer,
3783 first_scissor,
3784 p_scissors.len() as u32,
3785 p_scissors.as_ptr(),
3786 )
3787 };
3788 }
3789 ///Wraps [`vkCmdSetLineWidth`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetLineWidth.html).
3790 /**
3791 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3792 ///
3793 ///# Safety
3794 ///- `commandBuffer` (self) must be valid and not destroyed.
3795 ///- `commandBuffer` must be externally synchronized.
3796 ///
3797 ///# Panics
3798 ///Panics if `vkCmdSetLineWidth` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3799 ///
3800 ///# Usage Notes
3801 ///
3802 ///Sets the width of rasterised line primitives dynamically. Only takes
3803 ///effect if the pipeline was created with `DYNAMIC_STATE_LINE_WIDTH`.
3804 ///
3805 ///The default line width is 1.0. Wide lines (width > 1.0) require the
3806 ///`wide_lines` device feature, check
3807 ///`physical_device_features.wide_lines` before using.
3808 ///
3809 ///The supported range is device-dependent (query
3810 ///`physical_device_limits.line_width_range`). If `wide_lines` is not
3811 ///supported, only 1.0 is valid.
3812 ///
3813 ///Line width is specified in framebuffer pixels. Anti-aliased lines
3814 ///may be rendered slightly wider than the specified width due to
3815 ///coverage calculations.
3816 pub unsafe fn cmd_set_line_width(&self, command_buffer: CommandBuffer, line_width: f32) {
3817 let fp = self
3818 .commands()
3819 .cmd_set_line_width
3820 .expect("vkCmdSetLineWidth not loaded");
3821 unsafe { fp(command_buffer, line_width) };
3822 }
3823 ///Wraps [`vkCmdSetDepthBias`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthBias.html).
3824 /**
3825 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3826 ///
3827 ///# Safety
3828 ///- `commandBuffer` (self) must be valid and not destroyed.
3829 ///- `commandBuffer` must be externally synchronized.
3830 ///
3831 ///# Panics
3832 ///Panics if `vkCmdSetDepthBias` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3833 ///
3834 ///# Usage Notes
3835 ///
3836 ///Sets depth bias parameters dynamically. Only takes effect if the
3837 ///pipeline was created with `DYNAMIC_STATE_DEPTH_BIAS` and depth bias
3838 ///is enabled in the rasterisation state.
3839 ///
3840 ///Depth bias adds a computed offset to each fragment's depth value
3841 ///before the depth test. The primary use case is **shadow mapping**,
3842 ///biasing shadow caster geometry slightly away from the light prevents
3843 ///self-shadowing artifacts (shadow acne).
3844 ///
3845 ///The final bias is computed as:
3846 ///
3847 ///```text
3848 ///bias = constant_factor * r + slope_factor * max_slope
3849 ///```
3850 ///
3851 ///where `r` is the minimum resolvable depth difference and `max_slope`
3852 ///is the maximum depth slope of the triangle.
3853 ///
3854 ///**`depth_bias_clamp`** limits the maximum bias value. Requires the
3855 ///`depth_bias_clamp` device feature. A clamp of 0.0 disables clamping.
3856 ///
3857 ///Typical shadow map values: `constant_factor` = 1.25,
3858 ///`slope_factor` = 1.75, `clamp` = 0.0. Tune per scene.
3859 pub unsafe fn cmd_set_depth_bias(
3860 &self,
3861 command_buffer: CommandBuffer,
3862 depth_bias_constant_factor: f32,
3863 depth_bias_clamp: f32,
3864 depth_bias_slope_factor: f32,
3865 ) {
3866 let fp = self
3867 .commands()
3868 .cmd_set_depth_bias
3869 .expect("vkCmdSetDepthBias not loaded");
3870 unsafe {
3871 fp(
3872 command_buffer,
3873 depth_bias_constant_factor,
3874 depth_bias_clamp,
3875 depth_bias_slope_factor,
3876 )
3877 };
3878 }
3879 ///Wraps [`vkCmdSetBlendConstants`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetBlendConstants.html).
3880 /**
3881 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3882 ///
3883 ///# Safety
3884 ///- `commandBuffer` (self) must be valid and not destroyed.
3885 ///- `commandBuffer` must be externally synchronized.
3886 ///
3887 ///# Panics
3888 ///Panics if `vkCmdSetBlendConstants` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3889 ///
3890 ///# Usage Notes
3891 ///
3892 ///Sets the constant blend colour used when a blend factor references
3893 ///`BLEND_FACTOR_CONSTANT_COLOR`, `BLEND_FACTOR_CONSTANT_ALPHA`, or
3894 ///their one-minus variants. Only takes effect if the pipeline was
3895 ///created with `DYNAMIC_STATE_BLEND_CONSTANTS`.
3896 ///
3897 ///The four values are RGBA in [0.0, 1.0]. A common use is fading
3898 ///geometry by setting a constant alpha and blending with
3899 ///`BLEND_FACTOR_CONSTANT_ALPHA`.
3900 ///
3901 ///If your pipeline does not use any constant blend factors, you do not
3902 ///need to set this state. The values are ignored for blend modes that
3903 ///do not reference them.
3904 pub unsafe fn cmd_set_blend_constants(
3905 &self,
3906 command_buffer: CommandBuffer,
3907 blend_constants: f32,
3908 ) {
3909 let fp = self
3910 .commands()
3911 .cmd_set_blend_constants
3912 .expect("vkCmdSetBlendConstants not loaded");
3913 unsafe { fp(command_buffer, blend_constants) };
3914 }
3915 ///Wraps [`vkCmdSetDepthBounds`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthBounds.html).
3916 /**
3917 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3918 ///
3919 ///# Safety
3920 ///- `commandBuffer` (self) must be valid and not destroyed.
3921 ///- `commandBuffer` must be externally synchronized.
3922 ///
3923 ///# Panics
3924 ///Panics if `vkCmdSetDepthBounds` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3925 ///
3926 ///# Usage Notes
3927 ///
3928 ///Sets the depth bounds test range dynamically. Only takes effect if
3929 ///the pipeline was created with `DYNAMIC_STATE_DEPTH_BOUNDS` and
3930 ///depth bounds testing is enabled in the depth-stencil state.
3931 ///
3932 ///The depth bounds test discards fragments whose depth buffer value
3933 ///falls outside [`min_depth_bounds`, `max_depth_bounds`]. Note that
3934 ///this tests the **existing** depth buffer value, not the fragment's
3935 ///incoming depth.
3936 ///
3937 ///Use cases are niche:
3938 ///
3939 ///- **Stencil shadow volumes**: reject fragments that are clearly
3940 /// outside the shadow volume's depth range.
3941 ///- **Deferred shading light volumes**: skip fragments outside the
3942 /// light's depth range.
3943 ///
3944 ///Requires the `depth_bounds` device feature. Not supported on all
3945 ///hardware, check `physical_device_features.depth_bounds` before
3946 ///enabling.
3947 pub unsafe fn cmd_set_depth_bounds(
3948 &self,
3949 command_buffer: CommandBuffer,
3950 min_depth_bounds: f32,
3951 max_depth_bounds: f32,
3952 ) {
3953 let fp = self
3954 .commands()
3955 .cmd_set_depth_bounds
3956 .expect("vkCmdSetDepthBounds not loaded");
3957 unsafe { fp(command_buffer, min_depth_bounds, max_depth_bounds) };
3958 }
3959 ///Wraps [`vkCmdSetStencilCompareMask`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetStencilCompareMask.html).
3960 /**
3961 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3962 ///
3963 ///# Safety
3964 ///- `commandBuffer` (self) must be valid and not destroyed.
3965 ///- `commandBuffer` must be externally synchronized.
3966 ///
3967 ///# Panics
3968 ///Panics if `vkCmdSetStencilCompareMask` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3969 ///
3970 ///# Usage Notes
3971 ///
3972 ///Sets the stencil compare mask dynamically for front-facing,
3973 ///back-facing, or both face sets. Only takes effect if the pipeline
3974 ///was created with `DYNAMIC_STATE_STENCIL_COMPARE_MASK`.
3975 ///
3976 ///The compare mask is ANDed with both the reference value and the
3977 ///stencil buffer value before the stencil comparison. This lets you
3978 ///use individual bits of the stencil buffer for different purposes
3979 ///(e.g. bit 0 for portals, bits 1–3 for decal layers).
3980 ///
3981 ///A mask of `0xFF` (the default) uses all 8 bits of the stencil
3982 ///buffer. Narrower masks isolate specific bit planes for multi-purpose
3983 ///stencil schemes.
3984 pub unsafe fn cmd_set_stencil_compare_mask(
3985 &self,
3986 command_buffer: CommandBuffer,
3987 face_mask: StencilFaceFlags,
3988 compare_mask: u32,
3989 ) {
3990 let fp = self
3991 .commands()
3992 .cmd_set_stencil_compare_mask
3993 .expect("vkCmdSetStencilCompareMask not loaded");
3994 unsafe { fp(command_buffer, face_mask, compare_mask) };
3995 }
3996 ///Wraps [`vkCmdSetStencilWriteMask`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetStencilWriteMask.html).
3997 /**
3998 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3999 ///
4000 ///# Safety
4001 ///- `commandBuffer` (self) must be valid and not destroyed.
4002 ///- `commandBuffer` must be externally synchronized.
4003 ///
4004 ///# Panics
4005 ///Panics if `vkCmdSetStencilWriteMask` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4006 ///
4007 ///# Usage Notes
4008 ///
4009 ///Sets the stencil write mask dynamically for front-facing,
4010 ///back-facing, or both face sets. Only takes effect if the pipeline
4011 ///was created with `DYNAMIC_STATE_STENCIL_WRITE_MASK`.
4012 ///
4013 ///The write mask controls which bits of the stencil buffer are updated
4014 ///by stencil operations (`KEEP`, `REPLACE`, `INCREMENT`, etc.). Bits
4015 ///that are zero in the mask are left unchanged.
4016 ///
4017 ///A mask of `0xFF` writes all 8 bits. Use narrower masks when
4018 ///different rendering passes own different stencil bit planes.
4019 pub unsafe fn cmd_set_stencil_write_mask(
4020 &self,
4021 command_buffer: CommandBuffer,
4022 face_mask: StencilFaceFlags,
4023 write_mask: u32,
4024 ) {
4025 let fp = self
4026 .commands()
4027 .cmd_set_stencil_write_mask
4028 .expect("vkCmdSetStencilWriteMask not loaded");
4029 unsafe { fp(command_buffer, face_mask, write_mask) };
4030 }
4031 ///Wraps [`vkCmdSetStencilReference`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetStencilReference.html).
4032 /**
4033 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
4034 ///
4035 ///# Safety
4036 ///- `commandBuffer` (self) must be valid and not destroyed.
4037 ///- `commandBuffer` must be externally synchronized.
4038 ///
4039 ///# Panics
4040 ///Panics if `vkCmdSetStencilReference` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4041 ///
4042 ///# Usage Notes
4043 ///
4044 ///Sets the stencil reference value dynamically for front-facing,
4045 ///back-facing, or both face sets. Only takes effect if the pipeline
4046 ///was created with `DYNAMIC_STATE_STENCIL_REFERENCE`.
4047 ///
4048 ///The reference value is used in stencil comparison operations (e.g.
4049 ///`COMPARE_OP_EQUAL` compares the masked buffer value against the
4050 ///masked reference) and as the source value for `STENCIL_OP_REPLACE`.
4051 ///
4052 ///Common patterns:
4053 ///
4054 ///- **Portal/mirror rendering**: set reference to a unique ID per
4055 /// portal, write it with `STENCIL_OP_REPLACE`, then test with
4056 /// `COMPARE_OP_EQUAL` to mask subsequent draws to that portal's
4057 /// region.
4058 ///- **Decal layering**: increment the reference per layer.
4059 pub unsafe fn cmd_set_stencil_reference(
4060 &self,
4061 command_buffer: CommandBuffer,
4062 face_mask: StencilFaceFlags,
4063 reference: u32,
4064 ) {
4065 let fp = self
4066 .commands()
4067 .cmd_set_stencil_reference
4068 .expect("vkCmdSetStencilReference not loaded");
4069 unsafe { fp(command_buffer, face_mask, reference) };
4070 }
4071 ///Wraps [`vkCmdBindDescriptorSets`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindDescriptorSets.html).
4072 /**
4073 Provided by **VK_COMPUTE_VERSION_1_0**.*/
4074 ///
4075 ///# Safety
4076 ///- `commandBuffer` (self) must be valid and not destroyed.
4077 ///- `commandBuffer` must be externally synchronized.
4078 ///
4079 ///# Panics
4080 ///Panics if `vkCmdBindDescriptorSets` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4081 ///
4082 ///# Usage Notes
4083 ///
4084 ///Binds one or more descriptor sets to a command buffer at specified
4085 ///set indices. Subsequent draw or dispatch calls read resources from
4086 ///these bound sets.
4087 ///
4088 ///**`first_set`**: the set index at which binding starts. Sets at
4089 ///lower indices are not disturbed. This lets you bind per-frame data
4090 ///at set 0 once and rebind only per-material or per-object sets at
4091 ///higher indices.
4092 ///
4093 ///**Dynamic offsets**: for descriptors of type
4094 ///`UNIFORM_BUFFER_DYNAMIC` or `STORAGE_BUFFER_DYNAMIC`, the
4095 ///`dynamic_offsets` slice provides byte offsets applied at bind time.
4096 ///This lets multiple draw calls share a single large buffer with
4097 ///different sub-regions without updating the descriptor set.
4098 ///
4099 ///The bound pipeline layout and the descriptor set layouts must be
4100 ///compatible, same binding layout at each set index. Binding a set
4101 ///with an incompatible layout is undefined behaviour.
4102 pub unsafe fn cmd_bind_descriptor_sets(
4103 &self,
4104 command_buffer: CommandBuffer,
4105 pipeline_bind_point: PipelineBindPoint,
4106 layout: PipelineLayout,
4107 first_set: u32,
4108 p_descriptor_sets: &[DescriptorSet],
4109 p_dynamic_offsets: &[u32],
4110 ) {
4111 let fp = self
4112 .commands()
4113 .cmd_bind_descriptor_sets
4114 .expect("vkCmdBindDescriptorSets not loaded");
4115 unsafe {
4116 fp(
4117 command_buffer,
4118 pipeline_bind_point,
4119 layout,
4120 first_set,
4121 p_descriptor_sets.len() as u32,
4122 p_descriptor_sets.as_ptr(),
4123 p_dynamic_offsets.len() as u32,
4124 p_dynamic_offsets.as_ptr(),
4125 )
4126 };
4127 }
4128 ///Wraps [`vkCmdBindIndexBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindIndexBuffer.html).
4129 /**
4130 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
4131 ///
4132 ///# Safety
4133 ///- `commandBuffer` (self) must be valid and not destroyed.
4134 ///- `commandBuffer` must be externally synchronized.
4135 ///
4136 ///# Panics
4137 ///Panics if `vkCmdBindIndexBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4138 ///
4139 ///# Usage Notes
4140 ///
4141 ///Binds an index buffer for subsequent indexed draw calls
4142 ///(`cmd_draw_indexed`, `cmd_draw_indexed_indirect`).
4143 ///
4144 ///**Index type**:
4145 ///
4146 ///- `INDEX_TYPE_UINT16`: 2 bytes per index. Good for meshes with
4147 /// fewer than 65536 vertices, saves memory bandwidth.
4148 ///- `INDEX_TYPE_UINT32`: 4 bytes per index. Required for large meshes.
4149 ///- `INDEX_TYPE_UINT8_KHR` (extension): 1 byte per index for very
4150 /// small meshes.
4151 ///
4152 ///The buffer must have been created with `BUFFER_USAGE_INDEX_BUFFER`.
4153 ///The `offset` must be a multiple of the index type size (2 for
4154 ///UINT16, 4 for UINT32).
4155 ///
4156 ///Only one index buffer can be bound at a time, binding a new one
4157 ///replaces the previous binding.
4158 pub unsafe fn cmd_bind_index_buffer(
4159 &self,
4160 command_buffer: CommandBuffer,
4161 buffer: Buffer,
4162 offset: u64,
4163 index_type: IndexType,
4164 ) {
4165 let fp = self
4166 .commands()
4167 .cmd_bind_index_buffer
4168 .expect("vkCmdBindIndexBuffer not loaded");
4169 unsafe { fp(command_buffer, buffer, offset, index_type) };
4170 }
4171 ///Wraps [`vkCmdBindVertexBuffers`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindVertexBuffers.html).
4172 /**
4173 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
4174 ///
4175 ///# Safety
4176 ///- `commandBuffer` (self) must be valid and not destroyed.
4177 ///- `commandBuffer` must be externally synchronized.
4178 ///
4179 ///# Panics
4180 ///Panics if `vkCmdBindVertexBuffers` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4181 ///
4182 ///# Usage Notes
4183 ///
4184 ///Binds one or more vertex buffers to input binding slots for
4185 ///subsequent draw calls.
4186 ///
4187 ///**`first_binding`**: the binding slot index to start at. Binding
4188 ///slots are defined in the pipeline's vertex input state. Multiple
4189 ///buffers can be bound to consecutive slots in a single call.
4190 ///
4191 ///**Interleaved vs separate**: a single buffer with interleaved
4192 ///attributes (position + normal + UV) uses one binding slot. Separate
4193 ///attribute streams (one buffer per attribute) use multiple slots.
4194 ///Interleaved is generally more cache-friendly.
4195 ///
4196 ///Buffers must have been created with `BUFFER_USAGE_VERTEX_BUFFER`.
4197 ///The `offsets` array specifies the byte offset within each buffer
4198 ///where vertex data starts.
4199 ///
4200 ///For Vulkan 1.3+, `cmd_bind_vertex_buffers2` also lets you set
4201 ///buffer sizes and strides dynamically.
4202 pub unsafe fn cmd_bind_vertex_buffers(
4203 &self,
4204 command_buffer: CommandBuffer,
4205 first_binding: u32,
4206 p_buffers: &[Buffer],
4207 p_offsets: &u64,
4208 ) {
4209 let fp = self
4210 .commands()
4211 .cmd_bind_vertex_buffers
4212 .expect("vkCmdBindVertexBuffers not loaded");
4213 unsafe {
4214 fp(
4215 command_buffer,
4216 first_binding,
4217 p_buffers.len() as u32,
4218 p_buffers.as_ptr(),
4219 p_offsets,
4220 )
4221 };
4222 }
4223 ///Wraps [`vkCmdDraw`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDraw.html).
4224 /**
4225 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
4226 ///
4227 ///# Safety
4228 ///- `commandBuffer` (self) must be valid and not destroyed.
4229 ///- `commandBuffer` must be externally synchronized.
4230 ///
4231 ///# Panics
4232 ///Panics if `vkCmdDraw` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4233 ///
4234 ///# Usage Notes
4235 ///
4236 ///Records a non-indexed draw call. Vertices are generated sequentially
4237 ///from `first_vertex` to `first_vertex + vertex_count - 1`.
4238 ///
4239 ///**Parameters**:
4240 ///
4241 ///- `vertex_count`: number of vertices to draw.
4242 ///- `instance_count`: number of instances. Use 1 for non-instanced
4243 /// drawing.
4244 ///- `first_vertex`: offset into the vertex buffer (added to
4245 /// `gl_VertexIndex` in the shader).
4246 ///- `first_instance`: offset into instance data (added to
4247 /// `gl_InstanceIndex`). Requires the `first_instance` feature if
4248 /// non-zero.
4249 ///
4250 ///For indexed geometry (the common case for meshes), use
4251 ///`cmd_draw_indexed` instead. `cmd_draw` is typically used for
4252 ///full-screen quads, procedural geometry, or particle systems where
4253 ///vertices are generated in the shader.
4254 ///
4255 ///# Guide
4256 ///
4257 ///See [Command Buffers](https://hiddentale.github.io/vulkan_rust/concepts/command-buffers.html) in the vulkan_rust guide.
4258 pub unsafe fn cmd_draw(
4259 &self,
4260 command_buffer: CommandBuffer,
4261 vertex_count: u32,
4262 instance_count: u32,
4263 first_vertex: u32,
4264 first_instance: u32,
4265 ) {
4266 let fp = self.commands().cmd_draw.expect("vkCmdDraw not loaded");
4267 unsafe {
4268 fp(
4269 command_buffer,
4270 vertex_count,
4271 instance_count,
4272 first_vertex,
4273 first_instance,
4274 )
4275 };
4276 }
4277 ///Wraps [`vkCmdDrawIndexed`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndexed.html).
4278 /**
4279 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
4280 ///
4281 ///# Safety
4282 ///- `commandBuffer` (self) must be valid and not destroyed.
4283 ///- `commandBuffer` must be externally synchronized.
4284 ///
4285 ///# Panics
4286 ///Panics if `vkCmdDrawIndexed` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4287 ///
4288 ///# Usage Notes
4289 ///
4290 ///Records an indexed draw call, the standard way to draw meshes.
4291 ///Indices are read from the bound index buffer, and each index is used
4292 ///to fetch vertex attributes from the bound vertex buffers.
4293 ///
4294 ///**Parameters**:
4295 ///
4296 ///- `index_count`: number of indices to read.
4297 ///- `instance_count`: number of instances. Use 1 for non-instanced.
4298 ///- `first_index`: offset into the index buffer (in units of indices,
4299 /// not bytes).
4300 ///- `vertex_offset`: added to each index value before fetching the
4301 /// vertex. Useful for packing multiple meshes into a single vertex
4302 /// buffer at different offsets.
4303 ///- `first_instance`: offset into instance data.
4304 ///
4305 ///Indexed drawing reuses vertices via the index buffer, saving memory
4306 ///and bandwidth compared to non-indexed draws for any mesh with shared
4307 ///vertices (which is nearly all of them).
4308 pub unsafe fn cmd_draw_indexed(
4309 &self,
4310 command_buffer: CommandBuffer,
4311 index_count: u32,
4312 instance_count: u32,
4313 first_index: u32,
4314 vertex_offset: i32,
4315 first_instance: u32,
4316 ) {
4317 let fp = self
4318 .commands()
4319 .cmd_draw_indexed
4320 .expect("vkCmdDrawIndexed not loaded");
4321 unsafe {
4322 fp(
4323 command_buffer,
4324 index_count,
4325 instance_count,
4326 first_index,
4327 vertex_offset,
4328 first_instance,
4329 )
4330 };
4331 }
4332 ///Wraps [`vkCmdDrawMultiEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMultiEXT.html).
4333 /**
4334 Provided by **VK_EXT_multi_draw**.*/
4335 ///
4336 ///# Safety
4337 ///- `commandBuffer` (self) must be valid and not destroyed.
4338 ///- `commandBuffer` must be externally synchronized.
4339 ///
4340 ///# Panics
4341 ///Panics if `vkCmdDrawMultiEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4342 ///
4343 ///# Usage Notes
4344 ///
4345 ///Draws multiple non-indexed draw calls from an array of
4346 ///`MultiDrawInfoEXT` (first_vertex, vertex_count pairs). More
4347 ///efficient than issuing separate `cmd_draw` calls because the
4348 ///driver can batch them.
4349 ///
4350 ///Requires `VK_EXT_multi_draw` and the `multiDraw` feature.
4351 pub unsafe fn cmd_draw_multi_ext(
4352 &self,
4353 command_buffer: CommandBuffer,
4354 p_vertex_info: &[MultiDrawInfoEXT],
4355 instance_count: u32,
4356 first_instance: u32,
4357 stride: u32,
4358 ) {
4359 let fp = self
4360 .commands()
4361 .cmd_draw_multi_ext
4362 .expect("vkCmdDrawMultiEXT not loaded");
4363 unsafe {
4364 fp(
4365 command_buffer,
4366 p_vertex_info.len() as u32,
4367 p_vertex_info.as_ptr(),
4368 instance_count,
4369 first_instance,
4370 stride,
4371 )
4372 };
4373 }
4374 ///Wraps [`vkCmdDrawMultiIndexedEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMultiIndexedEXT.html).
4375 /**
4376 Provided by **VK_EXT_multi_draw**.*/
4377 ///
4378 ///# Safety
4379 ///- `commandBuffer` (self) must be valid and not destroyed.
4380 ///- `commandBuffer` must be externally synchronized.
4381 ///
4382 ///# Panics
4383 ///Panics if `vkCmdDrawMultiIndexedEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4384 ///
4385 ///# Usage Notes
4386 ///
4387 ///Draws multiple indexed draw calls from an array of
4388 ///`MultiDrawIndexedInfoEXT` (first_index, index_count,
4389 ///vertex_offset triples). More efficient than separate
4390 ///`cmd_draw_indexed` calls.
4391 ///
4392 ///An optional `p_vertex_offset` overrides all per-draw vertex
4393 ///offsets with a single value.
4394 ///
4395 ///Requires `VK_EXT_multi_draw` and the `multiDraw` feature.
4396 pub unsafe fn cmd_draw_multi_indexed_ext(
4397 &self,
4398 command_buffer: CommandBuffer,
4399 p_index_info: &[MultiDrawIndexedInfoEXT],
4400 instance_count: u32,
4401 first_instance: u32,
4402 stride: u32,
4403 p_vertex_offset: *const i32,
4404 ) {
4405 let fp = self
4406 .commands()
4407 .cmd_draw_multi_indexed_ext
4408 .expect("vkCmdDrawMultiIndexedEXT not loaded");
4409 unsafe {
4410 fp(
4411 command_buffer,
4412 p_index_info.len() as u32,
4413 p_index_info.as_ptr(),
4414 instance_count,
4415 first_instance,
4416 stride,
4417 p_vertex_offset,
4418 )
4419 };
4420 }
4421 ///Wraps [`vkCmdDrawIndirect`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndirect.html).
4422 /**
4423 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
4424 ///
4425 ///# Safety
4426 ///- `commandBuffer` (self) must be valid and not destroyed.
4427 ///- `commandBuffer` must be externally synchronized.
4428 ///
4429 ///# Panics
4430 ///Panics if `vkCmdDrawIndirect` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4431 ///
4432 ///# Usage Notes
4433 ///
4434 ///Records one or more non-indexed draw calls whose parameters are read
4435 ///from a GPU buffer at execution time rather than baked into the
4436 ///command buffer.
4437 ///
4438 ///Each `DrawIndirectCommand` in the buffer contains `vertex_count`,
4439 ///`instance_count`, `first_vertex`, and `first_instance`, the same
4440 ///parameters as `cmd_draw`.
4441 ///
4442 ///**Use cases**:
4443 ///
4444 ///- **GPU-driven rendering**: a compute shader fills the indirect
4445 /// buffer with draw parameters (e.g. after culling), and the GPU
4446 /// draws without CPU round-trips.
4447 ///- **Conditional draw counts**: pair with
4448 /// `cmd_draw_indirect_count` (Vulkan 1.2) to have the GPU also
4449 /// determine how many draws to execute.
4450 ///
4451 ///The buffer must have been created with
4452 ///`BUFFER_USAGE_INDIRECT_BUFFER`. The `stride` between commands must
4453 ///be at least `sizeof(DrawIndirectCommand)` (16 bytes) and a
4454 ///multiple of 4.
4455 pub unsafe fn cmd_draw_indirect(
4456 &self,
4457 command_buffer: CommandBuffer,
4458 buffer: Buffer,
4459 offset: u64,
4460 draw_count: u32,
4461 stride: u32,
4462 ) {
4463 let fp = self
4464 .commands()
4465 .cmd_draw_indirect
4466 .expect("vkCmdDrawIndirect not loaded");
4467 unsafe { fp(command_buffer, buffer, offset, draw_count, stride) };
4468 }
4469 ///Wraps [`vkCmdDrawIndexedIndirect`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndexedIndirect.html).
4470 /**
4471 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
4472 ///
4473 ///# Safety
4474 ///- `commandBuffer` (self) must be valid and not destroyed.
4475 ///- `commandBuffer` must be externally synchronized.
4476 ///
4477 ///# Panics
4478 ///Panics if `vkCmdDrawIndexedIndirect` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4479 ///
4480 ///# Usage Notes
4481 ///
4482 ///Records one or more indexed draw calls whose parameters are read
4483 ///from a GPU buffer. Each `DrawIndexedIndirectCommand` contains
4484 ///`index_count`, `instance_count`, `first_index`, `vertex_offset`,
4485 ///and `first_instance`.
4486 ///
4487 ///This is the indexed counterpart to `cmd_draw_indirect` and the most
4488 ///common indirect draw call for GPU-driven rendering pipelines. A
4489 ///compute shader performs culling and writes surviving draw commands
4490 ///into the buffer; the GPU then draws them without CPU involvement.
4491 ///
4492 ///The buffer must have `BUFFER_USAGE_INDIRECT_BUFFER`. The `stride`
4493 ///must be at least `sizeof(DrawIndexedIndirectCommand)` (20 bytes)
4494 ///and a multiple of 4.
4495 ///
4496 ///For dynamic draw counts, use `cmd_draw_indexed_indirect_count`
4497 ///(Vulkan 1.2).
4498 pub unsafe fn cmd_draw_indexed_indirect(
4499 &self,
4500 command_buffer: CommandBuffer,
4501 buffer: Buffer,
4502 offset: u64,
4503 draw_count: u32,
4504 stride: u32,
4505 ) {
4506 let fp = self
4507 .commands()
4508 .cmd_draw_indexed_indirect
4509 .expect("vkCmdDrawIndexedIndirect not loaded");
4510 unsafe { fp(command_buffer, buffer, offset, draw_count, stride) };
4511 }
4512 ///Wraps [`vkCmdDispatch`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDispatch.html).
4513 /**
4514 Provided by **VK_COMPUTE_VERSION_1_0**.*/
4515 ///
4516 ///# Safety
4517 ///- `commandBuffer` (self) must be valid and not destroyed.
4518 ///- `commandBuffer` must be externally synchronized.
4519 ///
4520 ///# Panics
4521 ///Panics if `vkCmdDispatch` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4522 ///
4523 ///# Usage Notes
4524 ///
4525 ///Launches a compute shader with the given number of workgroups in
4526 ///X, Y, and Z dimensions. The total number of invocations is
4527 ///`group_count * local_size` (defined in the shader's `local_size_x`,
4528 ///`local_size_y`, `local_size_z`).
4529 ///
4530 ///A compute pipeline must be bound before calling this. Compute
4531 ///dispatches can be recorded outside a render pass.
4532 ///
4533 ///**Sizing**: to process an image of `width × height` pixels with a
4534 ///local size of 16×16, dispatch
4535 ///`ceil(width / 16) × ceil(height / 16) × 1` workgroups.
4536 ///
4537 ///**Limits**: each dimension is capped by
4538 ///`max_compute_work_group_count` (at least 65535 per axis). The total
4539 ///invocations per workgroup are capped by
4540 ///`max_compute_work_group_invocations` (at least 128).
4541 ///
4542 ///For GPU-driven dispatch counts, use `cmd_dispatch_indirect`.
4543 pub unsafe fn cmd_dispatch(
4544 &self,
4545 command_buffer: CommandBuffer,
4546 group_count_x: u32,
4547 group_count_y: u32,
4548 group_count_z: u32,
4549 ) {
4550 let fp = self
4551 .commands()
4552 .cmd_dispatch
4553 .expect("vkCmdDispatch not loaded");
4554 unsafe { fp(command_buffer, group_count_x, group_count_y, group_count_z) };
4555 }
4556 ///Wraps [`vkCmdDispatchIndirect`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDispatchIndirect.html).
4557 /**
4558 Provided by **VK_COMPUTE_VERSION_1_0**.*/
4559 ///
4560 ///# Safety
4561 ///- `commandBuffer` (self) must be valid and not destroyed.
4562 ///- `commandBuffer` must be externally synchronized.
4563 ///
4564 ///# Panics
4565 ///Panics if `vkCmdDispatchIndirect` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4566 ///
4567 ///# Usage Notes
4568 ///
4569 ///Launches a compute shader with workgroup counts read from a GPU
4570 ///buffer. The buffer contains a `DispatchIndirectCommand` with
4571 ///`group_count_x`, `group_count_y`, `group_count_z`.
4572 ///
4573 ///Use this when a prior compute pass determines how much work to do,
4574 ///for example, a culling pass writes the surviving workgroup count
4575 ///for a subsequent processing pass.
4576 ///
4577 ///The buffer must have `BUFFER_USAGE_INDIRECT_BUFFER`. The offset must
4578 ///be a multiple of 4.
4579 ///
4580 ///The same workgroup count limits apply as for `cmd_dispatch`.
4581 pub unsafe fn cmd_dispatch_indirect(
4582 &self,
4583 command_buffer: CommandBuffer,
4584 buffer: Buffer,
4585 offset: u64,
4586 ) {
4587 let fp = self
4588 .commands()
4589 .cmd_dispatch_indirect
4590 .expect("vkCmdDispatchIndirect not loaded");
4591 unsafe { fp(command_buffer, buffer, offset) };
4592 }
4593 ///Wraps [`vkCmdSubpassShadingHUAWEI`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSubpassShadingHUAWEI.html).
4594 /**
4595 Provided by **VK_HUAWEI_subpass_shading**.*/
4596 ///
4597 ///# Safety
4598 ///- `commandBuffer` (self) must be valid and not destroyed.
4599 ///- `commandBuffer` must be externally synchronized.
4600 ///
4601 ///# Panics
4602 ///Panics if `vkCmdSubpassShadingHUAWEI` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4603 ///
4604 ///# Usage Notes
4605 ///
4606 ///Dispatches subpass shading work within the current subpass.
4607 ///Subpass shading runs compute-like shaders that have access to
4608 ///input attachments at the fragment's location, combining the
4609 ///efficiency of compute with the data locality of subpasses.
4610 ///
4611 ///Requires `VK_HUAWEI_subpass_shading`.
4612 pub unsafe fn cmd_subpass_shading_huawei(&self, command_buffer: CommandBuffer) {
4613 let fp = self
4614 .commands()
4615 .cmd_subpass_shading_huawei
4616 .expect("vkCmdSubpassShadingHUAWEI not loaded");
4617 unsafe { fp(command_buffer) };
4618 }
4619 ///Wraps [`vkCmdDrawClusterHUAWEI`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawClusterHUAWEI.html).
4620 /**
4621 Provided by **VK_HUAWEI_cluster_culling_shader**.*/
4622 ///
4623 ///# Safety
4624 ///- `commandBuffer` (self) must be valid and not destroyed.
4625 ///- `commandBuffer` must be externally synchronized.
4626 ///
4627 ///# Panics
4628 ///Panics if `vkCmdDrawClusterHUAWEI` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4629 ///
4630 ///# Usage Notes
4631 ///
4632 ///Dispatches cluster culling shader workgroups using the Huawei
4633 ///cluster culling shader pipeline. The group counts specify the
4634 ///3D dispatch dimensions, similar to `cmd_dispatch`.
4635 ///
4636 ///Requires `VK_HUAWEI_cluster_culling_shader`.
4637 pub unsafe fn cmd_draw_cluster_huawei(
4638 &self,
4639 command_buffer: CommandBuffer,
4640 group_count_x: u32,
4641 group_count_y: u32,
4642 group_count_z: u32,
4643 ) {
4644 let fp = self
4645 .commands()
4646 .cmd_draw_cluster_huawei
4647 .expect("vkCmdDrawClusterHUAWEI not loaded");
4648 unsafe { fp(command_buffer, group_count_x, group_count_y, group_count_z) };
4649 }
4650 ///Wraps [`vkCmdDrawClusterIndirectHUAWEI`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawClusterIndirectHUAWEI.html).
4651 /**
4652 Provided by **VK_HUAWEI_cluster_culling_shader**.*/
4653 ///
4654 ///# Safety
4655 ///- `commandBuffer` (self) must be valid and not destroyed.
4656 ///- `commandBuffer` must be externally synchronized.
4657 ///
4658 ///# Panics
4659 ///Panics if `vkCmdDrawClusterIndirectHUAWEI` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4660 ///
4661 ///# Usage Notes
4662 ///
4663 ///Indirect variant of `cmd_draw_cluster_huawei`. Reads the cluster
4664 ///dispatch parameters from a buffer at the given offset, allowing
4665 ///GPU-driven cluster culling without CPU readback.
4666 ///
4667 ///Requires `VK_HUAWEI_cluster_culling_shader`.
4668 pub unsafe fn cmd_draw_cluster_indirect_huawei(
4669 &self,
4670 command_buffer: CommandBuffer,
4671 buffer: Buffer,
4672 offset: u64,
4673 ) {
4674 let fp = self
4675 .commands()
4676 .cmd_draw_cluster_indirect_huawei
4677 .expect("vkCmdDrawClusterIndirectHUAWEI not loaded");
4678 unsafe { fp(command_buffer, buffer, offset) };
4679 }
4680 ///Wraps [`vkCmdUpdatePipelineIndirectBufferNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdUpdatePipelineIndirectBufferNV.html).
4681 /**
4682 Provided by **VK_NV_device_generated_commands_compute**.*/
4683 ///
4684 ///# Safety
4685 ///- `commandBuffer` (self) must be valid and not destroyed.
4686 ///- `commandBuffer` must be externally synchronized.
4687 ///
4688 ///# Panics
4689 ///Panics if `vkCmdUpdatePipelineIndirectBufferNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4690 ///
4691 ///# Usage Notes
4692 ///
4693 ///Updates the indirect dispatch parameters for a compute pipeline
4694 ///in a GPU buffer. Used with device-generated compute commands so
4695 ///the GPU can dispatch compute pipelines indirectly.
4696 ///
4697 ///Requires `VK_NV_device_generated_commands_compute`.
4698 pub unsafe fn cmd_update_pipeline_indirect_buffer_nv(
4699 &self,
4700 command_buffer: CommandBuffer,
4701 pipeline_bind_point: PipelineBindPoint,
4702 pipeline: Pipeline,
4703 ) {
4704 let fp = self
4705 .commands()
4706 .cmd_update_pipeline_indirect_buffer_nv
4707 .expect("vkCmdUpdatePipelineIndirectBufferNV not loaded");
4708 unsafe { fp(command_buffer, pipeline_bind_point, pipeline) };
4709 }
4710 ///Wraps [`vkCmdCopyBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyBuffer.html).
4711 /**
4712 Provided by **VK_BASE_VERSION_1_0**.*/
4713 ///
4714 ///# Safety
4715 ///- `commandBuffer` (self) must be valid and not destroyed.
4716 ///- `commandBuffer` must be externally synchronized.
4717 ///
4718 ///# Panics
4719 ///Panics if `vkCmdCopyBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4720 ///
4721 ///# Usage Notes
4722 ///
4723 ///Copies data between two buffers. Multiple regions can be copied in
4724 ///a single call. Must be recorded outside a render pass.
4725 ///
4726 ///Common patterns:
4727 ///
4728 ///- **Staging upload**: copy from a host-visible staging buffer to a
4729 /// device-local buffer. This is the standard way to get vertex,
4730 /// index, and uniform data onto the GPU.
4731 ///- **Buffer-to-buffer transfers**: defragment or reorganise GPU data.
4732 ///
4733 ///Source and destination regions must not overlap within the same
4734 ///buffer. Use a temporary staging buffer if you need to shift data
4735 ///within a single buffer.
4736 ///
4737 ///For Vulkan 1.3+, prefer `cmd_copy_buffer2` which uses an extensible
4738 ///`CopyBufferInfo2` struct.
4739 pub unsafe fn cmd_copy_buffer(
4740 &self,
4741 command_buffer: CommandBuffer,
4742 src_buffer: Buffer,
4743 dst_buffer: Buffer,
4744 p_regions: &[BufferCopy],
4745 ) {
4746 let fp = self
4747 .commands()
4748 .cmd_copy_buffer
4749 .expect("vkCmdCopyBuffer not loaded");
4750 unsafe {
4751 fp(
4752 command_buffer,
4753 src_buffer,
4754 dst_buffer,
4755 p_regions.len() as u32,
4756 p_regions.as_ptr(),
4757 )
4758 };
4759 }
4760 ///Wraps [`vkCmdCopyImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyImage.html).
4761 /**
4762 Provided by **VK_BASE_VERSION_1_0**.*/
4763 ///
4764 ///# Safety
4765 ///- `commandBuffer` (self) must be valid and not destroyed.
4766 ///- `commandBuffer` must be externally synchronized.
4767 ///
4768 ///# Panics
4769 ///Panics if `vkCmdCopyImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4770 ///
4771 ///# Usage Notes
4772 ///
4773 ///Copies texel data between two images. Both images must have been
4774 ///created with `TRANSFER_SRC` and `TRANSFER_DST` usage respectively,
4775 ///and must be in compatible layouts (`TRANSFER_SRC_OPTIMAL` /
4776 ///`TRANSFER_DST_OPTIMAL` or `GENERAL`).
4777 ///
4778 ///The source and destination formats must be identical, or both must
4779 ///be in the same size-compatibility class. For format conversion, use
4780 ///`cmd_blit_image` instead.
4781 ///
4782 ///Copy operates on raw texel blocks, no filtering or scaling. The
4783 ///extent must be aligned to the texel block size for compressed
4784 ///formats.
4785 ///
4786 ///Must be recorded outside a render pass. For Vulkan 1.3+, prefer
4787 ///`cmd_copy_image2`.
4788 pub unsafe fn cmd_copy_image(
4789 &self,
4790 command_buffer: CommandBuffer,
4791 src_image: Image,
4792 src_image_layout: ImageLayout,
4793 dst_image: Image,
4794 dst_image_layout: ImageLayout,
4795 p_regions: &[ImageCopy],
4796 ) {
4797 let fp = self
4798 .commands()
4799 .cmd_copy_image
4800 .expect("vkCmdCopyImage not loaded");
4801 unsafe {
4802 fp(
4803 command_buffer,
4804 src_image,
4805 src_image_layout,
4806 dst_image,
4807 dst_image_layout,
4808 p_regions.len() as u32,
4809 p_regions.as_ptr(),
4810 )
4811 };
4812 }
4813 ///Wraps [`vkCmdBlitImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBlitImage.html).
4814 /**
4815 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
4816 ///
4817 ///# Safety
4818 ///- `commandBuffer` (self) must be valid and not destroyed.
4819 ///- `commandBuffer` must be externally synchronized.
4820 ///
4821 ///# Panics
4822 ///Panics if `vkCmdBlitImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4823 ///
4824 ///# Usage Notes
4825 ///
4826 ///Copies a region between two images with optional scaling and format
4827 ///conversion. Unlike `cmd_copy_image`, blit supports different source
4828 ///and destination extents (scaling) and applies a filter.
4829 ///
4830 ///**Filters**:
4831 ///
4832 ///- `FILTER_NEAREST`: no interpolation. Fast, but produces blocky
4833 /// results when scaling.
4834 ///- `FILTER_LINEAR`: bilinear interpolation. Smooth scaling. Requires
4835 /// the format to support `FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR`.
4836 ///
4837 ///Common uses:
4838 ///
4839 ///- **Mipmap generation**: blit each mip level from the previous one,
4840 /// halving dimensions each step.
4841 ///- **Resolve or downscale**: blit a high-resolution offscreen image
4842 /// to a smaller swapchain image.
4843 ///
4844 ///Both images must be in appropriate transfer layouts. Must be recorded
4845 ///outside a render pass. For Vulkan 1.3+, prefer `cmd_blit_image2`.
4846 ///
4847 ///Not supported for depth/stencil or compressed formats. Use
4848 ///`cmd_copy_image` or `cmd_resolve_image` for those.
4849 pub unsafe fn cmd_blit_image(
4850 &self,
4851 command_buffer: CommandBuffer,
4852 src_image: Image,
4853 src_image_layout: ImageLayout,
4854 dst_image: Image,
4855 dst_image_layout: ImageLayout,
4856 p_regions: &[ImageBlit],
4857 filter: Filter,
4858 ) {
4859 let fp = self
4860 .commands()
4861 .cmd_blit_image
4862 .expect("vkCmdBlitImage not loaded");
4863 unsafe {
4864 fp(
4865 command_buffer,
4866 src_image,
4867 src_image_layout,
4868 dst_image,
4869 dst_image_layout,
4870 p_regions.len() as u32,
4871 p_regions.as_ptr(),
4872 filter,
4873 )
4874 };
4875 }
4876 ///Wraps [`vkCmdCopyBufferToImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyBufferToImage.html).
4877 /**
4878 Provided by **VK_BASE_VERSION_1_0**.*/
4879 ///
4880 ///# Safety
4881 ///- `commandBuffer` (self) must be valid and not destroyed.
4882 ///- `commandBuffer` must be externally synchronized.
4883 ///
4884 ///# Panics
4885 ///Panics if `vkCmdCopyBufferToImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4886 ///
4887 ///# Usage Notes
4888 ///
4889 ///Copies data from a buffer to an image, the primary way to upload
4890 ///texture data from CPU to GPU.
4891 ///
4892 ///**Typical upload workflow**:
4893 ///
4894 ///1. Write pixel data into a host-visible staging buffer.
4895 ///2. Transition the target image to `TRANSFER_DST_OPTIMAL`.
4896 ///3. `cmd_copy_buffer_to_image` with the appropriate
4897 /// `BufferImageCopy` regions.
4898 ///4. Transition the image to `SHADER_READ_ONLY_OPTIMAL` for sampling.
4899 ///
4900 ///**Buffer layout**: `buffer_row_length` and `buffer_image_height`
4901 ///control the row and slice pitch of the source data in the buffer.
4902 ///Set both to zero to use a tightly packed layout matching the image
4903 ///extent.
4904 ///
4905 ///Multiple regions can be copied in a single call (e.g. all mip
4906 ///levels of a texture). Must be recorded outside a render pass.
4907 ///
4908 ///For Vulkan 1.3+, prefer `cmd_copy_buffer_to_image2`.
4909 pub unsafe fn cmd_copy_buffer_to_image(
4910 &self,
4911 command_buffer: CommandBuffer,
4912 src_buffer: Buffer,
4913 dst_image: Image,
4914 dst_image_layout: ImageLayout,
4915 p_regions: &[BufferImageCopy],
4916 ) {
4917 let fp = self
4918 .commands()
4919 .cmd_copy_buffer_to_image
4920 .expect("vkCmdCopyBufferToImage not loaded");
4921 unsafe {
4922 fp(
4923 command_buffer,
4924 src_buffer,
4925 dst_image,
4926 dst_image_layout,
4927 p_regions.len() as u32,
4928 p_regions.as_ptr(),
4929 )
4930 };
4931 }
4932 ///Wraps [`vkCmdCopyImageToBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyImageToBuffer.html).
4933 /**
4934 Provided by **VK_BASE_VERSION_1_0**.*/
4935 ///
4936 ///# Safety
4937 ///- `commandBuffer` (self) must be valid and not destroyed.
4938 ///- `commandBuffer` must be externally synchronized.
4939 ///
4940 ///# Panics
4941 ///Panics if `vkCmdCopyImageToBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4942 ///
4943 ///# Usage Notes
4944 ///
4945 ///Copies data from an image to a buffer, used for GPU readback of
4946 ///rendered images, screenshots, or compute shader output.
4947 ///
4948 ///**Typical readback workflow**:
4949 ///
4950 ///1. Transition the source image to `TRANSFER_SRC_OPTIMAL`.
4951 ///2. `cmd_copy_image_to_buffer` into a host-visible buffer.
4952 ///3. Submit and wait for the fence.
4953 ///4. Map the buffer and read the pixel data on the CPU.
4954 ///
4955 ///The `buffer_row_length` and `buffer_image_height` fields in
4956 ///`BufferImageCopy` control the destination layout. Set both to zero
4957 ///for tightly packed output.
4958 ///
4959 ///Be aware that readback is not instantaneous, it requires a full
4960 ///GPU round-trip. Avoid reading back in the render loop unless you
4961 ///are double- or triple-buffering the readback to hide latency.
4962 ///
4963 ///Must be recorded outside a render pass. For Vulkan 1.3+, prefer
4964 ///`cmd_copy_image_to_buffer2`.
4965 pub unsafe fn cmd_copy_image_to_buffer(
4966 &self,
4967 command_buffer: CommandBuffer,
4968 src_image: Image,
4969 src_image_layout: ImageLayout,
4970 dst_buffer: Buffer,
4971 p_regions: &[BufferImageCopy],
4972 ) {
4973 let fp = self
4974 .commands()
4975 .cmd_copy_image_to_buffer
4976 .expect("vkCmdCopyImageToBuffer not loaded");
4977 unsafe {
4978 fp(
4979 command_buffer,
4980 src_image,
4981 src_image_layout,
4982 dst_buffer,
4983 p_regions.len() as u32,
4984 p_regions.as_ptr(),
4985 )
4986 };
4987 }
4988 ///Wraps [`vkCmdCopyMemoryIndirectNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMemoryIndirectNV.html).
4989 /**
4990 Provided by **VK_NV_copy_memory_indirect**.*/
4991 ///
4992 ///# Safety
4993 ///- `commandBuffer` (self) must be valid and not destroyed.
4994 ///- `commandBuffer` must be externally synchronized.
4995 ///
4996 ///# Panics
4997 ///Panics if `vkCmdCopyMemoryIndirectNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4998 ///
4999 ///# Usage Notes
5000 ///
5001 ///Copies memory regions using indirect parameters stored in a GPU
5002 ///buffer at the given device address. Enables GPU-driven memory
5003 ///copy workflows where the copy descriptors are generated on the
5004 ///device.
5005 ///
5006 ///Requires `VK_NV_copy_memory_indirect`.
5007 pub unsafe fn cmd_copy_memory_indirect_nv(
5008 &self,
5009 command_buffer: CommandBuffer,
5010 copy_buffer_address: u64,
5011 copy_count: u32,
5012 stride: u32,
5013 ) {
5014 let fp = self
5015 .commands()
5016 .cmd_copy_memory_indirect_nv
5017 .expect("vkCmdCopyMemoryIndirectNV not loaded");
5018 unsafe { fp(command_buffer, copy_buffer_address, copy_count, stride) };
5019 }
5020 ///Wraps [`vkCmdCopyMemoryIndirectKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMemoryIndirectKHR.html).
5021 /**
5022 Provided by **VK_KHR_copy_memory_indirect**.*/
5023 ///
5024 ///# Safety
5025 ///- `commandBuffer` (self) must be valid and not destroyed.
5026 ///- `commandBuffer` must be externally synchronized.
5027 ///
5028 ///# Panics
5029 ///Panics if `vkCmdCopyMemoryIndirectKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5030 ///
5031 ///# Usage Notes
5032 ///
5033 ///Copies memory regions using parameters read from a device-side
5034 ///info structure. Enables GPU-driven memory copies without CPU
5035 ///involvement in specifying source/destination addresses.
5036 ///
5037 ///Requires `VK_KHR_copy_memory_indirect`.
5038 pub unsafe fn cmd_copy_memory_indirect_khr(
5039 &self,
5040 command_buffer: CommandBuffer,
5041 p_copy_memory_indirect_info: &CopyMemoryIndirectInfoKHR,
5042 ) {
5043 let fp = self
5044 .commands()
5045 .cmd_copy_memory_indirect_khr
5046 .expect("vkCmdCopyMemoryIndirectKHR not loaded");
5047 unsafe { fp(command_buffer, p_copy_memory_indirect_info) };
5048 }
5049 ///Wraps [`vkCmdCopyMemoryToImageIndirectNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMemoryToImageIndirectNV.html).
5050 /**
5051 Provided by **VK_NV_copy_memory_indirect**.*/
5052 ///
5053 ///# Safety
5054 ///- `commandBuffer` (self) must be valid and not destroyed.
5055 ///- `commandBuffer` must be externally synchronized.
5056 ///
5057 ///# Panics
5058 ///Panics if `vkCmdCopyMemoryToImageIndirectNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5059 ///
5060 ///# Usage Notes
5061 ///
5062 ///Copies data from memory to an image using indirect parameters
5063 ///stored at a device address. Enables GPU-driven texture uploads
5064 ///where the copy regions are generated on the device.
5065 ///
5066 ///Requires `VK_NV_copy_memory_indirect`.
5067 pub unsafe fn cmd_copy_memory_to_image_indirect_nv(
5068 &self,
5069 command_buffer: CommandBuffer,
5070 copy_buffer_address: u64,
5071 stride: u32,
5072 dst_image: Image,
5073 dst_image_layout: ImageLayout,
5074 p_image_subresources: &[ImageSubresourceLayers],
5075 ) {
5076 let fp = self
5077 .commands()
5078 .cmd_copy_memory_to_image_indirect_nv
5079 .expect("vkCmdCopyMemoryToImageIndirectNV not loaded");
5080 unsafe {
5081 fp(
5082 command_buffer,
5083 copy_buffer_address,
5084 p_image_subresources.len() as u32,
5085 stride,
5086 dst_image,
5087 dst_image_layout,
5088 p_image_subresources.as_ptr(),
5089 )
5090 };
5091 }
5092 ///Wraps [`vkCmdCopyMemoryToImageIndirectKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMemoryToImageIndirectKHR.html).
5093 /**
5094 Provided by **VK_KHR_copy_memory_indirect**.*/
5095 ///
5096 ///# Safety
5097 ///- `commandBuffer` (self) must be valid and not destroyed.
5098 ///- `commandBuffer` must be externally synchronized.
5099 ///
5100 ///# Panics
5101 ///Panics if `vkCmdCopyMemoryToImageIndirectKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5102 ///
5103 ///# Usage Notes
5104 ///
5105 ///Copies data from memory to an image using parameters read from a
5106 ///device-side info structure. Enables GPU-driven memory-to-image
5107 ///transfers without CPU readback of copy parameters.
5108 ///
5109 ///Requires `VK_KHR_copy_memory_indirect`.
5110 pub unsafe fn cmd_copy_memory_to_image_indirect_khr(
5111 &self,
5112 command_buffer: CommandBuffer,
5113 p_copy_memory_to_image_indirect_info: &CopyMemoryToImageIndirectInfoKHR,
5114 ) {
5115 let fp = self
5116 .commands()
5117 .cmd_copy_memory_to_image_indirect_khr
5118 .expect("vkCmdCopyMemoryToImageIndirectKHR not loaded");
5119 unsafe { fp(command_buffer, p_copy_memory_to_image_indirect_info) };
5120 }
5121 ///Wraps [`vkCmdUpdateBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdUpdateBuffer.html).
5122 /**
5123 Provided by **VK_BASE_VERSION_1_0**.*/
5124 ///
5125 ///# Safety
5126 ///- `commandBuffer` (self) must be valid and not destroyed.
5127 ///- `commandBuffer` must be externally synchronized.
5128 ///
5129 ///# Panics
5130 ///Panics if `vkCmdUpdateBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5131 ///
5132 ///# Usage Notes
5133 ///
5134 ///Writes a small amount of data inline into a buffer from the command
5135 ///stream. The data is embedded directly in the command buffer, no
5136 ///staging buffer needed.
5137 ///
5138 ///**Size limit**: the data size must be ≤ 65536 bytes and a multiple
5139 ///of 4. For larger uploads, use `cmd_copy_buffer` with a staging
5140 ///buffer instead.
5141 ///
5142 ///This is convenient for small per-frame updates (e.g. a uniform
5143 ///buffer with a single matrix) but should not be used for bulk data,
5144 ///it inflates command buffer size and the data is uploaded through the
5145 ///command stream, which is slower than a DMA transfer.
5146 ///
5147 ///Must be recorded outside a render pass. The destination buffer must
5148 ///have `BUFFER_USAGE_TRANSFER_DST`.
5149 pub unsafe fn cmd_update_buffer(
5150 &self,
5151 command_buffer: CommandBuffer,
5152 dst_buffer: Buffer,
5153 dst_offset: u64,
5154 data_size: u64,
5155 p_data: *const core::ffi::c_void,
5156 ) {
5157 let fp = self
5158 .commands()
5159 .cmd_update_buffer
5160 .expect("vkCmdUpdateBuffer not loaded");
5161 unsafe { fp(command_buffer, dst_buffer, dst_offset, data_size, p_data) };
5162 }
5163 ///Wraps [`vkCmdFillBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdFillBuffer.html).
5164 /**
5165 Provided by **VK_BASE_VERSION_1_0**.*/
5166 ///
5167 ///# Safety
5168 ///- `commandBuffer` (self) must be valid and not destroyed.
5169 ///- `commandBuffer` must be externally synchronized.
5170 ///
5171 ///# Panics
5172 ///Panics if `vkCmdFillBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5173 ///
5174 ///# Usage Notes
5175 ///
5176 ///Fills a region of a buffer with a repeating 4-byte value. Useful
5177 ///for clearing GPU buffers to zero (or any uniform value) without a
5178 ///staging upload.
5179 ///
5180 ///Common uses:
5181 ///
5182 ///- **Zero-initialise** an indirect draw count buffer before a compute
5183 /// culling pass.
5184 ///- **Clear** a storage buffer used as a histogram or counter.
5185 ///
5186 ///The `offset` and `size` must be multiples of 4. Use `VK_WHOLE_SIZE`
5187 ///to fill from the offset to the end of the buffer.
5188 ///
5189 ///Must be recorded outside a render pass. The buffer must have
5190 ///`BUFFER_USAGE_TRANSFER_DST`.
5191 pub unsafe fn cmd_fill_buffer(
5192 &self,
5193 command_buffer: CommandBuffer,
5194 dst_buffer: Buffer,
5195 dst_offset: u64,
5196 size: u64,
5197 data: u32,
5198 ) {
5199 let fp = self
5200 .commands()
5201 .cmd_fill_buffer
5202 .expect("vkCmdFillBuffer not loaded");
5203 unsafe { fp(command_buffer, dst_buffer, dst_offset, size, data) };
5204 }
5205 ///Wraps [`vkCmdClearColorImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdClearColorImage.html).
5206 /**
5207 Provided by **VK_COMPUTE_VERSION_1_0**.*/
5208 ///
5209 ///# Safety
5210 ///- `commandBuffer` (self) must be valid and not destroyed.
5211 ///- `commandBuffer` must be externally synchronized.
5212 ///
5213 ///# Panics
5214 ///Panics if `vkCmdClearColorImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5215 ///
5216 ///# Usage Notes
5217 ///
5218 ///Clears one or more regions of a colour image to a specified value.
5219 ///The image must be in `TRANSFER_DST_OPTIMAL` or `GENERAL` layout.
5220 ///
5221 ///This is an explicit clear outside a render pass. For clears inside
5222 ///a render pass, use `load_op = CLEAR` in the attachment description
5223 ///or `cmd_clear_attachments`, both are typically faster because the
5224 ///driver can integrate them with tile-based rendering.
5225 ///
5226 ///The clear value is a `ClearColorValue` union: either four `float32`,
5227 ///`int32`, or `uint32` values depending on the image format.
5228 ///
5229 ///Must be recorded outside a render pass.
5230 pub unsafe fn cmd_clear_color_image(
5231 &self,
5232 command_buffer: CommandBuffer,
5233 image: Image,
5234 image_layout: ImageLayout,
5235 p_color: &ClearColorValue,
5236 p_ranges: &[ImageSubresourceRange],
5237 ) {
5238 let fp = self
5239 .commands()
5240 .cmd_clear_color_image
5241 .expect("vkCmdClearColorImage not loaded");
5242 unsafe {
5243 fp(
5244 command_buffer,
5245 image,
5246 image_layout,
5247 p_color,
5248 p_ranges.len() as u32,
5249 p_ranges.as_ptr(),
5250 )
5251 };
5252 }
5253 ///Wraps [`vkCmdClearDepthStencilImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdClearDepthStencilImage.html).
5254 /**
5255 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
5256 ///
5257 ///# Safety
5258 ///- `commandBuffer` (self) must be valid and not destroyed.
5259 ///- `commandBuffer` must be externally synchronized.
5260 ///
5261 ///# Panics
5262 ///Panics if `vkCmdClearDepthStencilImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5263 ///
5264 ///# Usage Notes
5265 ///
5266 ///Clears one or more regions of a depth/stencil image to a specified
5267 ///depth and stencil value. The image must be in
5268 ///`TRANSFER_DST_OPTIMAL` or `GENERAL` layout.
5269 ///
5270 ///For most rendering, clearing via `load_op = CLEAR` on the
5271 ///depth/stencil attachment is preferred, it lets tile-based GPUs
5272 ///avoid a separate clear pass. Use this command only when you need to
5273 ///clear a depth/stencil image outside a render pass.
5274 ///
5275 ///The `image_subresource_range` must reference the appropriate aspect
5276 ///flags (`DEPTH`, `STENCIL`, or both).
5277 ///
5278 ///Must be recorded outside a render pass.
5279 pub unsafe fn cmd_clear_depth_stencil_image(
5280 &self,
5281 command_buffer: CommandBuffer,
5282 image: Image,
5283 image_layout: ImageLayout,
5284 p_depth_stencil: &ClearDepthStencilValue,
5285 p_ranges: &[ImageSubresourceRange],
5286 ) {
5287 let fp = self
5288 .commands()
5289 .cmd_clear_depth_stencil_image
5290 .expect("vkCmdClearDepthStencilImage not loaded");
5291 unsafe {
5292 fp(
5293 command_buffer,
5294 image,
5295 image_layout,
5296 p_depth_stencil,
5297 p_ranges.len() as u32,
5298 p_ranges.as_ptr(),
5299 )
5300 };
5301 }
5302 ///Wraps [`vkCmdClearAttachments`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdClearAttachments.html).
5303 /**
5304 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
5305 ///
5306 ///# Safety
5307 ///- `commandBuffer` (self) must be valid and not destroyed.
5308 ///- `commandBuffer` must be externally synchronized.
5309 ///
5310 ///# Panics
5311 ///Panics if `vkCmdClearAttachments` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5312 ///
5313 ///# Usage Notes
5314 ///
5315 ///Clears one or more attachment regions **inside** an active render
5316 ///pass. Unlike `load_op = CLEAR` (which clears the entire attachment
5317 ///at render pass begin), this clears arbitrary rectangular regions
5318 ///mid-render-pass.
5319 ///
5320 ///Use cases:
5321 ///
5322 ///- Clear a sub-region of a colour attachment (e.g. a UI panel
5323 /// background).
5324 ///- Clear the stencil buffer for a specific screen region.
5325 ///
5326 ///Each `ClearAttachment` specifies which attachment to clear (colour
5327 ///index, depth, or stencil) and the clear value. Each `ClearRect`
5328 ///defines the pixel rectangle and layer range.
5329 ///
5330 ///For whole-attachment clears, prefer `load_op = CLEAR`, it is
5331 ///always at least as fast and often faster on tile-based hardware.
5332 pub unsafe fn cmd_clear_attachments(
5333 &self,
5334 command_buffer: CommandBuffer,
5335 p_attachments: &[ClearAttachment],
5336 p_rects: &[ClearRect],
5337 ) {
5338 let fp = self
5339 .commands()
5340 .cmd_clear_attachments
5341 .expect("vkCmdClearAttachments not loaded");
5342 unsafe {
5343 fp(
5344 command_buffer,
5345 p_attachments.len() as u32,
5346 p_attachments.as_ptr(),
5347 p_rects.len() as u32,
5348 p_rects.as_ptr(),
5349 )
5350 };
5351 }
5352 ///Wraps [`vkCmdResolveImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdResolveImage.html).
5353 /**
5354 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
5355 ///
5356 ///# Safety
5357 ///- `commandBuffer` (self) must be valid and not destroyed.
5358 ///- `commandBuffer` must be externally synchronized.
5359 ///
5360 ///# Panics
5361 ///Panics if `vkCmdResolveImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5362 ///
5363 ///# Usage Notes
5364 ///
5365 ///Resolves (downsamples) a multisample image into a single-sample
5366 ///image. Typically used to produce the final single-sample result from
5367 ///a multisampled colour attachment.
5368 ///
5369 ///Both images must be in appropriate transfer layouts
5370 ///(`TRANSFER_SRC_OPTIMAL` and `TRANSFER_DST_OPTIMAL` respectively).
5371 ///The source must be multisampled; the destination must be
5372 ///single-sample. Formats must be identical.
5373 ///
5374 ///For resolving inside a render pass, use `resolve_attachment` in the
5375 ///subpass description instead, it is more efficient on tile-based
5376 ///GPUs because the resolve happens in-tile.
5377 ///
5378 ///Must be recorded outside a render pass. For Vulkan 1.3+, prefer
5379 ///`cmd_resolve_image2`.
5380 pub unsafe fn cmd_resolve_image(
5381 &self,
5382 command_buffer: CommandBuffer,
5383 src_image: Image,
5384 src_image_layout: ImageLayout,
5385 dst_image: Image,
5386 dst_image_layout: ImageLayout,
5387 p_regions: &[ImageResolve],
5388 ) {
5389 let fp = self
5390 .commands()
5391 .cmd_resolve_image
5392 .expect("vkCmdResolveImage not loaded");
5393 unsafe {
5394 fp(
5395 command_buffer,
5396 src_image,
5397 src_image_layout,
5398 dst_image,
5399 dst_image_layout,
5400 p_regions.len() as u32,
5401 p_regions.as_ptr(),
5402 )
5403 };
5404 }
5405 ///Wraps [`vkCmdSetEvent`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetEvent.html).
5406 /**
5407 Provided by **VK_COMPUTE_VERSION_1_0**.*/
5408 ///
5409 ///# Safety
5410 ///- `commandBuffer` (self) must be valid and not destroyed.
5411 ///- `commandBuffer` must be externally synchronized.
5412 ///
5413 ///# Panics
5414 ///Panics if `vkCmdSetEvent` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5415 ///
5416 ///# Usage Notes
5417 ///
5418 ///Signals an event from the GPU at a specific pipeline stage. A later
5419 ///`cmd_wait_events` call can wait for this signal to synchronise work
5420 ///within the same queue.
5421 ///
5422 ///Events provide finer-grained synchronisation than pipeline barriers
5423 ///when you want to split a dependency into a "signal" point and a
5424 ///"wait" point separated by other commands. This lets the GPU execute
5425 ///interleaving work between the signal and wait.
5426 ///
5427 ///The `stage_mask` specifies at which pipeline stage the event is
5428 ///signaled. The event becomes signaled once all commands prior to this
5429 ///call have completed that stage.
5430 ///
5431 ///Events must only be used within a single queue. For cross-queue
5432 ///synchronisation, use semaphores.
5433 ///
5434 ///For Vulkan 1.3+, prefer `cmd_set_event2` which supports more
5435 ///precise stage and access masks.
5436 pub unsafe fn cmd_set_event(
5437 &self,
5438 command_buffer: CommandBuffer,
5439 event: Event,
5440 stage_mask: PipelineStageFlags,
5441 ) {
5442 let fp = self
5443 .commands()
5444 .cmd_set_event
5445 .expect("vkCmdSetEvent not loaded");
5446 unsafe { fp(command_buffer, event, stage_mask) };
5447 }
5448 ///Wraps [`vkCmdResetEvent`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdResetEvent.html).
5449 /**
5450 Provided by **VK_COMPUTE_VERSION_1_0**.*/
5451 ///
5452 ///# Safety
5453 ///- `commandBuffer` (self) must be valid and not destroyed.
5454 ///- `commandBuffer` must be externally synchronized.
5455 ///
5456 ///# Panics
5457 ///Panics if `vkCmdResetEvent` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5458 ///
5459 ///# Usage Notes
5460 ///
5461 ///Resets an event to the unsignaled state from the GPU at a specific
5462 ///pipeline stage. The event can then be signaled again by a
5463 ///subsequent `cmd_set_event`.
5464 ///
5465 ///Must not be called while a `cmd_wait_events` that waits on this
5466 ///event is between its wait and the completion of the dependent work.
5467 ///
5468 ///For Vulkan 1.3+, prefer `cmd_reset_event2`.
5469 pub unsafe fn cmd_reset_event(
5470 &self,
5471 command_buffer: CommandBuffer,
5472 event: Event,
5473 stage_mask: PipelineStageFlags,
5474 ) {
5475 let fp = self
5476 .commands()
5477 .cmd_reset_event
5478 .expect("vkCmdResetEvent not loaded");
5479 unsafe { fp(command_buffer, event, stage_mask) };
5480 }
5481 ///Wraps [`vkCmdWaitEvents`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWaitEvents.html).
5482 /**
5483 Provided by **VK_COMPUTE_VERSION_1_0**.*/
5484 ///
5485 ///# Safety
5486 ///- `commandBuffer` (self) must be valid and not destroyed.
5487 ///- `commandBuffer` must be externally synchronized.
5488 ///
5489 ///# Panics
5490 ///Panics if `vkCmdWaitEvents` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5491 ///
5492 ///# Usage Notes
5493 ///
5494 ///Waits for one or more events to be signaled and then inserts memory
5495 ///and execution dependencies. This is the "wait" half of the
5496 ///signal/wait pattern started by `cmd_set_event`.
5497 ///
5498 ///The wait blocks execution at the specified destination pipeline
5499 ///stages until all events are signaled. Memory barriers provided in
5500 ///this call make the specified source writes visible to the
5501 ///destination stages.
5502 ///
5503 ///**Split barriers**: the main advantage over `cmd_pipeline_barrier`
5504 ///is that you can interleave unrelated commands between the signal and
5505 ///wait, giving the GPU more opportunity for parallel execution.
5506 ///
5507 ///Events must not be waited on across different queues. For
5508 ///cross-queue synchronisation, use semaphores.
5509 ///
5510 ///For Vulkan 1.3+, prefer `cmd_wait_events2`.
5511 pub unsafe fn cmd_wait_events(
5512 &self,
5513 command_buffer: CommandBuffer,
5514 p_events: &[Event],
5515 src_stage_mask: PipelineStageFlags,
5516 dst_stage_mask: PipelineStageFlags,
5517 p_memory_barriers: &[MemoryBarrier],
5518 p_buffer_memory_barriers: &[BufferMemoryBarrier],
5519 p_image_memory_barriers: &[ImageMemoryBarrier],
5520 ) {
5521 let fp = self
5522 .commands()
5523 .cmd_wait_events
5524 .expect("vkCmdWaitEvents not loaded");
5525 unsafe {
5526 fp(
5527 command_buffer,
5528 p_events.len() as u32,
5529 p_events.as_ptr(),
5530 src_stage_mask,
5531 dst_stage_mask,
5532 p_memory_barriers.len() as u32,
5533 p_memory_barriers.as_ptr(),
5534 p_buffer_memory_barriers.len() as u32,
5535 p_buffer_memory_barriers.as_ptr(),
5536 p_image_memory_barriers.len() as u32,
5537 p_image_memory_barriers.as_ptr(),
5538 )
5539 };
5540 }
5541 ///Wraps [`vkCmdPipelineBarrier`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPipelineBarrier.html).
5542 /**
5543 Provided by **VK_BASE_VERSION_1_0**.*/
5544 ///
5545 ///# Safety
5546 ///- `commandBuffer` (self) must be valid and not destroyed.
5547 ///- `commandBuffer` must be externally synchronized.
5548 ///
5549 ///# Panics
5550 ///Panics if `vkCmdPipelineBarrier` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5551 ///
5552 ///# Usage Notes
5553 ///
5554 ///Inserts an execution and memory dependency between commands recorded
5555 ///before and after the barrier. This is the primary synchronisation
5556 ///tool inside a command buffer.
5557 ///
5558 ///**Three types of barrier**:
5559 ///
5560 ///- **Memory barriers** (`MemoryBarrier`): global, affects all
5561 /// resources. Rarely needed, prefer the more specific variants.
5562 ///- **Buffer memory barriers** (`BufferMemoryBarrier`): targets a
5563 /// specific buffer region. Use for storage buffer read-after-write.
5564 ///- **Image memory barriers** (`ImageMemoryBarrier`): targets a
5565 /// specific image subresource range. Also performs layout transitions.
5566 ///
5567 ///**Layout transitions**: image memory barriers are the primary way to
5568 ///transition images between layouts (e.g.
5569 ///`TRANSFER_DST_OPTIMAL` → `SHADER_READ_ONLY_OPTIMAL`). The old and
5570 ///new layouts in the barrier define the transition.
5571 ///
5572 ///**Stage masks**: `src_stage_mask` is the set of stages that must
5573 ///complete before the barrier. `dst_stage_mask` is the set of stages
5574 ///that must wait for the barrier. Choose the narrowest stages possible
5575 ///to minimise stalls.
5576 ///
5577 ///Inside a render pass, only self-dependencies are allowed (barriers
5578 ///within a single subpass). Outside a render pass, there are no
5579 ///restrictions.
5580 ///
5581 ///For Vulkan 1.3+, prefer `cmd_pipeline_barrier2` which uses
5582 ///extensible structs.
5583 pub unsafe fn cmd_pipeline_barrier(
5584 &self,
5585 command_buffer: CommandBuffer,
5586 src_stage_mask: PipelineStageFlags,
5587 dst_stage_mask: PipelineStageFlags,
5588 dependency_flags: DependencyFlags,
5589 p_memory_barriers: &[MemoryBarrier],
5590 p_buffer_memory_barriers: &[BufferMemoryBarrier],
5591 p_image_memory_barriers: &[ImageMemoryBarrier],
5592 ) {
5593 let fp = self
5594 .commands()
5595 .cmd_pipeline_barrier
5596 .expect("vkCmdPipelineBarrier not loaded");
5597 unsafe {
5598 fp(
5599 command_buffer,
5600 src_stage_mask,
5601 dst_stage_mask,
5602 dependency_flags,
5603 p_memory_barriers.len() as u32,
5604 p_memory_barriers.as_ptr(),
5605 p_buffer_memory_barriers.len() as u32,
5606 p_buffer_memory_barriers.as_ptr(),
5607 p_image_memory_barriers.len() as u32,
5608 p_image_memory_barriers.as_ptr(),
5609 )
5610 };
5611 }
5612 ///Wraps [`vkCmdBeginQuery`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginQuery.html).
5613 /**
5614 Provided by **VK_BASE_VERSION_1_0**.*/
5615 ///
5616 ///# Safety
5617 ///- `commandBuffer` (self) must be valid and not destroyed.
5618 ///- `commandBuffer` must be externally synchronized.
5619 ///
5620 ///# Panics
5621 ///Panics if `vkCmdBeginQuery` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5622 ///
5623 ///# Usage Notes
5624 ///
5625 ///Begins a query at the specified index in a query pool. All
5626 ///rendering or compute commands recorded between `cmd_begin_query` and
5627 ///`cmd_end_query` are measured by the query.
5628 ///
5629 ///**Flags**:
5630 ///
5631 ///- `QUERY_CONTROL_PRECISE`: for occlusion queries, return an exact
5632 /// sample count instead of a boolean. More expensive on some
5633 /// hardware. Requires the `occlusion_query_precise` device feature.
5634 ///
5635 ///The query slot must have been reset with `cmd_reset_query_pool` (or
5636 ///`reset_query_pool` on Vulkan 1.2+) before beginning.
5637 ///
5638 ///Pipeline statistics queries must be begun and ended outside a render
5639 ///pass. Occlusion queries can span draw calls within a render pass.
5640 pub unsafe fn cmd_begin_query(
5641 &self,
5642 command_buffer: CommandBuffer,
5643 query_pool: QueryPool,
5644 query: u32,
5645 flags: QueryControlFlags,
5646 ) {
5647 let fp = self
5648 .commands()
5649 .cmd_begin_query
5650 .expect("vkCmdBeginQuery not loaded");
5651 unsafe { fp(command_buffer, query_pool, query, flags) };
5652 }
5653 ///Wraps [`vkCmdEndQuery`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndQuery.html).
5654 /**
5655 Provided by **VK_BASE_VERSION_1_0**.*/
5656 ///
5657 ///# Safety
5658 ///- `commandBuffer` (self) must be valid and not destroyed.
5659 ///- `commandBuffer` must be externally synchronized.
5660 ///
5661 ///# Panics
5662 ///Panics if `vkCmdEndQuery` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5663 ///
5664 ///# Usage Notes
5665 ///
5666 ///Ends an active query at the specified index. The query results
5667 ///become available for retrieval via `get_query_pool_results` or
5668 ///`cmd_copy_query_pool_results` once the command buffer has completed
5669 ///execution.
5670 ///
5671 ///Must be paired with a preceding `cmd_begin_query` on the same
5672 ///query index. Beginning a query without ending it, or ending one
5673 ///that was not begun, is an error.
5674 pub unsafe fn cmd_end_query(
5675 &self,
5676 command_buffer: CommandBuffer,
5677 query_pool: QueryPool,
5678 query: u32,
5679 ) {
5680 let fp = self
5681 .commands()
5682 .cmd_end_query
5683 .expect("vkCmdEndQuery not loaded");
5684 unsafe { fp(command_buffer, query_pool, query) };
5685 }
5686 ///Wraps [`vkCmdBeginConditionalRenderingEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginConditionalRenderingEXT.html).
5687 /**
5688 Provided by **VK_EXT_conditional_rendering**.*/
5689 ///
5690 ///# Safety
5691 ///- `commandBuffer` (self) must be valid and not destroyed.
5692 ///- `commandBuffer` must be externally synchronized.
5693 ///
5694 ///# Panics
5695 ///Panics if `vkCmdBeginConditionalRenderingEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5696 ///
5697 ///# Usage Notes
5698 ///
5699 ///Begins a conditional rendering block. Subsequent rendering and
5700 ///dispatch commands are discarded if the 32-bit value at the
5701 ///specified buffer offset is zero (or non-zero if `INVERTED` is
5702 ///set).
5703 ///
5704 ///End with `cmd_end_conditional_rendering_ext`.
5705 ///
5706 ///Useful for GPU-driven occlusion culling, write visibility
5707 ///results to a buffer, then conditionally skip draw calls.
5708 ///
5709 ///Requires `VK_EXT_conditional_rendering`.
5710 pub unsafe fn cmd_begin_conditional_rendering_ext(
5711 &self,
5712 command_buffer: CommandBuffer,
5713 p_conditional_rendering_begin: &ConditionalRenderingBeginInfoEXT,
5714 ) {
5715 let fp = self
5716 .commands()
5717 .cmd_begin_conditional_rendering_ext
5718 .expect("vkCmdBeginConditionalRenderingEXT not loaded");
5719 unsafe { fp(command_buffer, p_conditional_rendering_begin) };
5720 }
5721 ///Wraps [`vkCmdEndConditionalRenderingEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndConditionalRenderingEXT.html).
5722 /**
5723 Provided by **VK_EXT_conditional_rendering**.*/
5724 ///
5725 ///# Safety
5726 ///- `commandBuffer` (self) must be valid and not destroyed.
5727 ///- `commandBuffer` must be externally synchronized.
5728 ///
5729 ///# Panics
5730 ///Panics if `vkCmdEndConditionalRenderingEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5731 ///
5732 ///# Usage Notes
5733 ///
5734 ///Ends a conditional rendering block started with
5735 ///`cmd_begin_conditional_rendering_ext`. Commands after this call
5736 ///execute unconditionally.
5737 ///
5738 ///Requires `VK_EXT_conditional_rendering`.
5739 pub unsafe fn cmd_end_conditional_rendering_ext(&self, command_buffer: CommandBuffer) {
5740 let fp = self
5741 .commands()
5742 .cmd_end_conditional_rendering_ext
5743 .expect("vkCmdEndConditionalRenderingEXT not loaded");
5744 unsafe { fp(command_buffer) };
5745 }
5746 ///Wraps [`vkCmdBeginCustomResolveEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginCustomResolveEXT.html).
5747 /**
5748 Provided by **VK_EXT_custom_resolve**.*/
5749 ///
5750 ///# Safety
5751 ///- `commandBuffer` (self) must be valid and not destroyed.
5752 ///- `commandBuffer` must be externally synchronized.
5753 ///
5754 ///# Panics
5755 ///Panics if `vkCmdBeginCustomResolveEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5756 ///
5757 ///# Usage Notes
5758 ///
5759 ///Begins a custom resolve region, allowing the application to use
5760 ///its own fragment shader for MSAA resolve instead of the fixed-
5761 ///function resolve. End with `cmd_end_custom_resolve_ext`.
5762 ///
5763 ///Useful for tone-mapped or weighted resolves that the built-in
5764 ///resolve operations cannot express.
5765 ///
5766 ///Requires `VK_EXT_custom_resolve`.
5767 pub unsafe fn cmd_begin_custom_resolve_ext(
5768 &self,
5769 command_buffer: CommandBuffer,
5770 p_begin_custom_resolve_info: Option<&BeginCustomResolveInfoEXT>,
5771 ) {
5772 let fp = self
5773 .commands()
5774 .cmd_begin_custom_resolve_ext
5775 .expect("vkCmdBeginCustomResolveEXT not loaded");
5776 let p_begin_custom_resolve_info_ptr =
5777 p_begin_custom_resolve_info.map_or(core::ptr::null(), core::ptr::from_ref);
5778 unsafe { fp(command_buffer, p_begin_custom_resolve_info_ptr) };
5779 }
5780 ///Wraps [`vkCmdResetQueryPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdResetQueryPool.html).
5781 /**
5782 Provided by **VK_BASE_VERSION_1_0**.*/
5783 ///
5784 ///# Safety
5785 ///- `commandBuffer` (self) must be valid and not destroyed.
5786 ///- `commandBuffer` must be externally synchronized.
5787 ///
5788 ///# Panics
5789 ///Panics if `vkCmdResetQueryPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5790 ///
5791 ///# Usage Notes
5792 ///
5793 ///Resets a range of queries in a pool from the GPU command stream.
5794 ///Queries must be reset before they can be used in `cmd_begin_query`
5795 ///or `cmd_write_timestamp`.
5796 ///
5797 ///This is the pre-1.2 way to reset queries. For Vulkan 1.2+,
5798 ///`reset_query_pool` (host-side) is often more convenient and avoids
5799 ///adding the reset to the command buffer.
5800 ///
5801 ///Must be recorded outside a render pass.
5802 pub unsafe fn cmd_reset_query_pool(
5803 &self,
5804 command_buffer: CommandBuffer,
5805 query_pool: QueryPool,
5806 first_query: u32,
5807 query_count: u32,
5808 ) {
5809 let fp = self
5810 .commands()
5811 .cmd_reset_query_pool
5812 .expect("vkCmdResetQueryPool not loaded");
5813 unsafe { fp(command_buffer, query_pool, first_query, query_count) };
5814 }
5815 ///Wraps [`vkCmdWriteTimestamp`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWriteTimestamp.html).
5816 /**
5817 Provided by **VK_BASE_VERSION_1_0**.*/
5818 ///
5819 ///# Safety
5820 ///- `commandBuffer` (self) must be valid and not destroyed.
5821 ///- `commandBuffer` must be externally synchronized.
5822 ///
5823 ///# Panics
5824 ///Panics if `vkCmdWriteTimestamp` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5825 ///
5826 ///# Usage Notes
5827 ///
5828 ///Writes the current GPU timestamp into a query pool slot when the
5829 ///specified pipeline stage completes. Use two timestamps to measure
5830 ///elapsed GPU time:
5831 ///
5832 ///```text
5833 ///cmd_write_timestamp(PIPELINE_STAGE_TOP_OF_PIPE, pool, 0);
5834 #[doc = "// ... commands to measure ..."]
5835 ///cmd_write_timestamp(PIPELINE_STAGE_BOTTOM_OF_PIPE, pool, 1);
5836 ///```
5837 ///
5838 ///After the command buffer completes, read the values with
5839 ///`get_query_pool_results` (with `QUERY_RESULT_64`) and compute:
5840 ///
5841 ///```text
5842 ///elapsed_ns = (timestamp[1] - timestamp[0]) * timestamp_period
5843 ///```
5844 ///
5845 ///`timestamp_period` is in nanoseconds per tick, available from
5846 ///`physical_device_limits`.
5847 ///
5848 ///Not all queue families support timestamps, check
5849 ///`timestamp_valid_bits` in the queue family properties. A value of 0
5850 ///means timestamps are not supported on that queue.
5851 ///
5852 ///For Vulkan 1.3+, prefer `cmd_write_timestamp2`.
5853 pub unsafe fn cmd_write_timestamp(
5854 &self,
5855 command_buffer: CommandBuffer,
5856 pipeline_stage: PipelineStageFlagBits,
5857 query_pool: QueryPool,
5858 query: u32,
5859 ) {
5860 let fp = self
5861 .commands()
5862 .cmd_write_timestamp
5863 .expect("vkCmdWriteTimestamp not loaded");
5864 unsafe { fp(command_buffer, pipeline_stage, query_pool, query) };
5865 }
5866 ///Wraps [`vkCmdCopyQueryPoolResults`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyQueryPoolResults.html).
5867 /**
5868 Provided by **VK_BASE_VERSION_1_0**.*/
5869 ///
5870 ///# Safety
5871 ///- `commandBuffer` (self) must be valid and not destroyed.
5872 ///- `commandBuffer` must be externally synchronized.
5873 ///
5874 ///# Panics
5875 ///Panics if `vkCmdCopyQueryPoolResults` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5876 ///
5877 ///# Usage Notes
5878 ///
5879 ///Copies query results directly into a GPU buffer. This is the
5880 ///GPU-side counterpart to `get_query_pool_results` and avoids a CPU
5881 ///round-trip when the results are consumed by subsequent GPU work
5882 ///(e.g. conditional rendering or indirect dispatch).
5883 ///
5884 ///The same flags apply as for `get_query_pool_results`:
5885 ///`QUERY_RESULT_64`, `QUERY_RESULT_WAIT`,
5886 ///`QUERY_RESULT_WITH_AVAILABILITY`, and `QUERY_RESULT_PARTIAL`.
5887 ///
5888 ///The destination buffer must have `BUFFER_USAGE_TRANSFER_DST`. The
5889 ///stride must be large enough to hold the result (and availability
5890 ///value, if requested).
5891 ///
5892 ///Must be recorded outside a render pass.
5893 pub unsafe fn cmd_copy_query_pool_results(
5894 &self,
5895 command_buffer: CommandBuffer,
5896 query_pool: QueryPool,
5897 first_query: u32,
5898 query_count: u32,
5899 dst_buffer: Buffer,
5900 dst_offset: u64,
5901 stride: u64,
5902 flags: QueryResultFlags,
5903 ) {
5904 let fp = self
5905 .commands()
5906 .cmd_copy_query_pool_results
5907 .expect("vkCmdCopyQueryPoolResults not loaded");
5908 unsafe {
5909 fp(
5910 command_buffer,
5911 query_pool,
5912 first_query,
5913 query_count,
5914 dst_buffer,
5915 dst_offset,
5916 stride,
5917 flags,
5918 )
5919 };
5920 }
5921 ///Wraps [`vkCmdPushConstants`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPushConstants.html).
5922 /**
5923 Provided by **VK_COMPUTE_VERSION_1_0**.*/
5924 ///
5925 ///# Safety
5926 ///- `commandBuffer` (self) must be valid and not destroyed.
5927 ///- `commandBuffer` must be externally synchronized.
5928 ///
5929 ///# Panics
5930 ///Panics if `vkCmdPushConstants` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5931 ///
5932 ///# Usage Notes
5933 ///
5934 ///Updates push constant values for the bound pipeline layout. Push
5935 ///constants are a fast path for small, frequently-changing data that
5936 ///avoids descriptor set updates entirely.
5937 ///
5938 ///**Size limit**: the total push constant range is at least 128 bytes
5939 ///(device limit `max_push_constants_size`). Use push constants for
5940 ///per-draw data like transform matrices, material indices, or time
5941 ///values.
5942 ///
5943 ///**Stage flags**: the `stage_flags` parameter must match the stages
5944 ///declared in the pipeline layout's push constant range. You can
5945 ///update different stage ranges separately (e.g. update the vertex
5946 ///shader's range without touching the fragment shader's range).
5947 ///
5948 ///Push constant data persists across draw/dispatch calls until the
5949 ///pipeline layout is changed or the values are overwritten.
5950 ///
5951 ///For Vulkan 1.4+, `cmd_push_constants2` uses an extensible struct.
5952 pub unsafe fn cmd_push_constants(
5953 &self,
5954 command_buffer: CommandBuffer,
5955 layout: PipelineLayout,
5956 stage_flags: ShaderStageFlags,
5957 offset: u32,
5958 p_values: &[core::ffi::c_void],
5959 ) {
5960 let fp = self
5961 .commands()
5962 .cmd_push_constants
5963 .expect("vkCmdPushConstants not loaded");
5964 unsafe {
5965 fp(
5966 command_buffer,
5967 layout,
5968 stage_flags,
5969 offset,
5970 p_values.len() as u32,
5971 p_values.as_ptr(),
5972 )
5973 };
5974 }
5975 ///Wraps [`vkCmdBeginRenderPass`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginRenderPass.html).
5976 /**
5977 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
5978 ///
5979 ///# Safety
5980 ///- `commandBuffer` (self) must be valid and not destroyed.
5981 ///- `commandBuffer` must be externally synchronized.
5982 ///
5983 ///# Panics
5984 ///Panics if `vkCmdBeginRenderPass` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5985 ///
5986 ///# Usage Notes
5987 ///
5988 ///Begins a render pass instance. All subsequent drawing commands are
5989 ///recorded within this render pass until `cmd_end_render_pass`.
5990 ///
5991 ///**`render_pass_begin_info`** specifies:
5992 ///
5993 ///- **Render pass and framebuffer**: which render pass to use and
5994 /// which concrete image views are bound.
5995 ///- **Render area**: the pixel region to render. Should match the
5996 /// framebuffer extent for best performance. Misalignment with the
5997 /// render area granularity can cause overhead on tile-based GPUs.
5998 ///- **Clear values**: one per attachment with `load_op = CLEAR`. The
5999 /// array must include entries for all attachments (use a dummy value
6000 /// for non-cleared attachments).
6001 ///
6002 ///**`contents`**:
6003 ///
6004 ///- `SUBPASS_CONTENTS_INLINE`: draw commands are recorded directly
6005 /// in this command buffer.
6006 ///- `SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS`: draw commands come
6007 /// from secondary command buffers via `cmd_execute_commands`.
6008 ///
6009 ///For Vulkan 1.2+, `cmd_begin_render_pass2` accepts a `SubpassBeginInfo`.
6010 ///For Vulkan 1.3+, consider dynamic rendering (`cmd_begin_rendering`)
6011 ///which avoids render pass and framebuffer objects entirely.
6012 ///
6013 ///# Guide
6014 ///
6015 ///See [Render Passes & Framebuffers](https://hiddentale.github.io/vulkan_rust/concepts/render-passes.html) in the vulkan_rust guide.
6016 pub unsafe fn cmd_begin_render_pass(
6017 &self,
6018 command_buffer: CommandBuffer,
6019 p_render_pass_begin: &RenderPassBeginInfo,
6020 contents: SubpassContents,
6021 ) {
6022 let fp = self
6023 .commands()
6024 .cmd_begin_render_pass
6025 .expect("vkCmdBeginRenderPass not loaded");
6026 unsafe { fp(command_buffer, p_render_pass_begin, contents) };
6027 }
6028 ///Wraps [`vkCmdNextSubpass`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdNextSubpass.html).
6029 /**
6030 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
6031 ///
6032 ///# Safety
6033 ///- `commandBuffer` (self) must be valid and not destroyed.
6034 ///- `commandBuffer` must be externally synchronized.
6035 ///
6036 ///# Panics
6037 ///Panics if `vkCmdNextSubpass` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6038 ///
6039 ///# Usage Notes
6040 ///
6041 ///Advances to the next subpass within a render pass. Subpass
6042 ///transitions allow the driver to resolve dependencies between
6043 ///subpasses, for example, reading a colour attachment written in
6044 ///the previous subpass as an input attachment.
6045 ///
6046 ///The `contents` parameter has the same meaning as in
6047 ///`cmd_begin_render_pass`: `INLINE` or `SECONDARY_COMMAND_BUFFERS`.
6048 ///
6049 ///Multi-subpass render passes are an optimisation for tile-based GPUs
6050 ///where they can keep data on-chip between subpasses. On desktop GPUs
6051 ///the benefit is smaller. Many applications use a single subpass and
6052 ///handle inter-pass dependencies with explicit pipeline barriers.
6053 ///
6054 ///For Vulkan 1.2+, prefer `cmd_next_subpass2`.
6055 pub unsafe fn cmd_next_subpass(
6056 &self,
6057 command_buffer: CommandBuffer,
6058 contents: SubpassContents,
6059 ) {
6060 let fp = self
6061 .commands()
6062 .cmd_next_subpass
6063 .expect("vkCmdNextSubpass not loaded");
6064 unsafe { fp(command_buffer, contents) };
6065 }
6066 ///Wraps [`vkCmdEndRenderPass`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndRenderPass.html).
6067 /**
6068 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
6069 ///
6070 ///# Safety
6071 ///- `commandBuffer` (self) must be valid and not destroyed.
6072 ///- `commandBuffer` must be externally synchronized.
6073 ///
6074 ///# Panics
6075 ///Panics if `vkCmdEndRenderPass` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6076 ///
6077 ///# Usage Notes
6078 ///
6079 ///Ends the current render pass instance. After this call, the
6080 ///implicit layout transitions specified by each attachment's
6081 ///`final_layout` are applied.
6082 ///
6083 ///No draw commands may be recorded after this until a new render pass
6084 ///is begun (or dynamic rendering is started).
6085 ///
6086 ///For Vulkan 1.2+, prefer `cmd_end_render_pass2`.
6087 pub unsafe fn cmd_end_render_pass(&self, command_buffer: CommandBuffer) {
6088 let fp = self
6089 .commands()
6090 .cmd_end_render_pass
6091 .expect("vkCmdEndRenderPass not loaded");
6092 unsafe { fp(command_buffer) };
6093 }
6094 ///Wraps [`vkCmdExecuteCommands`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdExecuteCommands.html).
6095 /**
6096 Provided by **VK_BASE_VERSION_1_0**.*/
6097 ///
6098 ///# Safety
6099 ///- `commandBuffer` (self) must be valid and not destroyed.
6100 ///- `commandBuffer` must be externally synchronized.
6101 ///
6102 ///# Panics
6103 ///Panics if `vkCmdExecuteCommands` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6104 ///
6105 ///# Usage Notes
6106 ///
6107 ///Executes one or more secondary command buffers from a primary
6108 ///command buffer. The secondary buffers are inlined into the primary
6109 ///buffer's execution stream in array order.
6110 ///
6111 ///**Use cases**:
6112 ///
6113 ///- **Multi-threaded recording**: each thread records a secondary
6114 /// command buffer, and the main thread assembles them with a single
6115 /// `cmd_execute_commands` call. This is the primary scaling strategy
6116 /// for CPU-bound recording.
6117 ///- **Reusable draw sequences**: record a secondary buffer once and
6118 /// execute it in multiple frames or from multiple primary buffers
6119 /// (requires `SIMULTANEOUS_USE` on the secondary buffer).
6120 ///
6121 ///Secondary command buffers inherit certain state from the primary
6122 ///buffer (viewport, scissor, etc.) only if declared in the
6123 ///`CommandBufferInheritanceInfo`. The render pass and subpass must
6124 ///match what the primary buffer is currently in.
6125 ///
6126 ///This command can only be called from a primary command buffer.
6127 pub unsafe fn cmd_execute_commands(
6128 &self,
6129 command_buffer: CommandBuffer,
6130 p_command_buffers: &[CommandBuffer],
6131 ) {
6132 let fp = self
6133 .commands()
6134 .cmd_execute_commands
6135 .expect("vkCmdExecuteCommands not loaded");
6136 unsafe {
6137 fp(
6138 command_buffer,
6139 p_command_buffers.len() as u32,
6140 p_command_buffers.as_ptr(),
6141 )
6142 };
6143 }
6144 ///Wraps [`vkCreateSharedSwapchainsKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateSharedSwapchainsKHR.html).
6145 /**
6146 Provided by **VK_KHR_display_swapchain**.*/
6147 ///
6148 ///# Errors
6149 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6150 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
6151 ///- `VK_ERROR_INCOMPATIBLE_DISPLAY_KHR`
6152 ///- `VK_ERROR_DEVICE_LOST`
6153 ///- `VK_ERROR_SURFACE_LOST_KHR`
6154 ///- `VK_ERROR_UNKNOWN`
6155 ///- `VK_ERROR_VALIDATION_FAILED`
6156 ///
6157 ///# Safety
6158 ///- `device` (self) must be valid and not destroyed.
6159 ///
6160 ///# Panics
6161 ///Panics if `vkCreateSharedSwapchainsKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6162 ///
6163 ///# Usage Notes
6164 ///
6165 ///Creates one or more swapchains that share presentable images with
6166 ///their `old_swapchain`. Provided by `VK_KHR_display_swapchain`.
6167 ///
6168 ///This is primarily used for direct-to-display rendering where
6169 ///multiple swapchains share the same display plane. For window-based
6170 ///rendering, use `create_swapchain_khr` instead.
6171 pub unsafe fn create_shared_swapchains_khr(
6172 &self,
6173 p_create_infos: &[SwapchainCreateInfoKHR],
6174 allocator: Option<&AllocationCallbacks>,
6175 ) -> VkResult<Vec<SwapchainKHR>> {
6176 let fp = self
6177 .commands()
6178 .create_shared_swapchains_khr
6179 .expect("vkCreateSharedSwapchainsKHR not loaded");
6180 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
6181 let count = p_create_infos.len();
6182 let mut out = vec![unsafe { core::mem::zeroed() }; count];
6183 check(unsafe {
6184 fp(
6185 self.handle(),
6186 p_create_infos.len() as u32,
6187 p_create_infos.as_ptr(),
6188 alloc_ptr,
6189 out.as_mut_ptr(),
6190 )
6191 })?;
6192 Ok(out)
6193 }
6194 ///Wraps [`vkCreateSwapchainKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateSwapchainKHR.html).
6195 /**
6196 Provided by **VK_KHR_swapchain**.*/
6197 ///
6198 ///# Errors
6199 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6200 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
6201 ///- `VK_ERROR_DEVICE_LOST`
6202 ///- `VK_ERROR_SURFACE_LOST_KHR`
6203 ///- `VK_ERROR_NATIVE_WINDOW_IN_USE_KHR`
6204 ///- `VK_ERROR_INITIALIZATION_FAILED`
6205 ///- `VK_ERROR_COMPRESSION_EXHAUSTED_EXT`
6206 ///- `VK_ERROR_UNKNOWN`
6207 ///- `VK_ERROR_VALIDATION_FAILED`
6208 ///
6209 ///# Safety
6210 ///- `device` (self) must be valid and not destroyed.
6211 ///
6212 ///# Panics
6213 ///Panics if `vkCreateSwapchainKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6214 ///
6215 ///# Usage Notes
6216 ///
6217 ///Creates a swapchain, a queue of presentable images tied to a
6218 ///surface (window). The swapchain is the bridge between rendering and
6219 ///display.
6220 ///
6221 ///**Key parameters**:
6222 ///
6223 ///- **`min_image_count`**: request at least this many images. For
6224 /// double buffering use 2, for triple buffering use 3. Query
6225 /// `get_physical_device_surface_capabilities_khr` for the supported
6226 /// range.
6227 ///- **`image_format` / `image_color_space`**: pick a pair from
6228 /// `get_physical_device_surface_formats_khr`. `B8G8R8A8_SRGB` +
6229 /// `SRGB_NONLINEAR` is the most portable.
6230 ///- **`present_mode`**: `FIFO` (vsync, always supported), `MAILBOX`
6231 /// (low-latency triple buffering), `IMMEDIATE` (no vsync, tearing).
6232 ///- **`pre_transform`**: set to `current_transform` from surface
6233 /// capabilities to avoid an extra composition blit.
6234 ///- **`old_swapchain`**: when recreating after a resize, pass the old
6235 /// swapchain here. The driver can reuse internal resources.
6236 ///
6237 ///**Swapchain recreation** is required when the surface size changes
6238 ///(window resize) or when `acquire_next_image_khr` returns
6239 ///`VK_ERROR_OUT_OF_DATE_KHR`. Destroy the old swapchain after
6240 ///creating the new one.
6241 ///
6242 ///# Guide
6243 ///
6244 ///See [Hello Triangle, Part 2](https://hiddentale.github.io/vulkan_rust/getting-started/hello-triangle-2.html) in the vulkan_rust guide.
6245 pub unsafe fn create_swapchain_khr(
6246 &self,
6247 p_create_info: &SwapchainCreateInfoKHR,
6248 allocator: Option<&AllocationCallbacks>,
6249 ) -> VkResult<SwapchainKHR> {
6250 let fp = self
6251 .commands()
6252 .create_swapchain_khr
6253 .expect("vkCreateSwapchainKHR not loaded");
6254 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
6255 let mut out = unsafe { core::mem::zeroed() };
6256 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
6257 Ok(out)
6258 }
6259 ///Wraps [`vkDestroySwapchainKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroySwapchainKHR.html).
6260 /**
6261 Provided by **VK_KHR_swapchain**.*/
6262 ///
6263 ///# Safety
6264 ///- `device` (self) must be valid and not destroyed.
6265 ///- `swapchain` must be externally synchronized.
6266 ///
6267 ///# Panics
6268 ///Panics if `vkDestroySwapchainKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6269 ///
6270 ///# Usage Notes
6271 ///
6272 ///Destroys a swapchain. All images obtained from
6273 ///`get_swapchain_images_khr` become invalid, destroy any image views
6274 ///and framebuffers referencing them first.
6275 ///
6276 ///Wait for all rendering to complete (`device_wait_idle`) before
6277 ///destroying. Do not destroy a swapchain while an acquired image has
6278 ///not been presented.
6279 ///
6280 ///When recreating a swapchain (e.g. on resize), create the new one
6281 ///first (passing the old as `old_swapchain`), then destroy the old
6282 ///one.
6283 ///
6284 ///# Guide
6285 ///
6286 ///See [Hello Triangle, Part 2](https://hiddentale.github.io/vulkan_rust/getting-started/hello-triangle-2.html) in the vulkan_rust guide.
6287 pub unsafe fn destroy_swapchain_khr(
6288 &self,
6289 swapchain: SwapchainKHR,
6290 allocator: Option<&AllocationCallbacks>,
6291 ) {
6292 let fp = self
6293 .commands()
6294 .destroy_swapchain_khr
6295 .expect("vkDestroySwapchainKHR not loaded");
6296 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
6297 unsafe { fp(self.handle(), swapchain, alloc_ptr) };
6298 }
6299 ///Wraps [`vkGetSwapchainImagesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSwapchainImagesKHR.html).
6300 /**
6301 Provided by **VK_KHR_swapchain**.*/
6302 ///
6303 ///# Errors
6304 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6305 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
6306 ///- `VK_ERROR_UNKNOWN`
6307 ///- `VK_ERROR_VALIDATION_FAILED`
6308 ///
6309 ///# Safety
6310 ///- `device` (self) must be valid and not destroyed.
6311 ///
6312 ///# Panics
6313 ///Panics if `vkGetSwapchainImagesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6314 ///
6315 ///# Usage Notes
6316 ///
6317 ///Returns the array of presentable images owned by the swapchain. You
6318 ///do not create or destroy these images, they are managed by the
6319 ///swapchain.
6320 ///
6321 ///The returned image count may be greater than `min_image_count`
6322 ///requested at swapchain creation.
6323 ///
6324 ///Create an `ImageView` for each swapchain image to use them as
6325 ///render targets. These views (and any framebuffers using them) must
6326 ///be destroyed before the swapchain is destroyed.
6327 ///
6328 ///The images start in an undefined layout. Transition them to the
6329 ///appropriate layout (e.g. `COLOR_ATTACHMENT_OPTIMAL`) during the
6330 ///first render pass or via a pipeline barrier.
6331 ///
6332 ///# Guide
6333 ///
6334 ///See [Hello Triangle, Part 2](https://hiddentale.github.io/vulkan_rust/getting-started/hello-triangle-2.html) in the vulkan_rust guide.
6335 pub unsafe fn get_swapchain_images_khr(&self, swapchain: SwapchainKHR) -> VkResult<Vec<Image>> {
6336 let fp = self
6337 .commands()
6338 .get_swapchain_images_khr
6339 .expect("vkGetSwapchainImagesKHR not loaded");
6340 enumerate_two_call(|count, data| unsafe { fp(self.handle(), swapchain, count, data) })
6341 }
6342 ///Wraps [`vkAcquireNextImageKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAcquireNextImageKHR.html).
6343 /**
6344 Provided by **VK_KHR_swapchain**.*/
6345 ///
6346 ///# Errors
6347 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6348 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
6349 ///- `VK_ERROR_DEVICE_LOST`
6350 ///- `VK_ERROR_OUT_OF_DATE_KHR`
6351 ///- `VK_ERROR_SURFACE_LOST_KHR`
6352 ///- `VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT`
6353 ///- `VK_ERROR_UNKNOWN`
6354 ///- `VK_ERROR_VALIDATION_FAILED`
6355 ///
6356 ///# Safety
6357 ///- `device` (self) must be valid and not destroyed.
6358 ///- `swapchain` must be externally synchronized.
6359 ///- `semaphore` must be externally synchronized.
6360 ///- `fence` must be externally synchronized.
6361 ///
6362 ///# Panics
6363 ///Panics if `vkAcquireNextImageKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6364 ///
6365 ///# Usage Notes
6366 ///
6367 ///Acquires the next available image from the swapchain for rendering.
6368 ///Returns the index into the array from `get_swapchain_images_khr`.
6369 ///
6370 ///**Synchronisation**: pass a semaphore, a fence, or both. The
6371 ///semaphore/fence is signaled when the image is ready to be rendered
6372 ///to. Do not start rendering until the semaphore is waited on in
6373 ///`queue_submit`.
6374 ///
6375 ///**Timeout**: in nanoseconds. `u64::MAX` blocks indefinitely.
6376 ///
6377 ///**Special return values**:
6378 ///
6379 ///- `VK_SUBOPTIMAL_KHR`: the swapchain still works but no longer
6380 /// matches the surface perfectly (e.g. after a resize). You can
6381 /// continue rendering but should recreate the swapchain soon.
6382 ///- `VK_ERROR_OUT_OF_DATE_KHR`: the swapchain is incompatible with
6383 /// the surface and must be recreated before rendering. Do not present
6384 /// the acquired image.
6385 ///
6386 ///A common frame loop:
6387 ///
6388 ///```text
6389 ///acquire_next_image_khr(swapchain, u64::MAX, image_available_sem, null)
6390 #[doc = "// wait on image_available_sem in queue_submit"]
6391 #[doc = "// render to swapchain_images[index]"]
6392 #[doc = "// signal render_finished_sem in queue_submit"]
6393 ///queue_present_khr(render_finished_sem, swapchain, index)
6394 ///```
6395 ///
6396 ///# Guide
6397 ///
6398 ///See [Synchronization](https://hiddentale.github.io/vulkan_rust/concepts/synchronization.html) in the vulkan_rust guide.
6399 pub unsafe fn acquire_next_image_khr(
6400 &self,
6401 swapchain: SwapchainKHR,
6402 timeout: u64,
6403 semaphore: Semaphore,
6404 fence: Fence,
6405 ) -> VkResult<u32> {
6406 let fp = self
6407 .commands()
6408 .acquire_next_image_khr
6409 .expect("vkAcquireNextImageKHR not loaded");
6410 let mut out = unsafe { core::mem::zeroed() };
6411 check(unsafe {
6412 fp(
6413 self.handle(),
6414 swapchain,
6415 timeout,
6416 semaphore,
6417 fence,
6418 &mut out,
6419 )
6420 })?;
6421 Ok(out)
6422 }
6423 ///Wraps [`vkQueuePresentKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueuePresentKHR.html).
6424 /**
6425 Provided by **VK_KHR_swapchain**.*/
6426 ///
6427 ///# Errors
6428 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6429 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
6430 ///- `VK_ERROR_DEVICE_LOST`
6431 ///- `VK_ERROR_OUT_OF_DATE_KHR`
6432 ///- `VK_ERROR_SURFACE_LOST_KHR`
6433 ///- `VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT`
6434 ///- `VK_ERROR_UNKNOWN`
6435 ///- `VK_ERROR_VALIDATION_FAILED`
6436 ///- `VK_ERROR_PRESENT_TIMING_QUEUE_FULL_EXT`
6437 ///
6438 ///# Safety
6439 ///- `queue` (self) must be valid and not destroyed.
6440 ///- `queue` must be externally synchronized.
6441 ///
6442 ///# Panics
6443 ///Panics if `vkQueuePresentKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6444 ///
6445 ///# Usage Notes
6446 ///
6447 ///Presents a rendered swapchain image to the display. This is the
6448 ///final step in the frame loop, after rendering is complete, present
6449 ///the image to make it visible.
6450 ///
6451 ///**Wait semaphores**: the present waits on these semaphores before
6452 ///presenting. Pass the semaphore that your render submission signals
6453 ///to ensure the image is fully rendered before it goes to the display.
6454 ///
6455 ///**Multiple swapchains**: a single present call can present to
6456 ///multiple swapchains simultaneously (e.g. for multi-window or
6457 ///multi-monitor rendering).
6458 ///
6459 ///**Return values**:
6460 ///
6461 ///- `VK_SUBOPTIMAL_KHR`: presented successfully but the swapchain
6462 /// should be recreated.
6463 ///- `VK_ERROR_OUT_OF_DATE_KHR`: presentation failed, the swapchain
6464 /// must be recreated.
6465 ///
6466 ///The present queue does not need to be the same as the graphics
6467 ///queue, but the semaphore synchronisation must be correct if they
6468 ///differ.
6469 ///
6470 ///# Guide
6471 ///
6472 ///See [Hello Triangle, Part 4](https://hiddentale.github.io/vulkan_rust/getting-started/hello-triangle-4.html) in the vulkan_rust guide.
6473 pub unsafe fn queue_present_khr(
6474 &self,
6475 queue: Queue,
6476 p_present_info: &PresentInfoKHR,
6477 ) -> VkResult<()> {
6478 let fp = self
6479 .commands()
6480 .queue_present_khr
6481 .expect("vkQueuePresentKHR not loaded");
6482 check(unsafe { fp(queue, p_present_info) })
6483 }
6484 ///Wraps [`vkDebugMarkerSetObjectNameEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDebugMarkerSetObjectNameEXT.html).
6485 /**
6486 Provided by **VK_EXT_debug_marker**.*/
6487 ///
6488 ///# Errors
6489 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6490 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
6491 ///- `VK_ERROR_UNKNOWN`
6492 ///- `VK_ERROR_VALIDATION_FAILED`
6493 ///
6494 ///# Safety
6495 ///- `device` (self) must be valid and not destroyed.
6496 ///
6497 ///# Panics
6498 ///Panics if `vkDebugMarkerSetObjectNameEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6499 ///
6500 ///# Usage Notes
6501 ///
6502 ///Assigns a name to a Vulkan object for debugging. This is the
6503 ///legacy `VK_EXT_debug_marker` equivalent of
6504 ///`set_debug_utils_object_name_ext`.
6505 ///
6506 ///`DebugMarkerObjectNameInfoEXT` uses the old
6507 ///`DebugReportObjectTypeEXT` enum to identify object types.
6508 ///
6509 ///Superseded by `VK_EXT_debug_utils`. Prefer
6510 ///`set_debug_utils_object_name_ext` for new code.
6511 pub unsafe fn debug_marker_set_object_name_ext(
6512 &self,
6513 p_name_info: &DebugMarkerObjectNameInfoEXT,
6514 ) -> VkResult<()> {
6515 let fp = self
6516 .commands()
6517 .debug_marker_set_object_name_ext
6518 .expect("vkDebugMarkerSetObjectNameEXT not loaded");
6519 check(unsafe { fp(self.handle(), p_name_info) })
6520 }
6521 ///Wraps [`vkDebugMarkerSetObjectTagEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDebugMarkerSetObjectTagEXT.html).
6522 /**
6523 Provided by **VK_EXT_debug_marker**.*/
6524 ///
6525 ///# Errors
6526 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6527 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
6528 ///- `VK_ERROR_UNKNOWN`
6529 ///- `VK_ERROR_VALIDATION_FAILED`
6530 ///
6531 ///# Safety
6532 ///- `device` (self) must be valid and not destroyed.
6533 ///
6534 ///# Panics
6535 ///Panics if `vkDebugMarkerSetObjectTagEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6536 ///
6537 ///# Usage Notes
6538 ///
6539 ///Attaches arbitrary binary data to a Vulkan object. This is the
6540 ///legacy `VK_EXT_debug_marker` equivalent of
6541 ///`set_debug_utils_object_tag_ext`.
6542 ///
6543 ///Superseded by `VK_EXT_debug_utils`. Prefer
6544 ///`set_debug_utils_object_tag_ext` for new code.
6545 pub unsafe fn debug_marker_set_object_tag_ext(
6546 &self,
6547 p_tag_info: &DebugMarkerObjectTagInfoEXT,
6548 ) -> VkResult<()> {
6549 let fp = self
6550 .commands()
6551 .debug_marker_set_object_tag_ext
6552 .expect("vkDebugMarkerSetObjectTagEXT not loaded");
6553 check(unsafe { fp(self.handle(), p_tag_info) })
6554 }
6555 ///Wraps [`vkCmdDebugMarkerBeginEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDebugMarkerBeginEXT.html).
6556 /**
6557 Provided by **VK_EXT_debug_marker**.*/
6558 ///
6559 ///# Safety
6560 ///- `commandBuffer` (self) must be valid and not destroyed.
6561 ///- `commandBuffer` must be externally synchronized.
6562 ///
6563 ///# Panics
6564 ///Panics if `vkCmdDebugMarkerBeginEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6565 ///
6566 ///# Usage Notes
6567 ///
6568 ///Opens a debug marker region in a command buffer. This is the
6569 ///legacy `VK_EXT_debug_marker` equivalent of
6570 ///`cmd_begin_debug_utils_label_ext`.
6571 ///
6572 ///`DebugMarkerMarkerInfoEXT` specifies a name and optional RGBA
6573 ///color. Close with `cmd_debug_marker_end_ext`.
6574 ///
6575 ///Superseded by `VK_EXT_debug_utils`. Prefer
6576 ///`cmd_begin_debug_utils_label_ext` for new code.
6577 pub unsafe fn cmd_debug_marker_begin_ext(
6578 &self,
6579 command_buffer: CommandBuffer,
6580 p_marker_info: &DebugMarkerMarkerInfoEXT,
6581 ) {
6582 let fp = self
6583 .commands()
6584 .cmd_debug_marker_begin_ext
6585 .expect("vkCmdDebugMarkerBeginEXT not loaded");
6586 unsafe { fp(command_buffer, p_marker_info) };
6587 }
6588 ///Wraps [`vkCmdDebugMarkerEndEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDebugMarkerEndEXT.html).
6589 /**
6590 Provided by **VK_EXT_debug_marker**.*/
6591 ///
6592 ///# Safety
6593 ///- `commandBuffer` (self) must be valid and not destroyed.
6594 ///- `commandBuffer` must be externally synchronized.
6595 ///
6596 ///# Panics
6597 ///Panics if `vkCmdDebugMarkerEndEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6598 ///
6599 ///# Usage Notes
6600 ///
6601 ///Closes the most recently opened debug marker region in the command
6602 ///buffer. Must be paired with `cmd_debug_marker_begin_ext`.
6603 ///
6604 ///This is the legacy `VK_EXT_debug_marker` equivalent of
6605 ///`cmd_end_debug_utils_label_ext`. Prefer `VK_EXT_debug_utils`
6606 ///for new code.
6607 pub unsafe fn cmd_debug_marker_end_ext(&self, command_buffer: CommandBuffer) {
6608 let fp = self
6609 .commands()
6610 .cmd_debug_marker_end_ext
6611 .expect("vkCmdDebugMarkerEndEXT not loaded");
6612 unsafe { fp(command_buffer) };
6613 }
6614 ///Wraps [`vkCmdDebugMarkerInsertEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDebugMarkerInsertEXT.html).
6615 /**
6616 Provided by **VK_EXT_debug_marker**.*/
6617 ///
6618 ///# Safety
6619 ///- `commandBuffer` (self) must be valid and not destroyed.
6620 ///- `commandBuffer` must be externally synchronized.
6621 ///
6622 ///# Panics
6623 ///Panics if `vkCmdDebugMarkerInsertEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6624 ///
6625 ///# Usage Notes
6626 ///
6627 ///Inserts a single-point debug marker into the command buffer.
6628 ///This is the legacy `VK_EXT_debug_marker` equivalent of
6629 ///`cmd_insert_debug_utils_label_ext`.
6630 ///
6631 ///`DebugMarkerMarkerInfoEXT` specifies a name and optional RGBA
6632 ///color.
6633 ///
6634 ///Superseded by `VK_EXT_debug_utils`. Prefer
6635 ///`cmd_insert_debug_utils_label_ext` for new code.
6636 pub unsafe fn cmd_debug_marker_insert_ext(
6637 &self,
6638 command_buffer: CommandBuffer,
6639 p_marker_info: &DebugMarkerMarkerInfoEXT,
6640 ) {
6641 let fp = self
6642 .commands()
6643 .cmd_debug_marker_insert_ext
6644 .expect("vkCmdDebugMarkerInsertEXT not loaded");
6645 unsafe { fp(command_buffer, p_marker_info) };
6646 }
6647 ///Wraps [`vkGetMemoryWin32HandleNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryWin32HandleNV.html).
6648 /**
6649 Provided by **VK_NV_external_memory_win32**.*/
6650 ///
6651 ///# Errors
6652 ///- `VK_ERROR_TOO_MANY_OBJECTS`
6653 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6654 ///- `VK_ERROR_UNKNOWN`
6655 ///- `VK_ERROR_VALIDATION_FAILED`
6656 ///
6657 ///# Safety
6658 ///- `device` (self) must be valid and not destroyed.
6659 ///
6660 ///# Panics
6661 ///Panics if `vkGetMemoryWin32HandleNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6662 ///
6663 ///# Usage Notes
6664 ///
6665 ///Exports a Vulkan device memory allocation as a Win32 handle
6666 ///(HANDLE) for sharing with other APIs or processes. This is the
6667 ///legacy NV path; prefer `get_memory_win32_handle_khr` for new
6668 ///code.
6669 ///
6670 ///Requires `VK_NV_external_memory_win32`. Windows only.
6671 pub unsafe fn get_memory_win32_handle_nv(
6672 &self,
6673 memory: DeviceMemory,
6674 handle_type: ExternalMemoryHandleTypeFlagsNV,
6675 ) -> VkResult<isize> {
6676 let fp = self
6677 .commands()
6678 .get_memory_win32_handle_nv
6679 .expect("vkGetMemoryWin32HandleNV not loaded");
6680 let mut out = unsafe { core::mem::zeroed() };
6681 check(unsafe { fp(self.handle(), memory, handle_type, &mut out) })?;
6682 Ok(out)
6683 }
6684 ///Wraps [`vkCmdExecuteGeneratedCommandsNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdExecuteGeneratedCommandsNV.html).
6685 /**
6686 Provided by **VK_NV_device_generated_commands**.*/
6687 ///
6688 ///# Safety
6689 ///- `commandBuffer` (self) must be valid and not destroyed.
6690 ///- `commandBuffer` must be externally synchronized.
6691 ///
6692 ///# Panics
6693 ///Panics if `vkCmdExecuteGeneratedCommandsNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6694 ///
6695 ///# Usage Notes
6696 ///
6697 ///Executes commands that were generated on the GPU. If
6698 ///`is_preprocessed` is set, the commands must have been
6699 ///preprocessed with `cmd_preprocess_generated_commands_nv` first.
6700 ///
6701 ///Requires `VK_NV_device_generated_commands`.
6702 pub unsafe fn cmd_execute_generated_commands_nv(
6703 &self,
6704 command_buffer: CommandBuffer,
6705 is_preprocessed: bool,
6706 p_generated_commands_info: &GeneratedCommandsInfoNV,
6707 ) {
6708 let fp = self
6709 .commands()
6710 .cmd_execute_generated_commands_nv
6711 .expect("vkCmdExecuteGeneratedCommandsNV not loaded");
6712 unsafe {
6713 fp(
6714 command_buffer,
6715 is_preprocessed as u32,
6716 p_generated_commands_info,
6717 )
6718 };
6719 }
6720 ///Wraps [`vkCmdPreprocessGeneratedCommandsNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPreprocessGeneratedCommandsNV.html).
6721 /**
6722 Provided by **VK_NV_device_generated_commands**.*/
6723 ///
6724 ///# Safety
6725 ///- `commandBuffer` (self) must be valid and not destroyed.
6726 ///- `commandBuffer` must be externally synchronized.
6727 ///
6728 ///# Panics
6729 ///Panics if `vkCmdPreprocessGeneratedCommandsNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6730 ///
6731 ///# Usage Notes
6732 ///
6733 ///Preprocesses device-generated commands into a form suitable for
6734 ///fast execution. The preprocessing result is stored in a
6735 ///preprocess buffer and later consumed by
6736 ///`cmd_execute_generated_commands_nv` with `is_preprocessed` set.
6737 ///
6738 ///Requires `VK_NV_device_generated_commands`.
6739 pub unsafe fn cmd_preprocess_generated_commands_nv(
6740 &self,
6741 command_buffer: CommandBuffer,
6742 p_generated_commands_info: &GeneratedCommandsInfoNV,
6743 ) {
6744 let fp = self
6745 .commands()
6746 .cmd_preprocess_generated_commands_nv
6747 .expect("vkCmdPreprocessGeneratedCommandsNV not loaded");
6748 unsafe { fp(command_buffer, p_generated_commands_info) };
6749 }
6750 ///Wraps [`vkCmdBindPipelineShaderGroupNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindPipelineShaderGroupNV.html).
6751 /**
6752 Provided by **VK_NV_device_generated_commands**.*/
6753 ///
6754 ///# Safety
6755 ///- `commandBuffer` (self) must be valid and not destroyed.
6756 ///- `commandBuffer` must be externally synchronized.
6757 ///
6758 ///# Panics
6759 ///Panics if `vkCmdBindPipelineShaderGroupNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6760 ///
6761 ///# Usage Notes
6762 ///
6763 ///Binds a shader group from a pipeline that was created with
6764 ///multiple shader groups. Used with device-generated commands to
6765 ///switch between pre-compiled shader variants without rebinding
6766 ///the entire pipeline.
6767 ///
6768 ///Requires `VK_NV_device_generated_commands`.
6769 pub unsafe fn cmd_bind_pipeline_shader_group_nv(
6770 &self,
6771 command_buffer: CommandBuffer,
6772 pipeline_bind_point: PipelineBindPoint,
6773 pipeline: Pipeline,
6774 group_index: u32,
6775 ) {
6776 let fp = self
6777 .commands()
6778 .cmd_bind_pipeline_shader_group_nv
6779 .expect("vkCmdBindPipelineShaderGroupNV not loaded");
6780 unsafe { fp(command_buffer, pipeline_bind_point, pipeline, group_index) };
6781 }
6782 ///Wraps [`vkGetGeneratedCommandsMemoryRequirementsNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetGeneratedCommandsMemoryRequirementsNV.html).
6783 /**
6784 Provided by **VK_NV_device_generated_commands**.*/
6785 ///
6786 ///# Safety
6787 ///- `device` (self) must be valid and not destroyed.
6788 ///
6789 ///# Panics
6790 ///Panics if `vkGetGeneratedCommandsMemoryRequirementsNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6791 ///
6792 ///# Usage Notes
6793 ///
6794 ///Queries the memory requirements for preprocessing device-generated
6795 ///commands. The returned size determines how large the preprocess
6796 ///buffer must be for `cmd_preprocess_generated_commands_nv`.
6797 ///
6798 ///Requires `VK_NV_device_generated_commands`.
6799 pub unsafe fn get_generated_commands_memory_requirements_nv(
6800 &self,
6801 p_info: &GeneratedCommandsMemoryRequirementsInfoNV,
6802 p_memory_requirements: &mut MemoryRequirements2,
6803 ) {
6804 let fp = self
6805 .commands()
6806 .get_generated_commands_memory_requirements_nv
6807 .expect("vkGetGeneratedCommandsMemoryRequirementsNV not loaded");
6808 unsafe { fp(self.handle(), p_info, p_memory_requirements) };
6809 }
6810 ///Wraps [`vkCreateIndirectCommandsLayoutNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateIndirectCommandsLayoutNV.html).
6811 /**
6812 Provided by **VK_NV_device_generated_commands**.*/
6813 ///
6814 ///# Errors
6815 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6816 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
6817 ///- `VK_ERROR_UNKNOWN`
6818 ///- `VK_ERROR_VALIDATION_FAILED`
6819 ///
6820 ///# Safety
6821 ///- `device` (self) must be valid and not destroyed.
6822 ///
6823 ///# Panics
6824 ///Panics if `vkCreateIndirectCommandsLayoutNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6825 ///
6826 ///# Usage Notes
6827 ///
6828 ///Creates a layout that describes the structure of indirect command
6829 ///sequences for device-generated commands. The layout defines which
6830 ///tokens (draw, dispatch, push constants, etc.) appear in the
6831 ///command stream and their order.
6832 ///
6833 ///Destroy with `destroy_indirect_commands_layout_nv`.
6834 ///
6835 ///Requires `VK_NV_device_generated_commands`.
6836 pub unsafe fn create_indirect_commands_layout_nv(
6837 &self,
6838 p_create_info: &IndirectCommandsLayoutCreateInfoNV,
6839 allocator: Option<&AllocationCallbacks>,
6840 ) -> VkResult<IndirectCommandsLayoutNV> {
6841 let fp = self
6842 .commands()
6843 .create_indirect_commands_layout_nv
6844 .expect("vkCreateIndirectCommandsLayoutNV not loaded");
6845 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
6846 let mut out = unsafe { core::mem::zeroed() };
6847 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
6848 Ok(out)
6849 }
6850 ///Wraps [`vkDestroyIndirectCommandsLayoutNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyIndirectCommandsLayoutNV.html).
6851 /**
6852 Provided by **VK_NV_device_generated_commands**.*/
6853 ///
6854 ///# Safety
6855 ///- `device` (self) must be valid and not destroyed.
6856 ///- `indirectCommandsLayout` must be externally synchronized.
6857 ///
6858 ///# Panics
6859 ///Panics if `vkDestroyIndirectCommandsLayoutNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6860 ///
6861 ///# Usage Notes
6862 ///
6863 ///Destroys an indirect commands layout created with
6864 ///`create_indirect_commands_layout_nv`.
6865 ///
6866 ///Requires `VK_NV_device_generated_commands`.
6867 pub unsafe fn destroy_indirect_commands_layout_nv(
6868 &self,
6869 indirect_commands_layout: IndirectCommandsLayoutNV,
6870 allocator: Option<&AllocationCallbacks>,
6871 ) {
6872 let fp = self
6873 .commands()
6874 .destroy_indirect_commands_layout_nv
6875 .expect("vkDestroyIndirectCommandsLayoutNV not loaded");
6876 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
6877 unsafe { fp(self.handle(), indirect_commands_layout, alloc_ptr) };
6878 }
6879 ///Wraps [`vkCmdExecuteGeneratedCommandsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdExecuteGeneratedCommandsEXT.html).
6880 /**
6881 Provided by **VK_EXT_device_generated_commands**.*/
6882 ///
6883 ///# Safety
6884 ///- `commandBuffer` (self) must be valid and not destroyed.
6885 ///- `commandBuffer` must be externally synchronized.
6886 ///
6887 ///# Panics
6888 ///Panics if `vkCmdExecuteGeneratedCommandsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6889 ///
6890 ///# Usage Notes
6891 ///
6892 ///Executes commands generated on the GPU from an indirect commands
6893 ///layout. The `GeneratedCommandsInfoEXT` specifies the indirect
6894 ///commands layout, pipeline/shader objects, and the buffer
6895 ///containing the generated command data.
6896 ///
6897 ///If `is_preprocessed` is true, the command data was prepared by
6898 ///a prior `cmd_preprocess_generated_commands_ext` call. Otherwise,
6899 ///preprocessing and execution happen in one step.
6900 ///
6901 ///Requires `VK_EXT_device_generated_commands`.
6902 pub unsafe fn cmd_execute_generated_commands_ext(
6903 &self,
6904 command_buffer: CommandBuffer,
6905 is_preprocessed: bool,
6906 p_generated_commands_info: &GeneratedCommandsInfoEXT,
6907 ) {
6908 let fp = self
6909 .commands()
6910 .cmd_execute_generated_commands_ext
6911 .expect("vkCmdExecuteGeneratedCommandsEXT not loaded");
6912 unsafe {
6913 fp(
6914 command_buffer,
6915 is_preprocessed as u32,
6916 p_generated_commands_info,
6917 )
6918 };
6919 }
6920 ///Wraps [`vkCmdPreprocessGeneratedCommandsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPreprocessGeneratedCommandsEXT.html).
6921 /**
6922 Provided by **VK_EXT_device_generated_commands**.*/
6923 ///
6924 ///# Safety
6925 ///- `commandBuffer` (self) must be valid and not destroyed.
6926 ///- `commandBuffer` must be externally synchronized.
6927 ///- `stateCommandBuffer` must be externally synchronized.
6928 ///
6929 ///# Panics
6930 ///Panics if `vkCmdPreprocessGeneratedCommandsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6931 ///
6932 ///# Usage Notes
6933 ///
6934 ///Preprocesses device-generated commands into an intermediate
6935 ///format. This can be done in a separate command buffer or pass,
6936 ///then executed later with `cmd_execute_generated_commands_ext`
6937 ///(with `is_preprocessed` = true).
6938 ///
6939 ///Separating preprocessing from execution allows overlapping the
6940 ///preprocessing work with other GPU tasks.
6941 ///
6942 ///Requires `VK_EXT_device_generated_commands`.
6943 pub unsafe fn cmd_preprocess_generated_commands_ext(
6944 &self,
6945 command_buffer: CommandBuffer,
6946 p_generated_commands_info: &GeneratedCommandsInfoEXT,
6947 state_command_buffer: CommandBuffer,
6948 ) {
6949 let fp = self
6950 .commands()
6951 .cmd_preprocess_generated_commands_ext
6952 .expect("vkCmdPreprocessGeneratedCommandsEXT not loaded");
6953 unsafe {
6954 fp(
6955 command_buffer,
6956 p_generated_commands_info,
6957 state_command_buffer,
6958 )
6959 };
6960 }
6961 ///Wraps [`vkGetGeneratedCommandsMemoryRequirementsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetGeneratedCommandsMemoryRequirementsEXT.html).
6962 /**
6963 Provided by **VK_EXT_device_generated_commands**.*/
6964 ///
6965 ///# Safety
6966 ///- `device` (self) must be valid and not destroyed.
6967 ///
6968 ///# Panics
6969 ///Panics if `vkGetGeneratedCommandsMemoryRequirementsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6970 ///
6971 ///# Usage Notes
6972 ///
6973 ///Queries the memory requirements for preprocessing and executing
6974 ///device-generated commands. Returns a `MemoryRequirements2` with
6975 ///the size and alignment needed for the preprocess buffer.
6976 ///
6977 ///Call this before allocating the preprocess buffer used by
6978 ///`cmd_preprocess_generated_commands_ext` and
6979 ///`cmd_execute_generated_commands_ext`.
6980 ///
6981 ///Requires `VK_EXT_device_generated_commands`.
6982 pub unsafe fn get_generated_commands_memory_requirements_ext(
6983 &self,
6984 p_info: &GeneratedCommandsMemoryRequirementsInfoEXT,
6985 p_memory_requirements: &mut MemoryRequirements2,
6986 ) {
6987 let fp = self
6988 .commands()
6989 .get_generated_commands_memory_requirements_ext
6990 .expect("vkGetGeneratedCommandsMemoryRequirementsEXT not loaded");
6991 unsafe { fp(self.handle(), p_info, p_memory_requirements) };
6992 }
6993 ///Wraps [`vkCreateIndirectCommandsLayoutEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateIndirectCommandsLayoutEXT.html).
6994 /**
6995 Provided by **VK_EXT_device_generated_commands**.*/
6996 ///
6997 ///# Errors
6998 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6999 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
7000 ///- `VK_ERROR_UNKNOWN`
7001 ///- `VK_ERROR_VALIDATION_FAILED`
7002 ///
7003 ///# Safety
7004 ///- `device` (self) must be valid and not destroyed.
7005 ///
7006 ///# Panics
7007 ///Panics if `vkCreateIndirectCommandsLayoutEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7008 ///
7009 ///# Usage Notes
7010 ///
7011 ///Creates an indirect commands layout that defines the structure of
7012 ///GPU-generated command sequences. Each token in the layout
7013 ///describes one command element (draw, dispatch, push constant,
7014 ///vertex buffer bind, index buffer bind, etc.).
7015 ///
7016 ///The layout is used with `cmd_execute_generated_commands_ext`.
7017 ///
7018 ///Destroy with `destroy_indirect_commands_layout_ext`.
7019 ///
7020 ///Requires `VK_EXT_device_generated_commands`.
7021 pub unsafe fn create_indirect_commands_layout_ext(
7022 &self,
7023 p_create_info: &IndirectCommandsLayoutCreateInfoEXT,
7024 allocator: Option<&AllocationCallbacks>,
7025 ) -> VkResult<IndirectCommandsLayoutEXT> {
7026 let fp = self
7027 .commands()
7028 .create_indirect_commands_layout_ext
7029 .expect("vkCreateIndirectCommandsLayoutEXT not loaded");
7030 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
7031 let mut out = unsafe { core::mem::zeroed() };
7032 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
7033 Ok(out)
7034 }
7035 ///Wraps [`vkDestroyIndirectCommandsLayoutEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyIndirectCommandsLayoutEXT.html).
7036 /**
7037 Provided by **VK_EXT_device_generated_commands**.*/
7038 ///
7039 ///# Safety
7040 ///- `device` (self) must be valid and not destroyed.
7041 ///- `indirectCommandsLayout` must be externally synchronized.
7042 ///
7043 ///# Panics
7044 ///Panics if `vkDestroyIndirectCommandsLayoutEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7045 ///
7046 ///# Usage Notes
7047 ///
7048 ///Destroys an indirect commands layout created with
7049 ///`create_indirect_commands_layout_ext`.
7050 ///
7051 ///Requires `VK_EXT_device_generated_commands`.
7052 pub unsafe fn destroy_indirect_commands_layout_ext(
7053 &self,
7054 indirect_commands_layout: IndirectCommandsLayoutEXT,
7055 allocator: Option<&AllocationCallbacks>,
7056 ) {
7057 let fp = self
7058 .commands()
7059 .destroy_indirect_commands_layout_ext
7060 .expect("vkDestroyIndirectCommandsLayoutEXT not loaded");
7061 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
7062 unsafe { fp(self.handle(), indirect_commands_layout, alloc_ptr) };
7063 }
7064 ///Wraps [`vkCreateIndirectExecutionSetEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateIndirectExecutionSetEXT.html).
7065 /**
7066 Provided by **VK_EXT_device_generated_commands**.*/
7067 ///
7068 ///# Errors
7069 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7070 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
7071 ///- `VK_ERROR_UNKNOWN`
7072 ///- `VK_ERROR_VALIDATION_FAILED`
7073 ///
7074 ///# Safety
7075 ///- `device` (self) must be valid and not destroyed.
7076 ///
7077 ///# Panics
7078 ///Panics if `vkCreateIndirectExecutionSetEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7079 ///
7080 ///# Usage Notes
7081 ///
7082 ///Creates an indirect execution set, a table of pipelines or
7083 ///shader objects that can be indexed at execution time by
7084 ///device-generated commands.
7085 ///
7086 ///The GPU selects which pipeline/shader to use based on an index
7087 ///in the generated command stream, enabling fully GPU-driven
7088 ///material/shader selection.
7089 ///
7090 ///Destroy with `destroy_indirect_execution_set_ext`.
7091 ///
7092 ///Requires `VK_EXT_device_generated_commands`.
7093 pub unsafe fn create_indirect_execution_set_ext(
7094 &self,
7095 p_create_info: &IndirectExecutionSetCreateInfoEXT,
7096 allocator: Option<&AllocationCallbacks>,
7097 ) -> VkResult<IndirectExecutionSetEXT> {
7098 let fp = self
7099 .commands()
7100 .create_indirect_execution_set_ext
7101 .expect("vkCreateIndirectExecutionSetEXT not loaded");
7102 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
7103 let mut out = unsafe { core::mem::zeroed() };
7104 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
7105 Ok(out)
7106 }
7107 ///Wraps [`vkDestroyIndirectExecutionSetEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyIndirectExecutionSetEXT.html).
7108 /**
7109 Provided by **VK_EXT_device_generated_commands**.*/
7110 ///
7111 ///# Safety
7112 ///- `device` (self) must be valid and not destroyed.
7113 ///- `indirectExecutionSet` must be externally synchronized.
7114 ///
7115 ///# Panics
7116 ///Panics if `vkDestroyIndirectExecutionSetEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7117 ///
7118 ///# Usage Notes
7119 ///
7120 ///Destroys an indirect execution set created with
7121 ///`create_indirect_execution_set_ext`.
7122 ///
7123 ///Requires `VK_EXT_device_generated_commands`.
7124 pub unsafe fn destroy_indirect_execution_set_ext(
7125 &self,
7126 indirect_execution_set: IndirectExecutionSetEXT,
7127 allocator: Option<&AllocationCallbacks>,
7128 ) {
7129 let fp = self
7130 .commands()
7131 .destroy_indirect_execution_set_ext
7132 .expect("vkDestroyIndirectExecutionSetEXT not loaded");
7133 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
7134 unsafe { fp(self.handle(), indirect_execution_set, alloc_ptr) };
7135 }
7136 ///Wraps [`vkUpdateIndirectExecutionSetPipelineEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkUpdateIndirectExecutionSetPipelineEXT.html).
7137 /**
7138 Provided by **VK_EXT_device_generated_commands**.*/
7139 ///
7140 ///# Safety
7141 ///- `device` (self) must be valid and not destroyed.
7142 ///- `indirectExecutionSet` must be externally synchronized.
7143 ///
7144 ///# Panics
7145 ///Panics if `vkUpdateIndirectExecutionSetPipelineEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7146 ///
7147 ///# Usage Notes
7148 ///
7149 ///Updates entries in an indirect execution set that holds pipelines.
7150 ///Each `WriteIndirectExecutionSetPipelineEXT` maps an index to a
7151 ///pipeline handle.
7152 ///
7153 ///The pipelines must be compatible with the initial pipeline used
7154 ///to create the execution set.
7155 ///
7156 ///Requires `VK_EXT_device_generated_commands`.
7157 pub unsafe fn update_indirect_execution_set_pipeline_ext(
7158 &self,
7159 indirect_execution_set: IndirectExecutionSetEXT,
7160 p_execution_set_writes: &[WriteIndirectExecutionSetPipelineEXT],
7161 ) {
7162 let fp = self
7163 .commands()
7164 .update_indirect_execution_set_pipeline_ext
7165 .expect("vkUpdateIndirectExecutionSetPipelineEXT not loaded");
7166 unsafe {
7167 fp(
7168 self.handle(),
7169 indirect_execution_set,
7170 p_execution_set_writes.len() as u32,
7171 p_execution_set_writes.as_ptr(),
7172 )
7173 };
7174 }
7175 ///Wraps [`vkUpdateIndirectExecutionSetShaderEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkUpdateIndirectExecutionSetShaderEXT.html).
7176 /**
7177 Provided by **VK_EXT_device_generated_commands**.*/
7178 ///
7179 ///# Safety
7180 ///- `device` (self) must be valid and not destroyed.
7181 ///- `indirectExecutionSet` must be externally synchronized.
7182 ///
7183 ///# Panics
7184 ///Panics if `vkUpdateIndirectExecutionSetShaderEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7185 ///
7186 ///# Usage Notes
7187 ///
7188 ///Updates entries in an indirect execution set that holds shader
7189 ///objects. Each `WriteIndirectExecutionSetShaderEXT` maps an index
7190 ///to a shader object handle.
7191 ///
7192 ///The shaders must be compatible with the initial shader used to
7193 ///create the execution set.
7194 ///
7195 ///Requires `VK_EXT_device_generated_commands`.
7196 pub unsafe fn update_indirect_execution_set_shader_ext(
7197 &self,
7198 indirect_execution_set: IndirectExecutionSetEXT,
7199 p_execution_set_writes: &[WriteIndirectExecutionSetShaderEXT],
7200 ) {
7201 let fp = self
7202 .commands()
7203 .update_indirect_execution_set_shader_ext
7204 .expect("vkUpdateIndirectExecutionSetShaderEXT not loaded");
7205 unsafe {
7206 fp(
7207 self.handle(),
7208 indirect_execution_set,
7209 p_execution_set_writes.len() as u32,
7210 p_execution_set_writes.as_ptr(),
7211 )
7212 };
7213 }
7214 ///Wraps [`vkCmdPushDescriptorSet`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPushDescriptorSet.html).
7215 /**
7216 Provided by **VK_COMPUTE_VERSION_1_4**.*/
7217 ///
7218 ///# Safety
7219 ///- `commandBuffer` (self) must be valid and not destroyed.
7220 ///- `commandBuffer` must be externally synchronized.
7221 ///
7222 ///# Panics
7223 ///Panics if `vkCmdPushDescriptorSet` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7224 ///
7225 ///# Usage Notes
7226 ///
7227 ///Pushes descriptor updates directly into the command buffer without
7228 ///allocating a descriptor set from a pool. The descriptors are embedded
7229 ///in the command stream and only live for the duration of the current
7230 ///command buffer recording.
7231 ///
7232 ///**Advantages**:
7233 ///
7234 ///- No descriptor pool allocation or management.
7235 ///- No need to track descriptor set lifetimes.
7236 ///- Ideal for per-draw data that changes every frame.
7237 ///
7238 ///**Trade-offs**:
7239 ///
7240 ///- Inflates command buffer size (descriptors are stored inline).
7241 ///- Not suitable for large descriptor sets, use conventional
7242 /// allocated sets for sets with many bindings.
7243 ///
7244 ///The pipeline layout must have been created with
7245 ///`DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR` on the target set
7246 ///index.
7247 ///
7248 ///Core in Vulkan 1.4. Previously available via `VK_KHR_push_descriptor`.
7249 pub unsafe fn cmd_push_descriptor_set(
7250 &self,
7251 command_buffer: CommandBuffer,
7252 pipeline_bind_point: PipelineBindPoint,
7253 layout: PipelineLayout,
7254 set: u32,
7255 p_descriptor_writes: &[WriteDescriptorSet],
7256 ) {
7257 let fp = self
7258 .commands()
7259 .cmd_push_descriptor_set
7260 .expect("vkCmdPushDescriptorSet not loaded");
7261 unsafe {
7262 fp(
7263 command_buffer,
7264 pipeline_bind_point,
7265 layout,
7266 set,
7267 p_descriptor_writes.len() as u32,
7268 p_descriptor_writes.as_ptr(),
7269 )
7270 };
7271 }
7272 ///Wraps [`vkTrimCommandPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkTrimCommandPool.html).
7273 /**
7274 Provided by **VK_BASE_VERSION_1_1**.*/
7275 ///
7276 ///# Safety
7277 ///- `device` (self) must be valid and not destroyed.
7278 ///- `commandPool` must be externally synchronized.
7279 ///
7280 ///# Panics
7281 ///Panics if `vkTrimCommandPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7282 ///
7283 ///# Usage Notes
7284 ///
7285 ///Returns unused memory from a command pool back to the system. This
7286 ///is a hint to the driver, it may or may not actually release memory.
7287 ///
7288 ///Call this after a period of high command buffer allocation followed
7289 ///by a return to lower usage (e.g. after loading screens or level
7290 ///transitions). It does not affect any allocated command buffers.
7291 ///
7292 ///Unlike `reset_command_pool`, trimming does not reset or invalidate
7293 ///command buffers. It only reclaims excess internal memory that the
7294 ///pool pre-allocated.
7295 ///
7296 ///In a steady-state frame loop where you reset the pool every frame,
7297 ///trimming is unnecessary, the pool reuses its memory naturally.
7298 pub unsafe fn trim_command_pool(&self, command_pool: CommandPool, flags: CommandPoolTrimFlags) {
7299 let fp = self
7300 .commands()
7301 .trim_command_pool
7302 .expect("vkTrimCommandPool not loaded");
7303 unsafe { fp(self.handle(), command_pool, flags) };
7304 }
7305 ///Wraps [`vkGetMemoryWin32HandleKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryWin32HandleKHR.html).
7306 /**
7307 Provided by **VK_KHR_external_memory_win32**.*/
7308 ///
7309 ///# Errors
7310 ///- `VK_ERROR_TOO_MANY_OBJECTS`
7311 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7312 ///- `VK_ERROR_UNKNOWN`
7313 ///- `VK_ERROR_VALIDATION_FAILED`
7314 ///
7315 ///# Safety
7316 ///- `device` (self) must be valid and not destroyed.
7317 ///
7318 ///# Panics
7319 ///Panics if `vkGetMemoryWin32HandleKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7320 ///
7321 ///# Usage Notes
7322 ///
7323 ///Exports a device memory allocation as a Windows HANDLE. The
7324 ///handle can be shared with other processes or APIs (D3D12, CUDA)
7325 ///for GPU memory interop.
7326 ///
7327 ///`MemoryGetWin32HandleInfoKHR` specifies the `DeviceMemory` and
7328 ///handle type (`OPAQUE_WIN32` or `OPAQUE_WIN32_KMT`).
7329 ///
7330 ///For `OPAQUE_WIN32`, the handle must be closed with `CloseHandle`
7331 ///when done. `OPAQUE_WIN32_KMT` handles are kernel-managed and do
7332 ///not need explicit cleanup.
7333 ///
7334 ///Windows only. Use `get_memory_fd_khr` on Linux.
7335 pub unsafe fn get_memory_win32_handle_khr(
7336 &self,
7337 p_get_win32_handle_info: &MemoryGetWin32HandleInfoKHR,
7338 ) -> VkResult<isize> {
7339 let fp = self
7340 .commands()
7341 .get_memory_win32_handle_khr
7342 .expect("vkGetMemoryWin32HandleKHR not loaded");
7343 let mut out = unsafe { core::mem::zeroed() };
7344 check(unsafe { fp(self.handle(), p_get_win32_handle_info, &mut out) })?;
7345 Ok(out)
7346 }
7347 ///Wraps [`vkGetMemoryWin32HandlePropertiesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryWin32HandlePropertiesKHR.html).
7348 /**
7349 Provided by **VK_KHR_external_memory_win32**.*/
7350 ///
7351 ///# Errors
7352 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7353 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
7354 ///- `VK_ERROR_UNKNOWN`
7355 ///- `VK_ERROR_VALIDATION_FAILED`
7356 ///
7357 ///# Safety
7358 ///- `device` (self) must be valid and not destroyed.
7359 ///
7360 ///# Panics
7361 ///Panics if `vkGetMemoryWin32HandlePropertiesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7362 ///
7363 ///# Usage Notes
7364 ///
7365 ///Queries which memory types are compatible with an external
7366 ///Windows HANDLE. Use this when importing memory from a handle
7367 ///received from another process or API (e.g., D3D11 shared
7368 ///textures).
7369 ///
7370 ///Returns `MemoryWin32HandlePropertiesKHR` with `memory_type_bits`
7371 ///indicating compatible memory type indices for import.
7372 ///
7373 ///Not valid for `OPAQUE_WIN32` or `OPAQUE_WIN32_KMT` handle types,
7374 ///those have their memory type determined by the exporting
7375 ///allocation.
7376 pub unsafe fn get_memory_win32_handle_properties_khr(
7377 &self,
7378 handle_type: ExternalMemoryHandleTypeFlagBits,
7379 handle: isize,
7380 p_memory_win32_handle_properties: &mut MemoryWin32HandlePropertiesKHR,
7381 ) -> VkResult<()> {
7382 let fp = self
7383 .commands()
7384 .get_memory_win32_handle_properties_khr
7385 .expect("vkGetMemoryWin32HandlePropertiesKHR not loaded");
7386 check(unsafe {
7387 fp(
7388 self.handle(),
7389 handle_type,
7390 handle,
7391 p_memory_win32_handle_properties,
7392 )
7393 })
7394 }
7395 ///Wraps [`vkGetMemoryFdKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryFdKHR.html).
7396 /**
7397 Provided by **VK_KHR_external_memory_fd**.*/
7398 ///
7399 ///# Errors
7400 ///- `VK_ERROR_TOO_MANY_OBJECTS`
7401 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7402 ///- `VK_ERROR_UNKNOWN`
7403 ///- `VK_ERROR_VALIDATION_FAILED`
7404 ///
7405 ///# Safety
7406 ///- `device` (self) must be valid and not destroyed.
7407 ///
7408 ///# Panics
7409 ///Panics if `vkGetMemoryFdKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7410 ///
7411 ///# Usage Notes
7412 ///
7413 ///Exports a device memory allocation as a POSIX file descriptor.
7414 ///The fd can be sent to another process (via Unix domain sockets)
7415 ///or another Vulkan device to share GPU memory.
7416 ///
7417 ///`MemoryGetFdInfoKHR` specifies the `DeviceMemory` and the handle
7418 ///type (`OPAQUE_FD` or `DMA_BUF`). The memory must have been
7419 ///allocated with `ExportMemoryAllocateInfo` requesting the
7420 ///corresponding handle type.
7421 ///
7422 ///The caller owns the returned fd and must close it when done.
7423 ///Each call returns a new fd, duplicates are independent.
7424 ///
7425 ///Linux/Android only. Use `get_memory_win32_handle_khr` on Windows.
7426 pub unsafe fn get_memory_fd_khr(
7427 &self,
7428 p_get_fd_info: &MemoryGetFdInfoKHR,
7429 ) -> VkResult<core::ffi::c_int> {
7430 let fp = self
7431 .commands()
7432 .get_memory_fd_khr
7433 .expect("vkGetMemoryFdKHR not loaded");
7434 let mut out = unsafe { core::mem::zeroed() };
7435 check(unsafe { fp(self.handle(), p_get_fd_info, &mut out) })?;
7436 Ok(out)
7437 }
7438 ///Wraps [`vkGetMemoryFdPropertiesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryFdPropertiesKHR.html).
7439 /**
7440 Provided by **VK_KHR_external_memory_fd**.*/
7441 ///
7442 ///# Errors
7443 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7444 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
7445 ///- `VK_ERROR_UNKNOWN`
7446 ///- `VK_ERROR_VALIDATION_FAILED`
7447 ///
7448 ///# Safety
7449 ///- `device` (self) must be valid and not destroyed.
7450 ///
7451 ///# Panics
7452 ///Panics if `vkGetMemoryFdPropertiesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7453 ///
7454 ///# Usage Notes
7455 ///
7456 ///Queries which memory types are compatible with an external file
7457 ///descriptor. Use this when importing memory from an fd received
7458 ///from another process or API.
7459 ///
7460 ///Returns `MemoryFdPropertiesKHR` with a `memory_type_bits` bitmask
7461 ///indicating which memory type indices can be used when allocating
7462 ///memory to import this fd.
7463 ///
7464 ///Only valid for `DMA_BUF` handle types. `OPAQUE_FD` handles don't
7465 ///need this query, their memory type is determined by the
7466 ///exporting allocation.
7467 pub unsafe fn get_memory_fd_properties_khr(
7468 &self,
7469 handle_type: ExternalMemoryHandleTypeFlagBits,
7470 fd: core::ffi::c_int,
7471 p_memory_fd_properties: &mut MemoryFdPropertiesKHR,
7472 ) -> VkResult<()> {
7473 let fp = self
7474 .commands()
7475 .get_memory_fd_properties_khr
7476 .expect("vkGetMemoryFdPropertiesKHR not loaded");
7477 check(unsafe { fp(self.handle(), handle_type, fd, p_memory_fd_properties) })
7478 }
7479 ///Wraps [`vkGetMemoryZirconHandleFUCHSIA`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryZirconHandleFUCHSIA.html).
7480 /**
7481 Provided by **VK_FUCHSIA_external_memory**.*/
7482 ///
7483 ///# Errors
7484 ///- `VK_ERROR_TOO_MANY_OBJECTS`
7485 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7486 ///- `VK_ERROR_UNKNOWN`
7487 ///- `VK_ERROR_VALIDATION_FAILED`
7488 ///
7489 ///# Safety
7490 ///- `device` (self) must be valid and not destroyed.
7491 ///
7492 ///# Panics
7493 ///Panics if `vkGetMemoryZirconHandleFUCHSIA` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7494 ///
7495 ///# Usage Notes
7496 ///
7497 ///Exports a Vulkan device memory allocation as a Fuchsia Zircon
7498 ///VMO handle. The returned handle can be shared with other Fuchsia
7499 ///processes. Fuchsia OS only.
7500 ///
7501 ///Requires `VK_FUCHSIA_external_memory`.
7502 pub unsafe fn get_memory_zircon_handle_fuchsia(
7503 &self,
7504 p_get_zircon_handle_info: &MemoryGetZirconHandleInfoFUCHSIA,
7505 ) -> VkResult<u32> {
7506 let fp = self
7507 .commands()
7508 .get_memory_zircon_handle_fuchsia
7509 .expect("vkGetMemoryZirconHandleFUCHSIA not loaded");
7510 let mut out = unsafe { core::mem::zeroed() };
7511 check(unsafe { fp(self.handle(), p_get_zircon_handle_info, &mut out) })?;
7512 Ok(out)
7513 }
7514 ///Wraps [`vkGetMemoryZirconHandlePropertiesFUCHSIA`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryZirconHandlePropertiesFUCHSIA.html).
7515 /**
7516 Provided by **VK_FUCHSIA_external_memory**.*/
7517 ///
7518 ///# Errors
7519 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
7520 ///- `VK_ERROR_UNKNOWN`
7521 ///- `VK_ERROR_VALIDATION_FAILED`
7522 ///
7523 ///# Safety
7524 ///- `device` (self) must be valid and not destroyed.
7525 ///
7526 ///# Panics
7527 ///Panics if `vkGetMemoryZirconHandlePropertiesFUCHSIA` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7528 ///
7529 ///# Usage Notes
7530 ///
7531 ///Queries the memory properties (compatible memory type bits) for
7532 ///a Zircon VMO handle. Use before importing external memory to
7533 ///determine which memory type to allocate. Fuchsia OS only.
7534 ///
7535 ///Requires `VK_FUCHSIA_external_memory`.
7536 pub unsafe fn get_memory_zircon_handle_properties_fuchsia(
7537 &self,
7538 handle_type: ExternalMemoryHandleTypeFlagBits,
7539 zircon_handle: u32,
7540 p_memory_zircon_handle_properties: &mut MemoryZirconHandlePropertiesFUCHSIA,
7541 ) -> VkResult<()> {
7542 let fp = self
7543 .commands()
7544 .get_memory_zircon_handle_properties_fuchsia
7545 .expect("vkGetMemoryZirconHandlePropertiesFUCHSIA not loaded");
7546 check(unsafe {
7547 fp(
7548 self.handle(),
7549 handle_type,
7550 zircon_handle,
7551 p_memory_zircon_handle_properties,
7552 )
7553 })
7554 }
7555 ///Wraps [`vkGetMemoryRemoteAddressNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryRemoteAddressNV.html).
7556 /**
7557 Provided by **VK_NV_external_memory_rdma**.*/
7558 ///
7559 ///# Errors
7560 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
7561 ///- `VK_ERROR_UNKNOWN`
7562 ///- `VK_ERROR_VALIDATION_FAILED`
7563 ///
7564 ///# Safety
7565 ///- `device` (self) must be valid and not destroyed.
7566 ///
7567 ///# Panics
7568 ///Panics if `vkGetMemoryRemoteAddressNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7569 ///
7570 ///# Usage Notes
7571 ///
7572 ///Retrieves a remote device address for a Vulkan memory allocation,
7573 ///enabling RDMA (Remote Direct Memory Access) between devices. The
7574 ///returned address can be used by another device to directly access
7575 ///this memory over a high-speed interconnect.
7576 ///
7577 ///Requires `VK_NV_external_memory_rdma`.
7578 pub unsafe fn get_memory_remote_address_nv(
7579 &self,
7580 p_memory_get_remote_address_info: &MemoryGetRemoteAddressInfoNV,
7581 ) -> VkResult<*mut core::ffi::c_void> {
7582 let fp = self
7583 .commands()
7584 .get_memory_remote_address_nv
7585 .expect("vkGetMemoryRemoteAddressNV not loaded");
7586 let mut out = unsafe { core::mem::zeroed() };
7587 check(unsafe { fp(self.handle(), p_memory_get_remote_address_info, &mut out) })?;
7588 Ok(out)
7589 }
7590 ///Wraps [`vkGetMemorySciBufNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemorySciBufNV.html).
7591 ///
7592 ///# Errors
7593 ///- `VK_ERROR_INITIALIZATION_FAILED`
7594 ///- `VK_ERROR_UNKNOWN`
7595 ///- `VK_ERROR_VALIDATION_FAILED`
7596 ///
7597 ///# Safety
7598 ///- `device` (self) must be valid and not destroyed.
7599 ///
7600 ///# Panics
7601 ///Panics if `vkGetMemorySciBufNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7602 ///
7603 ///# Usage Notes
7604 ///
7605 ///Exports a Vulkan device memory allocation as a QNX SCI buffer
7606 ///for cross-process or cross-API sharing on QNX platforms.
7607 ///
7608 ///Requires `VK_NV_external_memory_sci_buf`. QNX only.
7609 pub unsafe fn get_memory_sci_buf_nv(
7610 &self,
7611 p_get_sci_buf_info: &MemoryGetSciBufInfoNV,
7612 ) -> VkResult<core::ffi::c_void> {
7613 let fp = self
7614 .commands()
7615 .get_memory_sci_buf_nv
7616 .expect("vkGetMemorySciBufNV not loaded");
7617 let mut out = unsafe { core::mem::zeroed() };
7618 check(unsafe { fp(self.handle(), p_get_sci_buf_info, &mut out) })?;
7619 Ok(out)
7620 }
7621 ///Wraps [`vkGetSemaphoreWin32HandleKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSemaphoreWin32HandleKHR.html).
7622 /**
7623 Provided by **VK_KHR_external_semaphore_win32**.*/
7624 ///
7625 ///# Errors
7626 ///- `VK_ERROR_TOO_MANY_OBJECTS`
7627 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7628 ///- `VK_ERROR_UNKNOWN`
7629 ///- `VK_ERROR_VALIDATION_FAILED`
7630 ///
7631 ///# Safety
7632 ///- `device` (self) must be valid and not destroyed.
7633 ///
7634 ///# Panics
7635 ///Panics if `vkGetSemaphoreWin32HandleKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7636 ///
7637 ///# Usage Notes
7638 ///
7639 ///Exports a semaphore's synchronization state as a Windows HANDLE.
7640 ///The handle can be shared with other processes or APIs for
7641 ///cross-process GPU synchronization.
7642 ///
7643 ///`SemaphoreGetWin32HandleInfoKHR` specifies the semaphore and
7644 ///handle type (`OPAQUE_WIN32`, `OPAQUE_WIN32_KMT`, or
7645 ///`D3D12_FENCE`).
7646 ///
7647 ///For `OPAQUE_WIN32` and `D3D12_FENCE`, close the handle with
7648 ///`CloseHandle` when done. `OPAQUE_WIN32_KMT` handles are
7649 ///kernel-managed.
7650 ///
7651 ///Windows only. Use `get_semaphore_fd_khr` on Linux.
7652 pub unsafe fn get_semaphore_win32_handle_khr(
7653 &self,
7654 p_get_win32_handle_info: &SemaphoreGetWin32HandleInfoKHR,
7655 ) -> VkResult<isize> {
7656 let fp = self
7657 .commands()
7658 .get_semaphore_win32_handle_khr
7659 .expect("vkGetSemaphoreWin32HandleKHR not loaded");
7660 let mut out = unsafe { core::mem::zeroed() };
7661 check(unsafe { fp(self.handle(), p_get_win32_handle_info, &mut out) })?;
7662 Ok(out)
7663 }
7664 ///Wraps [`vkImportSemaphoreWin32HandleKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkImportSemaphoreWin32HandleKHR.html).
7665 /**
7666 Provided by **VK_KHR_external_semaphore_win32**.*/
7667 ///
7668 ///# Errors
7669 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7670 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
7671 ///- `VK_ERROR_UNKNOWN`
7672 ///- `VK_ERROR_VALIDATION_FAILED`
7673 ///
7674 ///# Safety
7675 ///- `device` (self) must be valid and not destroyed.
7676 ///
7677 ///# Panics
7678 ///Panics if `vkImportSemaphoreWin32HandleKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7679 ///
7680 ///# Usage Notes
7681 ///
7682 ///Imports a synchronization payload from a Windows HANDLE into a
7683 ///semaphore. After import, the semaphore uses the external
7684 ///synchronization state.
7685 ///
7686 ///`ImportSemaphoreWin32HandleInfoKHR` specifies the target
7687 ///semaphore, handle type, handle (or name for named handles), and
7688 ///whether the import is temporary or permanent.
7689 ///
7690 ///The handle is duplicated internally, the caller retains
7691 ///ownership and should close it when no longer needed.
7692 ///
7693 ///Windows only. Use `import_semaphore_fd_khr` on Linux.
7694 pub unsafe fn import_semaphore_win32_handle_khr(
7695 &self,
7696 p_import_semaphore_win32_handle_info: &ImportSemaphoreWin32HandleInfoKHR,
7697 ) -> VkResult<()> {
7698 let fp = self
7699 .commands()
7700 .import_semaphore_win32_handle_khr
7701 .expect("vkImportSemaphoreWin32HandleKHR not loaded");
7702 check(unsafe { fp(self.handle(), p_import_semaphore_win32_handle_info) })
7703 }
7704 ///Wraps [`vkGetSemaphoreFdKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSemaphoreFdKHR.html).
7705 /**
7706 Provided by **VK_KHR_external_semaphore_fd**.*/
7707 ///
7708 ///# Errors
7709 ///- `VK_ERROR_TOO_MANY_OBJECTS`
7710 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7711 ///- `VK_ERROR_UNKNOWN`
7712 ///- `VK_ERROR_VALIDATION_FAILED`
7713 ///
7714 ///# Safety
7715 ///- `device` (self) must be valid and not destroyed.
7716 ///
7717 ///# Panics
7718 ///Panics if `vkGetSemaphoreFdKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7719 ///
7720 ///# Usage Notes
7721 ///
7722 ///Exports a semaphore's synchronization state as a POSIX file
7723 ///descriptor. The fd can be transferred to another process for
7724 ///cross-process GPU synchronization.
7725 ///
7726 ///`SemaphoreGetFdInfoKHR` specifies the semaphore and handle type
7727 ///(`OPAQUE_FD` or `SYNC_FD`). For `SYNC_FD`, the semaphore must
7728 ///be signaled or have a pending signal operation, exporting
7729 ///transfers ownership and resets the semaphore to unsignaled.
7730 ///
7731 ///The caller owns the returned fd. For `OPAQUE_FD`, each export
7732 ///creates a new reference. For `SYNC_FD`, the export is a
7733 ///move, the semaphore payload is transferred.
7734 ///
7735 ///Linux/Android only. Use `get_semaphore_win32_handle_khr` on
7736 ///Windows.
7737 pub unsafe fn get_semaphore_fd_khr(
7738 &self,
7739 p_get_fd_info: &SemaphoreGetFdInfoKHR,
7740 ) -> VkResult<core::ffi::c_int> {
7741 let fp = self
7742 .commands()
7743 .get_semaphore_fd_khr
7744 .expect("vkGetSemaphoreFdKHR not loaded");
7745 let mut out = unsafe { core::mem::zeroed() };
7746 check(unsafe { fp(self.handle(), p_get_fd_info, &mut out) })?;
7747 Ok(out)
7748 }
7749 ///Wraps [`vkImportSemaphoreFdKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkImportSemaphoreFdKHR.html).
7750 /**
7751 Provided by **VK_KHR_external_semaphore_fd**.*/
7752 ///
7753 ///# Errors
7754 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7755 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
7756 ///- `VK_ERROR_UNKNOWN`
7757 ///- `VK_ERROR_VALIDATION_FAILED`
7758 ///
7759 ///# Safety
7760 ///- `device` (self) must be valid and not destroyed.
7761 ///
7762 ///# Panics
7763 ///Panics if `vkImportSemaphoreFdKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7764 ///
7765 ///# Usage Notes
7766 ///
7767 ///Imports a synchronization payload from a POSIX file descriptor
7768 ///into a semaphore. After import, the semaphore uses the external
7769 ///synchronization state.
7770 ///
7771 ///`ImportSemaphoreFdInfoKHR` specifies the target semaphore, handle
7772 ///type, fd, and whether the import is temporary (payload consumed
7773 ///on first wait) or permanent.
7774 ///
7775 ///For `SYNC_FD`, the import takes ownership of the fd, do not
7776 ///close it afterward. For `OPAQUE_FD`, the fd is duplicated
7777 ///internally and can be closed after the call.
7778 ///
7779 ///Linux/Android only. Use `import_semaphore_win32_handle_khr` on
7780 ///Windows.
7781 pub unsafe fn import_semaphore_fd_khr(
7782 &self,
7783 p_import_semaphore_fd_info: &ImportSemaphoreFdInfoKHR,
7784 ) -> VkResult<()> {
7785 let fp = self
7786 .commands()
7787 .import_semaphore_fd_khr
7788 .expect("vkImportSemaphoreFdKHR not loaded");
7789 check(unsafe { fp(self.handle(), p_import_semaphore_fd_info) })
7790 }
7791 ///Wraps [`vkGetSemaphoreZirconHandleFUCHSIA`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSemaphoreZirconHandleFUCHSIA.html).
7792 /**
7793 Provided by **VK_FUCHSIA_external_semaphore**.*/
7794 ///
7795 ///# Errors
7796 ///- `VK_ERROR_TOO_MANY_OBJECTS`
7797 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7798 ///- `VK_ERROR_UNKNOWN`
7799 ///- `VK_ERROR_VALIDATION_FAILED`
7800 ///
7801 ///# Safety
7802 ///- `device` (self) must be valid and not destroyed.
7803 ///
7804 ///# Panics
7805 ///Panics if `vkGetSemaphoreZirconHandleFUCHSIA` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7806 ///
7807 ///# Usage Notes
7808 ///
7809 ///Exports a Vulkan semaphore as a Fuchsia Zircon event handle for
7810 ///cross-process synchronisation. Fuchsia OS only.
7811 ///
7812 ///Requires `VK_FUCHSIA_external_semaphore`.
7813 pub unsafe fn get_semaphore_zircon_handle_fuchsia(
7814 &self,
7815 p_get_zircon_handle_info: &SemaphoreGetZirconHandleInfoFUCHSIA,
7816 ) -> VkResult<u32> {
7817 let fp = self
7818 .commands()
7819 .get_semaphore_zircon_handle_fuchsia
7820 .expect("vkGetSemaphoreZirconHandleFUCHSIA not loaded");
7821 let mut out = unsafe { core::mem::zeroed() };
7822 check(unsafe { fp(self.handle(), p_get_zircon_handle_info, &mut out) })?;
7823 Ok(out)
7824 }
7825 ///Wraps [`vkImportSemaphoreZirconHandleFUCHSIA`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkImportSemaphoreZirconHandleFUCHSIA.html).
7826 /**
7827 Provided by **VK_FUCHSIA_external_semaphore**.*/
7828 ///
7829 ///# Errors
7830 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7831 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
7832 ///- `VK_ERROR_UNKNOWN`
7833 ///- `VK_ERROR_VALIDATION_FAILED`
7834 ///
7835 ///# Safety
7836 ///- `device` (self) must be valid and not destroyed.
7837 ///
7838 ///# Panics
7839 ///Panics if `vkImportSemaphoreZirconHandleFUCHSIA` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7840 ///
7841 ///# Usage Notes
7842 ///
7843 ///Imports a Fuchsia Zircon event handle into an existing Vulkan
7844 ///semaphore for cross-process synchronisation. Fuchsia OS only.
7845 ///
7846 ///Requires `VK_FUCHSIA_external_semaphore`.
7847 pub unsafe fn import_semaphore_zircon_handle_fuchsia(
7848 &self,
7849 p_import_semaphore_zircon_handle_info: &ImportSemaphoreZirconHandleInfoFUCHSIA,
7850 ) -> VkResult<()> {
7851 let fp = self
7852 .commands()
7853 .import_semaphore_zircon_handle_fuchsia
7854 .expect("vkImportSemaphoreZirconHandleFUCHSIA not loaded");
7855 check(unsafe { fp(self.handle(), p_import_semaphore_zircon_handle_info) })
7856 }
7857 ///Wraps [`vkGetFenceWin32HandleKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetFenceWin32HandleKHR.html).
7858 /**
7859 Provided by **VK_KHR_external_fence_win32**.*/
7860 ///
7861 ///# Errors
7862 ///- `VK_ERROR_TOO_MANY_OBJECTS`
7863 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7864 ///- `VK_ERROR_UNKNOWN`
7865 ///- `VK_ERROR_VALIDATION_FAILED`
7866 ///
7867 ///# Safety
7868 ///- `device` (self) must be valid and not destroyed.
7869 ///
7870 ///# Panics
7871 ///Panics if `vkGetFenceWin32HandleKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7872 ///
7873 ///# Usage Notes
7874 ///
7875 ///Exports a fence's synchronization state as a Windows HANDLE
7876 ///for cross-process fence synchronization.
7877 ///
7878 ///`FenceGetWin32HandleInfoKHR` specifies the fence and handle type
7879 ///(`OPAQUE_WIN32` or `OPAQUE_WIN32_KMT`).
7880 ///
7881 ///For `OPAQUE_WIN32`, close the handle with `CloseHandle` when
7882 ///done. `OPAQUE_WIN32_KMT` handles are kernel-managed.
7883 ///
7884 ///Windows only. Use `get_fence_fd_khr` on Linux.
7885 pub unsafe fn get_fence_win32_handle_khr(
7886 &self,
7887 p_get_win32_handle_info: &FenceGetWin32HandleInfoKHR,
7888 ) -> VkResult<isize> {
7889 let fp = self
7890 .commands()
7891 .get_fence_win32_handle_khr
7892 .expect("vkGetFenceWin32HandleKHR not loaded");
7893 let mut out = unsafe { core::mem::zeroed() };
7894 check(unsafe { fp(self.handle(), p_get_win32_handle_info, &mut out) })?;
7895 Ok(out)
7896 }
7897 ///Wraps [`vkImportFenceWin32HandleKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkImportFenceWin32HandleKHR.html).
7898 /**
7899 Provided by **VK_KHR_external_fence_win32**.*/
7900 ///
7901 ///# Errors
7902 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7903 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
7904 ///- `VK_ERROR_UNKNOWN`
7905 ///- `VK_ERROR_VALIDATION_FAILED`
7906 ///
7907 ///# Safety
7908 ///- `device` (self) must be valid and not destroyed.
7909 ///
7910 ///# Panics
7911 ///Panics if `vkImportFenceWin32HandleKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7912 ///
7913 ///# Usage Notes
7914 ///
7915 ///Imports a synchronization payload from a Windows HANDLE into a
7916 ///fence.
7917 ///
7918 ///`ImportFenceWin32HandleInfoKHR` specifies the target fence,
7919 ///handle type, handle (or name), and whether the import is
7920 ///temporary or permanent.
7921 ///
7922 ///The handle is duplicated internally, the caller retains
7923 ///ownership and should close it when no longer needed.
7924 ///
7925 ///Windows only. Use `import_fence_fd_khr` on Linux.
7926 pub unsafe fn import_fence_win32_handle_khr(
7927 &self,
7928 p_import_fence_win32_handle_info: &ImportFenceWin32HandleInfoKHR,
7929 ) -> VkResult<()> {
7930 let fp = self
7931 .commands()
7932 .import_fence_win32_handle_khr
7933 .expect("vkImportFenceWin32HandleKHR not loaded");
7934 check(unsafe { fp(self.handle(), p_import_fence_win32_handle_info) })
7935 }
7936 ///Wraps [`vkGetFenceFdKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetFenceFdKHR.html).
7937 /**
7938 Provided by **VK_KHR_external_fence_fd**.*/
7939 ///
7940 ///# Errors
7941 ///- `VK_ERROR_TOO_MANY_OBJECTS`
7942 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7943 ///- `VK_ERROR_UNKNOWN`
7944 ///- `VK_ERROR_VALIDATION_FAILED`
7945 ///
7946 ///# Safety
7947 ///- `device` (self) must be valid and not destroyed.
7948 ///
7949 ///# Panics
7950 ///Panics if `vkGetFenceFdKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7951 ///
7952 ///# Usage Notes
7953 ///
7954 ///Exports a fence's synchronization state as a POSIX file
7955 ///descriptor. The fd enables cross-process fence synchronization.
7956 ///
7957 ///`FenceGetFdInfoKHR` specifies the fence and handle type
7958 ///(`OPAQUE_FD` or `SYNC_FD`). For `SYNC_FD`, the fence must be
7959 ///signaled or have a pending signal, exporting transfers the
7960 ///payload and resets the fence.
7961 ///
7962 ///The caller owns the returned fd and must close it when done.
7963 ///
7964 ///Linux/Android only. Use `get_fence_win32_handle_khr` on Windows.
7965 pub unsafe fn get_fence_fd_khr(
7966 &self,
7967 p_get_fd_info: &FenceGetFdInfoKHR,
7968 ) -> VkResult<core::ffi::c_int> {
7969 let fp = self
7970 .commands()
7971 .get_fence_fd_khr
7972 .expect("vkGetFenceFdKHR not loaded");
7973 let mut out = unsafe { core::mem::zeroed() };
7974 check(unsafe { fp(self.handle(), p_get_fd_info, &mut out) })?;
7975 Ok(out)
7976 }
7977 ///Wraps [`vkImportFenceFdKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkImportFenceFdKHR.html).
7978 /**
7979 Provided by **VK_KHR_external_fence_fd**.*/
7980 ///
7981 ///# Errors
7982 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7983 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
7984 ///- `VK_ERROR_UNKNOWN`
7985 ///- `VK_ERROR_VALIDATION_FAILED`
7986 ///
7987 ///# Safety
7988 ///- `device` (self) must be valid and not destroyed.
7989 ///
7990 ///# Panics
7991 ///Panics if `vkImportFenceFdKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7992 ///
7993 ///# Usage Notes
7994 ///
7995 ///Imports a synchronization payload from a POSIX file descriptor
7996 ///into a fence.
7997 ///
7998 ///`ImportFenceFdInfoKHR` specifies the target fence, handle type,
7999 ///fd, and whether the import is temporary (payload consumed on
8000 ///first wait/reset) or permanent.
8001 ///
8002 ///For `SYNC_FD`, ownership of the fd transfers to the
8003 ///implementation, do not close it. For `OPAQUE_FD`, the fd is
8004 ///duplicated and can be closed after the call.
8005 ///
8006 ///Linux/Android only. Use `import_fence_win32_handle_khr` on
8007 ///Windows.
8008 pub unsafe fn import_fence_fd_khr(
8009 &self,
8010 p_import_fence_fd_info: &ImportFenceFdInfoKHR,
8011 ) -> VkResult<()> {
8012 let fp = self
8013 .commands()
8014 .import_fence_fd_khr
8015 .expect("vkImportFenceFdKHR not loaded");
8016 check(unsafe { fp(self.handle(), p_import_fence_fd_info) })
8017 }
8018 ///Wraps [`vkGetFenceSciSyncFenceNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetFenceSciSyncFenceNV.html).
8019 ///
8020 ///# Errors
8021 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
8022 ///- `VK_ERROR_NOT_PERMITTED`
8023 ///- `VK_ERROR_UNKNOWN`
8024 ///- `VK_ERROR_VALIDATION_FAILED`
8025 ///
8026 ///# Safety
8027 ///- `device` (self) must be valid and not destroyed.
8028 ///
8029 ///# Panics
8030 ///Panics if `vkGetFenceSciSyncFenceNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8031 ///
8032 ///# Usage Notes
8033 ///
8034 ///Exports a Vulkan fence as a SciSync fence handle for
8035 ///cross-process synchronisation on NV safety-critical platforms.
8036 ///QNX/NVIDIA Safety only.
8037 ///
8038 ///Requires `VK_NV_external_sci_sync`.
8039 pub unsafe fn get_fence_sci_sync_fence_nv(
8040 &self,
8041 p_get_sci_sync_handle_info: &FenceGetSciSyncInfoNV,
8042 ) -> VkResult<core::ffi::c_void> {
8043 let fp = self
8044 .commands()
8045 .get_fence_sci_sync_fence_nv
8046 .expect("vkGetFenceSciSyncFenceNV not loaded");
8047 let mut out = unsafe { core::mem::zeroed() };
8048 check(unsafe { fp(self.handle(), p_get_sci_sync_handle_info, &mut out) })?;
8049 Ok(out)
8050 }
8051 ///Wraps [`vkGetFenceSciSyncObjNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetFenceSciSyncObjNV.html).
8052 ///
8053 ///# Errors
8054 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
8055 ///- `VK_ERROR_NOT_PERMITTED`
8056 ///- `VK_ERROR_UNKNOWN`
8057 ///- `VK_ERROR_VALIDATION_FAILED`
8058 ///
8059 ///# Safety
8060 ///- `device` (self) must be valid and not destroyed.
8061 ///
8062 ///# Panics
8063 ///Panics if `vkGetFenceSciSyncObjNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8064 ///
8065 ///# Usage Notes
8066 ///
8067 ///Exports a Vulkan fence as a SciSync object handle for
8068 ///cross-process synchronisation on NV safety-critical platforms.
8069 ///QNX/NVIDIA Safety only.
8070 ///
8071 ///Requires `VK_NV_external_sci_sync`.
8072 pub unsafe fn get_fence_sci_sync_obj_nv(
8073 &self,
8074 p_get_sci_sync_handle_info: &FenceGetSciSyncInfoNV,
8075 ) -> VkResult<core::ffi::c_void> {
8076 let fp = self
8077 .commands()
8078 .get_fence_sci_sync_obj_nv
8079 .expect("vkGetFenceSciSyncObjNV not loaded");
8080 let mut out = unsafe { core::mem::zeroed() };
8081 check(unsafe { fp(self.handle(), p_get_sci_sync_handle_info, &mut out) })?;
8082 Ok(out)
8083 }
8084 ///Wraps [`vkImportFenceSciSyncFenceNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkImportFenceSciSyncFenceNV.html).
8085 ///
8086 ///# Errors
8087 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
8088 ///- `VK_ERROR_NOT_PERMITTED`
8089 ///- `VK_ERROR_UNKNOWN`
8090 ///- `VK_ERROR_VALIDATION_FAILED`
8091 ///
8092 ///# Safety
8093 ///- `device` (self) must be valid and not destroyed.
8094 ///
8095 ///# Panics
8096 ///Panics if `vkImportFenceSciSyncFenceNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8097 ///
8098 ///# Usage Notes
8099 ///
8100 ///Imports a SciSync fence handle into an existing Vulkan fence for
8101 ///cross-process synchronisation on NV safety-critical platforms.
8102 ///QNX/NVIDIA Safety only.
8103 ///
8104 ///Requires `VK_NV_external_sci_sync`.
8105 pub unsafe fn import_fence_sci_sync_fence_nv(
8106 &self,
8107 p_import_fence_sci_sync_info: &ImportFenceSciSyncInfoNV,
8108 ) -> VkResult<()> {
8109 let fp = self
8110 .commands()
8111 .import_fence_sci_sync_fence_nv
8112 .expect("vkImportFenceSciSyncFenceNV not loaded");
8113 check(unsafe { fp(self.handle(), p_import_fence_sci_sync_info) })
8114 }
8115 ///Wraps [`vkImportFenceSciSyncObjNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkImportFenceSciSyncObjNV.html).
8116 ///
8117 ///# Errors
8118 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
8119 ///- `VK_ERROR_NOT_PERMITTED`
8120 ///- `VK_ERROR_UNKNOWN`
8121 ///- `VK_ERROR_VALIDATION_FAILED`
8122 ///
8123 ///# Safety
8124 ///- `device` (self) must be valid and not destroyed.
8125 ///
8126 ///# Panics
8127 ///Panics if `vkImportFenceSciSyncObjNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8128 ///
8129 ///# Usage Notes
8130 ///
8131 ///Imports a SciSync object handle into an existing Vulkan fence
8132 ///for cross-process synchronisation on NV safety-critical
8133 ///platforms. QNX/NVIDIA Safety only.
8134 ///
8135 ///Requires `VK_NV_external_sci_sync`.
8136 pub unsafe fn import_fence_sci_sync_obj_nv(
8137 &self,
8138 p_import_fence_sci_sync_info: &ImportFenceSciSyncInfoNV,
8139 ) -> VkResult<()> {
8140 let fp = self
8141 .commands()
8142 .import_fence_sci_sync_obj_nv
8143 .expect("vkImportFenceSciSyncObjNV not loaded");
8144 check(unsafe { fp(self.handle(), p_import_fence_sci_sync_info) })
8145 }
8146 ///Wraps [`vkGetSemaphoreSciSyncObjNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSemaphoreSciSyncObjNV.html).
8147 ///
8148 ///# Errors
8149 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
8150 ///- `VK_ERROR_NOT_PERMITTED`
8151 ///- `VK_ERROR_UNKNOWN`
8152 ///- `VK_ERROR_VALIDATION_FAILED`
8153 ///
8154 ///# Safety
8155 ///- `device` (self) must be valid and not destroyed.
8156 ///
8157 ///# Panics
8158 ///Panics if `vkGetSemaphoreSciSyncObjNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8159 ///
8160 ///# Usage Notes
8161 ///
8162 ///Exports a Vulkan semaphore as a SciSync object handle for
8163 ///cross-process synchronisation on NV safety-critical platforms.
8164 ///QNX/NVIDIA Safety only.
8165 ///
8166 ///Requires `VK_NV_external_sci_sync`.
8167 pub unsafe fn get_semaphore_sci_sync_obj_nv(
8168 &self,
8169 p_get_sci_sync_info: &SemaphoreGetSciSyncInfoNV,
8170 ) -> VkResult<core::ffi::c_void> {
8171 let fp = self
8172 .commands()
8173 .get_semaphore_sci_sync_obj_nv
8174 .expect("vkGetSemaphoreSciSyncObjNV not loaded");
8175 let mut out = unsafe { core::mem::zeroed() };
8176 check(unsafe { fp(self.handle(), p_get_sci_sync_info, &mut out) })?;
8177 Ok(out)
8178 }
8179 ///Wraps [`vkImportSemaphoreSciSyncObjNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkImportSemaphoreSciSyncObjNV.html).
8180 ///
8181 ///# Errors
8182 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
8183 ///- `VK_ERROR_NOT_PERMITTED`
8184 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8185 ///- `VK_ERROR_UNKNOWN`
8186 ///- `VK_ERROR_VALIDATION_FAILED`
8187 ///
8188 ///# Safety
8189 ///- `device` (self) must be valid and not destroyed.
8190 ///
8191 ///# Panics
8192 ///Panics if `vkImportSemaphoreSciSyncObjNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8193 ///
8194 ///# Usage Notes
8195 ///
8196 ///Imports a SciSync object handle into an existing Vulkan
8197 ///semaphore for cross-process synchronisation on NV
8198 ///safety-critical platforms. QNX/NVIDIA Safety only.
8199 ///
8200 ///Requires `VK_NV_external_sci_sync`.
8201 pub unsafe fn import_semaphore_sci_sync_obj_nv(
8202 &self,
8203 p_import_semaphore_sci_sync_info: &ImportSemaphoreSciSyncInfoNV,
8204 ) -> VkResult<()> {
8205 let fp = self
8206 .commands()
8207 .import_semaphore_sci_sync_obj_nv
8208 .expect("vkImportSemaphoreSciSyncObjNV not loaded");
8209 check(unsafe { fp(self.handle(), p_import_semaphore_sci_sync_info) })
8210 }
8211 ///Wraps [`vkCreateSemaphoreSciSyncPoolNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateSemaphoreSciSyncPoolNV.html).
8212 ///
8213 ///# Errors
8214 ///- `VK_ERROR_INITIALIZATION_FAILED`
8215 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8216 ///- `VK_ERROR_UNKNOWN`
8217 ///- `VK_ERROR_VALIDATION_FAILED`
8218 ///
8219 ///# Safety
8220 ///- `device` (self) must be valid and not destroyed.
8221 ///
8222 ///# Panics
8223 ///Panics if `vkCreateSemaphoreSciSyncPoolNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8224 ///
8225 ///# Usage Notes
8226 ///
8227 ///Creates a pool of SciSync-backed semaphores for efficient
8228 ///cross-engine synchronisation on NV safety-critical platforms.
8229 ///QNX/NVIDIA Safety only.
8230 ///
8231 ///Requires `VK_NV_external_sci_sync2`.
8232 pub unsafe fn create_semaphore_sci_sync_pool_nv(
8233 &self,
8234 p_create_info: &SemaphoreSciSyncPoolCreateInfoNV,
8235 allocator: Option<&AllocationCallbacks>,
8236 ) -> VkResult<SemaphoreSciSyncPoolNV> {
8237 let fp = self
8238 .commands()
8239 .create_semaphore_sci_sync_pool_nv
8240 .expect("vkCreateSemaphoreSciSyncPoolNV not loaded");
8241 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
8242 let mut out = unsafe { core::mem::zeroed() };
8243 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
8244 Ok(out)
8245 }
8246 ///Wraps [`vkDestroySemaphoreSciSyncPoolNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroySemaphoreSciSyncPoolNV.html).
8247 ///
8248 ///# Safety
8249 ///- `device` (self) must be valid and not destroyed.
8250 ///- `semaphorePool` must be externally synchronized.
8251 ///
8252 ///# Panics
8253 ///Panics if `vkDestroySemaphoreSciSyncPoolNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8254 ///
8255 ///# Usage Notes
8256 ///
8257 ///Destroys a SciSync semaphore pool. The pool must not be in use
8258 ///by any pending operations. QNX/NVIDIA Safety only.
8259 ///
8260 ///Requires `VK_NV_external_sci_sync2`.
8261 pub unsafe fn destroy_semaphore_sci_sync_pool_nv(
8262 &self,
8263 semaphore_pool: SemaphoreSciSyncPoolNV,
8264 allocator: Option<&AllocationCallbacks>,
8265 ) {
8266 let fp = self
8267 .commands()
8268 .destroy_semaphore_sci_sync_pool_nv
8269 .expect("vkDestroySemaphoreSciSyncPoolNV not loaded");
8270 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
8271 unsafe { fp(self.handle(), semaphore_pool, alloc_ptr) };
8272 }
8273 ///Wraps [`vkDisplayPowerControlEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDisplayPowerControlEXT.html).
8274 /**
8275 Provided by **VK_EXT_display_control**.*/
8276 ///
8277 ///# Errors
8278 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8279 ///- `VK_ERROR_UNKNOWN`
8280 ///- `VK_ERROR_VALIDATION_FAILED`
8281 ///
8282 ///# Safety
8283 ///- `device` (self) must be valid and not destroyed.
8284 ///
8285 ///# Panics
8286 ///Panics if `vkDisplayPowerControlEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8287 ///
8288 ///# Usage Notes
8289 ///
8290 ///Controls the power state of a display (e.g., standby, suspend,
8291 ///off, on). `DisplayPowerInfoEXT` specifies the desired power state.
8292 ///
8293 ///Requires `VK_EXT_display_control`.
8294 pub unsafe fn display_power_control_ext(
8295 &self,
8296 display: DisplayKHR,
8297 p_display_power_info: &DisplayPowerInfoEXT,
8298 ) -> VkResult<()> {
8299 let fp = self
8300 .commands()
8301 .display_power_control_ext
8302 .expect("vkDisplayPowerControlEXT not loaded");
8303 check(unsafe { fp(self.handle(), display, p_display_power_info) })
8304 }
8305 ///Wraps [`vkRegisterDeviceEventEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkRegisterDeviceEventEXT.html).
8306 /**
8307 Provided by **VK_EXT_display_control**.*/
8308 ///
8309 ///# Errors
8310 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8311 ///- `VK_ERROR_UNKNOWN`
8312 ///- `VK_ERROR_VALIDATION_FAILED`
8313 ///
8314 ///# Safety
8315 ///- `device` (self) must be valid and not destroyed.
8316 ///
8317 ///# Panics
8318 ///Panics if `vkRegisterDeviceEventEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8319 ///
8320 ///# Usage Notes
8321 ///
8322 ///Registers a fence to be signaled when a device event occurs.
8323 ///`DeviceEventInfoEXT` specifies the event type (e.g.,
8324 ///`DISPLAY_HOTPLUG`).
8325 ///
8326 ///Returns a fence that will be signaled when the event fires.
8327 ///
8328 ///Requires `VK_EXT_display_control`.
8329 pub unsafe fn register_device_event_ext(
8330 &self,
8331 p_device_event_info: &DeviceEventInfoEXT,
8332 allocator: Option<&AllocationCallbacks>,
8333 ) -> VkResult<Fence> {
8334 let fp = self
8335 .commands()
8336 .register_device_event_ext
8337 .expect("vkRegisterDeviceEventEXT not loaded");
8338 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
8339 let mut out = unsafe { core::mem::zeroed() };
8340 check(unsafe { fp(self.handle(), p_device_event_info, alloc_ptr, &mut out) })?;
8341 Ok(out)
8342 }
8343 ///Wraps [`vkRegisterDisplayEventEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkRegisterDisplayEventEXT.html).
8344 /**
8345 Provided by **VK_EXT_display_control**.*/
8346 ///
8347 ///# Errors
8348 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8349 ///- `VK_ERROR_UNKNOWN`
8350 ///- `VK_ERROR_VALIDATION_FAILED`
8351 ///
8352 ///# Safety
8353 ///- `device` (self) must be valid and not destroyed.
8354 ///
8355 ///# Panics
8356 ///Panics if `vkRegisterDisplayEventEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8357 ///
8358 ///# Usage Notes
8359 ///
8360 ///Registers a fence to be signaled when a display event occurs.
8361 ///`DisplayEventInfoEXT` specifies the event type (e.g.,
8362 ///`FIRST_PIXEL_OUT`, signaled at the start of the first scanline
8363 ///after a present).
8364 ///
8365 ///Returns a fence. Useful for frame pacing and display timing.
8366 ///
8367 ///Requires `VK_EXT_display_control`.
8368 pub unsafe fn register_display_event_ext(
8369 &self,
8370 display: DisplayKHR,
8371 p_display_event_info: &DisplayEventInfoEXT,
8372 allocator: Option<&AllocationCallbacks>,
8373 ) -> VkResult<Fence> {
8374 let fp = self
8375 .commands()
8376 .register_display_event_ext
8377 .expect("vkRegisterDisplayEventEXT not loaded");
8378 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
8379 let mut out = unsafe { core::mem::zeroed() };
8380 check(unsafe {
8381 fp(
8382 self.handle(),
8383 display,
8384 p_display_event_info,
8385 alloc_ptr,
8386 &mut out,
8387 )
8388 })?;
8389 Ok(out)
8390 }
8391 ///Wraps [`vkGetSwapchainCounterEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSwapchainCounterEXT.html).
8392 /**
8393 Provided by **VK_EXT_display_control**.*/
8394 ///
8395 ///# Errors
8396 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8397 ///- `VK_ERROR_DEVICE_LOST`
8398 ///- `VK_ERROR_OUT_OF_DATE_KHR`
8399 ///- `VK_ERROR_UNKNOWN`
8400 ///- `VK_ERROR_VALIDATION_FAILED`
8401 ///
8402 ///# Safety
8403 ///- `device` (self) must be valid and not destroyed.
8404 ///
8405 ///# Panics
8406 ///Panics if `vkGetSwapchainCounterEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8407 ///
8408 ///# Usage Notes
8409 ///
8410 ///Queries a performance counter associated with a swapchain (e.g.,
8411 ///vertical blanks). Returns the counter value as a `u64`.
8412 ///
8413 ///The counter type is specified as a `SurfaceCounterFlagBitsEXT`
8414 ///(typically `VBLANK`).
8415 ///
8416 ///Requires `VK_EXT_display_control`.
8417 pub unsafe fn get_swapchain_counter_ext(
8418 &self,
8419 swapchain: SwapchainKHR,
8420 counter: SurfaceCounterFlagBitsEXT,
8421 ) -> VkResult<u64> {
8422 let fp = self
8423 .commands()
8424 .get_swapchain_counter_ext
8425 .expect("vkGetSwapchainCounterEXT not loaded");
8426 let mut out = unsafe { core::mem::zeroed() };
8427 check(unsafe { fp(self.handle(), swapchain, counter, &mut out) })?;
8428 Ok(out)
8429 }
8430 ///Wraps [`vkGetDeviceGroupPeerMemoryFeatures`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceGroupPeerMemoryFeatures.html).
8431 /**
8432 Provided by **VK_BASE_VERSION_1_1**.*/
8433 ///
8434 ///# Safety
8435 ///- `device` (self) must be valid and not destroyed.
8436 ///
8437 ///# Panics
8438 ///Panics if `vkGetDeviceGroupPeerMemoryFeatures` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8439 ///
8440 ///# Usage Notes
8441 ///
8442 ///Queries the memory access capabilities between two physical devices
8443 ///in a device group. Returns flags indicating whether memory allocated
8444 ///on one device can be copied to, accessed generically, or accessed
8445 ///natively from the other device.
8446 ///
8447 ///Only relevant for multi-GPU device groups. On single-GPU systems
8448 ///this is not needed.
8449 ///
8450 ///Use the returned flags to decide how to share resources across
8451 ///devices, for example, whether a texture on GPU 0 can be sampled
8452 ///directly by GPU 1, or whether it must be copied.
8453 pub unsafe fn get_device_group_peer_memory_features(
8454 &self,
8455 heap_index: u32,
8456 local_device_index: u32,
8457 remote_device_index: u32,
8458 ) -> PeerMemoryFeatureFlags {
8459 let fp = self
8460 .commands()
8461 .get_device_group_peer_memory_features
8462 .expect("vkGetDeviceGroupPeerMemoryFeatures not loaded");
8463 let mut out = unsafe { core::mem::zeroed() };
8464 unsafe {
8465 fp(
8466 self.handle(),
8467 heap_index,
8468 local_device_index,
8469 remote_device_index,
8470 &mut out,
8471 )
8472 };
8473 out
8474 }
8475 ///Wraps [`vkBindBufferMemory2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBindBufferMemory2.html).
8476 /**
8477 Provided by **VK_BASE_VERSION_1_1**.*/
8478 ///
8479 ///# Errors
8480 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8481 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
8482 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
8483 ///- `VK_ERROR_UNKNOWN`
8484 ///- `VK_ERROR_VALIDATION_FAILED`
8485 ///
8486 ///# Safety
8487 ///- `device` (self) must be valid and not destroyed.
8488 ///
8489 ///# Panics
8490 ///Panics if `vkBindBufferMemory2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8491 ///
8492 ///# Usage Notes
8493 ///
8494 ///Binds memory to one or more buffers in a single call. This is the
8495 ///Vulkan 1.1 batch version of `bind_buffer_memory`.
8496 ///
8497 ///Each `BindBufferMemoryInfo` specifies a buffer, memory object, and
8498 ///offset, the same parameters as `bind_buffer_memory`, but batched.
8499 ///
8500 ///Use `BindBufferMemoryDeviceGroupInfo` in the pNext chain to bind
8501 ///memory for specific devices in a device group (multi-GPU). For
8502 ///single-GPU usage, `bind_buffer_memory` and `bind_buffer_memory2`
8503 ///are equivalent.
8504 pub unsafe fn bind_buffer_memory2(
8505 &self,
8506 p_bind_infos: &[BindBufferMemoryInfo],
8507 ) -> VkResult<()> {
8508 let fp = self
8509 .commands()
8510 .bind_buffer_memory2
8511 .expect("vkBindBufferMemory2 not loaded");
8512 check(unsafe {
8513 fp(
8514 self.handle(),
8515 p_bind_infos.len() as u32,
8516 p_bind_infos.as_ptr(),
8517 )
8518 })
8519 }
8520 ///Wraps [`vkBindImageMemory2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBindImageMemory2.html).
8521 /**
8522 Provided by **VK_BASE_VERSION_1_1**.*/
8523 ///
8524 ///# Errors
8525 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8526 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
8527 ///- `VK_ERROR_UNKNOWN`
8528 ///- `VK_ERROR_VALIDATION_FAILED`
8529 ///
8530 ///# Safety
8531 ///- `device` (self) must be valid and not destroyed.
8532 ///
8533 ///# Panics
8534 ///Panics if `vkBindImageMemory2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8535 ///
8536 ///# Usage Notes
8537 ///
8538 ///Binds memory to one or more images in a single call. This is the
8539 ///Vulkan 1.1 batch version of `bind_image_memory`.
8540 ///
8541 ///Also required when binding memory to images created with
8542 ///disjoint multi-planar formats, each plane is bound separately via
8543 ///`BindImagePlaneMemoryInfo` in the pNext chain.
8544 ///
8545 ///For device groups (multi-GPU), chain
8546 ///`BindImageMemoryDeviceGroupInfo` to assign memory per device and
8547 ///specify split-instance bind regions.
8548 pub unsafe fn bind_image_memory2(&self, p_bind_infos: &[BindImageMemoryInfo]) -> VkResult<()> {
8549 let fp = self
8550 .commands()
8551 .bind_image_memory2
8552 .expect("vkBindImageMemory2 not loaded");
8553 check(unsafe {
8554 fp(
8555 self.handle(),
8556 p_bind_infos.len() as u32,
8557 p_bind_infos.as_ptr(),
8558 )
8559 })
8560 }
8561 ///Wraps [`vkCmdSetDeviceMask`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDeviceMask.html).
8562 /**
8563 Provided by **VK_BASE_VERSION_1_1**.*/
8564 ///
8565 ///# Safety
8566 ///- `commandBuffer` (self) must be valid and not destroyed.
8567 ///- `commandBuffer` must be externally synchronized.
8568 ///
8569 ///# Panics
8570 ///Panics if `vkCmdSetDeviceMask` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8571 ///
8572 ///# Usage Notes
8573 ///
8574 ///Sets the device mask for subsequent commands in a command buffer
8575 ///when using device groups (multi-GPU with
8576 ///`VK_KHR_device_group` / Vulkan 1.1).
8577 ///
8578 ///The device mask is a bitmask where bit *i* indicates that subsequent
8579 ///commands execute on physical device *i* in the device group.
8580 ///
8581 ///For single-GPU systems (the common case), the device mask is always
8582 ///`0x1` and this command is not needed.
8583 ///
8584 ///Must only be called outside a render pass, or inside a render pass
8585 ///that was begun with `DEVICE_GROUP_BEGIN_INFO` and has the
8586 ///`DEVICE_GROUP` flag set.
8587 pub unsafe fn cmd_set_device_mask(&self, command_buffer: CommandBuffer, device_mask: u32) {
8588 let fp = self
8589 .commands()
8590 .cmd_set_device_mask
8591 .expect("vkCmdSetDeviceMask not loaded");
8592 unsafe { fp(command_buffer, device_mask) };
8593 }
8594 ///Wraps [`vkGetDeviceGroupPresentCapabilitiesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceGroupPresentCapabilitiesKHR.html).
8595 /**
8596 Provided by **VK_KHR_swapchain**.*/
8597 ///
8598 ///# Errors
8599 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8600 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
8601 ///- `VK_ERROR_UNKNOWN`
8602 ///- `VK_ERROR_VALIDATION_FAILED`
8603 ///
8604 ///# Safety
8605 ///- `device` (self) must be valid and not destroyed.
8606 ///
8607 ///# Panics
8608 ///Panics if `vkGetDeviceGroupPresentCapabilitiesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8609 ///
8610 ///# Usage Notes
8611 ///
8612 ///Queries the present capabilities of a device group, which physical
8613 ///devices can present to which surfaces, and what presentation modes
8614 ///are supported.
8615 ///
8616 ///Only relevant for multi-GPU device groups. On single-GPU systems,
8617 ///only `DEVICE_GROUP_PRESENT_MODE_LOCAL` is supported (each device
8618 ///presents its own images).
8619 pub unsafe fn get_device_group_present_capabilities_khr(
8620 &self,
8621 p_device_group_present_capabilities: &mut DeviceGroupPresentCapabilitiesKHR,
8622 ) -> VkResult<()> {
8623 let fp = self
8624 .commands()
8625 .get_device_group_present_capabilities_khr
8626 .expect("vkGetDeviceGroupPresentCapabilitiesKHR not loaded");
8627 check(unsafe { fp(self.handle(), p_device_group_present_capabilities) })
8628 }
8629 ///Wraps [`vkGetDeviceGroupSurfacePresentModesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceGroupSurfacePresentModesKHR.html).
8630 /**
8631 Provided by **VK_KHR_swapchain**.*/
8632 ///
8633 ///# Errors
8634 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8635 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
8636 ///- `VK_ERROR_SURFACE_LOST_KHR`
8637 ///- `VK_ERROR_UNKNOWN`
8638 ///- `VK_ERROR_VALIDATION_FAILED`
8639 ///
8640 ///# Safety
8641 ///- `device` (self) must be valid and not destroyed.
8642 ///- `surface` must be externally synchronized.
8643 ///
8644 ///# Panics
8645 ///Panics if `vkGetDeviceGroupSurfacePresentModesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8646 ///
8647 ///# Usage Notes
8648 ///
8649 ///Queries which device group present modes a surface supports. The
8650 ///returned bitmask indicates whether `LOCAL`, `REMOTE`, `SUM`, or
8651 ///`LOCAL_MULTI_DEVICE` modes are available.
8652 ///
8653 ///Only relevant for multi-GPU device groups. On single-GPU systems,
8654 ///only `LOCAL` is supported.
8655 pub unsafe fn get_device_group_surface_present_modes_khr(
8656 &self,
8657 surface: SurfaceKHR,
8658 ) -> VkResult<DeviceGroupPresentModeFlagsKHR> {
8659 let fp = self
8660 .commands()
8661 .get_device_group_surface_present_modes_khr
8662 .expect("vkGetDeviceGroupSurfacePresentModesKHR not loaded");
8663 let mut out = unsafe { core::mem::zeroed() };
8664 check(unsafe { fp(self.handle(), surface, &mut out) })?;
8665 Ok(out)
8666 }
8667 ///Wraps [`vkAcquireNextImage2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAcquireNextImage2KHR.html).
8668 /**
8669 Provided by **VK_KHR_swapchain**.*/
8670 ///
8671 ///# Errors
8672 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8673 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
8674 ///- `VK_ERROR_DEVICE_LOST`
8675 ///- `VK_ERROR_OUT_OF_DATE_KHR`
8676 ///- `VK_ERROR_SURFACE_LOST_KHR`
8677 ///- `VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT`
8678 ///- `VK_ERROR_UNKNOWN`
8679 ///- `VK_ERROR_VALIDATION_FAILED`
8680 ///
8681 ///# Safety
8682 ///- `device` (self) must be valid and not destroyed.
8683 ///
8684 ///# Panics
8685 ///Panics if `vkAcquireNextImage2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8686 ///
8687 ///# Usage Notes
8688 ///
8689 ///Extended version of `acquire_next_image_khr` that takes an
8690 ///`AcquireNextImageInfoKHR` struct with pNext support.
8691 ///
8692 ///The key addition is `device_mask` for device groups (multi-GPU),
8693 ///specifying which physical devices the acquired image will be used
8694 ///on.
8695 ///
8696 ///For single-GPU usage, this is functionally identical to
8697 ///`acquire_next_image_khr`.
8698 pub unsafe fn acquire_next_image2_khr(
8699 &self,
8700 p_acquire_info: &AcquireNextImageInfoKHR,
8701 ) -> VkResult<u32> {
8702 let fp = self
8703 .commands()
8704 .acquire_next_image2_khr
8705 .expect("vkAcquireNextImage2KHR not loaded");
8706 let mut out = unsafe { core::mem::zeroed() };
8707 check(unsafe { fp(self.handle(), p_acquire_info, &mut out) })?;
8708 Ok(out)
8709 }
8710 ///Wraps [`vkCmdDispatchBase`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDispatchBase.html).
8711 /**
8712 Provided by **VK_COMPUTE_VERSION_1_1**.*/
8713 ///
8714 ///# Safety
8715 ///- `commandBuffer` (self) must be valid and not destroyed.
8716 ///- `commandBuffer` must be externally synchronized.
8717 ///
8718 ///# Panics
8719 ///Panics if `vkCmdDispatchBase` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8720 ///
8721 ///# Usage Notes
8722 ///
8723 ///Dispatches a compute shader with a non-zero base workgroup offset.
8724 ///The shader's `gl_WorkGroupID` starts at (`base_group_x`,
8725 ///`base_group_y`, `base_group_z`) instead of (0, 0, 0).
8726 ///
8727 ///This is useful for splitting a large dispatch across multiple
8728 ///submissions or for device groups where different physical devices
8729 ///handle different regions of the workgroup space.
8730 ///
8731 ///`gl_NumWorkGroups` reflects the `group_count` parameters, not the
8732 ///total. The shader sees workgroup IDs in the range
8733 ///[`base`, `base + count`).
8734 ///
8735 ///For single-GPU, zero-base dispatches, use `cmd_dispatch` instead.
8736 pub unsafe fn cmd_dispatch_base(
8737 &self,
8738 command_buffer: CommandBuffer,
8739 base_group_x: u32,
8740 base_group_y: u32,
8741 base_group_z: u32,
8742 group_count_x: u32,
8743 group_count_y: u32,
8744 group_count_z: u32,
8745 ) {
8746 let fp = self
8747 .commands()
8748 .cmd_dispatch_base
8749 .expect("vkCmdDispatchBase not loaded");
8750 unsafe {
8751 fp(
8752 command_buffer,
8753 base_group_x,
8754 base_group_y,
8755 base_group_z,
8756 group_count_x,
8757 group_count_y,
8758 group_count_z,
8759 )
8760 };
8761 }
8762 ///Wraps [`vkCreateDescriptorUpdateTemplate`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateDescriptorUpdateTemplate.html).
8763 /**
8764 Provided by **VK_COMPUTE_VERSION_1_1**.*/
8765 ///
8766 ///# Errors
8767 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8768 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
8769 ///- `VK_ERROR_UNKNOWN`
8770 ///- `VK_ERROR_VALIDATION_FAILED`
8771 ///
8772 ///# Safety
8773 ///- `device` (self) must be valid and not destroyed.
8774 ///
8775 ///# Panics
8776 ///Panics if `vkCreateDescriptorUpdateTemplate` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8777 ///
8778 ///# Usage Notes
8779 ///
8780 ///Creates a template that describes how to update a descriptor set
8781 ///from a compact block of host memory. Instead of building an array
8782 ///of `WriteDescriptorSet` structs, you define the layout once in the
8783 ///template and then call `update_descriptor_set_with_template` with
8784 ///a raw pointer to your data.
8785 ///
8786 ///**Benefits**:
8787 ///
8788 ///- Reduces CPU overhead for frequent descriptor updates.
8789 ///- Avoids allocating `WriteDescriptorSet` arrays every frame.
8790 ///- Pairs well with `cmd_push_descriptor_set_with_template` for
8791 /// push descriptors.
8792 ///
8793 ///Each entry in the template maps an offset in your host data block to
8794 ///a descriptor binding, array element, and type. The driver compiles
8795 ///this into an optimised update path.
8796 ///
8797 ///Templates are immutable after creation and can be reused across
8798 ///frames.
8799 pub unsafe fn create_descriptor_update_template(
8800 &self,
8801 p_create_info: &DescriptorUpdateTemplateCreateInfo,
8802 allocator: Option<&AllocationCallbacks>,
8803 ) -> VkResult<DescriptorUpdateTemplate> {
8804 let fp = self
8805 .commands()
8806 .create_descriptor_update_template
8807 .expect("vkCreateDescriptorUpdateTemplate not loaded");
8808 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
8809 let mut out = unsafe { core::mem::zeroed() };
8810 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
8811 Ok(out)
8812 }
8813 ///Wraps [`vkDestroyDescriptorUpdateTemplate`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyDescriptorUpdateTemplate.html).
8814 /**
8815 Provided by **VK_COMPUTE_VERSION_1_1**.*/
8816 ///
8817 ///# Safety
8818 ///- `device` (self) must be valid and not destroyed.
8819 ///- `descriptorUpdateTemplate` must be externally synchronized.
8820 ///
8821 ///# Panics
8822 ///Panics if `vkDestroyDescriptorUpdateTemplate` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8823 ///
8824 ///# Usage Notes
8825 ///
8826 ///Destroys a descriptor update template. The template must not be in
8827 ///use by any pending `update_descriptor_set_with_template` or
8828 ///`cmd_push_descriptor_set_with_template` call.
8829 pub unsafe fn destroy_descriptor_update_template(
8830 &self,
8831 descriptor_update_template: DescriptorUpdateTemplate,
8832 allocator: Option<&AllocationCallbacks>,
8833 ) {
8834 let fp = self
8835 .commands()
8836 .destroy_descriptor_update_template
8837 .expect("vkDestroyDescriptorUpdateTemplate not loaded");
8838 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
8839 unsafe { fp(self.handle(), descriptor_update_template, alloc_ptr) };
8840 }
8841 ///Wraps [`vkUpdateDescriptorSetWithTemplate`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkUpdateDescriptorSetWithTemplate.html).
8842 /**
8843 Provided by **VK_COMPUTE_VERSION_1_1**.*/
8844 ///
8845 ///# Safety
8846 ///- `device` (self) must be valid and not destroyed.
8847 ///- `descriptorSet` must be externally synchronized.
8848 ///
8849 ///# Panics
8850 ///Panics if `vkUpdateDescriptorSetWithTemplate` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8851 ///
8852 ///# Usage Notes
8853 ///
8854 ///Updates a descriptor set using a descriptor update template and a
8855 ///raw pointer to a block of host data. The template defines the mapping
8856 ///from the data block to descriptor bindings.
8857 ///
8858 ///This is faster than `update_descriptor_sets` for repeated updates
8859 ///with the same layout, the driver has pre-compiled the update path.
8860 ///
8861 ///The `data` pointer must point to a block of memory laid out according
8862 ///to the template's entry offsets and strides. The data is consumed
8863 ///immediately; the pointer does not need to remain valid after the
8864 ///call returns.
8865 pub unsafe fn update_descriptor_set_with_template(
8866 &self,
8867 descriptor_set: DescriptorSet,
8868 descriptor_update_template: DescriptorUpdateTemplate,
8869 p_data: *const core::ffi::c_void,
8870 ) {
8871 let fp = self
8872 .commands()
8873 .update_descriptor_set_with_template
8874 .expect("vkUpdateDescriptorSetWithTemplate not loaded");
8875 unsafe {
8876 fp(
8877 self.handle(),
8878 descriptor_set,
8879 descriptor_update_template,
8880 p_data,
8881 )
8882 };
8883 }
8884 ///Wraps [`vkCmdPushDescriptorSetWithTemplate`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPushDescriptorSetWithTemplate.html).
8885 /**
8886 Provided by **VK_COMPUTE_VERSION_1_4**.*/
8887 ///
8888 ///# Safety
8889 ///- `commandBuffer` (self) must be valid and not destroyed.
8890 ///- `commandBuffer` must be externally synchronized.
8891 ///
8892 ///# Panics
8893 ///Panics if `vkCmdPushDescriptorSetWithTemplate` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8894 ///
8895 ///# Usage Notes
8896 ///
8897 ///Combines push descriptors with descriptor update templates for
8898 ///maximum efficiency. Updates are pushed directly into the command
8899 ///buffer using the compact host data format defined by the template.
8900 ///
8901 ///This is the fastest path for per-draw descriptor updates: no pool
8902 ///allocation, no `WriteDescriptorSet` array construction, and the
8903 ///driver has a pre-compiled update path from the template.
8904 ///
8905 ///The template must have been created with
8906 ///`DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS`.
8907 ///
8908 ///Core in Vulkan 1.4. Previously via `VK_KHR_push_descriptor` +
8909 ///`VK_KHR_descriptor_update_template`.
8910 pub unsafe fn cmd_push_descriptor_set_with_template(
8911 &self,
8912 command_buffer: CommandBuffer,
8913 descriptor_update_template: DescriptorUpdateTemplate,
8914 layout: PipelineLayout,
8915 set: u32,
8916 p_data: *const core::ffi::c_void,
8917 ) {
8918 let fp = self
8919 .commands()
8920 .cmd_push_descriptor_set_with_template
8921 .expect("vkCmdPushDescriptorSetWithTemplate not loaded");
8922 unsafe {
8923 fp(
8924 command_buffer,
8925 descriptor_update_template,
8926 layout,
8927 set,
8928 p_data,
8929 )
8930 };
8931 }
8932 ///Wraps [`vkSetHdrMetadataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetHdrMetadataEXT.html).
8933 /**
8934 Provided by **VK_EXT_hdr_metadata**.*/
8935 ///
8936 ///# Safety
8937 ///- `device` (self) must be valid and not destroyed.
8938 ///
8939 ///# Panics
8940 ///Panics if `vkSetHdrMetadataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8941 ///
8942 ///# Usage Notes
8943 ///
8944 ///Sets HDR metadata (mastering display color volume, content light
8945 ///levels) for one or more swapchains. The compositor uses this to
8946 ///tone-map content appropriately for the connected display.
8947 ///
8948 ///Call whenever the content characteristics change (e.g., switching
8949 ///between SDR UI and HDR scene rendering).
8950 ///
8951 ///Requires `VK_EXT_hdr_metadata`.
8952 pub unsafe fn set_hdr_metadata_ext(
8953 &self,
8954 p_swapchains: &[SwapchainKHR],
8955 p_metadata: &HdrMetadataEXT,
8956 ) {
8957 let fp = self
8958 .commands()
8959 .set_hdr_metadata_ext
8960 .expect("vkSetHdrMetadataEXT not loaded");
8961 unsafe {
8962 fp(
8963 self.handle(),
8964 p_swapchains.len() as u32,
8965 p_swapchains.as_ptr(),
8966 p_metadata,
8967 )
8968 };
8969 }
8970 ///Wraps [`vkGetSwapchainStatusKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSwapchainStatusKHR.html).
8971 /**
8972 Provided by **VK_KHR_shared_presentable_image**.*/
8973 ///
8974 ///# Errors
8975 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8976 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
8977 ///- `VK_ERROR_DEVICE_LOST`
8978 ///- `VK_ERROR_OUT_OF_DATE_KHR`
8979 ///- `VK_ERROR_SURFACE_LOST_KHR`
8980 ///- `VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT`
8981 ///- `VK_ERROR_UNKNOWN`
8982 ///- `VK_ERROR_VALIDATION_FAILED`
8983 ///
8984 ///# Safety
8985 ///- `device` (self) must be valid and not destroyed.
8986 ///- `swapchain` must be externally synchronized.
8987 ///
8988 ///# Panics
8989 ///Panics if `vkGetSwapchainStatusKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8990 ///
8991 ///# Usage Notes
8992 ///
8993 ///Queries the current status of a shared presentable swapchain
8994 ///(created with `PRESENT_MODE_SHARED_DEMAND_REFRESH` or
8995 ///`PRESENT_MODE_SHARED_CONTINUOUS_REFRESH`).
8996 ///
8997 ///Returns `VK_SUCCESS` if the swapchain is usable, or
8998 ///`VK_SUBOPTIMAL_KHR` / `VK_ERROR_OUT_OF_DATE_KHR` / surface-lost
8999 ///errors if the swapchain needs recreation.
9000 ///
9001 ///Only relevant for shared presentable images
9002 ///(`VK_KHR_shared_presentable_image`). For regular swapchains, status
9003 ///is communicated through `acquire_next_image_khr` and
9004 ///`queue_present_khr` return values.
9005 pub unsafe fn get_swapchain_status_khr(&self, swapchain: SwapchainKHR) -> VkResult<()> {
9006 let fp = self
9007 .commands()
9008 .get_swapchain_status_khr
9009 .expect("vkGetSwapchainStatusKHR not loaded");
9010 check(unsafe { fp(self.handle(), swapchain) })
9011 }
9012 ///Wraps [`vkGetRefreshCycleDurationGOOGLE`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetRefreshCycleDurationGOOGLE.html).
9013 /**
9014 Provided by **VK_GOOGLE_display_timing**.*/
9015 ///
9016 ///# Errors
9017 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
9018 ///- `VK_ERROR_DEVICE_LOST`
9019 ///- `VK_ERROR_SURFACE_LOST_KHR`
9020 ///- `VK_ERROR_UNKNOWN`
9021 ///- `VK_ERROR_VALIDATION_FAILED`
9022 ///
9023 ///# Safety
9024 ///- `device` (self) must be valid and not destroyed.
9025 ///- `swapchain` must be externally synchronized.
9026 ///
9027 ///# Panics
9028 ///Panics if `vkGetRefreshCycleDurationGOOGLE` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9029 ///
9030 ///# Usage Notes
9031 ///
9032 ///Queries the duration of a single refresh cycle (vsync interval)
9033 ///for the display associated with the given swapchain. Returns
9034 ///the period in nanoseconds. Essential for accurate frame pacing.
9035 ///
9036 ///Requires `VK_GOOGLE_display_timing`.
9037 pub unsafe fn get_refresh_cycle_duration_google(
9038 &self,
9039 swapchain: SwapchainKHR,
9040 ) -> VkResult<RefreshCycleDurationGOOGLE> {
9041 let fp = self
9042 .commands()
9043 .get_refresh_cycle_duration_google
9044 .expect("vkGetRefreshCycleDurationGOOGLE not loaded");
9045 let mut out = unsafe { core::mem::zeroed() };
9046 check(unsafe { fp(self.handle(), swapchain, &mut out) })?;
9047 Ok(out)
9048 }
9049 ///Wraps [`vkGetPastPresentationTimingGOOGLE`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPastPresentationTimingGOOGLE.html).
9050 /**
9051 Provided by **VK_GOOGLE_display_timing**.*/
9052 ///
9053 ///# Errors
9054 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
9055 ///- `VK_ERROR_DEVICE_LOST`
9056 ///- `VK_ERROR_OUT_OF_DATE_KHR`
9057 ///- `VK_ERROR_SURFACE_LOST_KHR`
9058 ///- `VK_ERROR_UNKNOWN`
9059 ///- `VK_ERROR_VALIDATION_FAILED`
9060 ///
9061 ///# Safety
9062 ///- `device` (self) must be valid and not destroyed.
9063 ///- `swapchain` must be externally synchronized.
9064 ///
9065 ///# Panics
9066 ///Panics if `vkGetPastPresentationTimingGOOGLE` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9067 ///
9068 ///# Usage Notes
9069 ///
9070 ///Returns timing data for past presentations on a swapchain,
9071 ///including actual present time, earliest possible present time,
9072 ///and finish time. Uses the two-call idiom (call once to get the
9073 ///count, again to fill the buffer). Useful for frame pacing and
9074 ///latency analysis.
9075 ///
9076 ///Requires `VK_GOOGLE_display_timing`.
9077 pub unsafe fn get_past_presentation_timing_google(
9078 &self,
9079 swapchain: SwapchainKHR,
9080 ) -> VkResult<Vec<PastPresentationTimingGOOGLE>> {
9081 let fp = self
9082 .commands()
9083 .get_past_presentation_timing_google
9084 .expect("vkGetPastPresentationTimingGOOGLE not loaded");
9085 enumerate_two_call(|count, data| unsafe { fp(self.handle(), swapchain, count, data) })
9086 }
9087 ///Wraps [`vkCmdSetViewportWScalingNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetViewportWScalingNV.html).
9088 /**
9089 Provided by **VK_NV_clip_space_w_scaling**.*/
9090 ///
9091 ///# Safety
9092 ///- `commandBuffer` (self) must be valid and not destroyed.
9093 ///- `commandBuffer` must be externally synchronized.
9094 ///
9095 ///# Panics
9096 ///Panics if `vkCmdSetViewportWScalingNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9097 ///
9098 ///# Usage Notes
9099 ///
9100 ///Sets per-viewport W scaling factors for lens-matched shading.
9101 ///The W scaling modifies the clip-space W coordinate to account
9102 ///for lens distortion in VR headsets, enabling more efficient
9103 ///shading by varying pixel density across the viewport.
9104 ///
9105 ///Requires `VK_NV_clip_space_w_scaling`.
9106 pub unsafe fn cmd_set_viewport_w_scaling_nv(
9107 &self,
9108 command_buffer: CommandBuffer,
9109 first_viewport: u32,
9110 p_viewport_w_scalings: &[ViewportWScalingNV],
9111 ) {
9112 let fp = self
9113 .commands()
9114 .cmd_set_viewport_w_scaling_nv
9115 .expect("vkCmdSetViewportWScalingNV not loaded");
9116 unsafe {
9117 fp(
9118 command_buffer,
9119 first_viewport,
9120 p_viewport_w_scalings.len() as u32,
9121 p_viewport_w_scalings.as_ptr(),
9122 )
9123 };
9124 }
9125 ///Wraps [`vkCmdSetDiscardRectangleEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDiscardRectangleEXT.html).
9126 /**
9127 Provided by **VK_EXT_discard_rectangles**.*/
9128 ///
9129 ///# Safety
9130 ///- `commandBuffer` (self) must be valid and not destroyed.
9131 ///- `commandBuffer` must be externally synchronized.
9132 ///
9133 ///# Panics
9134 ///Panics if `vkCmdSetDiscardRectangleEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9135 ///
9136 ///# Usage Notes
9137 ///
9138 ///Dynamically sets the discard rectangles for the current command
9139 ///buffer. Fragments inside (or outside, depending on mode) these
9140 ///rectangles are discarded before the fragment shader runs.
9141 ///
9142 ///Useful for multi-view or split-screen rendering to cheaply cull
9143 ///fragments that belong to a different viewport.
9144 ///
9145 ///Requires `VK_EXT_discard_rectangles`.
9146 pub unsafe fn cmd_set_discard_rectangle_ext(
9147 &self,
9148 command_buffer: CommandBuffer,
9149 first_discard_rectangle: u32,
9150 p_discard_rectangles: &[Rect2D],
9151 ) {
9152 let fp = self
9153 .commands()
9154 .cmd_set_discard_rectangle_ext
9155 .expect("vkCmdSetDiscardRectangleEXT not loaded");
9156 unsafe {
9157 fp(
9158 command_buffer,
9159 first_discard_rectangle,
9160 p_discard_rectangles.len() as u32,
9161 p_discard_rectangles.as_ptr(),
9162 )
9163 };
9164 }
9165 ///Wraps [`vkCmdSetDiscardRectangleEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDiscardRectangleEnableEXT.html).
9166 /**
9167 Provided by **VK_EXT_discard_rectangles**.*/
9168 ///
9169 ///# Safety
9170 ///- `commandBuffer` (self) must be valid and not destroyed.
9171 ///- `commandBuffer` must be externally synchronized.
9172 ///
9173 ///# Panics
9174 ///Panics if `vkCmdSetDiscardRectangleEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9175 ///
9176 ///# Usage Notes
9177 ///
9178 ///Dynamically enables or disables discard rectangles for subsequent
9179 ///draw commands. When disabled, no fragments are discarded regardless
9180 ///of the configured rectangles.
9181 ///
9182 ///Requires `VK_EXT_discard_rectangles`.
9183 pub unsafe fn cmd_set_discard_rectangle_enable_ext(
9184 &self,
9185 command_buffer: CommandBuffer,
9186 discard_rectangle_enable: bool,
9187 ) {
9188 let fp = self
9189 .commands()
9190 .cmd_set_discard_rectangle_enable_ext
9191 .expect("vkCmdSetDiscardRectangleEnableEXT not loaded");
9192 unsafe { fp(command_buffer, discard_rectangle_enable as u32) };
9193 }
9194 ///Wraps [`vkCmdSetDiscardRectangleModeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDiscardRectangleModeEXT.html).
9195 /**
9196 Provided by **VK_EXT_discard_rectangles**.*/
9197 ///
9198 ///# Safety
9199 ///- `commandBuffer` (self) must be valid and not destroyed.
9200 ///- `commandBuffer` must be externally synchronized.
9201 ///
9202 ///# Panics
9203 ///Panics if `vkCmdSetDiscardRectangleModeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9204 ///
9205 ///# Usage Notes
9206 ///
9207 ///Dynamically sets whether fragments inside or outside the discard
9208 ///rectangles are discarded. `INCLUSIVE` discards fragments inside
9209 ///the rectangles; `EXCLUSIVE` discards fragments outside.
9210 ///
9211 ///Requires `VK_EXT_discard_rectangles`.
9212 pub unsafe fn cmd_set_discard_rectangle_mode_ext(
9213 &self,
9214 command_buffer: CommandBuffer,
9215 discard_rectangle_mode: DiscardRectangleModeEXT,
9216 ) {
9217 let fp = self
9218 .commands()
9219 .cmd_set_discard_rectangle_mode_ext
9220 .expect("vkCmdSetDiscardRectangleModeEXT not loaded");
9221 unsafe { fp(command_buffer, discard_rectangle_mode) };
9222 }
9223 ///Wraps [`vkCmdSetSampleLocationsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetSampleLocationsEXT.html).
9224 /**
9225 Provided by **VK_EXT_sample_locations**.*/
9226 ///
9227 ///# Safety
9228 ///- `commandBuffer` (self) must be valid and not destroyed.
9229 ///- `commandBuffer` must be externally synchronized.
9230 ///
9231 ///# Panics
9232 ///Panics if `vkCmdSetSampleLocationsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9233 ///
9234 ///# Usage Notes
9235 ///
9236 ///Sets custom sample locations for multisampled rasterization.
9237 ///`SampleLocationsInfoEXT` specifies the grid size, sample count,
9238 ///and per-sample (x, y) positions within each pixel.
9239 ///
9240 ///Custom sample locations enable techniques like temporal AA
9241 ///jittering and programmable MSAA patterns.
9242 ///
9243 ///Must be called when custom sample locations are enabled (via
9244 ///`cmd_set_sample_locations_enable_ext` or pipeline state).
9245 ///
9246 ///Requires `VK_EXT_sample_locations`.
9247 pub unsafe fn cmd_set_sample_locations_ext(
9248 &self,
9249 command_buffer: CommandBuffer,
9250 p_sample_locations_info: &SampleLocationsInfoEXT,
9251 ) {
9252 let fp = self
9253 .commands()
9254 .cmd_set_sample_locations_ext
9255 .expect("vkCmdSetSampleLocationsEXT not loaded");
9256 unsafe { fp(command_buffer, p_sample_locations_info) };
9257 }
9258 ///Wraps [`vkGetBufferMemoryRequirements2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetBufferMemoryRequirements2.html).
9259 /**
9260 Provided by **VK_BASE_VERSION_1_1**.*/
9261 ///
9262 ///# Safety
9263 ///- `device` (self) must be valid and not destroyed.
9264 ///
9265 ///# Panics
9266 ///Panics if `vkGetBufferMemoryRequirements2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9267 ///
9268 ///# Usage Notes
9269 ///
9270 ///Vulkan 1.1 version of `get_buffer_memory_requirements` that supports
9271 ///extensible output structs via pNext.
9272 ///
9273 ///Chain `MemoryDedicatedRequirements` to query whether the driver
9274 ///prefers or requires a dedicated allocation for this buffer. If
9275 ///`prefers_dedicated_allocation` is true, allocating a dedicated
9276 ///`DeviceMemory` for this buffer may improve performance.
9277 ///
9278 ///The base `MemoryRequirements` (size, alignment, memory type bits) is
9279 ///identical to what `get_buffer_memory_requirements` returns.
9280 pub unsafe fn get_buffer_memory_requirements2(
9281 &self,
9282 p_info: &BufferMemoryRequirementsInfo2,
9283 p_memory_requirements: &mut MemoryRequirements2,
9284 ) {
9285 let fp = self
9286 .commands()
9287 .get_buffer_memory_requirements2
9288 .expect("vkGetBufferMemoryRequirements2 not loaded");
9289 unsafe { fp(self.handle(), p_info, p_memory_requirements) };
9290 }
9291 ///Wraps [`vkGetImageMemoryRequirements2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageMemoryRequirements2.html).
9292 /**
9293 Provided by **VK_BASE_VERSION_1_1**.*/
9294 ///
9295 ///# Safety
9296 ///- `device` (self) must be valid and not destroyed.
9297 ///
9298 ///# Panics
9299 ///Panics if `vkGetImageMemoryRequirements2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9300 ///
9301 ///# Usage Notes
9302 ///
9303 ///Vulkan 1.1 version of `get_image_memory_requirements` that supports
9304 ///extensible output structs via pNext.
9305 ///
9306 ///Chain `MemoryDedicatedRequirements` to query whether the driver
9307 ///prefers or requires a dedicated allocation for this image. Dedicated
9308 ///allocations are common for large render targets and swapchain-sized
9309 ///images, some drivers require them.
9310 ///
9311 ///For multi-planar images, chain `ImagePlaneMemoryRequirementsInfo` in
9312 ///the input to query requirements for a specific plane.
9313 ///
9314 ///The base `MemoryRequirements` is identical to what
9315 ///`get_image_memory_requirements` returns.
9316 pub unsafe fn get_image_memory_requirements2(
9317 &self,
9318 p_info: &ImageMemoryRequirementsInfo2,
9319 p_memory_requirements: &mut MemoryRequirements2,
9320 ) {
9321 let fp = self
9322 .commands()
9323 .get_image_memory_requirements2
9324 .expect("vkGetImageMemoryRequirements2 not loaded");
9325 unsafe { fp(self.handle(), p_info, p_memory_requirements) };
9326 }
9327 ///Wraps [`vkGetImageSparseMemoryRequirements2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageSparseMemoryRequirements2.html).
9328 /**
9329 Provided by **VK_BASE_VERSION_1_1**.*/
9330 ///
9331 ///# Safety
9332 ///- `device` (self) must be valid and not destroyed.
9333 ///
9334 ///# Panics
9335 ///Panics if `vkGetImageSparseMemoryRequirements2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9336 ///
9337 ///# Usage Notes
9338 ///
9339 ///Vulkan 1.1 version of `get_image_sparse_memory_requirements` that
9340 ///supports extensible output structs via pNext. Returns the sparse
9341 ///memory requirements for an image created with sparse flags.
9342 ///
9343 ///For non-sparse images, returns an empty list. Only relevant if you
9344 ///are using sparse resources.
9345 pub unsafe fn get_image_sparse_memory_requirements2(
9346 &self,
9347 p_info: &ImageSparseMemoryRequirementsInfo2,
9348 ) -> Vec<SparseImageMemoryRequirements2> {
9349 let fp = self
9350 .commands()
9351 .get_image_sparse_memory_requirements2
9352 .expect("vkGetImageSparseMemoryRequirements2 not loaded");
9353 fill_two_call(|count, data| unsafe { fp(self.handle(), p_info, count, data) })
9354 }
9355 ///Wraps [`vkGetDeviceBufferMemoryRequirements`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceBufferMemoryRequirements.html).
9356 /**
9357 Provided by **VK_BASE_VERSION_1_3**.*/
9358 ///
9359 ///# Safety
9360 ///- `device` (self) must be valid and not destroyed.
9361 ///
9362 ///# Panics
9363 ///Panics if `vkGetDeviceBufferMemoryRequirements` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9364 ///
9365 ///# Usage Notes
9366 ///
9367 ///Vulkan 1.3 command that queries memory requirements for a buffer
9368 ///**without creating it first**. Pass a `DeviceBufferMemoryRequirements`
9369 ///containing the hypothetical `BufferCreateInfo`.
9370 ///
9371 ///This lets you pre-plan memory allocations before creating any
9372 ///objects, useful for memory allocation strategies that need to know
9373 ///sizes and alignments up front.
9374 ///
9375 ///The returned requirements are identical to what
9376 ///`get_buffer_memory_requirements2` would return for an actual buffer
9377 ///created with the same parameters.
9378 pub unsafe fn get_device_buffer_memory_requirements(
9379 &self,
9380 p_info: &DeviceBufferMemoryRequirements,
9381 p_memory_requirements: &mut MemoryRequirements2,
9382 ) {
9383 let fp = self
9384 .commands()
9385 .get_device_buffer_memory_requirements
9386 .expect("vkGetDeviceBufferMemoryRequirements not loaded");
9387 unsafe { fp(self.handle(), p_info, p_memory_requirements) };
9388 }
9389 ///Wraps [`vkGetDeviceImageMemoryRequirements`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceImageMemoryRequirements.html).
9390 /**
9391 Provided by **VK_BASE_VERSION_1_3**.*/
9392 ///
9393 ///# Safety
9394 ///- `device` (self) must be valid and not destroyed.
9395 ///
9396 ///# Panics
9397 ///Panics if `vkGetDeviceImageMemoryRequirements` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9398 ///
9399 ///# Usage Notes
9400 ///
9401 ///Vulkan 1.3 command that queries memory requirements for an image
9402 ///**without creating it first**. Pass a `DeviceImageMemoryRequirements`
9403 ///containing the hypothetical `ImageCreateInfo`.
9404 ///
9405 ///Useful for pre-planning memory allocations or estimating VRAM usage
9406 ///before committing to image creation.
9407 ///
9408 ///For multi-planar images, set `plane_aspect` to query requirements
9409 ///for a specific plane.
9410 ///
9411 ///The returned requirements are identical to what
9412 ///`get_image_memory_requirements2` would return for an actual image
9413 ///created with the same parameters.
9414 pub unsafe fn get_device_image_memory_requirements(
9415 &self,
9416 p_info: &DeviceImageMemoryRequirements,
9417 p_memory_requirements: &mut MemoryRequirements2,
9418 ) {
9419 let fp = self
9420 .commands()
9421 .get_device_image_memory_requirements
9422 .expect("vkGetDeviceImageMemoryRequirements not loaded");
9423 unsafe { fp(self.handle(), p_info, p_memory_requirements) };
9424 }
9425 ///Wraps [`vkGetDeviceImageSparseMemoryRequirements`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceImageSparseMemoryRequirements.html).
9426 /**
9427 Provided by **VK_BASE_VERSION_1_3**.*/
9428 ///
9429 ///# Safety
9430 ///- `device` (self) must be valid and not destroyed.
9431 ///
9432 ///# Panics
9433 ///Panics if `vkGetDeviceImageSparseMemoryRequirements` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9434 ///
9435 ///# Usage Notes
9436 ///
9437 ///Vulkan 1.3 command that queries sparse memory requirements for an
9438 ///image **without creating it first**. The counterpart to
9439 ///`get_device_image_memory_requirements` for sparse images.
9440 ///
9441 ///Only relevant if you are using sparse resources with the hypothetical
9442 ///image creation parameters.
9443 pub unsafe fn get_device_image_sparse_memory_requirements(
9444 &self,
9445 p_info: &DeviceImageMemoryRequirements,
9446 ) -> Vec<SparseImageMemoryRequirements2> {
9447 let fp = self
9448 .commands()
9449 .get_device_image_sparse_memory_requirements
9450 .expect("vkGetDeviceImageSparseMemoryRequirements not loaded");
9451 fill_two_call(|count, data| unsafe { fp(self.handle(), p_info, count, data) })
9452 }
9453 ///Wraps [`vkCreateSamplerYcbcrConversion`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateSamplerYcbcrConversion.html).
9454 /**
9455 Provided by **VK_COMPUTE_VERSION_1_1**.*/
9456 ///
9457 ///# Errors
9458 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
9459 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
9460 ///- `VK_ERROR_UNKNOWN`
9461 ///- `VK_ERROR_VALIDATION_FAILED`
9462 ///
9463 ///# Safety
9464 ///- `device` (self) must be valid and not destroyed.
9465 ///
9466 ///# Panics
9467 ///Panics if `vkCreateSamplerYcbcrConversion` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9468 ///
9469 ///# Usage Notes
9470 ///
9471 ///Creates a sampler YCBCR conversion object that describes how to
9472 ///convert YCBCR-encoded image data to RGB during sampling. Required
9473 ///for multi-planar formats like `G8_B8_R8_3PLANE_420_UNORM` commonly
9474 ///used in video decoding and camera capture.
9475 ///
9476 ///The conversion parameters specify:
9477 ///
9478 ///- **Format**: the multi-planar format being converted.
9479 ///- **YCBCR model**: `RGB_IDENTITY`, `YCBCR_IDENTITY`,
9480 /// `YCBCR_709`, `YCBCR_601`, `YCBCR_2020`.
9481 ///- **Range**: `ITU_FULL` or `ITU_NARROW`.
9482 ///- **Chroma location**: where subsampled chroma samples are located
9483 /// relative to luma samples.
9484 ///- **Chroma filter**: `NEAREST` or `LINEAR` for chroma upsampling.
9485 ///
9486 ///The conversion object is attached to a sampler via
9487 ///`SamplerYcbcrConversionInfo` in the pNext chain, and that sampler
9488 ///must be used as an immutable sampler in the descriptor set layout.
9489 pub unsafe fn create_sampler_ycbcr_conversion(
9490 &self,
9491 p_create_info: &SamplerYcbcrConversionCreateInfo,
9492 allocator: Option<&AllocationCallbacks>,
9493 ) -> VkResult<SamplerYcbcrConversion> {
9494 let fp = self
9495 .commands()
9496 .create_sampler_ycbcr_conversion
9497 .expect("vkCreateSamplerYcbcrConversion not loaded");
9498 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
9499 let mut out = unsafe { core::mem::zeroed() };
9500 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
9501 Ok(out)
9502 }
9503 ///Wraps [`vkDestroySamplerYcbcrConversion`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroySamplerYcbcrConversion.html).
9504 /**
9505 Provided by **VK_COMPUTE_VERSION_1_1**.*/
9506 ///
9507 ///# Safety
9508 ///- `device` (self) must be valid and not destroyed.
9509 ///- `ycbcrConversion` must be externally synchronized.
9510 ///
9511 ///# Panics
9512 ///Panics if `vkDestroySamplerYcbcrConversion` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9513 ///
9514 ///# Usage Notes
9515 ///
9516 ///Destroys a sampler YCBCR conversion object. Any sampler that was
9517 ///created with this conversion must already be destroyed.
9518 ///
9519 ///After destruction, any descriptor set layout that used the associated
9520 ///sampler as an immutable sampler remains valid but cannot be used to
9521 ///allocate new descriptor sets.
9522 pub unsafe fn destroy_sampler_ycbcr_conversion(
9523 &self,
9524 ycbcr_conversion: SamplerYcbcrConversion,
9525 allocator: Option<&AllocationCallbacks>,
9526 ) {
9527 let fp = self
9528 .commands()
9529 .destroy_sampler_ycbcr_conversion
9530 .expect("vkDestroySamplerYcbcrConversion not loaded");
9531 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
9532 unsafe { fp(self.handle(), ycbcr_conversion, alloc_ptr) };
9533 }
9534 ///Wraps [`vkGetDeviceQueue2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceQueue2.html).
9535 /**
9536 Provided by **VK_BASE_VERSION_1_1**.*/
9537 ///
9538 ///# Safety
9539 ///- `device` (self) must be valid and not destroyed.
9540 ///
9541 ///# Panics
9542 ///Panics if `vkGetDeviceQueue2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9543 ///
9544 ///# Usage Notes
9545 ///
9546 ///Retrieves a queue handle for a queue created with specific flags.
9547 ///This is the Vulkan 1.1 version of `get_device_queue` that supports
9548 ///`DeviceQueueInfo2` with queue creation flags.
9549 ///
9550 ///Use this instead of `get_device_queue` when you created queues with
9551 ///non-zero `DeviceQueueCreateFlags` (e.g. `PROTECTED` for protected
9552 ///content processing). For queues created without flags, both
9553 ///`get_device_queue` and `get_device_queue2` work.
9554 pub unsafe fn get_device_queue2(&self, p_queue_info: &DeviceQueueInfo2) -> Queue {
9555 let fp = self
9556 .commands()
9557 .get_device_queue2
9558 .expect("vkGetDeviceQueue2 not loaded");
9559 let mut out = unsafe { core::mem::zeroed() };
9560 unsafe { fp(self.handle(), p_queue_info, &mut out) };
9561 out
9562 }
9563 ///Wraps [`vkCreateValidationCacheEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateValidationCacheEXT.html).
9564 /**
9565 Provided by **VK_EXT_validation_cache**.*/
9566 ///
9567 ///# Errors
9568 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
9569 ///- `VK_ERROR_UNKNOWN`
9570 ///- `VK_ERROR_VALIDATION_FAILED`
9571 ///
9572 ///# Safety
9573 ///- `device` (self) must be valid and not destroyed.
9574 ///
9575 ///# Panics
9576 ///Panics if `vkCreateValidationCacheEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9577 ///
9578 ///# Usage Notes
9579 ///
9580 ///Creates a validation cache that stores the results of validation
9581 ///layer checks. Subsequent pipeline creations with the same shaders
9582 ///can skip redundant validation, improving pipeline creation time.
9583 ///
9584 ///Provide previously saved cache data to warm-start the cache.
9585 ///Retrieve data with `get_validation_cache_data_ext`.
9586 ///
9587 ///Destroy with `destroy_validation_cache_ext`.
9588 ///
9589 ///Requires `VK_EXT_validation_cache`.
9590 pub unsafe fn create_validation_cache_ext(
9591 &self,
9592 p_create_info: &ValidationCacheCreateInfoEXT,
9593 allocator: Option<&AllocationCallbacks>,
9594 ) -> VkResult<ValidationCacheEXT> {
9595 let fp = self
9596 .commands()
9597 .create_validation_cache_ext
9598 .expect("vkCreateValidationCacheEXT not loaded");
9599 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
9600 let mut out = unsafe { core::mem::zeroed() };
9601 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
9602 Ok(out)
9603 }
9604 ///Wraps [`vkDestroyValidationCacheEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyValidationCacheEXT.html).
9605 /**
9606 Provided by **VK_EXT_validation_cache**.*/
9607 ///
9608 ///# Safety
9609 ///- `device` (self) must be valid and not destroyed.
9610 ///- `validationCache` must be externally synchronized.
9611 ///
9612 ///# Panics
9613 ///Panics if `vkDestroyValidationCacheEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9614 ///
9615 ///# Usage Notes
9616 ///
9617 ///Destroys a validation cache created with
9618 ///`create_validation_cache_ext`.
9619 ///
9620 ///Requires `VK_EXT_validation_cache`.
9621 pub unsafe fn destroy_validation_cache_ext(
9622 &self,
9623 validation_cache: ValidationCacheEXT,
9624 allocator: Option<&AllocationCallbacks>,
9625 ) {
9626 let fp = self
9627 .commands()
9628 .destroy_validation_cache_ext
9629 .expect("vkDestroyValidationCacheEXT not loaded");
9630 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
9631 unsafe { fp(self.handle(), validation_cache, alloc_ptr) };
9632 }
9633 ///Wraps [`vkGetValidationCacheDataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetValidationCacheDataEXT.html).
9634 /**
9635 Provided by **VK_EXT_validation_cache**.*/
9636 ///
9637 ///# Errors
9638 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
9639 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
9640 ///- `VK_ERROR_UNKNOWN`
9641 ///- `VK_ERROR_VALIDATION_FAILED`
9642 ///
9643 ///# Safety
9644 ///- `device` (self) must be valid and not destroyed.
9645 ///
9646 ///# Panics
9647 ///Panics if `vkGetValidationCacheDataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9648 ///
9649 ///# Usage Notes
9650 ///
9651 ///Retrieves the data from a validation cache for serialization to
9652 ///disk. Call once with a null buffer to query the size, then again
9653 ///with an appropriately sized buffer.
9654 ///
9655 ///Feed the saved data back into `create_validation_cache_ext` on
9656 ///the next run to avoid redundant validation.
9657 ///
9658 ///Requires `VK_EXT_validation_cache`.
9659 pub unsafe fn get_validation_cache_data_ext(
9660 &self,
9661 validation_cache: ValidationCacheEXT,
9662 p_data: *mut core::ffi::c_void,
9663 ) -> VkResult<usize> {
9664 let fp = self
9665 .commands()
9666 .get_validation_cache_data_ext
9667 .expect("vkGetValidationCacheDataEXT not loaded");
9668 let mut out = unsafe { core::mem::zeroed() };
9669 check(unsafe { fp(self.handle(), validation_cache, &mut out, p_data) })?;
9670 Ok(out)
9671 }
9672 ///Wraps [`vkMergeValidationCachesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkMergeValidationCachesEXT.html).
9673 /**
9674 Provided by **VK_EXT_validation_cache**.*/
9675 ///
9676 ///# Errors
9677 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
9678 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
9679 ///- `VK_ERROR_UNKNOWN`
9680 ///- `VK_ERROR_VALIDATION_FAILED`
9681 ///
9682 ///# Safety
9683 ///- `device` (self) must be valid and not destroyed.
9684 ///- `dstCache` must be externally synchronized.
9685 ///
9686 ///# Panics
9687 ///Panics if `vkMergeValidationCachesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9688 ///
9689 ///# Usage Notes
9690 ///
9691 ///Merges one or more source validation caches into a destination
9692 ///cache. Useful for combining caches from parallel pipeline creation
9693 ///threads.
9694 ///
9695 ///Requires `VK_EXT_validation_cache`.
9696 pub unsafe fn merge_validation_caches_ext(
9697 &self,
9698 dst_cache: ValidationCacheEXT,
9699 p_src_caches: &[ValidationCacheEXT],
9700 ) -> VkResult<()> {
9701 let fp = self
9702 .commands()
9703 .merge_validation_caches_ext
9704 .expect("vkMergeValidationCachesEXT not loaded");
9705 check(unsafe {
9706 fp(
9707 self.handle(),
9708 dst_cache,
9709 p_src_caches.len() as u32,
9710 p_src_caches.as_ptr(),
9711 )
9712 })
9713 }
9714 ///Wraps [`vkGetDescriptorSetLayoutSupport`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDescriptorSetLayoutSupport.html).
9715 /**
9716 Provided by **VK_COMPUTE_VERSION_1_1**.*/
9717 ///
9718 ///# Safety
9719 ///- `device` (self) must be valid and not destroyed.
9720 ///
9721 ///# Panics
9722 ///Panics if `vkGetDescriptorSetLayoutSupport` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9723 ///
9724 ///# Usage Notes
9725 ///
9726 ///Queries whether a descriptor set layout with the given bindings can
9727 ///be created on this device, and returns information about the
9728 ///variable descriptor count limit if applicable.
9729 ///
9730 ///Use this before creating layouts with very large descriptor counts
9731 ///or update-after-bind bindings to verify they are within device
9732 ///limits. The call is lightweight and does not allocate anything.
9733 ///
9734 ///Chain `DescriptorSetVariableDescriptorCountLayoutSupport` in the
9735 ///output to query the maximum variable descriptor count for layouts
9736 ///that use `DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT`.
9737 pub unsafe fn get_descriptor_set_layout_support(
9738 &self,
9739 p_create_info: &DescriptorSetLayoutCreateInfo,
9740 p_support: &mut DescriptorSetLayoutSupport,
9741 ) {
9742 let fp = self
9743 .commands()
9744 .get_descriptor_set_layout_support
9745 .expect("vkGetDescriptorSetLayoutSupport not loaded");
9746 unsafe { fp(self.handle(), p_create_info, p_support) };
9747 }
9748 ///Wraps [`vkGetSwapchainGrallocUsageANDROID`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSwapchainGrallocUsageANDROID.html).
9749 ///
9750 ///# Safety
9751 ///- `device` (self) must be valid and not destroyed.
9752 ///
9753 ///# Panics
9754 ///Panics if `vkGetSwapchainGrallocUsageANDROID` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9755 ///
9756 ///# Usage Notes
9757 ///
9758 ///Queries the Android gralloc usage flags needed for swapchain
9759 ///images with the given format and Vulkan image usage. Used
9760 ///internally by the Android WSI implementation. Android only.
9761 ///
9762 ///Requires `VK_ANDROID_native_buffer`.
9763 pub unsafe fn get_swapchain_gralloc_usage_android(
9764 &self,
9765 format: Format,
9766 image_usage: ImageUsageFlags,
9767 ) -> VkResult<core::ffi::c_int> {
9768 let fp = self
9769 .commands()
9770 .get_swapchain_gralloc_usage_android
9771 .expect("vkGetSwapchainGrallocUsageANDROID not loaded");
9772 let mut out = unsafe { core::mem::zeroed() };
9773 check(unsafe { fp(self.handle(), format, image_usage, &mut out) })?;
9774 Ok(out)
9775 }
9776 ///Wraps [`vkGetSwapchainGrallocUsage2ANDROID`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSwapchainGrallocUsage2ANDROID.html).
9777 ///
9778 ///# Safety
9779 ///- `device` (self) must be valid and not destroyed.
9780 ///
9781 ///# Panics
9782 ///Panics if `vkGetSwapchainGrallocUsage2ANDROID` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9783 ///
9784 ///# Usage Notes
9785 ///
9786 ///Extended version of `get_swapchain_gralloc_usage_android` that
9787 ///additionally accepts swapchain-specific image usage flags and
9788 ///returns both producer and consumer gralloc usage. Android only.
9789 ///
9790 ///Requires `VK_ANDROID_native_buffer`.
9791 pub unsafe fn get_swapchain_gralloc_usage2_android(
9792 &self,
9793 format: Format,
9794 image_usage: ImageUsageFlags,
9795 swapchain_image_usage: SwapchainImageUsageFlagsANDROID,
9796 gralloc_consumer_usage: *mut u64,
9797 ) -> VkResult<u64> {
9798 let fp = self
9799 .commands()
9800 .get_swapchain_gralloc_usage2_android
9801 .expect("vkGetSwapchainGrallocUsage2ANDROID not loaded");
9802 let mut out = unsafe { core::mem::zeroed() };
9803 check(unsafe {
9804 fp(
9805 self.handle(),
9806 format,
9807 image_usage,
9808 swapchain_image_usage,
9809 gralloc_consumer_usage,
9810 &mut out,
9811 )
9812 })?;
9813 Ok(out)
9814 }
9815 ///Wraps [`vkAcquireImageANDROID`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAcquireImageANDROID.html).
9816 ///
9817 ///# Safety
9818 ///- `device` (self) must be valid and not destroyed.
9819 ///
9820 ///# Panics
9821 ///Panics if `vkAcquireImageANDROID` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9822 ///
9823 ///# Usage Notes
9824 ///
9825 ///Acquires ownership of a swapchain image on Android. Takes a
9826 ///native fence FD for synchronisation and can signal a Vulkan
9827 ///semaphore or fence on completion. Android only.
9828 ///
9829 ///Requires `VK_ANDROID_native_buffer`.
9830 pub unsafe fn acquire_image_android(
9831 &self,
9832 image: Image,
9833 native_fence_fd: core::ffi::c_int,
9834 semaphore: Semaphore,
9835 fence: Fence,
9836 ) -> VkResult<()> {
9837 let fp = self
9838 .commands()
9839 .acquire_image_android
9840 .expect("vkAcquireImageANDROID not loaded");
9841 check(unsafe { fp(self.handle(), image, native_fence_fd, semaphore, fence) })
9842 }
9843 ///Wraps [`vkQueueSignalReleaseImageANDROID`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueSignalReleaseImageANDROID.html).
9844 ///
9845 ///# Safety
9846 ///- `queue` (self) must be valid and not destroyed.
9847 ///
9848 ///# Panics
9849 ///Panics if `vkQueueSignalReleaseImageANDROID` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9850 ///
9851 ///# Usage Notes
9852 ///
9853 ///Releases a swapchain image back to the Android compositor after
9854 ///rendering. Waits on the given semaphores and returns a native
9855 ///fence FD for external synchronisation. Android only.
9856 ///
9857 ///Requires `VK_ANDROID_native_buffer`.
9858 pub unsafe fn queue_signal_release_image_android(
9859 &self,
9860 queue: Queue,
9861 p_wait_semaphores: &[Semaphore],
9862 image: Image,
9863 ) -> VkResult<core::ffi::c_int> {
9864 let fp = self
9865 .commands()
9866 .queue_signal_release_image_android
9867 .expect("vkQueueSignalReleaseImageANDROID not loaded");
9868 let mut out = unsafe { core::mem::zeroed() };
9869 check(unsafe {
9870 fp(
9871 queue,
9872 p_wait_semaphores.len() as u32,
9873 p_wait_semaphores.as_ptr(),
9874 image,
9875 &mut out,
9876 )
9877 })?;
9878 Ok(out)
9879 }
9880 ///Wraps [`vkGetShaderInfoAMD`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetShaderInfoAMD.html).
9881 /**
9882 Provided by **VK_AMD_shader_info**.*/
9883 ///
9884 ///# Errors
9885 ///- `VK_ERROR_FEATURE_NOT_PRESENT`
9886 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
9887 ///- `VK_ERROR_UNKNOWN`
9888 ///- `VK_ERROR_VALIDATION_FAILED`
9889 ///
9890 ///# Safety
9891 ///- `device` (self) must be valid and not destroyed.
9892 ///
9893 ///# Panics
9894 ///Panics if `vkGetShaderInfoAMD` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9895 ///
9896 ///# Usage Notes
9897 ///
9898 ///Queries AMD-specific shader information such as compiled binary
9899 ///statistics, disassembly, or resource usage. Call once with a null
9900 ///buffer to query the size, then again with an appropriately sized
9901 ///buffer.
9902 ///
9903 ///Requires `VK_AMD_shader_info`.
9904 pub unsafe fn get_shader_info_amd(
9905 &self,
9906 pipeline: Pipeline,
9907 shader_stage: ShaderStageFlagBits,
9908 info_type: ShaderInfoTypeAMD,
9909 p_info: *mut core::ffi::c_void,
9910 ) -> VkResult<usize> {
9911 let fp = self
9912 .commands()
9913 .get_shader_info_amd
9914 .expect("vkGetShaderInfoAMD not loaded");
9915 let mut out = unsafe { core::mem::zeroed() };
9916 check(unsafe {
9917 fp(
9918 self.handle(),
9919 pipeline,
9920 shader_stage,
9921 info_type,
9922 &mut out,
9923 p_info,
9924 )
9925 })?;
9926 Ok(out)
9927 }
9928 ///Wraps [`vkSetLocalDimmingAMD`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetLocalDimmingAMD.html).
9929 /**
9930 Provided by **VK_AMD_display_native_hdr**.*/
9931 ///
9932 ///# Safety
9933 ///- `device` (self) must be valid and not destroyed.
9934 ///
9935 ///# Panics
9936 ///Panics if `vkSetLocalDimmingAMD` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9937 ///
9938 ///# Usage Notes
9939 ///
9940 ///Enables or disables local dimming on an AMD display with native
9941 ///HDR support. Local dimming improves HDR contrast by adjusting
9942 ///backlight zones independently.
9943 ///
9944 ///Requires `VK_AMD_display_native_hdr`.
9945 pub unsafe fn set_local_dimming_amd(
9946 &self,
9947 swap_chain: SwapchainKHR,
9948 local_dimming_enable: bool,
9949 ) {
9950 let fp = self
9951 .commands()
9952 .set_local_dimming_amd
9953 .expect("vkSetLocalDimmingAMD not loaded");
9954 unsafe { fp(self.handle(), swap_chain, local_dimming_enable as u32) };
9955 }
9956 ///Wraps [`vkGetCalibratedTimestampsKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetCalibratedTimestampsKHR.html).
9957 /**
9958 Provided by **VK_KHR_calibrated_timestamps**.*/
9959 ///
9960 ///# Errors
9961 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
9962 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
9963 ///- `VK_ERROR_UNKNOWN`
9964 ///- `VK_ERROR_VALIDATION_FAILED`
9965 ///
9966 ///# Safety
9967 ///- `device` (self) must be valid and not destroyed.
9968 ///
9969 ///# Panics
9970 ///Panics if `vkGetCalibratedTimestampsKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9971 ///
9972 ///# Usage Notes
9973 ///
9974 ///Samples multiple time domains simultaneously and returns
9975 ///calibrated timestamps. This allows correlating GPU timestamps
9976 ///(from `cmd_write_timestamp2`) with CPU time.
9977 ///
9978 ///Each `CalibratedTimestampInfoKHR` specifies a time domain
9979 ///(e.g., `DEVICE`, `CLOCK_MONOTONIC`, `CLOCK_MONOTONIC_RAW`,
9980 ///`QUERY_PERFORMANCE_COUNTER`). All requested timestamps are
9981 ///sampled as close together as possible.
9982 ///
9983 ///The returned `max_deviation` (in nanoseconds) bounds how far
9984 ///apart the samples could be, smaller is better. If deviation
9985 ///is too large, retry the call.
9986 ///
9987 ///Query available time domains first with
9988 ///`get_physical_device_calibrateable_time_domains_khr`.
9989 pub unsafe fn get_calibrated_timestamps_khr(
9990 &self,
9991 p_timestamp_infos: &[CalibratedTimestampInfoKHR],
9992 p_max_deviation: *mut u64,
9993 ) -> VkResult<Vec<u64>> {
9994 let fp = self
9995 .commands()
9996 .get_calibrated_timestamps_khr
9997 .expect("vkGetCalibratedTimestampsKHR not loaded");
9998 let count = p_timestamp_infos.len();
9999 let mut out = vec![unsafe { core::mem::zeroed() }; count];
10000 check(unsafe {
10001 fp(
10002 self.handle(),
10003 p_timestamp_infos.len() as u32,
10004 p_timestamp_infos.as_ptr(),
10005 out.as_mut_ptr(),
10006 p_max_deviation,
10007 )
10008 })?;
10009 Ok(out)
10010 }
10011 ///Wraps [`vkSetDebugUtilsObjectNameEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetDebugUtilsObjectNameEXT.html).
10012 /**
10013 Provided by **VK_EXT_debug_utils**.*/
10014 ///
10015 ///# Errors
10016 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
10017 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
10018 ///- `VK_ERROR_UNKNOWN`
10019 ///- `VK_ERROR_VALIDATION_FAILED`
10020 ///
10021 ///# Safety
10022 ///- `device` (self) must be valid and not destroyed.
10023 ///- `pNameInfo` must be externally synchronized.
10024 ///
10025 ///# Panics
10026 ///Panics if `vkSetDebugUtilsObjectNameEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10027 ///
10028 ///# Usage Notes
10029 ///
10030 ///Assigns a human-readable name to any Vulkan object. The name
10031 ///appears in validation layer messages, GPU debuggers (RenderDoc,
10032 ///Nsight), and crash reports.
10033 ///
10034 ///`DebugUtilsObjectNameInfoEXT` specifies the object type, handle,
10035 ///and a null-terminated UTF-8 name string.
10036 ///
10037 ///Set the name to null to remove a previously assigned name.
10038 ///
10039 ///This is the most impactful debugging tool in Vulkan, name
10040 ///every object you create.
10041 ///
10042 ///Requires `VK_EXT_debug_utils`.
10043 pub unsafe fn set_debug_utils_object_name_ext(
10044 &self,
10045 p_name_info: &DebugUtilsObjectNameInfoEXT,
10046 ) -> VkResult<()> {
10047 let fp = self
10048 .commands()
10049 .set_debug_utils_object_name_ext
10050 .expect("vkSetDebugUtilsObjectNameEXT not loaded");
10051 check(unsafe { fp(self.handle(), p_name_info) })
10052 }
10053 ///Wraps [`vkSetDebugUtilsObjectTagEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetDebugUtilsObjectTagEXT.html).
10054 /**
10055 Provided by **VK_EXT_debug_utils**.*/
10056 ///
10057 ///# Errors
10058 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
10059 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
10060 ///- `VK_ERROR_UNKNOWN`
10061 ///- `VK_ERROR_VALIDATION_FAILED`
10062 ///
10063 ///# Safety
10064 ///- `device` (self) must be valid and not destroyed.
10065 ///
10066 ///# Panics
10067 ///Panics if `vkSetDebugUtilsObjectTagEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10068 ///
10069 ///# Usage Notes
10070 ///
10071 ///Attaches arbitrary binary data to a Vulkan object. Unlike
10072 ///`set_debug_utils_object_name_ext` (which sets a string),
10073 ///tags carry opaque byte data identified by a `tag_name` (u64).
10074 ///
10075 ///Tags are consumed by debugging tools and layers that understand
10076 ///the specific `tag_name` value. Most applications only need
10077 ///`set_debug_utils_object_name_ext`, use tags for tool-specific
10078 ///metadata.
10079 ///
10080 ///Requires `VK_EXT_debug_utils`.
10081 pub unsafe fn set_debug_utils_object_tag_ext(
10082 &self,
10083 p_tag_info: &DebugUtilsObjectTagInfoEXT,
10084 ) -> VkResult<()> {
10085 let fp = self
10086 .commands()
10087 .set_debug_utils_object_tag_ext
10088 .expect("vkSetDebugUtilsObjectTagEXT not loaded");
10089 check(unsafe { fp(self.handle(), p_tag_info) })
10090 }
10091 ///Wraps [`vkQueueBeginDebugUtilsLabelEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueBeginDebugUtilsLabelEXT.html).
10092 /**
10093 Provided by **VK_EXT_debug_utils**.*/
10094 ///
10095 ///# Safety
10096 ///- `queue` (self) must be valid and not destroyed.
10097 ///- `queue` must be externally synchronized.
10098 ///
10099 ///# Panics
10100 ///Panics if `vkQueueBeginDebugUtilsLabelEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10101 ///
10102 ///# Usage Notes
10103 ///
10104 ///Opens a debug label region on a queue. All submissions between
10105 ///this call and the matching `queue_end_debug_utils_label_ext` are
10106 ///grouped under the label in GPU debuggers.
10107 ///
10108 ///Unlike `cmd_begin_debug_utils_label_ext` (which operates inside
10109 ///a command buffer), this groups entire queue submissions.
10110 ///
10111 ///Requires `VK_EXT_debug_utils`.
10112 pub unsafe fn queue_begin_debug_utils_label_ext(
10113 &self,
10114 queue: Queue,
10115 p_label_info: &DebugUtilsLabelEXT,
10116 ) {
10117 let fp = self
10118 .commands()
10119 .queue_begin_debug_utils_label_ext
10120 .expect("vkQueueBeginDebugUtilsLabelEXT not loaded");
10121 unsafe { fp(queue, p_label_info) };
10122 }
10123 ///Wraps [`vkQueueEndDebugUtilsLabelEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueEndDebugUtilsLabelEXT.html).
10124 /**
10125 Provided by **VK_EXT_debug_utils**.*/
10126 ///
10127 ///# Safety
10128 ///- `queue` (self) must be valid and not destroyed.
10129 ///- `queue` must be externally synchronized.
10130 ///
10131 ///# Panics
10132 ///Panics if `vkQueueEndDebugUtilsLabelEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10133 ///
10134 ///# Usage Notes
10135 ///
10136 ///Closes the most recently opened debug label region on the queue.
10137 ///Must be paired with a prior `queue_begin_debug_utils_label_ext`
10138 ///on the same queue.
10139 ///
10140 ///Requires `VK_EXT_debug_utils`.
10141 pub unsafe fn queue_end_debug_utils_label_ext(&self, queue: Queue) {
10142 let fp = self
10143 .commands()
10144 .queue_end_debug_utils_label_ext
10145 .expect("vkQueueEndDebugUtilsLabelEXT not loaded");
10146 unsafe { fp(queue) };
10147 }
10148 ///Wraps [`vkQueueInsertDebugUtilsLabelEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueInsertDebugUtilsLabelEXT.html).
10149 /**
10150 Provided by **VK_EXT_debug_utils**.*/
10151 ///
10152 ///# Safety
10153 ///- `queue` (self) must be valid and not destroyed.
10154 ///- `queue` must be externally synchronized.
10155 ///
10156 ///# Panics
10157 ///Panics if `vkQueueInsertDebugUtilsLabelEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10158 ///
10159 ///# Usage Notes
10160 ///
10161 ///Inserts a single-point debug label on a queue. Marks a specific
10162 ///moment in the queue's submission timeline without opening a
10163 ///begin/end region.
10164 ///
10165 ///Requires `VK_EXT_debug_utils`.
10166 pub unsafe fn queue_insert_debug_utils_label_ext(
10167 &self,
10168 queue: Queue,
10169 p_label_info: &DebugUtilsLabelEXT,
10170 ) {
10171 let fp = self
10172 .commands()
10173 .queue_insert_debug_utils_label_ext
10174 .expect("vkQueueInsertDebugUtilsLabelEXT not loaded");
10175 unsafe { fp(queue, p_label_info) };
10176 }
10177 ///Wraps [`vkCmdBeginDebugUtilsLabelEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginDebugUtilsLabelEXT.html).
10178 /**
10179 Provided by **VK_EXT_debug_utils**.*/
10180 ///
10181 ///# Safety
10182 ///- `commandBuffer` (self) must be valid and not destroyed.
10183 ///- `commandBuffer` must be externally synchronized.
10184 ///
10185 ///# Panics
10186 ///Panics if `vkCmdBeginDebugUtilsLabelEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10187 ///
10188 ///# Usage Notes
10189 ///
10190 ///Opens a debug label region in a command buffer. All commands
10191 ///recorded between this call and the matching
10192 ///`cmd_end_debug_utils_label_ext` are grouped under the label in
10193 ///GPU debuggers (RenderDoc, Nsight).
10194 ///
10195 ///`DebugUtilsLabelEXT` specifies a name and optional RGBA color
10196 ///for the region.
10197 ///
10198 ///Labels can nest. Every begin must have a matching end within the
10199 ///same command buffer.
10200 ///
10201 ///Requires `VK_EXT_debug_utils`.
10202 pub unsafe fn cmd_begin_debug_utils_label_ext(
10203 &self,
10204 command_buffer: CommandBuffer,
10205 p_label_info: &DebugUtilsLabelEXT,
10206 ) {
10207 let fp = self
10208 .commands()
10209 .cmd_begin_debug_utils_label_ext
10210 .expect("vkCmdBeginDebugUtilsLabelEXT not loaded");
10211 unsafe { fp(command_buffer, p_label_info) };
10212 }
10213 ///Wraps [`vkCmdEndDebugUtilsLabelEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndDebugUtilsLabelEXT.html).
10214 /**
10215 Provided by **VK_EXT_debug_utils**.*/
10216 ///
10217 ///# Safety
10218 ///- `commandBuffer` (self) must be valid and not destroyed.
10219 ///- `commandBuffer` must be externally synchronized.
10220 ///
10221 ///# Panics
10222 ///Panics if `vkCmdEndDebugUtilsLabelEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10223 ///
10224 ///# Usage Notes
10225 ///
10226 ///Closes the most recently opened debug label region in the command
10227 ///buffer. Must be paired with a prior `cmd_begin_debug_utils_label_ext`
10228 ///in the same command buffer.
10229 ///
10230 ///Requires `VK_EXT_debug_utils`.
10231 pub unsafe fn cmd_end_debug_utils_label_ext(&self, command_buffer: CommandBuffer) {
10232 let fp = self
10233 .commands()
10234 .cmd_end_debug_utils_label_ext
10235 .expect("vkCmdEndDebugUtilsLabelEXT not loaded");
10236 unsafe { fp(command_buffer) };
10237 }
10238 ///Wraps [`vkCmdInsertDebugUtilsLabelEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdInsertDebugUtilsLabelEXT.html).
10239 /**
10240 Provided by **VK_EXT_debug_utils**.*/
10241 ///
10242 ///# Safety
10243 ///- `commandBuffer` (self) must be valid and not destroyed.
10244 ///- `commandBuffer` must be externally synchronized.
10245 ///
10246 ///# Panics
10247 ///Panics if `vkCmdInsertDebugUtilsLabelEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10248 ///
10249 ///# Usage Notes
10250 ///
10251 ///Inserts a single-point debug label into the command buffer
10252 ///(as opposed to a begin/end region). Useful for marking specific
10253 ///events like "shadow pass complete" or "post-process start" that
10254 ///don't span a range of commands.
10255 ///
10256 ///Appears as a marker in GPU debuggers (RenderDoc, Nsight).
10257 ///
10258 ///Requires `VK_EXT_debug_utils`.
10259 pub unsafe fn cmd_insert_debug_utils_label_ext(
10260 &self,
10261 command_buffer: CommandBuffer,
10262 p_label_info: &DebugUtilsLabelEXT,
10263 ) {
10264 let fp = self
10265 .commands()
10266 .cmd_insert_debug_utils_label_ext
10267 .expect("vkCmdInsertDebugUtilsLabelEXT not loaded");
10268 unsafe { fp(command_buffer, p_label_info) };
10269 }
10270 ///Wraps [`vkGetMemoryHostPointerPropertiesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryHostPointerPropertiesEXT.html).
10271 /**
10272 Provided by **VK_EXT_external_memory_host**.*/
10273 ///
10274 ///# Errors
10275 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
10276 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
10277 ///- `VK_ERROR_UNKNOWN`
10278 ///- `VK_ERROR_VALIDATION_FAILED`
10279 ///
10280 ///# Safety
10281 ///- `device` (self) must be valid and not destroyed.
10282 ///
10283 ///# Panics
10284 ///Panics if `vkGetMemoryHostPointerPropertiesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10285 ///
10286 ///# Usage Notes
10287 ///
10288 ///Queries which memory types are compatible with importing a host
10289 ///pointer as external memory. Use this before allocating device
10290 ///memory backed by a host-allocated buffer to determine valid
10291 ///memory type bits.
10292 ///
10293 ///Requires `VK_EXT_external_memory_host`.
10294 pub unsafe fn get_memory_host_pointer_properties_ext(
10295 &self,
10296 handle_type: ExternalMemoryHandleTypeFlagBits,
10297 p_host_pointer: *const core::ffi::c_void,
10298 p_memory_host_pointer_properties: &mut MemoryHostPointerPropertiesEXT,
10299 ) -> VkResult<()> {
10300 let fp = self
10301 .commands()
10302 .get_memory_host_pointer_properties_ext
10303 .expect("vkGetMemoryHostPointerPropertiesEXT not loaded");
10304 check(unsafe {
10305 fp(
10306 self.handle(),
10307 handle_type,
10308 p_host_pointer,
10309 p_memory_host_pointer_properties,
10310 )
10311 })
10312 }
10313 ///Wraps [`vkCmdWriteBufferMarkerAMD`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWriteBufferMarkerAMD.html).
10314 /**
10315 Provided by **VK_AMD_buffer_marker**.*/
10316 ///
10317 ///# Safety
10318 ///- `commandBuffer` (self) must be valid and not destroyed.
10319 ///- `commandBuffer` must be externally synchronized.
10320 ///
10321 ///# Panics
10322 ///Panics if `vkCmdWriteBufferMarkerAMD` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10323 ///
10324 ///# Usage Notes
10325 ///
10326 ///Writes a 32-bit marker value into a buffer after a specified
10327 ///pipeline stage completes. Useful for fine-grained GPU progress
10328 ///tracking and debugging GPU hangs by identifying the last
10329 ///completed stage.
10330 ///
10331 ///Requires `VK_AMD_buffer_marker`.
10332 pub unsafe fn cmd_write_buffer_marker_amd(
10333 &self,
10334 command_buffer: CommandBuffer,
10335 pipeline_stage: PipelineStageFlagBits,
10336 dst_buffer: Buffer,
10337 dst_offset: u64,
10338 marker: u32,
10339 ) {
10340 let fp = self
10341 .commands()
10342 .cmd_write_buffer_marker_amd
10343 .expect("vkCmdWriteBufferMarkerAMD not loaded");
10344 unsafe {
10345 fp(
10346 command_buffer,
10347 pipeline_stage,
10348 dst_buffer,
10349 dst_offset,
10350 marker,
10351 )
10352 };
10353 }
10354 ///Wraps [`vkCreateRenderPass2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateRenderPass2.html).
10355 /**
10356 Provided by **VK_GRAPHICS_VERSION_1_2**.*/
10357 ///
10358 ///# Errors
10359 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
10360 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
10361 ///- `VK_ERROR_UNKNOWN`
10362 ///- `VK_ERROR_VALIDATION_FAILED`
10363 ///
10364 ///# Safety
10365 ///- `device` (self) must be valid and not destroyed.
10366 ///
10367 ///# Panics
10368 ///Panics if `vkCreateRenderPass2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10369 ///
10370 ///# Usage Notes
10371 ///
10372 ///Vulkan 1.2 version of `create_render_pass` that uses extensible
10373 ///`RenderPassCreateInfo2`, `AttachmentDescription2`,
10374 ///`SubpassDescription2`, and `SubpassDependency2` structs.
10375 ///
10376 ///Key additions over the 1.0 version:
10377 ///
10378 ///- **View masks**: `SubpassDescription2::view_mask` enables multiview
10379 /// rendering where a single draw call renders to multiple layers
10380 /// simultaneously (e.g. VR left/right eyes).
10381 ///- **Fragment density map**: chain
10382 /// `RenderPassFragmentDensityMapCreateInfoEXT` for variable-rate
10383 /// shading via density maps.
10384 ///- **Depth/stencil resolve**: `SubpassDescriptionDepthStencilResolve`
10385 /// enables automatic depth/stencil resolve at the end of a subpass.
10386 ///
10387 ///Prefer this over `create_render_pass` when targeting Vulkan 1.2+.
10388 ///For Vulkan 1.3+, consider dynamic rendering (`cmd_begin_rendering`)
10389 ///which avoids render pass objects entirely.
10390 pub unsafe fn create_render_pass2(
10391 &self,
10392 p_create_info: &RenderPassCreateInfo2,
10393 allocator: Option<&AllocationCallbacks>,
10394 ) -> VkResult<RenderPass> {
10395 let fp = self
10396 .commands()
10397 .create_render_pass2
10398 .expect("vkCreateRenderPass2 not loaded");
10399 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
10400 let mut out = unsafe { core::mem::zeroed() };
10401 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
10402 Ok(out)
10403 }
10404 ///Wraps [`vkCmdBeginRenderPass2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginRenderPass2.html).
10405 /**
10406 Provided by **VK_GRAPHICS_VERSION_1_2**.*/
10407 ///
10408 ///# Safety
10409 ///- `commandBuffer` (self) must be valid and not destroyed.
10410 ///- `commandBuffer` must be externally synchronized.
10411 ///
10412 ///# Panics
10413 ///Panics if `vkCmdBeginRenderPass2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10414 ///
10415 ///# Usage Notes
10416 ///
10417 ///Vulkan 1.2 version of `cmd_begin_render_pass` that takes an
10418 ///additional `SubpassBeginInfo` parameter specifying the subpass
10419 ///contents mode.
10420 ///
10421 ///The extensible structs allow chaining `RenderPassAttachmentBeginInfo`
10422 ///for imageless framebuffers, concrete image views are supplied at
10423 ///begin time rather than at framebuffer creation time.
10424 ///
10425 ///Prefer this over `cmd_begin_render_pass` when targeting Vulkan 1.2+.
10426 ///For Vulkan 1.3+, consider `cmd_begin_rendering` (dynamic rendering)
10427 ///which eliminates render pass and framebuffer objects entirely.
10428 pub unsafe fn cmd_begin_render_pass2(
10429 &self,
10430 command_buffer: CommandBuffer,
10431 p_render_pass_begin: &RenderPassBeginInfo,
10432 p_subpass_begin_info: &SubpassBeginInfo,
10433 ) {
10434 let fp = self
10435 .commands()
10436 .cmd_begin_render_pass2
10437 .expect("vkCmdBeginRenderPass2 not loaded");
10438 unsafe { fp(command_buffer, p_render_pass_begin, p_subpass_begin_info) };
10439 }
10440 ///Wraps [`vkCmdNextSubpass2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdNextSubpass2.html).
10441 /**
10442 Provided by **VK_GRAPHICS_VERSION_1_2**.*/
10443 ///
10444 ///# Safety
10445 ///- `commandBuffer` (self) must be valid and not destroyed.
10446 ///- `commandBuffer` must be externally synchronized.
10447 ///
10448 ///# Panics
10449 ///Panics if `vkCmdNextSubpass2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10450 ///
10451 ///# Usage Notes
10452 ///
10453 ///Vulkan 1.2 version of `cmd_next_subpass` that takes extensible
10454 ///`SubpassBeginInfo` and `SubpassEndInfo` structs.
10455 ///
10456 ///Functionally identical to `cmd_next_subpass`. Prefer this when
10457 ///targeting Vulkan 1.2+.
10458 pub unsafe fn cmd_next_subpass2(
10459 &self,
10460 command_buffer: CommandBuffer,
10461 p_subpass_begin_info: &SubpassBeginInfo,
10462 p_subpass_end_info: &SubpassEndInfo,
10463 ) {
10464 let fp = self
10465 .commands()
10466 .cmd_next_subpass2
10467 .expect("vkCmdNextSubpass2 not loaded");
10468 unsafe { fp(command_buffer, p_subpass_begin_info, p_subpass_end_info) };
10469 }
10470 ///Wraps [`vkCmdEndRenderPass2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndRenderPass2.html).
10471 /**
10472 Provided by **VK_GRAPHICS_VERSION_1_2**.*/
10473 ///
10474 ///# Safety
10475 ///- `commandBuffer` (self) must be valid and not destroyed.
10476 ///- `commandBuffer` must be externally synchronized.
10477 ///
10478 ///# Panics
10479 ///Panics if `vkCmdEndRenderPass2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10480 ///
10481 ///# Usage Notes
10482 ///
10483 ///Vulkan 1.2 version of `cmd_end_render_pass` that takes an extensible
10484 ///`SubpassEndInfo` struct.
10485 ///
10486 ///Functionally identical to `cmd_end_render_pass`. Prefer this when
10487 ///targeting Vulkan 1.2+.
10488 pub unsafe fn cmd_end_render_pass2(
10489 &self,
10490 command_buffer: CommandBuffer,
10491 p_subpass_end_info: &SubpassEndInfo,
10492 ) {
10493 let fp = self
10494 .commands()
10495 .cmd_end_render_pass2
10496 .expect("vkCmdEndRenderPass2 not loaded");
10497 unsafe { fp(command_buffer, p_subpass_end_info) };
10498 }
10499 ///Wraps [`vkGetSemaphoreCounterValue`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSemaphoreCounterValue.html).
10500 /**
10501 Provided by **VK_BASE_VERSION_1_2**.*/
10502 ///
10503 ///# Errors
10504 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
10505 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
10506 ///- `VK_ERROR_DEVICE_LOST`
10507 ///- `VK_ERROR_UNKNOWN`
10508 ///- `VK_ERROR_VALIDATION_FAILED`
10509 ///
10510 ///# Safety
10511 ///- `device` (self) must be valid and not destroyed.
10512 ///
10513 ///# Panics
10514 ///Panics if `vkGetSemaphoreCounterValue` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10515 ///
10516 ///# Usage Notes
10517 ///
10518 ///Returns the current counter value of a timeline semaphore. Timeline
10519 ///semaphores (Vulkan 1.2) use a monotonically increasing 64-bit
10520 ///counter instead of binary signaled/unsignaled state.
10521 ///
10522 ///Use this for non-blocking progress checks:
10523 ///
10524 ///```text
10525 ///let value = get_semaphore_counter_value(semaphore);
10526 ///if value >= expected_frame {
10527 /// // GPU has finished frame N, safe to reuse resources
10528 ///}
10529 ///```
10530 ///
10531 ///For blocking waits, use `wait_semaphores`. For signaling from the
10532 ///CPU, use `signal_semaphore`.
10533 ///
10534 ///Only valid for semaphores created with `SEMAPHORE_TYPE_TIMELINE`.
10535 ///Calling this on a binary semaphore is an error.
10536 pub unsafe fn get_semaphore_counter_value(&self, semaphore: Semaphore) -> VkResult<u64> {
10537 let fp = self
10538 .commands()
10539 .get_semaphore_counter_value
10540 .expect("vkGetSemaphoreCounterValue not loaded");
10541 let mut out = unsafe { core::mem::zeroed() };
10542 check(unsafe { fp(self.handle(), semaphore, &mut out) })?;
10543 Ok(out)
10544 }
10545 ///Wraps [`vkWaitSemaphores`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkWaitSemaphores.html).
10546 /**
10547 Provided by **VK_BASE_VERSION_1_2**.*/
10548 ///
10549 ///# Errors
10550 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
10551 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
10552 ///- `VK_ERROR_DEVICE_LOST`
10553 ///- `VK_ERROR_UNKNOWN`
10554 ///- `VK_ERROR_VALIDATION_FAILED`
10555 ///
10556 ///# Safety
10557 ///- `device` (self) must be valid and not destroyed.
10558 ///
10559 ///# Panics
10560 ///Panics if `vkWaitSemaphores` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10561 ///
10562 ///# Usage Notes
10563 ///
10564 ///Blocks the calling thread until one or all of the specified timeline
10565 ///semaphores reach their target values, or until the timeout expires.
10566 ///
10567 ///**`SemaphoreWaitInfo` flags**:
10568 ///
10569 ///- `SEMAPHORE_WAIT_ANY`: return when *any* semaphore reaches its
10570 /// target. Without this flag, waits for *all* semaphores.
10571 ///
10572 ///**Timeout**: in nanoseconds. `u64::MAX` for indefinite. Zero for a
10573 ///non-blocking poll.
10574 ///
10575 ///Timeline semaphore waits are the CPU-side counterpart to
10576 ///`queue_submit` timeline waits. They replace many fence-based
10577 ///synchronisation patterns with a single, more flexible primitive.
10578 ///
10579 ///```text
10580 #[doc = "// Wait for frame N to complete on the GPU"]
10581 ///let info = SemaphoreWaitInfo::builder()
10582 /// .semaphores(&[timeline_sem])
10583 /// .values(&[frame_number]);
10584 ///wait_semaphores(&info, u64::MAX);
10585 ///```
10586 ///
10587 ///Only valid for semaphores created with `SEMAPHORE_TYPE_TIMELINE`.
10588 pub unsafe fn wait_semaphores(
10589 &self,
10590 p_wait_info: &SemaphoreWaitInfo,
10591 timeout: u64,
10592 ) -> VkResult<()> {
10593 let fp = self
10594 .commands()
10595 .wait_semaphores
10596 .expect("vkWaitSemaphores not loaded");
10597 check(unsafe { fp(self.handle(), p_wait_info, timeout) })
10598 }
10599 ///Wraps [`vkSignalSemaphore`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSignalSemaphore.html).
10600 /**
10601 Provided by **VK_BASE_VERSION_1_2**.*/
10602 ///
10603 ///# Errors
10604 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
10605 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
10606 ///- `VK_ERROR_UNKNOWN`
10607 ///- `VK_ERROR_VALIDATION_FAILED`
10608 ///
10609 ///# Safety
10610 ///- `device` (self) must be valid and not destroyed.
10611 ///
10612 ///# Panics
10613 ///Panics if `vkSignalSemaphore` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10614 ///
10615 ///# Usage Notes
10616 ///
10617 ///Signals a timeline semaphore from the host (CPU), advancing its
10618 ///counter to the specified value. The value must be greater than the
10619 ///current counter value.
10620 ///
10621 ///Use this to unblock GPU work that is waiting on the semaphore via
10622 ///`queue_submit`. For example, a CPU-side data preparation step can
10623 ///signal a timeline semaphore when data is ready, and the GPU waits on
10624 ///it before processing.
10625 ///
10626 ///Only valid for semaphores created with `SEMAPHORE_TYPE_TIMELINE`.
10627 ///
10628 ///Timeline semaphores replace many use cases that previously required
10629 ///fences, they can be waited on from both the CPU (`wait_semaphores`)
10630 ///and the GPU (`queue_submit`).
10631 pub unsafe fn signal_semaphore(&self, p_signal_info: &SemaphoreSignalInfo) -> VkResult<()> {
10632 let fp = self
10633 .commands()
10634 .signal_semaphore
10635 .expect("vkSignalSemaphore not loaded");
10636 check(unsafe { fp(self.handle(), p_signal_info) })
10637 }
10638 ///Wraps [`vkGetAndroidHardwareBufferPropertiesANDROID`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetAndroidHardwareBufferPropertiesANDROID.html).
10639 /**
10640 Provided by **VK_ANDROID_external_memory_android_hardware_buffer**.*/
10641 ///
10642 ///# Errors
10643 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
10644 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR`
10645 ///- `VK_ERROR_UNKNOWN`
10646 ///- `VK_ERROR_VALIDATION_FAILED`
10647 ///
10648 ///# Safety
10649 ///- `device` (self) must be valid and not destroyed.
10650 ///
10651 ///# Panics
10652 ///Panics if `vkGetAndroidHardwareBufferPropertiesANDROID` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10653 ///
10654 ///# Usage Notes
10655 ///
10656 ///Queries the Vulkan memory properties (memory type bits, size)
10657 ///for an Android `AHardwareBuffer`. Use before importing the
10658 ///buffer as Vulkan memory. Android only.
10659 ///
10660 ///Requires `VK_ANDROID_external_memory_android_hardware_buffer`.
10661 pub unsafe fn get_android_hardware_buffer_properties_android(
10662 &self,
10663 buffer: *const core::ffi::c_void,
10664 p_properties: &mut AndroidHardwareBufferPropertiesANDROID,
10665 ) -> VkResult<()> {
10666 let fp = self
10667 .commands()
10668 .get_android_hardware_buffer_properties_android
10669 .expect("vkGetAndroidHardwareBufferPropertiesANDROID not loaded");
10670 check(unsafe { fp(self.handle(), buffer, p_properties) })
10671 }
10672 ///Wraps [`vkGetMemoryAndroidHardwareBufferANDROID`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryAndroidHardwareBufferANDROID.html).
10673 /**
10674 Provided by **VK_ANDROID_external_memory_android_hardware_buffer**.*/
10675 ///
10676 ///# Errors
10677 ///- `VK_ERROR_TOO_MANY_OBJECTS`
10678 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
10679 ///- `VK_ERROR_UNKNOWN`
10680 ///- `VK_ERROR_VALIDATION_FAILED`
10681 ///
10682 ///# Safety
10683 ///- `device` (self) must be valid and not destroyed.
10684 ///
10685 ///# Panics
10686 ///Panics if `vkGetMemoryAndroidHardwareBufferANDROID` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10687 ///
10688 ///# Usage Notes
10689 ///
10690 ///Exports a Vulkan device memory allocation as an Android
10691 ///`AHardwareBuffer` for sharing with other Android APIs (camera,
10692 ///media codec, SurfaceFlinger). Android only.
10693 ///
10694 ///Requires `VK_ANDROID_external_memory_android_hardware_buffer`.
10695 pub unsafe fn get_memory_android_hardware_buffer_android(
10696 &self,
10697 p_info: &MemoryGetAndroidHardwareBufferInfoANDROID,
10698 p_buffer: *mut *mut core::ffi::c_void,
10699 ) -> VkResult<()> {
10700 let fp = self
10701 .commands()
10702 .get_memory_android_hardware_buffer_android
10703 .expect("vkGetMemoryAndroidHardwareBufferANDROID not loaded");
10704 check(unsafe { fp(self.handle(), p_info, p_buffer) })
10705 }
10706 ///Wraps [`vkCmdDrawIndirectCount`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndirectCount.html).
10707 /**
10708 Provided by **VK_GRAPHICS_VERSION_1_2**.*/
10709 ///
10710 ///# Safety
10711 ///- `commandBuffer` (self) must be valid and not destroyed.
10712 ///- `commandBuffer` must be externally synchronized.
10713 ///
10714 ///# Panics
10715 ///Panics if `vkCmdDrawIndirectCount` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10716 ///
10717 ///# Usage Notes
10718 ///
10719 ///Draws non-indexed geometry with both the draw parameters and the
10720 ///draw **count** read from GPU buffers. The non-indexed counterpart to
10721 ///`cmd_draw_indexed_indirect_count`.
10722 ///
10723 ///See `cmd_draw_indexed_indirect_count` for a full explanation of the
10724 ///GPU-driven rendering pattern. The only difference is that this
10725 ///command reads `DrawIndirectCommand` entries instead of
10726 ///`DrawIndexedIndirectCommand`.
10727 ///
10728 ///Core in Vulkan 1.2. Previously available via
10729 ///`VK_KHR_draw_indirect_count`.
10730 pub unsafe fn cmd_draw_indirect_count(
10731 &self,
10732 command_buffer: CommandBuffer,
10733 buffer: Buffer,
10734 offset: u64,
10735 count_buffer: Buffer,
10736 count_buffer_offset: u64,
10737 max_draw_count: u32,
10738 stride: u32,
10739 ) {
10740 let fp = self
10741 .commands()
10742 .cmd_draw_indirect_count
10743 .expect("vkCmdDrawIndirectCount not loaded");
10744 unsafe {
10745 fp(
10746 command_buffer,
10747 buffer,
10748 offset,
10749 count_buffer,
10750 count_buffer_offset,
10751 max_draw_count,
10752 stride,
10753 )
10754 };
10755 }
10756 ///Wraps [`vkCmdDrawIndexedIndirectCount`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndexedIndirectCount.html).
10757 /**
10758 Provided by **VK_GRAPHICS_VERSION_1_2**.*/
10759 ///
10760 ///# Safety
10761 ///- `commandBuffer` (self) must be valid and not destroyed.
10762 ///- `commandBuffer` must be externally synchronized.
10763 ///
10764 ///# Panics
10765 ///Panics if `vkCmdDrawIndexedIndirectCount` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10766 ///
10767 ///# Usage Notes
10768 ///
10769 ///Draws indexed geometry with both the draw parameters and the draw
10770 ///**count** read from GPU buffers. The `count_buffer` contains a
10771 ///`u32` that limits how many `DrawIndexedIndirectCommand` entries from
10772 ///the main buffer are actually executed, up to `max_draw_count`.
10773 ///
10774 ///This is the key primitive for GPU-driven rendering pipelines: a
10775 ///compute shader fills an indirect buffer and writes the surviving
10776 ///draw count after culling. The CPU does not need to know the count.
10777 ///
10778 ///The main buffer must have `BUFFER_USAGE_INDIRECT_BUFFER`. The count
10779 ///buffer must also have `BUFFER_USAGE_INDIRECT_BUFFER`. The count
10780 ///offset must be a multiple of 4.
10781 ///
10782 ///Core in Vulkan 1.2. Previously available via
10783 ///`VK_KHR_draw_indirect_count`.
10784 pub unsafe fn cmd_draw_indexed_indirect_count(
10785 &self,
10786 command_buffer: CommandBuffer,
10787 buffer: Buffer,
10788 offset: u64,
10789 count_buffer: Buffer,
10790 count_buffer_offset: u64,
10791 max_draw_count: u32,
10792 stride: u32,
10793 ) {
10794 let fp = self
10795 .commands()
10796 .cmd_draw_indexed_indirect_count
10797 .expect("vkCmdDrawIndexedIndirectCount not loaded");
10798 unsafe {
10799 fp(
10800 command_buffer,
10801 buffer,
10802 offset,
10803 count_buffer,
10804 count_buffer_offset,
10805 max_draw_count,
10806 stride,
10807 )
10808 };
10809 }
10810 ///Wraps [`vkCmdSetCheckpointNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetCheckpointNV.html).
10811 /**
10812 Provided by **VK_NV_device_diagnostic_checkpoints**.*/
10813 ///
10814 ///# Safety
10815 ///- `commandBuffer` (self) must be valid and not destroyed.
10816 ///- `commandBuffer` must be externally synchronized.
10817 ///
10818 ///# Panics
10819 ///Panics if `vkCmdSetCheckpointNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10820 ///
10821 ///# Usage Notes
10822 ///
10823 ///Inserts a checkpoint marker into the command buffer for
10824 ///diagnostic purposes. If the device is lost, the most recently
10825 ///executed checkpoint can be retrieved with
10826 ///`get_queue_checkpoint_data_nv` to identify which commands
10827 ///completed before the failure.
10828 ///
10829 ///Requires `VK_NV_device_diagnostic_checkpoints`.
10830 pub unsafe fn cmd_set_checkpoint_nv(
10831 &self,
10832 command_buffer: CommandBuffer,
10833 p_checkpoint_marker: *const core::ffi::c_void,
10834 ) {
10835 let fp = self
10836 .commands()
10837 .cmd_set_checkpoint_nv
10838 .expect("vkCmdSetCheckpointNV not loaded");
10839 unsafe { fp(command_buffer, p_checkpoint_marker) };
10840 }
10841 ///Wraps [`vkGetQueueCheckpointDataNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetQueueCheckpointDataNV.html).
10842 /**
10843 Provided by **VK_NV_device_diagnostic_checkpoints**.*/
10844 ///
10845 ///# Safety
10846 ///- `queue` (self) must be valid and not destroyed.
10847 ///
10848 ///# Panics
10849 ///Panics if `vkGetQueueCheckpointDataNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10850 ///
10851 ///# Usage Notes
10852 ///
10853 ///Retrieves the checkpoint markers that were most recently executed
10854 ///on a queue before a device-lost event. Use with
10855 ///`cmd_set_checkpoint_nv` for post-mortem debugging.
10856 ///
10857 ///Requires `VK_NV_device_diagnostic_checkpoints`.
10858 pub unsafe fn get_queue_checkpoint_data_nv(&self, queue: Queue) -> Vec<CheckpointDataNV> {
10859 let fp = self
10860 .commands()
10861 .get_queue_checkpoint_data_nv
10862 .expect("vkGetQueueCheckpointDataNV not loaded");
10863 fill_two_call(|count, data| unsafe { fp(queue, count, data) })
10864 }
10865 ///Wraps [`vkCmdBindTransformFeedbackBuffersEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindTransformFeedbackBuffersEXT.html).
10866 /**
10867 Provided by **VK_EXT_transform_feedback**.*/
10868 ///
10869 ///# Safety
10870 ///- `commandBuffer` (self) must be valid and not destroyed.
10871 ///- `commandBuffer` must be externally synchronized.
10872 ///
10873 ///# Panics
10874 ///Panics if `vkCmdBindTransformFeedbackBuffersEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10875 ///
10876 ///# Usage Notes
10877 ///
10878 ///Binds buffers for transform feedback output. Each binding slot
10879 ///receives vertex data streamed from the vertex or geometry shader
10880 ///during a transform feedback pass.
10881 ///
10882 ///`first_binding` is the first binding index. Arrays of buffers,
10883 ///offsets, and sizes specify the output targets.
10884 ///
10885 ///Must be called before `cmd_begin_transform_feedback_ext`.
10886 ///
10887 ///Requires `VK_EXT_transform_feedback`.
10888 pub unsafe fn cmd_bind_transform_feedback_buffers_ext(
10889 &self,
10890 command_buffer: CommandBuffer,
10891 first_binding: u32,
10892 p_buffers: &[Buffer],
10893 p_offsets: &u64,
10894 p_sizes: Option<&u64>,
10895 ) {
10896 let fp = self
10897 .commands()
10898 .cmd_bind_transform_feedback_buffers_ext
10899 .expect("vkCmdBindTransformFeedbackBuffersEXT not loaded");
10900 let p_sizes_ptr = p_sizes.map_or(core::ptr::null(), core::ptr::from_ref);
10901 unsafe {
10902 fp(
10903 command_buffer,
10904 first_binding,
10905 p_buffers.len() as u32,
10906 p_buffers.as_ptr(),
10907 p_offsets,
10908 p_sizes_ptr,
10909 )
10910 };
10911 }
10912 ///Wraps [`vkCmdBeginTransformFeedbackEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginTransformFeedbackEXT.html).
10913 /**
10914 Provided by **VK_EXT_transform_feedback**.*/
10915 ///
10916 ///# Safety
10917 ///- `commandBuffer` (self) must be valid and not destroyed.
10918 ///- `commandBuffer` must be externally synchronized.
10919 ///
10920 ///# Panics
10921 ///Panics if `vkCmdBeginTransformFeedbackEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10922 ///
10923 ///# Usage Notes
10924 ///
10925 ///Begins a transform feedback pass. Vertex shader outputs (or
10926 ///geometry shader outputs) are written to transform feedback buffers
10927 ///previously bound with `cmd_bind_transform_feedback_buffers_ext`.
10928 ///
10929 ///`first_counter_buffer` and `p_counter_buffer_offsets` specify
10930 ///where to resume writing from (pass null offsets to start from
10931 ///scratch).
10932 ///
10933 ///End with `cmd_end_transform_feedback_ext`.
10934 ///
10935 ///Requires `VK_EXT_transform_feedback` and the
10936 ///`transformFeedback` feature.
10937 pub unsafe fn cmd_begin_transform_feedback_ext(
10938 &self,
10939 command_buffer: CommandBuffer,
10940 first_counter_buffer: u32,
10941 p_counter_buffers: &[Buffer],
10942 p_counter_buffer_offsets: Option<&u64>,
10943 ) {
10944 let fp = self
10945 .commands()
10946 .cmd_begin_transform_feedback_ext
10947 .expect("vkCmdBeginTransformFeedbackEXT not loaded");
10948 let p_counter_buffer_offsets_ptr =
10949 p_counter_buffer_offsets.map_or(core::ptr::null(), core::ptr::from_ref);
10950 unsafe {
10951 fp(
10952 command_buffer,
10953 first_counter_buffer,
10954 p_counter_buffers.len() as u32,
10955 p_counter_buffers.as_ptr(),
10956 p_counter_buffer_offsets_ptr,
10957 )
10958 };
10959 }
10960 ///Wraps [`vkCmdEndTransformFeedbackEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndTransformFeedbackEXT.html).
10961 /**
10962 Provided by **VK_EXT_transform_feedback**.*/
10963 ///
10964 ///# Safety
10965 ///- `commandBuffer` (self) must be valid and not destroyed.
10966 ///- `commandBuffer` must be externally synchronized.
10967 ///
10968 ///# Panics
10969 ///Panics if `vkCmdEndTransformFeedbackEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10970 ///
10971 ///# Usage Notes
10972 ///
10973 ///Ends a transform feedback pass started with
10974 ///`cmd_begin_transform_feedback_ext`. Counter values are written
10975 ///back to the counter buffers so that a subsequent pass can resume
10976 ///where this one left off.
10977 ///
10978 ///Requires `VK_EXT_transform_feedback`.
10979 pub unsafe fn cmd_end_transform_feedback_ext(
10980 &self,
10981 command_buffer: CommandBuffer,
10982 first_counter_buffer: u32,
10983 p_counter_buffers: &[Buffer],
10984 p_counter_buffer_offsets: Option<&u64>,
10985 ) {
10986 let fp = self
10987 .commands()
10988 .cmd_end_transform_feedback_ext
10989 .expect("vkCmdEndTransformFeedbackEXT not loaded");
10990 let p_counter_buffer_offsets_ptr =
10991 p_counter_buffer_offsets.map_or(core::ptr::null(), core::ptr::from_ref);
10992 unsafe {
10993 fp(
10994 command_buffer,
10995 first_counter_buffer,
10996 p_counter_buffers.len() as u32,
10997 p_counter_buffers.as_ptr(),
10998 p_counter_buffer_offsets_ptr,
10999 )
11000 };
11001 }
11002 ///Wraps [`vkCmdBeginQueryIndexedEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginQueryIndexedEXT.html).
11003 /**
11004 Provided by **VK_EXT_transform_feedback**.*/
11005 ///
11006 ///# Safety
11007 ///- `commandBuffer` (self) must be valid and not destroyed.
11008 ///- `commandBuffer` must be externally synchronized.
11009 ///
11010 ///# Panics
11011 ///Panics if `vkCmdBeginQueryIndexedEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11012 ///
11013 ///# Usage Notes
11014 ///
11015 ///Begins an indexed query, like `cmd_begin_query` but with an
11016 ///additional `index` parameter that selects which vertex stream
11017 ///to query when used with transform feedback statistics queries.
11018 ///
11019 ///For `QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT`, the index
11020 ///selects the stream (0–3). For other query types, index must be 0.
11021 ///
11022 ///End with `cmd_end_query_indexed_ext`.
11023 ///
11024 ///Requires `VK_EXT_transform_feedback`.
11025 pub unsafe fn cmd_begin_query_indexed_ext(
11026 &self,
11027 command_buffer: CommandBuffer,
11028 query_pool: QueryPool,
11029 query: u32,
11030 flags: QueryControlFlags,
11031 index: u32,
11032 ) {
11033 let fp = self
11034 .commands()
11035 .cmd_begin_query_indexed_ext
11036 .expect("vkCmdBeginQueryIndexedEXT not loaded");
11037 unsafe { fp(command_buffer, query_pool, query, flags, index) };
11038 }
11039 ///Wraps [`vkCmdEndQueryIndexedEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndQueryIndexedEXT.html).
11040 /**
11041 Provided by **VK_EXT_transform_feedback**.*/
11042 ///
11043 ///# Safety
11044 ///- `commandBuffer` (self) must be valid and not destroyed.
11045 ///- `commandBuffer` must be externally synchronized.
11046 ///
11047 ///# Panics
11048 ///Panics if `vkCmdEndQueryIndexedEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11049 ///
11050 ///# Usage Notes
11051 ///
11052 ///Ends an indexed query started with `cmd_begin_query_indexed_ext`.
11053 ///The `index` parameter must match the one used in the begin call.
11054 ///
11055 ///Requires `VK_EXT_transform_feedback`.
11056 pub unsafe fn cmd_end_query_indexed_ext(
11057 &self,
11058 command_buffer: CommandBuffer,
11059 query_pool: QueryPool,
11060 query: u32,
11061 index: u32,
11062 ) {
11063 let fp = self
11064 .commands()
11065 .cmd_end_query_indexed_ext
11066 .expect("vkCmdEndQueryIndexedEXT not loaded");
11067 unsafe { fp(command_buffer, query_pool, query, index) };
11068 }
11069 ///Wraps [`vkCmdDrawIndirectByteCountEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndirectByteCountEXT.html).
11070 /**
11071 Provided by **VK_EXT_transform_feedback**.*/
11072 ///
11073 ///# Safety
11074 ///- `commandBuffer` (self) must be valid and not destroyed.
11075 ///- `commandBuffer` must be externally synchronized.
11076 ///
11077 ///# Panics
11078 ///Panics if `vkCmdDrawIndirectByteCountEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11079 ///
11080 ///# Usage Notes
11081 ///
11082 ///Draws vertices using a byte count stored in a counter buffer
11083 ///(typically written by a transform feedback pass). The vertex
11084 ///count is computed as `counter_value / vertex_stride`.
11085 ///
11086 ///`counter_offset` accounts for any header bytes before the
11087 ///counter value in the buffer.
11088 ///
11089 ///Requires `VK_EXT_transform_feedback`.
11090 pub unsafe fn cmd_draw_indirect_byte_count_ext(
11091 &self,
11092 command_buffer: CommandBuffer,
11093 instance_count: u32,
11094 first_instance: u32,
11095 counter_buffer: Buffer,
11096 counter_buffer_offset: u64,
11097 counter_offset: u32,
11098 vertex_stride: u32,
11099 ) {
11100 let fp = self
11101 .commands()
11102 .cmd_draw_indirect_byte_count_ext
11103 .expect("vkCmdDrawIndirectByteCountEXT not loaded");
11104 unsafe {
11105 fp(
11106 command_buffer,
11107 instance_count,
11108 first_instance,
11109 counter_buffer,
11110 counter_buffer_offset,
11111 counter_offset,
11112 vertex_stride,
11113 )
11114 };
11115 }
11116 ///Wraps [`vkCmdSetExclusiveScissorNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetExclusiveScissorNV.html).
11117 /**
11118 Provided by **VK_NV_scissor_exclusive**.*/
11119 ///
11120 ///# Safety
11121 ///- `commandBuffer` (self) must be valid and not destroyed.
11122 ///- `commandBuffer` must be externally synchronized.
11123 ///
11124 ///# Panics
11125 ///Panics if `vkCmdSetExclusiveScissorNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11126 ///
11127 ///# Usage Notes
11128 ///
11129 ///Dynamically sets the exclusive scissor rectangles for one or
11130 ///more viewports. Fragments outside these rectangles are discarded
11131 ///when exclusive scissor testing is enabled.
11132 ///
11133 ///Requires `VK_NV_scissor_exclusive`.
11134 pub unsafe fn cmd_set_exclusive_scissor_nv(
11135 &self,
11136 command_buffer: CommandBuffer,
11137 first_exclusive_scissor: u32,
11138 p_exclusive_scissors: &[Rect2D],
11139 ) {
11140 let fp = self
11141 .commands()
11142 .cmd_set_exclusive_scissor_nv
11143 .expect("vkCmdSetExclusiveScissorNV not loaded");
11144 unsafe {
11145 fp(
11146 command_buffer,
11147 first_exclusive_scissor,
11148 p_exclusive_scissors.len() as u32,
11149 p_exclusive_scissors.as_ptr(),
11150 )
11151 };
11152 }
11153 ///Wraps [`vkCmdSetExclusiveScissorEnableNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetExclusiveScissorEnableNV.html).
11154 /**
11155 Provided by **VK_NV_scissor_exclusive**.*/
11156 ///
11157 ///# Safety
11158 ///- `commandBuffer` (self) must be valid and not destroyed.
11159 ///- `commandBuffer` must be externally synchronized.
11160 ///
11161 ///# Panics
11162 ///Panics if `vkCmdSetExclusiveScissorEnableNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11163 ///
11164 ///# Usage Notes
11165 ///
11166 ///Dynamically enables or disables the exclusive scissor test for
11167 ///one or more viewports. When enabled, fragments outside the
11168 ///exclusive scissor rectangle are discarded.
11169 ///
11170 ///Requires `VK_NV_scissor_exclusive`.
11171 pub unsafe fn cmd_set_exclusive_scissor_enable_nv(
11172 &self,
11173 command_buffer: CommandBuffer,
11174 first_exclusive_scissor: u32,
11175 p_exclusive_scissor_enables: &[u32],
11176 ) {
11177 let fp = self
11178 .commands()
11179 .cmd_set_exclusive_scissor_enable_nv
11180 .expect("vkCmdSetExclusiveScissorEnableNV not loaded");
11181 unsafe {
11182 fp(
11183 command_buffer,
11184 first_exclusive_scissor,
11185 p_exclusive_scissor_enables.len() as u32,
11186 p_exclusive_scissor_enables.as_ptr(),
11187 )
11188 };
11189 }
11190 ///Wraps [`vkCmdBindShadingRateImageNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindShadingRateImageNV.html).
11191 /**
11192 Provided by **VK_NV_shading_rate_image**.*/
11193 ///
11194 ///# Safety
11195 ///- `commandBuffer` (self) must be valid and not destroyed.
11196 ///- `commandBuffer` must be externally synchronized.
11197 ///
11198 ///# Panics
11199 ///Panics if `vkCmdBindShadingRateImageNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11200 ///
11201 ///# Usage Notes
11202 ///
11203 ///Binds a shading rate image that controls per-region fragment
11204 ///shading rate. Each texel in the image maps to a tile of the
11205 ///framebuffer and specifies the coarse shading rate for that tile.
11206 ///
11207 ///Requires `VK_NV_shading_rate_image`.
11208 pub unsafe fn cmd_bind_shading_rate_image_nv(
11209 &self,
11210 command_buffer: CommandBuffer,
11211 image_view: ImageView,
11212 image_layout: ImageLayout,
11213 ) {
11214 let fp = self
11215 .commands()
11216 .cmd_bind_shading_rate_image_nv
11217 .expect("vkCmdBindShadingRateImageNV not loaded");
11218 unsafe { fp(command_buffer, image_view, image_layout) };
11219 }
11220 ///Wraps [`vkCmdSetViewportShadingRatePaletteNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetViewportShadingRatePaletteNV.html).
11221 /**
11222 Provided by **VK_NV_shading_rate_image**.*/
11223 ///
11224 ///# Safety
11225 ///- `commandBuffer` (self) must be valid and not destroyed.
11226 ///- `commandBuffer` must be externally synchronized.
11227 ///
11228 ///# Panics
11229 ///Panics if `vkCmdSetViewportShadingRatePaletteNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11230 ///
11231 ///# Usage Notes
11232 ///
11233 ///Sets the shading rate palette for one or more viewports. The
11234 ///palette maps shading rate image texel values to actual shading
11235 ///rates (e.g., 1x1, 2x2, 4x4).
11236 ///
11237 ///Requires `VK_NV_shading_rate_image`.
11238 pub unsafe fn cmd_set_viewport_shading_rate_palette_nv(
11239 &self,
11240 command_buffer: CommandBuffer,
11241 first_viewport: u32,
11242 p_shading_rate_palettes: &[ShadingRatePaletteNV],
11243 ) {
11244 let fp = self
11245 .commands()
11246 .cmd_set_viewport_shading_rate_palette_nv
11247 .expect("vkCmdSetViewportShadingRatePaletteNV not loaded");
11248 unsafe {
11249 fp(
11250 command_buffer,
11251 first_viewport,
11252 p_shading_rate_palettes.len() as u32,
11253 p_shading_rate_palettes.as_ptr(),
11254 )
11255 };
11256 }
11257 ///Wraps [`vkCmdSetCoarseSampleOrderNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetCoarseSampleOrderNV.html).
11258 /**
11259 Provided by **VK_NV_shading_rate_image**.*/
11260 ///
11261 ///# Safety
11262 ///- `commandBuffer` (self) must be valid and not destroyed.
11263 ///- `commandBuffer` must be externally synchronized.
11264 ///
11265 ///# Panics
11266 ///Panics if `vkCmdSetCoarseSampleOrderNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11267 ///
11268 ///# Usage Notes
11269 ///
11270 ///Sets the sample ordering for coarse shading rate fragments. By
11271 ///default, the driver chooses sample order; use this to specify a
11272 ///custom order when the fragment shader relies on specific sample
11273 ///positions within coarse fragments.
11274 ///
11275 ///Requires `VK_NV_shading_rate_image`.
11276 pub unsafe fn cmd_set_coarse_sample_order_nv(
11277 &self,
11278 command_buffer: CommandBuffer,
11279 sample_order_type: CoarseSampleOrderTypeNV,
11280 p_custom_sample_orders: &[CoarseSampleOrderCustomNV],
11281 ) {
11282 let fp = self
11283 .commands()
11284 .cmd_set_coarse_sample_order_nv
11285 .expect("vkCmdSetCoarseSampleOrderNV not loaded");
11286 unsafe {
11287 fp(
11288 command_buffer,
11289 sample_order_type,
11290 p_custom_sample_orders.len() as u32,
11291 p_custom_sample_orders.as_ptr(),
11292 )
11293 };
11294 }
11295 ///Wraps [`vkCmdDrawMeshTasksNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMeshTasksNV.html).
11296 /**
11297 Provided by **VK_NV_mesh_shader**.*/
11298 ///
11299 ///# Safety
11300 ///- `commandBuffer` (self) must be valid and not destroyed.
11301 ///- `commandBuffer` must be externally synchronized.
11302 ///
11303 ///# Panics
11304 ///Panics if `vkCmdDrawMeshTasksNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11305 ///
11306 ///# Usage Notes
11307 ///
11308 ///Dispatches mesh shader work using the NV mesh shader model.
11309 ///Launches `task_count` task shader workgroups starting at
11310 ///`first_task`.
11311 ///
11312 ///This is the legacy NV path; prefer `cmd_draw_mesh_tasks_ext`
11313 ///for new code.
11314 ///
11315 ///Requires `VK_NV_mesh_shader`.
11316 pub unsafe fn cmd_draw_mesh_tasks_nv(
11317 &self,
11318 command_buffer: CommandBuffer,
11319 task_count: u32,
11320 first_task: u32,
11321 ) {
11322 let fp = self
11323 .commands()
11324 .cmd_draw_mesh_tasks_nv
11325 .expect("vkCmdDrawMeshTasksNV not loaded");
11326 unsafe { fp(command_buffer, task_count, first_task) };
11327 }
11328 ///Wraps [`vkCmdDrawMeshTasksIndirectNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMeshTasksIndirectNV.html).
11329 /**
11330 Provided by **VK_NV_mesh_shader**.*/
11331 ///
11332 ///# Safety
11333 ///- `commandBuffer` (self) must be valid and not destroyed.
11334 ///- `commandBuffer` must be externally synchronized.
11335 ///
11336 ///# Panics
11337 ///Panics if `vkCmdDrawMeshTasksIndirectNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11338 ///
11339 ///# Usage Notes
11340 ///
11341 ///Indirect variant of `cmd_draw_mesh_tasks_nv`. Reads draw
11342 ///parameters from a buffer, enabling GPU-driven mesh shader
11343 ///dispatch.
11344 ///
11345 ///Requires `VK_NV_mesh_shader`.
11346 pub unsafe fn cmd_draw_mesh_tasks_indirect_nv(
11347 &self,
11348 command_buffer: CommandBuffer,
11349 buffer: Buffer,
11350 offset: u64,
11351 draw_count: u32,
11352 stride: u32,
11353 ) {
11354 let fp = self
11355 .commands()
11356 .cmd_draw_mesh_tasks_indirect_nv
11357 .expect("vkCmdDrawMeshTasksIndirectNV not loaded");
11358 unsafe { fp(command_buffer, buffer, offset, draw_count, stride) };
11359 }
11360 ///Wraps [`vkCmdDrawMeshTasksIndirectCountNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMeshTasksIndirectCountNV.html).
11361 /**
11362 Provided by **VK_NV_mesh_shader**.*/
11363 ///
11364 ///# Safety
11365 ///- `commandBuffer` (self) must be valid and not destroyed.
11366 ///- `commandBuffer` must be externally synchronized.
11367 ///
11368 ///# Panics
11369 ///Panics if `vkCmdDrawMeshTasksIndirectCountNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11370 ///
11371 ///# Usage Notes
11372 ///
11373 ///Indirect-count variant of `cmd_draw_mesh_tasks_nv`. Reads both
11374 ///the draw parameters and the draw count from GPU buffers, enabling
11375 ///fully GPU-driven mesh shader dispatch where the number of draws
11376 ///is determined at runtime.
11377 ///
11378 ///Requires `VK_NV_mesh_shader`.
11379 pub unsafe fn cmd_draw_mesh_tasks_indirect_count_nv(
11380 &self,
11381 command_buffer: CommandBuffer,
11382 buffer: Buffer,
11383 offset: u64,
11384 count_buffer: Buffer,
11385 count_buffer_offset: u64,
11386 max_draw_count: u32,
11387 stride: u32,
11388 ) {
11389 let fp = self
11390 .commands()
11391 .cmd_draw_mesh_tasks_indirect_count_nv
11392 .expect("vkCmdDrawMeshTasksIndirectCountNV not loaded");
11393 unsafe {
11394 fp(
11395 command_buffer,
11396 buffer,
11397 offset,
11398 count_buffer,
11399 count_buffer_offset,
11400 max_draw_count,
11401 stride,
11402 )
11403 };
11404 }
11405 ///Wraps [`vkCmdDrawMeshTasksEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMeshTasksEXT.html).
11406 /**
11407 Provided by **VK_EXT_mesh_shader**.*/
11408 ///
11409 ///# Safety
11410 ///- `commandBuffer` (self) must be valid and not destroyed.
11411 ///- `commandBuffer` must be externally synchronized.
11412 ///
11413 ///# Panics
11414 ///Panics if `vkCmdDrawMeshTasksEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11415 ///
11416 ///# Usage Notes
11417 ///
11418 ///Dispatches mesh shader work groups. `group_count_x/y/z` specify
11419 ///the number of task or mesh shader work groups to launch.
11420 ///
11421 ///Each work group runs the mesh shader (or task shader, if bound)
11422 ///which emits primitives directly without traditional vertex/index
11423 ///buffers.
11424 ///
11425 ///Requires `VK_EXT_mesh_shader` and the `meshShader` feature.
11426 pub unsafe fn cmd_draw_mesh_tasks_ext(
11427 &self,
11428 command_buffer: CommandBuffer,
11429 group_count_x: u32,
11430 group_count_y: u32,
11431 group_count_z: u32,
11432 ) {
11433 let fp = self
11434 .commands()
11435 .cmd_draw_mesh_tasks_ext
11436 .expect("vkCmdDrawMeshTasksEXT not loaded");
11437 unsafe { fp(command_buffer, group_count_x, group_count_y, group_count_z) };
11438 }
11439 ///Wraps [`vkCmdDrawMeshTasksIndirectEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMeshTasksIndirectEXT.html).
11440 /**
11441 Provided by **VK_EXT_mesh_shader**.*/
11442 ///
11443 ///# Safety
11444 ///- `commandBuffer` (self) must be valid and not destroyed.
11445 ///- `commandBuffer` must be externally synchronized.
11446 ///
11447 ///# Panics
11448 ///Panics if `vkCmdDrawMeshTasksIndirectEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11449 ///
11450 ///# Usage Notes
11451 ///
11452 ///Indirect version of `cmd_draw_mesh_tasks_ext`. Reads mesh shader
11453 ///dispatch parameters from a buffer. Each indirect command contains
11454 ///group counts (x, y, z).
11455 ///
11456 ///`draw_count` specifies how many indirect commands to execute.
11457 ///`stride` is the byte stride between commands in the buffer.
11458 ///
11459 ///Requires `VK_EXT_mesh_shader`.
11460 pub unsafe fn cmd_draw_mesh_tasks_indirect_ext(
11461 &self,
11462 command_buffer: CommandBuffer,
11463 buffer: Buffer,
11464 offset: u64,
11465 draw_count: u32,
11466 stride: u32,
11467 ) {
11468 let fp = self
11469 .commands()
11470 .cmd_draw_mesh_tasks_indirect_ext
11471 .expect("vkCmdDrawMeshTasksIndirectEXT not loaded");
11472 unsafe { fp(command_buffer, buffer, offset, draw_count, stride) };
11473 }
11474 ///Wraps [`vkCmdDrawMeshTasksIndirectCountEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMeshTasksIndirectCountEXT.html).
11475 /**
11476 Provided by **VK_EXT_mesh_shader**.*/
11477 ///
11478 ///# Safety
11479 ///- `commandBuffer` (self) must be valid and not destroyed.
11480 ///- `commandBuffer` must be externally synchronized.
11481 ///
11482 ///# Panics
11483 ///Panics if `vkCmdDrawMeshTasksIndirectCountEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11484 ///
11485 ///# Usage Notes
11486 ///
11487 ///Count-indirect version of mesh shader dispatch. Both the dispatch
11488 ///parameters and the draw count are read from GPU buffers, enabling
11489 ///fully GPU-driven mesh shader workloads.
11490 ///
11491 ///`max_draw_count` caps the count read from the count buffer.
11492 ///
11493 ///Requires `VK_EXT_mesh_shader`.
11494 pub unsafe fn cmd_draw_mesh_tasks_indirect_count_ext(
11495 &self,
11496 command_buffer: CommandBuffer,
11497 buffer: Buffer,
11498 offset: u64,
11499 count_buffer: Buffer,
11500 count_buffer_offset: u64,
11501 max_draw_count: u32,
11502 stride: u32,
11503 ) {
11504 let fp = self
11505 .commands()
11506 .cmd_draw_mesh_tasks_indirect_count_ext
11507 .expect("vkCmdDrawMeshTasksIndirectCountEXT not loaded");
11508 unsafe {
11509 fp(
11510 command_buffer,
11511 buffer,
11512 offset,
11513 count_buffer,
11514 count_buffer_offset,
11515 max_draw_count,
11516 stride,
11517 )
11518 };
11519 }
11520 ///Wraps [`vkCompileDeferredNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCompileDeferredNV.html).
11521 /**
11522 Provided by **VK_NV_ray_tracing**.*/
11523 ///
11524 ///# Errors
11525 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
11526 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
11527 ///- `VK_ERROR_UNKNOWN`
11528 ///- `VK_ERROR_VALIDATION_FAILED`
11529 ///
11530 ///# Safety
11531 ///- `device` (self) must be valid and not destroyed.
11532 ///
11533 ///# Panics
11534 ///Panics if `vkCompileDeferredNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11535 ///
11536 ///# Usage Notes
11537 ///
11538 ///Triggers compilation of a deferred shader in an NV ray tracing
11539 ///pipeline. When a pipeline is created with
11540 ///`PIPELINE_CREATE_DEFER_COMPILE_BIT_NV`, individual shaders can
11541 ///be compiled on demand using this command.
11542 ///
11543 ///Useful for spreading compilation cost across frames or threads.
11544 ///
11545 ///Requires `VK_NV_ray_tracing`.
11546 pub unsafe fn compile_deferred_nv(&self, pipeline: Pipeline, shader: u32) -> VkResult<()> {
11547 let fp = self
11548 .commands()
11549 .compile_deferred_nv
11550 .expect("vkCompileDeferredNV not loaded");
11551 check(unsafe { fp(self.handle(), pipeline, shader) })
11552 }
11553 ///Wraps [`vkCreateAccelerationStructureNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateAccelerationStructureNV.html).
11554 /**
11555 Provided by **VK_NV_ray_tracing**.*/
11556 ///
11557 ///# Errors
11558 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
11559 ///- `VK_ERROR_UNKNOWN`
11560 ///- `VK_ERROR_VALIDATION_FAILED`
11561 ///
11562 ///# Safety
11563 ///- `device` (self) must be valid and not destroyed.
11564 ///
11565 ///# Panics
11566 ///Panics if `vkCreateAccelerationStructureNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11567 ///
11568 ///# Usage Notes
11569 ///
11570 ///Creates an NV ray tracing acceleration structure. This is the
11571 ///legacy NV path; prefer `create_acceleration_structure_khr` for
11572 ///new code.
11573 ///
11574 ///The NV acceleration structure owns its memory implicitly, bind
11575 ///memory with `bind_acceleration_structure_memory_nv`. Destroy with
11576 ///`destroy_acceleration_structure_nv`.
11577 ///
11578 ///Requires `VK_NV_ray_tracing`.
11579 pub unsafe fn create_acceleration_structure_nv(
11580 &self,
11581 p_create_info: &AccelerationStructureCreateInfoNV,
11582 allocator: Option<&AllocationCallbacks>,
11583 ) -> VkResult<AccelerationStructureNV> {
11584 let fp = self
11585 .commands()
11586 .create_acceleration_structure_nv
11587 .expect("vkCreateAccelerationStructureNV not loaded");
11588 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
11589 let mut out = unsafe { core::mem::zeroed() };
11590 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
11591 Ok(out)
11592 }
11593 ///Wraps [`vkCmdBindInvocationMaskHUAWEI`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindInvocationMaskHUAWEI.html).
11594 /**
11595 Provided by **VK_HUAWEI_invocation_mask**.*/
11596 ///
11597 ///# Safety
11598 ///- `commandBuffer` (self) must be valid and not destroyed.
11599 ///- `commandBuffer` must be externally synchronized.
11600 ///
11601 ///# Panics
11602 ///Panics if `vkCmdBindInvocationMaskHUAWEI` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11603 ///
11604 ///# Usage Notes
11605 ///
11606 ///Binds an image view as an invocation mask for ray tracing. The
11607 ///mask selectively enables or disables ray generation shader
11608 ///invocations per pixel, allowing efficient partial-screen ray
11609 ///tracing on Huawei GPUs.
11610 ///
11611 ///Requires `VK_HUAWEI_invocation_mask`.
11612 pub unsafe fn cmd_bind_invocation_mask_huawei(
11613 &self,
11614 command_buffer: CommandBuffer,
11615 image_view: ImageView,
11616 image_layout: ImageLayout,
11617 ) {
11618 let fp = self
11619 .commands()
11620 .cmd_bind_invocation_mask_huawei
11621 .expect("vkCmdBindInvocationMaskHUAWEI not loaded");
11622 unsafe { fp(command_buffer, image_view, image_layout) };
11623 }
11624 ///Wraps [`vkDestroyAccelerationStructureKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyAccelerationStructureKHR.html).
11625 /**
11626 Provided by **VK_KHR_acceleration_structure**.*/
11627 ///
11628 ///# Safety
11629 ///- `device` (self) must be valid and not destroyed.
11630 ///- `accelerationStructure` must be externally synchronized.
11631 ///
11632 ///# Panics
11633 ///Panics if `vkDestroyAccelerationStructureKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11634 ///
11635 ///# Usage Notes
11636 ///
11637 ///Destroys an acceleration structure. The structure must not be
11638 ///referenced by any pending ray tracing command or TLAS build.
11639 ///
11640 ///Destroying the acceleration structure does not free the backing
11641 ///buffer, destroy or reclaim it separately.
11642 pub unsafe fn destroy_acceleration_structure_khr(
11643 &self,
11644 acceleration_structure: AccelerationStructureKHR,
11645 allocator: Option<&AllocationCallbacks>,
11646 ) {
11647 let fp = self
11648 .commands()
11649 .destroy_acceleration_structure_khr
11650 .expect("vkDestroyAccelerationStructureKHR not loaded");
11651 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
11652 unsafe { fp(self.handle(), acceleration_structure, alloc_ptr) };
11653 }
11654 ///Wraps [`vkDestroyAccelerationStructureNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyAccelerationStructureNV.html).
11655 /**
11656 Provided by **VK_NV_ray_tracing**.*/
11657 ///
11658 ///# Safety
11659 ///- `device` (self) must be valid and not destroyed.
11660 ///- `accelerationStructure` must be externally synchronized.
11661 ///
11662 ///# Panics
11663 ///Panics if `vkDestroyAccelerationStructureNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11664 ///
11665 ///# Usage Notes
11666 ///
11667 ///Destroys an NV acceleration structure created with
11668 ///`create_acceleration_structure_nv`. The structure must not be
11669 ///referenced by any pending command.
11670 ///
11671 ///Requires `VK_NV_ray_tracing`.
11672 pub unsafe fn destroy_acceleration_structure_nv(
11673 &self,
11674 acceleration_structure: AccelerationStructureNV,
11675 allocator: Option<&AllocationCallbacks>,
11676 ) {
11677 let fp = self
11678 .commands()
11679 .destroy_acceleration_structure_nv
11680 .expect("vkDestroyAccelerationStructureNV not loaded");
11681 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
11682 unsafe { fp(self.handle(), acceleration_structure, alloc_ptr) };
11683 }
11684 ///Wraps [`vkGetAccelerationStructureMemoryRequirementsNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetAccelerationStructureMemoryRequirementsNV.html).
11685 /**
11686 Provided by **VK_NV_ray_tracing**.*/
11687 ///
11688 ///# Safety
11689 ///- `device` (self) must be valid and not destroyed.
11690 ///
11691 ///# Panics
11692 ///Panics if `vkGetAccelerationStructureMemoryRequirementsNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11693 ///
11694 ///# Usage Notes
11695 ///
11696 ///Queries the memory requirements for an NV acceleration structure,
11697 ///including the scratch memory needed for builds and updates. Use
11698 ///the result to allocate and bind memory before building.
11699 ///
11700 ///Requires `VK_NV_ray_tracing`.
11701 pub unsafe fn get_acceleration_structure_memory_requirements_nv(
11702 &self,
11703 p_info: &AccelerationStructureMemoryRequirementsInfoNV,
11704 ) -> MemoryRequirements2KHR {
11705 let fp = self
11706 .commands()
11707 .get_acceleration_structure_memory_requirements_nv
11708 .expect("vkGetAccelerationStructureMemoryRequirementsNV not loaded");
11709 let mut out = unsafe { core::mem::zeroed() };
11710 unsafe { fp(self.handle(), p_info, &mut out) };
11711 out
11712 }
11713 ///Wraps [`vkBindAccelerationStructureMemoryNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBindAccelerationStructureMemoryNV.html).
11714 /**
11715 Provided by **VK_NV_ray_tracing**.*/
11716 ///
11717 ///# Errors
11718 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
11719 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
11720 ///- `VK_ERROR_UNKNOWN`
11721 ///- `VK_ERROR_VALIDATION_FAILED`
11722 ///
11723 ///# Safety
11724 ///- `device` (self) must be valid and not destroyed.
11725 ///
11726 ///# Panics
11727 ///Panics if `vkBindAccelerationStructureMemoryNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11728 ///
11729 ///# Usage Notes
11730 ///
11731 ///Binds device memory to one or more NV acceleration structures.
11732 ///Must be called before the structure can be used in a build or
11733 ///trace command.
11734 ///
11735 ///Requires `VK_NV_ray_tracing`.
11736 pub unsafe fn bind_acceleration_structure_memory_nv(
11737 &self,
11738 p_bind_infos: &[BindAccelerationStructureMemoryInfoNV],
11739 ) -> VkResult<()> {
11740 let fp = self
11741 .commands()
11742 .bind_acceleration_structure_memory_nv
11743 .expect("vkBindAccelerationStructureMemoryNV not loaded");
11744 check(unsafe {
11745 fp(
11746 self.handle(),
11747 p_bind_infos.len() as u32,
11748 p_bind_infos.as_ptr(),
11749 )
11750 })
11751 }
11752 ///Wraps [`vkCmdCopyAccelerationStructureNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyAccelerationStructureNV.html).
11753 /**
11754 Provided by **VK_NV_ray_tracing**.*/
11755 ///
11756 ///# Safety
11757 ///- `commandBuffer` (self) must be valid and not destroyed.
11758 ///- `commandBuffer` must be externally synchronized.
11759 ///
11760 ///# Panics
11761 ///Panics if `vkCmdCopyAccelerationStructureNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11762 ///
11763 ///# Usage Notes
11764 ///
11765 ///Copies or compacts an NV acceleration structure. Use `CLONE` mode
11766 ///for a full copy, or `COMPACT` to produce a smaller copy after
11767 ///querying the compacted size.
11768 ///
11769 ///Requires `VK_NV_ray_tracing`.
11770 pub unsafe fn cmd_copy_acceleration_structure_nv(
11771 &self,
11772 command_buffer: CommandBuffer,
11773 dst: AccelerationStructureNV,
11774 src: AccelerationStructureNV,
11775 mode: CopyAccelerationStructureModeKHR,
11776 ) {
11777 let fp = self
11778 .commands()
11779 .cmd_copy_acceleration_structure_nv
11780 .expect("vkCmdCopyAccelerationStructureNV not loaded");
11781 unsafe { fp(command_buffer, dst, src, mode) };
11782 }
11783 ///Wraps [`vkCmdCopyAccelerationStructureKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyAccelerationStructureKHR.html).
11784 /**
11785 Provided by **VK_KHR_acceleration_structure**.*/
11786 ///
11787 ///# Safety
11788 ///- `commandBuffer` (self) must be valid and not destroyed.
11789 ///- `commandBuffer` must be externally synchronized.
11790 ///
11791 ///# Panics
11792 ///Panics if `vkCmdCopyAccelerationStructureKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11793 ///
11794 ///# Usage Notes
11795 ///
11796 ///Copies an acceleration structure. Modes:
11797 ///
11798 ///- `COPY_ACCELERATION_STRUCTURE_MODE_CLONE`: full copy. The
11799 /// destination must be at least as large as the source.
11800 ///- `COPY_ACCELERATION_STRUCTURE_MODE_COMPACT`: copies into a smaller
11801 /// buffer after a compaction query. Use this to reclaim memory after
11802 /// building.
11803 ///
11804 ///**Compaction workflow**:
11805 ///
11806 ///1. Build with `BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION`.
11807 ///2. Query compacted size with
11808 /// `cmd_write_acceleration_structures_properties_khr`.
11809 ///3. Create a new, smaller backing buffer.
11810 ///4. Copy with `MODE_COMPACT`.
11811 ///
11812 ///Compaction typically saves 50–70% of BLAS memory.
11813 pub unsafe fn cmd_copy_acceleration_structure_khr(
11814 &self,
11815 command_buffer: CommandBuffer,
11816 p_info: &CopyAccelerationStructureInfoKHR,
11817 ) {
11818 let fp = self
11819 .commands()
11820 .cmd_copy_acceleration_structure_khr
11821 .expect("vkCmdCopyAccelerationStructureKHR not loaded");
11822 unsafe { fp(command_buffer, p_info) };
11823 }
11824 ///Wraps [`vkCopyAccelerationStructureKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCopyAccelerationStructureKHR.html).
11825 /**
11826 Provided by **VK_KHR_acceleration_structure**.*/
11827 ///
11828 ///# Errors
11829 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
11830 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
11831 ///- `VK_ERROR_UNKNOWN`
11832 ///- `VK_ERROR_VALIDATION_FAILED`
11833 ///
11834 ///# Safety
11835 ///- `device` (self) must be valid and not destroyed.
11836 ///
11837 ///# Panics
11838 ///Panics if `vkCopyAccelerationStructureKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11839 ///
11840 ///# Usage Notes
11841 ///
11842 ///Host-side acceleration structure copy. The CPU counterpart to
11843 ///`cmd_copy_acceleration_structure_khr`. Supports the same clone and
11844 ///compact modes.
11845 ///
11846 ///Requires the `acceleration_structure_host_commands` feature.
11847 pub unsafe fn copy_acceleration_structure_khr(
11848 &self,
11849 deferred_operation: DeferredOperationKHR,
11850 p_info: &CopyAccelerationStructureInfoKHR,
11851 ) -> VkResult<()> {
11852 let fp = self
11853 .commands()
11854 .copy_acceleration_structure_khr
11855 .expect("vkCopyAccelerationStructureKHR not loaded");
11856 check(unsafe { fp(self.handle(), deferred_operation, p_info) })
11857 }
11858 ///Wraps [`vkCmdCopyAccelerationStructureToMemoryKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyAccelerationStructureToMemoryKHR.html).
11859 /**
11860 Provided by **VK_KHR_acceleration_structure**.*/
11861 ///
11862 ///# Safety
11863 ///- `commandBuffer` (self) must be valid and not destroyed.
11864 ///- `commandBuffer` must be externally synchronized.
11865 ///
11866 ///# Panics
11867 ///Panics if `vkCmdCopyAccelerationStructureToMemoryKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11868 ///
11869 ///# Usage Notes
11870 ///
11871 ///Serializes an acceleration structure into a buffer for storage or
11872 ///transfer. The serialized format is opaque and driver-specific, it
11873 ///can only be deserialized on the same driver and hardware.
11874 ///
11875 ///Use this for:
11876 ///
11877 ///- Saving acceleration structures to disk for faster subsequent loads.
11878 ///- Transferring structures between devices in a device group.
11879 ///
11880 ///Deserialize with `cmd_copy_memory_to_acceleration_structure_khr`.
11881 pub unsafe fn cmd_copy_acceleration_structure_to_memory_khr(
11882 &self,
11883 command_buffer: CommandBuffer,
11884 p_info: &CopyAccelerationStructureToMemoryInfoKHR,
11885 ) {
11886 let fp = self
11887 .commands()
11888 .cmd_copy_acceleration_structure_to_memory_khr
11889 .expect("vkCmdCopyAccelerationStructureToMemoryKHR not loaded");
11890 unsafe { fp(command_buffer, p_info) };
11891 }
11892 ///Wraps [`vkCopyAccelerationStructureToMemoryKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCopyAccelerationStructureToMemoryKHR.html).
11893 /**
11894 Provided by **VK_KHR_acceleration_structure**.*/
11895 ///
11896 ///# Errors
11897 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
11898 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
11899 ///- `VK_ERROR_UNKNOWN`
11900 ///- `VK_ERROR_VALIDATION_FAILED`
11901 ///
11902 ///# Safety
11903 ///- `device` (self) must be valid and not destroyed.
11904 ///
11905 ///# Panics
11906 ///Panics if `vkCopyAccelerationStructureToMemoryKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11907 ///
11908 ///# Usage Notes
11909 ///
11910 ///Host-side acceleration structure serialization. The CPU counterpart
11911 ///to `cmd_copy_acceleration_structure_to_memory_khr`.
11912 ///
11913 ///Requires the `acceleration_structure_host_commands` feature.
11914 pub unsafe fn copy_acceleration_structure_to_memory_khr(
11915 &self,
11916 deferred_operation: DeferredOperationKHR,
11917 p_info: &CopyAccelerationStructureToMemoryInfoKHR,
11918 ) -> VkResult<()> {
11919 let fp = self
11920 .commands()
11921 .copy_acceleration_structure_to_memory_khr
11922 .expect("vkCopyAccelerationStructureToMemoryKHR not loaded");
11923 check(unsafe { fp(self.handle(), deferred_operation, p_info) })
11924 }
11925 ///Wraps [`vkCmdCopyMemoryToAccelerationStructureKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMemoryToAccelerationStructureKHR.html).
11926 /**
11927 Provided by **VK_KHR_acceleration_structure**.*/
11928 ///
11929 ///# Safety
11930 ///- `commandBuffer` (self) must be valid and not destroyed.
11931 ///- `commandBuffer` must be externally synchronized.
11932 ///
11933 ///# Panics
11934 ///Panics if `vkCmdCopyMemoryToAccelerationStructureKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11935 ///
11936 ///# Usage Notes
11937 ///
11938 ///Deserializes an acceleration structure from a buffer that was
11939 ///previously written by
11940 ///`cmd_copy_acceleration_structure_to_memory_khr`.
11941 ///
11942 ///The data must have been serialized on the same driver and hardware
11943 ///(check `acceleration_structure_uuid` compatibility before loading).
11944 ///
11945 ///After deserialization the acceleration structure is ready for use
11946 ///in ray tracing commands.
11947 pub unsafe fn cmd_copy_memory_to_acceleration_structure_khr(
11948 &self,
11949 command_buffer: CommandBuffer,
11950 p_info: &CopyMemoryToAccelerationStructureInfoKHR,
11951 ) {
11952 let fp = self
11953 .commands()
11954 .cmd_copy_memory_to_acceleration_structure_khr
11955 .expect("vkCmdCopyMemoryToAccelerationStructureKHR not loaded");
11956 unsafe { fp(command_buffer, p_info) };
11957 }
11958 ///Wraps [`vkCopyMemoryToAccelerationStructureKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCopyMemoryToAccelerationStructureKHR.html).
11959 /**
11960 Provided by **VK_KHR_acceleration_structure**.*/
11961 ///
11962 ///# Errors
11963 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
11964 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
11965 ///- `VK_ERROR_UNKNOWN`
11966 ///- `VK_ERROR_VALIDATION_FAILED`
11967 ///
11968 ///# Safety
11969 ///- `device` (self) must be valid and not destroyed.
11970 ///
11971 ///# Panics
11972 ///Panics if `vkCopyMemoryToAccelerationStructureKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11973 ///
11974 ///# Usage Notes
11975 ///
11976 ///Host-side acceleration structure deserialization. The CPU counterpart
11977 ///to `cmd_copy_memory_to_acceleration_structure_khr`.
11978 ///
11979 ///Requires the `acceleration_structure_host_commands` feature.
11980 pub unsafe fn copy_memory_to_acceleration_structure_khr(
11981 &self,
11982 deferred_operation: DeferredOperationKHR,
11983 p_info: &CopyMemoryToAccelerationStructureInfoKHR,
11984 ) -> VkResult<()> {
11985 let fp = self
11986 .commands()
11987 .copy_memory_to_acceleration_structure_khr
11988 .expect("vkCopyMemoryToAccelerationStructureKHR not loaded");
11989 check(unsafe { fp(self.handle(), deferred_operation, p_info) })
11990 }
11991 ///Wraps [`vkCmdWriteAccelerationStructuresPropertiesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWriteAccelerationStructuresPropertiesKHR.html).
11992 /**
11993 Provided by **VK_KHR_acceleration_structure**.*/
11994 ///
11995 ///# Safety
11996 ///- `commandBuffer` (self) must be valid and not destroyed.
11997 ///- `commandBuffer` must be externally synchronized.
11998 ///
11999 ///# Panics
12000 ///Panics if `vkCmdWriteAccelerationStructuresPropertiesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12001 ///
12002 ///# Usage Notes
12003 ///
12004 ///Writes acceleration structure properties into a query pool. The
12005 ///primary use is querying `QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE`
12006 ///after a build to determine the compacted size before copying.
12007 ///
12008 ///**Compaction workflow**:
12009 ///
12010 ///1. Build with `ALLOW_COMPACTION`.
12011 ///2. `cmd_write_acceleration_structures_properties_khr` with
12012 /// `COMPACTED_SIZE` query type.
12013 ///3. Read the result from the query pool.
12014 ///4. Create a smaller buffer and copy with `MODE_COMPACT`.
12015 ///
12016 ///Also supports `QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE`
12017 ///for estimating serialization buffer requirements.
12018 pub unsafe fn cmd_write_acceleration_structures_properties_khr(
12019 &self,
12020 command_buffer: CommandBuffer,
12021 p_acceleration_structures: &[AccelerationStructureKHR],
12022 query_type: QueryType,
12023 query_pool: QueryPool,
12024 first_query: u32,
12025 ) {
12026 let fp = self
12027 .commands()
12028 .cmd_write_acceleration_structures_properties_khr
12029 .expect("vkCmdWriteAccelerationStructuresPropertiesKHR not loaded");
12030 unsafe {
12031 fp(
12032 command_buffer,
12033 p_acceleration_structures.len() as u32,
12034 p_acceleration_structures.as_ptr(),
12035 query_type,
12036 query_pool,
12037 first_query,
12038 )
12039 };
12040 }
12041 ///Wraps [`vkCmdWriteAccelerationStructuresPropertiesNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWriteAccelerationStructuresPropertiesNV.html).
12042 /**
12043 Provided by **VK_NV_ray_tracing**.*/
12044 ///
12045 ///# Safety
12046 ///- `commandBuffer` (self) must be valid and not destroyed.
12047 ///- `commandBuffer` must be externally synchronized.
12048 ///
12049 ///# Panics
12050 ///Panics if `vkCmdWriteAccelerationStructuresPropertiesNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12051 ///
12052 ///# Usage Notes
12053 ///
12054 ///Writes acceleration structure properties (such as compacted size)
12055 ///into a query pool. Use this after a build to determine the
12056 ///compacted size before calling `cmd_copy_acceleration_structure_nv`
12057 ///with `COMPACT` mode.
12058 ///
12059 ///Requires `VK_NV_ray_tracing`.
12060 pub unsafe fn cmd_write_acceleration_structures_properties_nv(
12061 &self,
12062 command_buffer: CommandBuffer,
12063 p_acceleration_structures: &[AccelerationStructureNV],
12064 query_type: QueryType,
12065 query_pool: QueryPool,
12066 first_query: u32,
12067 ) {
12068 let fp = self
12069 .commands()
12070 .cmd_write_acceleration_structures_properties_nv
12071 .expect("vkCmdWriteAccelerationStructuresPropertiesNV not loaded");
12072 unsafe {
12073 fp(
12074 command_buffer,
12075 p_acceleration_structures.len() as u32,
12076 p_acceleration_structures.as_ptr(),
12077 query_type,
12078 query_pool,
12079 first_query,
12080 )
12081 };
12082 }
12083 ///Wraps [`vkCmdBuildAccelerationStructureNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBuildAccelerationStructureNV.html).
12084 /**
12085 Provided by **VK_NV_ray_tracing**.*/
12086 ///
12087 ///# Safety
12088 ///- `commandBuffer` (self) must be valid and not destroyed.
12089 ///- `commandBuffer` must be externally synchronized.
12090 ///
12091 ///# Panics
12092 ///Panics if `vkCmdBuildAccelerationStructureNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12093 ///
12094 ///# Usage Notes
12095 ///
12096 ///Builds or updates an NV acceleration structure from geometry data.
12097 ///Set `update` to non-zero to refit an existing structure in place
12098 ///(faster but lower quality than a full rebuild).
12099 ///
12100 ///A scratch buffer is required; query its size with
12101 ///`get_acceleration_structure_memory_requirements_nv`.
12102 ///
12103 ///Requires `VK_NV_ray_tracing`.
12104 pub unsafe fn cmd_build_acceleration_structure_nv(
12105 &self,
12106 command_buffer: CommandBuffer,
12107 p_info: &AccelerationStructureInfoNV,
12108 instance_data: Buffer,
12109 instance_offset: u64,
12110 update: bool,
12111 dst: AccelerationStructureNV,
12112 src: AccelerationStructureNV,
12113 scratch: Buffer,
12114 scratch_offset: u64,
12115 ) {
12116 let fp = self
12117 .commands()
12118 .cmd_build_acceleration_structure_nv
12119 .expect("vkCmdBuildAccelerationStructureNV not loaded");
12120 unsafe {
12121 fp(
12122 command_buffer,
12123 p_info,
12124 instance_data,
12125 instance_offset,
12126 update as u32,
12127 dst,
12128 src,
12129 scratch,
12130 scratch_offset,
12131 )
12132 };
12133 }
12134 ///Wraps [`vkWriteAccelerationStructuresPropertiesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkWriteAccelerationStructuresPropertiesKHR.html).
12135 /**
12136 Provided by **VK_KHR_acceleration_structure**.*/
12137 ///
12138 ///# Errors
12139 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
12140 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
12141 ///- `VK_ERROR_UNKNOWN`
12142 ///- `VK_ERROR_VALIDATION_FAILED`
12143 ///
12144 ///# Safety
12145 ///- `device` (self) must be valid and not destroyed.
12146 ///
12147 ///# Panics
12148 ///Panics if `vkWriteAccelerationStructuresPropertiesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12149 ///
12150 ///# Usage Notes
12151 ///
12152 ///Host-side query of acceleration structure properties. The CPU
12153 ///counterpart to `cmd_write_acceleration_structures_properties_khr`.
12154 ///
12155 ///Writes results directly to a host buffer rather than a query pool.
12156 ///Supports the same query types: compacted size and serialization
12157 ///size.
12158 ///
12159 ///Requires the `acceleration_structure_host_commands` feature.
12160 pub unsafe fn write_acceleration_structures_properties_khr(
12161 &self,
12162 p_acceleration_structures: &[AccelerationStructureKHR],
12163 query_type: QueryType,
12164 data_size: usize,
12165 p_data: *mut core::ffi::c_void,
12166 stride: usize,
12167 ) -> VkResult<()> {
12168 let fp = self
12169 .commands()
12170 .write_acceleration_structures_properties_khr
12171 .expect("vkWriteAccelerationStructuresPropertiesKHR not loaded");
12172 check(unsafe {
12173 fp(
12174 self.handle(),
12175 p_acceleration_structures.len() as u32,
12176 p_acceleration_structures.as_ptr(),
12177 query_type,
12178 data_size,
12179 p_data,
12180 stride,
12181 )
12182 })
12183 }
12184 ///Wraps [`vkCmdTraceRaysKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdTraceRaysKHR.html).
12185 /**
12186 Provided by **VK_KHR_ray_tracing_pipeline**.*/
12187 ///
12188 ///# Safety
12189 ///- `commandBuffer` (self) must be valid and not destroyed.
12190 ///- `commandBuffer` must be externally synchronized.
12191 ///
12192 ///# Panics
12193 ///Panics if `vkCmdTraceRaysKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12194 ///
12195 ///# Usage Notes
12196 ///
12197 ///Dispatches rays into the scene. This is the primary ray tracing
12198 ///dispatch command, the ray tracing equivalent of `cmd_draw` or
12199 ///`cmd_dispatch`.
12200 ///
12201 ///Each of the four shader binding table (SBT) regions points to a
12202 ///device memory region containing shader group handles:
12203 ///
12204 ///- **Raygen**: exactly one entry, the ray generation shader.
12205 ///- **Miss**: shaders invoked when a ray hits nothing.
12206 ///- **Hit**: shader groups invoked on ray-geometry intersection.
12207 ///- **Callable**: shaders invoked explicitly from other stages.
12208 ///
12209 ///The `width`, `height`, and `depth` parameters define the 3D launch
12210 ///dimensions. Each invocation gets a unique `gl_LaunchIDEXT`. For
12211 ///a fullscreen ray trace, use the render target resolution with
12212 ///`depth = 1`.
12213 ///
12214 ///The SBT entries must be built from handles retrieved with
12215 ///`get_ray_tracing_shader_group_handles_khr`, stored in a buffer
12216 ///with `BUFFER_USAGE_SHADER_BINDING_TABLE`. Each region's `stride`
12217 ///must be a multiple of `shaderGroupHandleAlignment` and the base
12218 ///address must be aligned to `shaderGroupBaseAlignment`.
12219 pub unsafe fn cmd_trace_rays_khr(
12220 &self,
12221 command_buffer: CommandBuffer,
12222 p_raygen_shader_binding_table: &StridedDeviceAddressRegionKHR,
12223 p_miss_shader_binding_table: &StridedDeviceAddressRegionKHR,
12224 p_hit_shader_binding_table: &StridedDeviceAddressRegionKHR,
12225 p_callable_shader_binding_table: &StridedDeviceAddressRegionKHR,
12226 width: u32,
12227 height: u32,
12228 depth: u32,
12229 ) {
12230 let fp = self
12231 .commands()
12232 .cmd_trace_rays_khr
12233 .expect("vkCmdTraceRaysKHR not loaded");
12234 unsafe {
12235 fp(
12236 command_buffer,
12237 p_raygen_shader_binding_table,
12238 p_miss_shader_binding_table,
12239 p_hit_shader_binding_table,
12240 p_callable_shader_binding_table,
12241 width,
12242 height,
12243 depth,
12244 )
12245 };
12246 }
12247 ///Wraps [`vkCmdTraceRaysNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdTraceRaysNV.html).
12248 /**
12249 Provided by **VK_NV_ray_tracing**.*/
12250 ///
12251 ///# Safety
12252 ///- `commandBuffer` (self) must be valid and not destroyed.
12253 ///- `commandBuffer` must be externally synchronized.
12254 ///
12255 ///# Panics
12256 ///Panics if `vkCmdTraceRaysNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12257 ///
12258 ///# Usage Notes
12259 ///
12260 ///Dispatches a ray tracing workload using the NV ray tracing
12261 ///pipeline. Takes shader binding table buffer/offset/stride for
12262 ///each shader stage (raygen, miss, closest hit, callable) and the
12263 ///dispatch dimensions.
12264 ///
12265 ///This is the legacy NV path; prefer `cmd_trace_rays_khr` for new
12266 ///code.
12267 ///
12268 ///Requires `VK_NV_ray_tracing`.
12269 pub unsafe fn cmd_trace_rays_nv(
12270 &self,
12271 command_buffer: CommandBuffer,
12272 raygen_shader_binding_table_buffer: Buffer,
12273 raygen_shader_binding_offset: u64,
12274 miss_shader_binding_table_buffer: Buffer,
12275 miss_shader_binding_offset: u64,
12276 miss_shader_binding_stride: u64,
12277 hit_shader_binding_table_buffer: Buffer,
12278 hit_shader_binding_offset: u64,
12279 hit_shader_binding_stride: u64,
12280 callable_shader_binding_table_buffer: Buffer,
12281 callable_shader_binding_offset: u64,
12282 callable_shader_binding_stride: u64,
12283 width: u32,
12284 height: u32,
12285 depth: u32,
12286 ) {
12287 let fp = self
12288 .commands()
12289 .cmd_trace_rays_nv
12290 .expect("vkCmdTraceRaysNV not loaded");
12291 unsafe {
12292 fp(
12293 command_buffer,
12294 raygen_shader_binding_table_buffer,
12295 raygen_shader_binding_offset,
12296 miss_shader_binding_table_buffer,
12297 miss_shader_binding_offset,
12298 miss_shader_binding_stride,
12299 hit_shader_binding_table_buffer,
12300 hit_shader_binding_offset,
12301 hit_shader_binding_stride,
12302 callable_shader_binding_table_buffer,
12303 callable_shader_binding_offset,
12304 callable_shader_binding_stride,
12305 width,
12306 height,
12307 depth,
12308 )
12309 };
12310 }
12311 ///Wraps [`vkGetRayTracingShaderGroupHandlesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetRayTracingShaderGroupHandlesKHR.html).
12312 /**
12313 Provided by **VK_KHR_ray_tracing_pipeline**.*/
12314 ///
12315 ///# Errors
12316 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
12317 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
12318 ///- `VK_ERROR_UNKNOWN`
12319 ///- `VK_ERROR_VALIDATION_FAILED`
12320 ///
12321 ///# Safety
12322 ///- `device` (self) must be valid and not destroyed.
12323 ///
12324 ///# Panics
12325 ///Panics if `vkGetRayTracingShaderGroupHandlesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12326 ///
12327 ///# Usage Notes
12328 ///
12329 ///Retrieves opaque shader group handles from a ray tracing pipeline.
12330 ///These handles are copied into GPU-visible buffers to build the
12331 ///**shader binding table** (SBT) that `cmd_trace_rays_khr` indexes
12332 ///into.
12333 ///
12334 ///Each handle is `shaderGroupHandleSize` bytes (query from
12335 ///`PhysicalDeviceRayTracingPipelinePropertiesKHR`, typically 32
12336 ///bytes). The `p_data` buffer must be at least
12337 ///`group_count * shaderGroupHandleSize` bytes.
12338 ///
12339 ///`first_group` and `group_count` index into the `groups` array
12340 ///from `RayTracingPipelineCreateInfoKHR`. Handles are written
12341 ///sequentially, group `first_group` first, then
12342 ///`first_group + 1`, and so on.
12343 ///
12344 ///After retrieving handles, copy them into a buffer with
12345 ///`BUFFER_USAGE_SHADER_BINDING_TABLE` at the correct stride and
12346 ///alignment for each SBT region.
12347 pub unsafe fn get_ray_tracing_shader_group_handles_khr(
12348 &self,
12349 pipeline: Pipeline,
12350 first_group: u32,
12351 group_count: u32,
12352 data_size: usize,
12353 p_data: *mut core::ffi::c_void,
12354 ) -> VkResult<()> {
12355 let fp = self
12356 .commands()
12357 .get_ray_tracing_shader_group_handles_khr
12358 .expect("vkGetRayTracingShaderGroupHandlesKHR not loaded");
12359 check(unsafe {
12360 fp(
12361 self.handle(),
12362 pipeline,
12363 first_group,
12364 group_count,
12365 data_size,
12366 p_data,
12367 )
12368 })
12369 }
12370 ///Wraps [`vkGetRayTracingCaptureReplayShaderGroupHandlesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetRayTracingCaptureReplayShaderGroupHandlesKHR.html).
12371 /**
12372 Provided by **VK_KHR_ray_tracing_pipeline**.*/
12373 ///
12374 ///# Errors
12375 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
12376 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
12377 ///- `VK_ERROR_UNKNOWN`
12378 ///- `VK_ERROR_VALIDATION_FAILED`
12379 ///
12380 ///# Safety
12381 ///- `device` (self) must be valid and not destroyed.
12382 ///
12383 ///# Panics
12384 ///Panics if `vkGetRayTracingCaptureReplayShaderGroupHandlesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12385 ///
12386 ///# Usage Notes
12387 ///
12388 ///Retrieves opaque capture/replay handles for shader groups. These
12389 ///handles allow recreating a ray tracing pipeline with identical
12390 ///shader group assignments on a subsequent run, enabling
12391 ///deterministic replay of GPU traces.
12392 ///
12393 ///Use this for tools, profilers, and capture-replay frameworks.
12394 ///The handles are passed back via
12395 ///`RayTracingShaderGroupCreateInfoKHR::shader_group_capture_replay_handle`
12396 ///when recreating the pipeline.
12397 ///
12398 ///The pipeline must have been created with
12399 ///`PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY`.
12400 ///Requires the `rayTracingPipelineShaderGroupHandleCaptureReplay`
12401 ///device feature.
12402 ///
12403 ///The buffer layout is the same as
12404 ///`get_ray_tracing_shader_group_handles_khr`, sequential handles
12405 ///of `shaderGroupHandleSize` bytes each.
12406 pub unsafe fn get_ray_tracing_capture_replay_shader_group_handles_khr(
12407 &self,
12408 pipeline: Pipeline,
12409 first_group: u32,
12410 group_count: u32,
12411 data_size: usize,
12412 p_data: *mut core::ffi::c_void,
12413 ) -> VkResult<()> {
12414 let fp = self
12415 .commands()
12416 .get_ray_tracing_capture_replay_shader_group_handles_khr
12417 .expect("vkGetRayTracingCaptureReplayShaderGroupHandlesKHR not loaded");
12418 check(unsafe {
12419 fp(
12420 self.handle(),
12421 pipeline,
12422 first_group,
12423 group_count,
12424 data_size,
12425 p_data,
12426 )
12427 })
12428 }
12429 ///Wraps [`vkGetAccelerationStructureHandleNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetAccelerationStructureHandleNV.html).
12430 /**
12431 Provided by **VK_NV_ray_tracing**.*/
12432 ///
12433 ///# Errors
12434 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
12435 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
12436 ///- `VK_ERROR_UNKNOWN`
12437 ///- `VK_ERROR_VALIDATION_FAILED`
12438 ///
12439 ///# Safety
12440 ///- `device` (self) must be valid and not destroyed.
12441 ///
12442 ///# Panics
12443 ///Panics if `vkGetAccelerationStructureHandleNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12444 ///
12445 ///# Usage Notes
12446 ///
12447 ///Retrieves an opaque handle for an NV acceleration structure. This
12448 ///handle is used when building a top-level acceleration structure
12449 ///that references bottom-level structures.
12450 ///
12451 ///Requires `VK_NV_ray_tracing`.
12452 pub unsafe fn get_acceleration_structure_handle_nv(
12453 &self,
12454 acceleration_structure: AccelerationStructureNV,
12455 data_size: usize,
12456 p_data: *mut core::ffi::c_void,
12457 ) -> VkResult<()> {
12458 let fp = self
12459 .commands()
12460 .get_acceleration_structure_handle_nv
12461 .expect("vkGetAccelerationStructureHandleNV not loaded");
12462 check(unsafe { fp(self.handle(), acceleration_structure, data_size, p_data) })
12463 }
12464 ///Wraps [`vkCreateRayTracingPipelinesNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateRayTracingPipelinesNV.html).
12465 /**
12466 Provided by **VK_NV_ray_tracing**.*/
12467 ///
12468 ///# Errors
12469 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
12470 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
12471 ///- `VK_ERROR_INVALID_SHADER_NV`
12472 ///- `VK_ERROR_UNKNOWN`
12473 ///- `VK_ERROR_VALIDATION_FAILED`
12474 ///
12475 ///# Safety
12476 ///- `device` (self) must be valid and not destroyed.
12477 ///- `pipelineCache` must be externally synchronized.
12478 ///
12479 ///# Panics
12480 ///Panics if `vkCreateRayTracingPipelinesNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12481 ///
12482 ///# Usage Notes
12483 ///
12484 ///Creates one or more ray tracing pipelines using the NV model.
12485 ///This is the legacy NV path; prefer
12486 ///`create_ray_tracing_pipelines_khr` for new code.
12487 ///
12488 ///Supports a pipeline cache for faster subsequent creation.
12489 ///
12490 ///Requires `VK_NV_ray_tracing`.
12491 pub unsafe fn create_ray_tracing_pipelines_nv(
12492 &self,
12493 pipeline_cache: PipelineCache,
12494 p_create_infos: &[RayTracingPipelineCreateInfoNV],
12495 allocator: Option<&AllocationCallbacks>,
12496 ) -> VkResult<Vec<Pipeline>> {
12497 let fp = self
12498 .commands()
12499 .create_ray_tracing_pipelines_nv
12500 .expect("vkCreateRayTracingPipelinesNV not loaded");
12501 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
12502 let count = p_create_infos.len();
12503 let mut out = vec![unsafe { core::mem::zeroed() }; count];
12504 check(unsafe {
12505 fp(
12506 self.handle(),
12507 pipeline_cache,
12508 p_create_infos.len() as u32,
12509 p_create_infos.as_ptr(),
12510 alloc_ptr,
12511 out.as_mut_ptr(),
12512 )
12513 })?;
12514 Ok(out)
12515 }
12516 ///Wraps [`vkCreateRayTracingPipelinesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateRayTracingPipelinesKHR.html).
12517 /**
12518 Provided by **VK_KHR_ray_tracing_pipeline**.*/
12519 ///
12520 ///# Errors
12521 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
12522 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
12523 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS`
12524 ///- `VK_ERROR_UNKNOWN`
12525 ///- `VK_ERROR_VALIDATION_FAILED`
12526 ///
12527 ///# Safety
12528 ///- `device` (self) must be valid and not destroyed.
12529 ///- `pipelineCache` must be externally synchronized.
12530 ///
12531 ///# Panics
12532 ///Panics if `vkCreateRayTracingPipelinesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12533 ///
12534 ///# Usage Notes
12535 ///
12536 ///Creates one or more ray tracing pipelines. A ray tracing pipeline
12537 ///contains the shader stages (ray generation, miss, closest hit,
12538 ///any hit, intersection, callable) and shader groups that define
12539 ///how rays interact with geometry.
12540 ///
12541 ///Unlike graphics pipelines, ray tracing pipelines organize shaders
12542 ///into **groups**:
12543 ///
12544 ///- **General**: ray generation, miss, or callable shaders.
12545 ///- **Triangles hit**: closest hit + optional any hit for triangles.
12546 ///- **Procedural hit**: intersection + closest hit + optional any hit
12547 /// for custom geometry (AABBs).
12548 ///
12549 ///Pass a `DeferredOperationKHR` handle to compile asynchronously,
12550 ///the call returns `OPERATION_DEFERRED_KHR` and the pipeline handles
12551 ///are not valid until the deferred operation completes. Pass a null
12552 ///handle for synchronous creation.
12553 ///
12554 ///Supports `pipeline_cache` for faster creation on subsequent runs
12555 ///and `base_pipeline_handle` / `base_pipeline_index` for derivative
12556 ///pipelines when `PIPELINE_CREATE_DERIVATIVE` is set.
12557 ///
12558 ///After creation, retrieve shader group handles with
12559 ///`get_ray_tracing_shader_group_handles_khr` to build the shader
12560 ///binding table.
12561 pub unsafe fn create_ray_tracing_pipelines_khr(
12562 &self,
12563 deferred_operation: DeferredOperationKHR,
12564 pipeline_cache: PipelineCache,
12565 p_create_infos: &[RayTracingPipelineCreateInfoKHR],
12566 allocator: Option<&AllocationCallbacks>,
12567 ) -> VkResult<Vec<Pipeline>> {
12568 let fp = self
12569 .commands()
12570 .create_ray_tracing_pipelines_khr
12571 .expect("vkCreateRayTracingPipelinesKHR not loaded");
12572 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
12573 let count = p_create_infos.len();
12574 let mut out = vec![unsafe { core::mem::zeroed() }; count];
12575 check(unsafe {
12576 fp(
12577 self.handle(),
12578 deferred_operation,
12579 pipeline_cache,
12580 p_create_infos.len() as u32,
12581 p_create_infos.as_ptr(),
12582 alloc_ptr,
12583 out.as_mut_ptr(),
12584 )
12585 })?;
12586 Ok(out)
12587 }
12588 ///Wraps [`vkCmdTraceRaysIndirectKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdTraceRaysIndirectKHR.html).
12589 /**
12590 Provided by **VK_KHR_ray_tracing_pipeline**.*/
12591 ///
12592 ///# Safety
12593 ///- `commandBuffer` (self) must be valid and not destroyed.
12594 ///- `commandBuffer` must be externally synchronized.
12595 ///
12596 ///# Panics
12597 ///Panics if `vkCmdTraceRaysIndirectKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12598 ///
12599 ///# Usage Notes
12600 ///
12601 ///Dispatches rays with launch dimensions read from a GPU buffer.
12602 ///Identical to `cmd_trace_rays_khr` except the `width`, `height`,
12603 ///and `depth` are sourced from a `TraceRaysIndirectCommandKHR`
12604 ///struct at `indirect_device_address`.
12605 ///
12606 ///This enables the GPU to determine ray dispatch dimensions without
12607 ///a CPU round-trip, useful when the dispatch size depends on prior
12608 ///GPU work such as culling, tile classification, or adaptive
12609 ///sampling.
12610 ///
12611 ///The indirect buffer must have been created with
12612 ///`BUFFER_USAGE_INDIRECT_BUFFER` and the address must be aligned
12613 ///to 4 bytes. The SBT parameters are still provided directly on
12614 ///the CPU side.
12615 ///
12616 ///Requires the `rayTracingPipelineTraceRaysIndirect` feature.
12617 pub unsafe fn cmd_trace_rays_indirect_khr(
12618 &self,
12619 command_buffer: CommandBuffer,
12620 p_raygen_shader_binding_table: &StridedDeviceAddressRegionKHR,
12621 p_miss_shader_binding_table: &StridedDeviceAddressRegionKHR,
12622 p_hit_shader_binding_table: &StridedDeviceAddressRegionKHR,
12623 p_callable_shader_binding_table: &StridedDeviceAddressRegionKHR,
12624 indirect_device_address: u64,
12625 ) {
12626 let fp = self
12627 .commands()
12628 .cmd_trace_rays_indirect_khr
12629 .expect("vkCmdTraceRaysIndirectKHR not loaded");
12630 unsafe {
12631 fp(
12632 command_buffer,
12633 p_raygen_shader_binding_table,
12634 p_miss_shader_binding_table,
12635 p_hit_shader_binding_table,
12636 p_callable_shader_binding_table,
12637 indirect_device_address,
12638 )
12639 };
12640 }
12641 ///Wraps [`vkCmdTraceRaysIndirect2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdTraceRaysIndirect2KHR.html).
12642 /**
12643 Provided by **VK_KHR_ray_tracing_maintenance1**.*/
12644 ///
12645 ///# Safety
12646 ///- `commandBuffer` (self) must be valid and not destroyed.
12647 ///- `commandBuffer` must be externally synchronized.
12648 ///
12649 ///# Panics
12650 ///Panics if `vkCmdTraceRaysIndirect2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12651 ///
12652 ///# Usage Notes
12653 ///
12654 ///Fully indirect ray dispatch, both the shader binding table
12655 ///addresses and the launch dimensions are read from a GPU buffer.
12656 ///This is the most flexible ray tracing dispatch.
12657 ///
12658 ///The `indirect_device_address` points to a
12659 ///`TraceRaysIndirectCommand2KHR` struct on the device, which
12660 ///contains all four SBT regions (raygen, miss, hit, callable) plus
12661 ///the `width`, `height`, and `depth`.
12662 ///
12663 ///This allows the GPU to dynamically select which shaders to use
12664 ///and how many rays to launch, enabling advanced techniques like
12665 ///GPU-driven material sorting or multi-pass ray tracing without
12666 ///CPU synchronization.
12667 ///
12668 ///Provided by `VK_KHR_ray_tracing_maintenance1`, not the base
12669 ///ray tracing pipeline extension. Requires the
12670 ///`rayTracingPipelineTraceRaysIndirect2` feature.
12671 pub unsafe fn cmd_trace_rays_indirect2_khr(
12672 &self,
12673 command_buffer: CommandBuffer,
12674 indirect_device_address: u64,
12675 ) {
12676 let fp = self
12677 .commands()
12678 .cmd_trace_rays_indirect2_khr
12679 .expect("vkCmdTraceRaysIndirect2KHR not loaded");
12680 unsafe { fp(command_buffer, indirect_device_address) };
12681 }
12682 ///Wraps [`vkGetClusterAccelerationStructureBuildSizesNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetClusterAccelerationStructureBuildSizesNV.html).
12683 /**
12684 Provided by **VK_NV_cluster_acceleration_structure**.*/
12685 ///
12686 ///# Safety
12687 ///- `device` (self) must be valid and not destroyed.
12688 ///
12689 ///# Panics
12690 ///Panics if `vkGetClusterAccelerationStructureBuildSizesNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12691 ///
12692 ///# Usage Notes
12693 ///
12694 ///Queries the buffer sizes needed to build a cluster acceleration
12695 ///structure. Use the returned sizes to allocate the destination
12696 ///and scratch buffers before building.
12697 ///
12698 ///Requires `VK_NV_cluster_acceleration_structure`.
12699 pub unsafe fn get_cluster_acceleration_structure_build_sizes_nv(
12700 &self,
12701 p_info: &ClusterAccelerationStructureInputInfoNV,
12702 p_size_info: &mut AccelerationStructureBuildSizesInfoKHR,
12703 ) {
12704 let fp = self
12705 .commands()
12706 .get_cluster_acceleration_structure_build_sizes_nv
12707 .expect("vkGetClusterAccelerationStructureBuildSizesNV not loaded");
12708 unsafe { fp(self.handle(), p_info, p_size_info) };
12709 }
12710 ///Wraps [`vkCmdBuildClusterAccelerationStructureIndirectNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBuildClusterAccelerationStructureIndirectNV.html).
12711 /**
12712 Provided by **VK_NV_cluster_acceleration_structure**.*/
12713 ///
12714 ///# Safety
12715 ///- `commandBuffer` (self) must be valid and not destroyed.
12716 ///- `commandBuffer` must be externally synchronized.
12717 ///
12718 ///# Panics
12719 ///Panics if `vkCmdBuildClusterAccelerationStructureIndirectNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12720 ///
12721 ///# Usage Notes
12722 ///
12723 ///Builds a cluster acceleration structure using indirect parameters.
12724 ///Cluster acceleration structures organize geometry into spatial
12725 ///clusters for more efficient ray traversal on NVIDIA hardware.
12726 ///
12727 ///Requires `VK_NV_cluster_acceleration_structure`.
12728 pub unsafe fn cmd_build_cluster_acceleration_structure_indirect_nv(
12729 &self,
12730 command_buffer: CommandBuffer,
12731 p_command_infos: &ClusterAccelerationStructureCommandsInfoNV,
12732 ) {
12733 let fp = self
12734 .commands()
12735 .cmd_build_cluster_acceleration_structure_indirect_nv
12736 .expect("vkCmdBuildClusterAccelerationStructureIndirectNV not loaded");
12737 unsafe { fp(command_buffer, p_command_infos) };
12738 }
12739 ///Wraps [`vkGetDeviceAccelerationStructureCompatibilityKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceAccelerationStructureCompatibilityKHR.html).
12740 /**
12741 Provided by **VK_KHR_acceleration_structure**.*/
12742 ///
12743 ///# Safety
12744 ///- `device` (self) must be valid and not destroyed.
12745 ///
12746 ///# Panics
12747 ///Panics if `vkGetDeviceAccelerationStructureCompatibilityKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12748 ///
12749 ///# Usage Notes
12750 ///
12751 ///Checks whether a serialized acceleration structure (from
12752 ///`copy_acceleration_structure_to_memory_khr`) is compatible with
12753 ///this device and can be deserialized.
12754 ///
12755 ///Returns `ACCELERATION_STRUCTURE_COMPATIBILITY_COMPATIBLE` if the
12756 ///data can be loaded, or `INCOMPATIBLE` if not. Incompatibility
12757 ///typically means the data was serialized on different hardware or a
12758 ///different driver version.
12759 ///
12760 ///Check compatibility before attempting deserialization to avoid
12761 ///errors.
12762 pub unsafe fn get_device_acceleration_structure_compatibility_khr(
12763 &self,
12764 p_version_info: &AccelerationStructureVersionInfoKHR,
12765 ) -> AccelerationStructureCompatibilityKHR {
12766 let fp = self
12767 .commands()
12768 .get_device_acceleration_structure_compatibility_khr
12769 .expect("vkGetDeviceAccelerationStructureCompatibilityKHR not loaded");
12770 let mut out = unsafe { core::mem::zeroed() };
12771 unsafe { fp(self.handle(), p_version_info, &mut out) };
12772 out
12773 }
12774 ///Wraps [`vkGetRayTracingShaderGroupStackSizeKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetRayTracingShaderGroupStackSizeKHR.html).
12775 /**
12776 Provided by **VK_KHR_ray_tracing_pipeline**.*/
12777 ///
12778 ///# Safety
12779 ///- `device` (self) must be valid and not destroyed.
12780 ///
12781 ///# Panics
12782 ///Panics if `vkGetRayTracingShaderGroupStackSizeKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12783 ///
12784 ///# Usage Notes
12785 ///
12786 ///Queries the stack size contribution of a single shader within a
12787 ///shader group. The result is used to compute the total pipeline
12788 ///stack size for `cmd_set_ray_tracing_pipeline_stack_size_khr`.
12789 ///
12790 ///`group` indexes into the shader groups array from pipeline
12791 ///creation. `group_shader` selects which shader within the group:
12792 ///`GENERAL`, `CLOSEST_HIT`, `ANY_HIT`, or `INTERSECTION`.
12793 ///
12794 ///The default pipeline stack size is computed automatically at
12795 ///creation time, but it assumes worst-case recursion. If you know
12796 ///your actual `maxPipelineRayRecursionDepth` is lower, query
12797 ///individual stack sizes and compute a tighter total to reduce
12798 ///scratch memory usage.
12799 ///
12800 ///Stack size computation formula (from spec):
12801 ///
12802 ///`raygen + max(closesthit + intersection, miss, callable) * maxRecursionDepth`
12803 ///
12804 ///Call this per-shader, aggregate across all groups, then set the
12805 ///result with `cmd_set_ray_tracing_pipeline_stack_size_khr`.
12806 pub unsafe fn get_ray_tracing_shader_group_stack_size_khr(
12807 &self,
12808 pipeline: Pipeline,
12809 group: u32,
12810 group_shader: ShaderGroupShaderKHR,
12811 ) {
12812 let fp = self
12813 .commands()
12814 .get_ray_tracing_shader_group_stack_size_khr
12815 .expect("vkGetRayTracingShaderGroupStackSizeKHR not loaded");
12816 unsafe { fp(self.handle(), pipeline, group, group_shader) };
12817 }
12818 ///Wraps [`vkCmdSetRayTracingPipelineStackSizeKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetRayTracingPipelineStackSizeKHR.html).
12819 /**
12820 Provided by **VK_KHR_ray_tracing_pipeline**.*/
12821 ///
12822 ///# Safety
12823 ///- `commandBuffer` (self) must be valid and not destroyed.
12824 ///- `commandBuffer` must be externally synchronized.
12825 ///
12826 ///# Panics
12827 ///Panics if `vkCmdSetRayTracingPipelineStackSizeKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12828 ///
12829 ///# Usage Notes
12830 ///
12831 ///Overrides the default ray tracing pipeline stack size for the
12832 ///bound pipeline. The stack is scratch memory used during shader
12833 ///execution and recursion.
12834 ///
12835 ///The default stack size (set at pipeline creation) assumes
12836 ///worst-case recursion depth across all shader groups. If your
12837 ///application uses a lower effective recursion depth or only a
12838 ///subset of shader groups, setting a smaller stack size reduces
12839 ///per-invocation memory usage and may improve occupancy.
12840 ///
12841 ///Compute the required size by querying individual shader
12842 ///contributions with `get_ray_tracing_shader_group_stack_size_khr`
12843 ///and applying the recursion formula from the spec.
12844 ///
12845 ///This is a dynamic state command, it takes effect for subsequent
12846 ///`cmd_trace_rays_khr` calls within the same command buffer.
12847 ///Binding a new pipeline resets the stack size to the pipeline's
12848 ///default.
12849 pub unsafe fn cmd_set_ray_tracing_pipeline_stack_size_khr(
12850 &self,
12851 command_buffer: CommandBuffer,
12852 pipeline_stack_size: u32,
12853 ) {
12854 let fp = self
12855 .commands()
12856 .cmd_set_ray_tracing_pipeline_stack_size_khr
12857 .expect("vkCmdSetRayTracingPipelineStackSizeKHR not loaded");
12858 unsafe { fp(command_buffer, pipeline_stack_size) };
12859 }
12860 ///Wraps [`vkGetImageViewHandleNVX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageViewHandleNVX.html).
12861 /**
12862 Provided by **VK_NVX_image_view_handle**.*/
12863 ///
12864 ///# Safety
12865 ///- `device` (self) must be valid and not destroyed.
12866 ///
12867 ///# Panics
12868 ///Panics if `vkGetImageViewHandleNVX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12869 ///
12870 ///# Usage Notes
12871 ///
12872 ///Returns a 32-bit handle for an image view that can be used as a
12873 ///bindless descriptor index. Use with `get_image_view_address_nvx`
12874 ///for fully bindless texture access.
12875 ///
12876 ///Requires `VK_NVX_image_view_handle`.
12877 pub unsafe fn get_image_view_handle_nvx(&self, p_info: &ImageViewHandleInfoNVX) {
12878 let fp = self
12879 .commands()
12880 .get_image_view_handle_nvx
12881 .expect("vkGetImageViewHandleNVX not loaded");
12882 unsafe { fp(self.handle(), p_info) };
12883 }
12884 ///Wraps [`vkGetImageViewHandle64NVX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageViewHandle64NVX.html).
12885 /**
12886 Provided by **VK_NVX_image_view_handle**.*/
12887 ///
12888 ///# Safety
12889 ///- `device` (self) must be valid and not destroyed.
12890 ///
12891 ///# Panics
12892 ///Panics if `vkGetImageViewHandle64NVX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12893 ///
12894 ///# Usage Notes
12895 ///
12896 ///Returns a 64-bit handle for an image view. The 64-bit variant
12897 ///accommodates larger descriptor heaps than the 32-bit
12898 ///`get_image_view_handle_nvx`.
12899 ///
12900 ///Requires `VK_NVX_image_view_handle`.
12901 pub unsafe fn get_image_view_handle64_nvx(&self, p_info: &ImageViewHandleInfoNVX) {
12902 let fp = self
12903 .commands()
12904 .get_image_view_handle64_nvx
12905 .expect("vkGetImageViewHandle64NVX not loaded");
12906 unsafe { fp(self.handle(), p_info) };
12907 }
12908 ///Wraps [`vkGetImageViewAddressNVX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageViewAddressNVX.html).
12909 /**
12910 Provided by **VK_NVX_image_view_handle**.*/
12911 ///
12912 ///# Errors
12913 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
12914 ///- `VK_ERROR_UNKNOWN`
12915 ///- `VK_ERROR_VALIDATION_FAILED`
12916 ///
12917 ///# Safety
12918 ///- `device` (self) must be valid and not destroyed.
12919 ///
12920 ///# Panics
12921 ///Panics if `vkGetImageViewAddressNVX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12922 ///
12923 ///# Usage Notes
12924 ///
12925 ///Queries the device address and size of an image view's descriptor
12926 ///data. The address can be used for raw pointer-based descriptor
12927 ///access in shaders.
12928 ///
12929 ///Requires `VK_NVX_image_view_handle`.
12930 pub unsafe fn get_image_view_address_nvx(
12931 &self,
12932 image_view: ImageView,
12933 p_properties: &mut ImageViewAddressPropertiesNVX,
12934 ) -> VkResult<()> {
12935 let fp = self
12936 .commands()
12937 .get_image_view_address_nvx
12938 .expect("vkGetImageViewAddressNVX not loaded");
12939 check(unsafe { fp(self.handle(), image_view, p_properties) })
12940 }
12941 ///Wraps [`vkGetDeviceCombinedImageSamplerIndexNVX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceCombinedImageSamplerIndexNVX.html).
12942 /**
12943 Provided by **VK_NVX_image_view_handle**.*/
12944 ///
12945 ///# Safety
12946 ///- `device` (self) must be valid and not destroyed.
12947 ///
12948 ///# Panics
12949 ///Panics if `vkGetDeviceCombinedImageSamplerIndexNVX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12950 ///
12951 ///# Usage Notes
12952 ///
12953 ///Returns the combined image-sampler descriptor index for a given
12954 ///image view and sampler pair. Used for bindless combined image-
12955 ///sampler access.
12956 ///
12957 ///Requires `VK_NVX_image_view_handle`.
12958 pub unsafe fn get_device_combined_image_sampler_index_nvx(
12959 &self,
12960 image_view_index: u64,
12961 sampler_index: u64,
12962 ) {
12963 let fp = self
12964 .commands()
12965 .get_device_combined_image_sampler_index_nvx
12966 .expect("vkGetDeviceCombinedImageSamplerIndexNVX not loaded");
12967 unsafe { fp(self.handle(), image_view_index, sampler_index) };
12968 }
12969 ///Wraps [`vkGetDeviceGroupSurfacePresentModes2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceGroupSurfacePresentModes2EXT.html).
12970 /**
12971 Provided by **VK_EXT_full_screen_exclusive**.*/
12972 ///
12973 ///# Errors
12974 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
12975 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
12976 ///- `VK_ERROR_SURFACE_LOST_KHR`
12977 ///- `VK_ERROR_UNKNOWN`
12978 ///- `VK_ERROR_VALIDATION_FAILED`
12979 ///
12980 ///# Safety
12981 ///- `device` (self) must be valid and not destroyed.
12982 ///
12983 ///# Panics
12984 ///Panics if `vkGetDeviceGroupSurfacePresentModes2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12985 ///
12986 ///# Usage Notes
12987 ///
12988 ///Queries the supported present modes for a device group and surface,
12989 ///using the extended surface info structure. This is the
12990 ///`VK_EXT_full_screen_exclusive` variant of
12991 ///`get_device_group_surface_present_modes_khr`, allowing full-screen
12992 ///exclusive configuration to be factored into the query.
12993 ///
12994 ///Requires `VK_EXT_full_screen_exclusive`. Windows only.
12995 pub unsafe fn get_device_group_surface_present_modes2_ext(
12996 &self,
12997 p_surface_info: &PhysicalDeviceSurfaceInfo2KHR,
12998 ) -> VkResult<DeviceGroupPresentModeFlagsKHR> {
12999 let fp = self
13000 .commands()
13001 .get_device_group_surface_present_modes2_ext
13002 .expect("vkGetDeviceGroupSurfacePresentModes2EXT not loaded");
13003 let mut out = unsafe { core::mem::zeroed() };
13004 check(unsafe { fp(self.handle(), p_surface_info, &mut out) })?;
13005 Ok(out)
13006 }
13007 ///Wraps [`vkAcquireFullScreenExclusiveModeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAcquireFullScreenExclusiveModeEXT.html).
13008 /**
13009 Provided by **VK_EXT_full_screen_exclusive**.*/
13010 ///
13011 ///# Errors
13012 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13013 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
13014 ///- `VK_ERROR_INITIALIZATION_FAILED`
13015 ///- `VK_ERROR_SURFACE_LOST_KHR`
13016 ///- `VK_ERROR_UNKNOWN`
13017 ///- `VK_ERROR_VALIDATION_FAILED`
13018 ///
13019 ///# Safety
13020 ///- `device` (self) must be valid and not destroyed.
13021 ///
13022 ///# Panics
13023 ///Panics if `vkAcquireFullScreenExclusiveModeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13024 ///
13025 ///# Usage Notes
13026 ///
13027 ///Acquires full-screen exclusive mode for a swapchain, giving the
13028 ///application direct control over the display output. This can
13029 ///reduce latency and enable adaptive sync.
13030 ///
13031 ///The swapchain must have been created with
13032 ///`SurfaceFullScreenExclusiveInfoEXT` in its pNext chain.
13033 ///Release with `release_full_screen_exclusive_mode_ext`.
13034 ///
13035 ///Requires `VK_EXT_full_screen_exclusive`. Windows only.
13036 pub unsafe fn acquire_full_screen_exclusive_mode_ext(
13037 &self,
13038 swapchain: SwapchainKHR,
13039 ) -> VkResult<()> {
13040 let fp = self
13041 .commands()
13042 .acquire_full_screen_exclusive_mode_ext
13043 .expect("vkAcquireFullScreenExclusiveModeEXT not loaded");
13044 check(unsafe { fp(self.handle(), swapchain) })
13045 }
13046 ///Wraps [`vkReleaseFullScreenExclusiveModeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkReleaseFullScreenExclusiveModeEXT.html).
13047 /**
13048 Provided by **VK_EXT_full_screen_exclusive**.*/
13049 ///
13050 ///# Errors
13051 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13052 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
13053 ///- `VK_ERROR_SURFACE_LOST_KHR`
13054 ///- `VK_ERROR_UNKNOWN`
13055 ///- `VK_ERROR_VALIDATION_FAILED`
13056 ///
13057 ///# Safety
13058 ///- `device` (self) must be valid and not destroyed.
13059 ///
13060 ///# Panics
13061 ///Panics if `vkReleaseFullScreenExclusiveModeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13062 ///
13063 ///# Usage Notes
13064 ///
13065 ///Releases full-screen exclusive mode previously acquired with
13066 ///`acquire_full_screen_exclusive_mode_ext`. The swapchain returns
13067 ///to shared/composed presentation.
13068 ///
13069 ///Requires `VK_EXT_full_screen_exclusive`. Windows only.
13070 pub unsafe fn release_full_screen_exclusive_mode_ext(
13071 &self,
13072 swapchain: SwapchainKHR,
13073 ) -> VkResult<()> {
13074 let fp = self
13075 .commands()
13076 .release_full_screen_exclusive_mode_ext
13077 .expect("vkReleaseFullScreenExclusiveModeEXT not loaded");
13078 check(unsafe { fp(self.handle(), swapchain) })
13079 }
13080 ///Wraps [`vkAcquireProfilingLockKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAcquireProfilingLockKHR.html).
13081 /**
13082 Provided by **VK_KHR_performance_query**.*/
13083 ///
13084 ///# Errors
13085 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13086 ///- `VK_TIMEOUT`
13087 ///- `VK_ERROR_UNKNOWN`
13088 ///- `VK_ERROR_VALIDATION_FAILED`
13089 ///
13090 ///# Safety
13091 ///- `device` (self) must be valid and not destroyed.
13092 ///
13093 ///# Panics
13094 ///Panics if `vkAcquireProfilingLockKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13095 ///
13096 ///# Usage Notes
13097 ///
13098 ///Acquires the device profiling lock, which must be held while
13099 ///submitting command buffers that contain performance queries.
13100 ///Only one thread can hold the lock at a time.
13101 ///
13102 ///The `AcquireProfilingLockInfoKHR` specifies a timeout in
13103 ///nanoseconds. Returns `TIMEOUT` if the lock cannot be acquired
13104 ///within that period.
13105 ///
13106 ///Release with `release_profiling_lock_khr` when profiling
13107 ///submission is complete.
13108 ///
13109 ///Requires `VK_KHR_performance_query`.
13110 pub unsafe fn acquire_profiling_lock_khr(
13111 &self,
13112 p_info: &AcquireProfilingLockInfoKHR,
13113 ) -> VkResult<()> {
13114 let fp = self
13115 .commands()
13116 .acquire_profiling_lock_khr
13117 .expect("vkAcquireProfilingLockKHR not loaded");
13118 check(unsafe { fp(self.handle(), p_info) })
13119 }
13120 ///Wraps [`vkReleaseProfilingLockKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkReleaseProfilingLockKHR.html).
13121 /**
13122 Provided by **VK_KHR_performance_query**.*/
13123 ///
13124 ///# Safety
13125 ///- `device` (self) must be valid and not destroyed.
13126 ///
13127 ///# Panics
13128 ///Panics if `vkReleaseProfilingLockKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13129 ///
13130 ///# Usage Notes
13131 ///
13132 ///Releases the device profiling lock previously acquired with
13133 ///`acquire_profiling_lock_khr`. Must be called after all command
13134 ///buffers containing performance queries have been submitted.
13135 ///
13136 ///Requires `VK_KHR_performance_query`.
13137 pub unsafe fn release_profiling_lock_khr(&self) {
13138 let fp = self
13139 .commands()
13140 .release_profiling_lock_khr
13141 .expect("vkReleaseProfilingLockKHR not loaded");
13142 unsafe { fp(self.handle()) };
13143 }
13144 ///Wraps [`vkGetImageDrmFormatModifierPropertiesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageDrmFormatModifierPropertiesEXT.html).
13145 /**
13146 Provided by **VK_EXT_image_drm_format_modifier**.*/
13147 ///
13148 ///# Errors
13149 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13150 ///- `VK_ERROR_UNKNOWN`
13151 ///- `VK_ERROR_VALIDATION_FAILED`
13152 ///
13153 ///# Safety
13154 ///- `device` (self) must be valid and not destroyed.
13155 ///
13156 ///# Panics
13157 ///Panics if `vkGetImageDrmFormatModifierPropertiesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13158 ///
13159 ///# Usage Notes
13160 ///
13161 ///Queries which DRM format modifier was selected for an image
13162 ///created with `VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT`. The
13163 ///chosen modifier determines the memory layout and is needed
13164 ///when sharing the image with other DRM/KMS clients.
13165 ///
13166 ///Requires `VK_EXT_image_drm_format_modifier`.
13167 pub unsafe fn get_image_drm_format_modifier_properties_ext(
13168 &self,
13169 image: Image,
13170 p_properties: &mut ImageDrmFormatModifierPropertiesEXT,
13171 ) -> VkResult<()> {
13172 let fp = self
13173 .commands()
13174 .get_image_drm_format_modifier_properties_ext
13175 .expect("vkGetImageDrmFormatModifierPropertiesEXT not loaded");
13176 check(unsafe { fp(self.handle(), image, p_properties) })
13177 }
13178 ///Wraps [`vkGetBufferOpaqueCaptureAddress`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetBufferOpaqueCaptureAddress.html).
13179 /**
13180 Provided by **VK_BASE_VERSION_1_2**.*/
13181 ///
13182 ///# Safety
13183 ///- `device` (self) must be valid and not destroyed.
13184 ///
13185 ///# Panics
13186 ///Panics if `vkGetBufferOpaqueCaptureAddress` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13187 ///
13188 ///# Usage Notes
13189 ///
13190 ///Returns an opaque capture address for a buffer that was created with
13191 ///`BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY`. This address is used
13192 ///to recreate the buffer at the same virtual address in a replay
13193 ///session (e.g. for GPU crash dump replay or deterministic replay
13194 ///tools).
13195 ///
13196 ///Most applications do not need this, it is primarily for debugging
13197 ///and profiling tools. Use `get_buffer_device_address` for runtime
13198 ///buffer address access.
13199 pub unsafe fn get_buffer_opaque_capture_address(&self, p_info: &BufferDeviceAddressInfo) {
13200 let fp = self
13201 .commands()
13202 .get_buffer_opaque_capture_address
13203 .expect("vkGetBufferOpaqueCaptureAddress not loaded");
13204 unsafe { fp(self.handle(), p_info) };
13205 }
13206 ///Wraps [`vkGetBufferDeviceAddress`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetBufferDeviceAddress.html).
13207 /**
13208 Provided by **VK_BASE_VERSION_1_2**.*/
13209 ///
13210 ///# Safety
13211 ///- `device` (self) must be valid and not destroyed.
13212 ///
13213 ///# Panics
13214 ///Panics if `vkGetBufferDeviceAddress` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13215 ///
13216 ///# Usage Notes
13217 ///
13218 ///Returns a 64-bit GPU virtual address for a buffer. This address can
13219 ///be passed to shaders via push constants or descriptors, enabling
13220 ///direct pointer-style access to buffer data from GPU code.
13221 ///
13222 ///The buffer must have been created with
13223 ///`BUFFER_USAGE_SHADER_DEVICE_ADDRESS` and the
13224 ///`buffer_device_address` feature must be enabled.
13225 ///
13226 ///**Use cases**:
13227 ///
13228 ///- **Bindless rendering**: pass buffer addresses in a storage buffer
13229 /// or push constant instead of binding individual descriptors.
13230 ///- **Acceleration structures**: ray tracing BLASes and TLASes
13231 /// reference geometry buffers by device address.
13232 ///- **GPU-driven pipelines**: indirect command generators read vertex
13233 /// and index data by address.
13234 ///
13235 ///The address remains valid for the lifetime of the buffer. If the
13236 ///buffer was created with
13237 ///`BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY`, the address can be
13238 ///captured and replayed across sessions.
13239 pub unsafe fn get_buffer_device_address(&self, p_info: &BufferDeviceAddressInfo) {
13240 let fp = self
13241 .commands()
13242 .get_buffer_device_address
13243 .expect("vkGetBufferDeviceAddress not loaded");
13244 unsafe { fp(self.handle(), p_info) };
13245 }
13246 ///Wraps [`vkInitializePerformanceApiINTEL`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkInitializePerformanceApiINTEL.html).
13247 /**
13248 Provided by **VK_INTEL_performance_query**.*/
13249 ///
13250 ///# Errors
13251 ///- `VK_ERROR_TOO_MANY_OBJECTS`
13252 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13253 ///- `VK_ERROR_UNKNOWN`
13254 ///- `VK_ERROR_VALIDATION_FAILED`
13255 ///
13256 ///# Safety
13257 ///- `device` (self) must be valid and not destroyed.
13258 ///
13259 ///# Panics
13260 ///Panics if `vkInitializePerformanceApiINTEL` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13261 ///
13262 ///# Usage Notes
13263 ///
13264 ///Initializes the Intel performance query API on a device. Must be
13265 ///called before using any other Intel performance query commands.
13266 ///Uninitialize with `uninitialize_performance_api_intel`.
13267 ///
13268 ///Requires `VK_INTEL_performance_query`.
13269 pub unsafe fn initialize_performance_api_intel(
13270 &self,
13271 p_initialize_info: &InitializePerformanceApiInfoINTEL,
13272 ) -> VkResult<()> {
13273 let fp = self
13274 .commands()
13275 .initialize_performance_api_intel
13276 .expect("vkInitializePerformanceApiINTEL not loaded");
13277 check(unsafe { fp(self.handle(), p_initialize_info) })
13278 }
13279 ///Wraps [`vkUninitializePerformanceApiINTEL`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkUninitializePerformanceApiINTEL.html).
13280 /**
13281 Provided by **VK_INTEL_performance_query**.*/
13282 ///
13283 ///# Safety
13284 ///- `device` (self) must be valid and not destroyed.
13285 ///
13286 ///# Panics
13287 ///Panics if `vkUninitializePerformanceApiINTEL` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13288 ///
13289 ///# Usage Notes
13290 ///
13291 ///Shuts down the Intel performance query API on a device, releasing
13292 ///any internal resources. Call when performance profiling is
13293 ///complete.
13294 ///
13295 ///Requires `VK_INTEL_performance_query`.
13296 pub unsafe fn uninitialize_performance_api_intel(&self) {
13297 let fp = self
13298 .commands()
13299 .uninitialize_performance_api_intel
13300 .expect("vkUninitializePerformanceApiINTEL not loaded");
13301 unsafe { fp(self.handle()) };
13302 }
13303 ///Wraps [`vkCmdSetPerformanceMarkerINTEL`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetPerformanceMarkerINTEL.html).
13304 /**
13305 Provided by **VK_INTEL_performance_query**.*/
13306 ///
13307 ///# Errors
13308 ///- `VK_ERROR_TOO_MANY_OBJECTS`
13309 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13310 ///- `VK_ERROR_UNKNOWN`
13311 ///- `VK_ERROR_VALIDATION_FAILED`
13312 ///
13313 ///# Safety
13314 ///- `commandBuffer` (self) must be valid and not destroyed.
13315 ///- `commandBuffer` must be externally synchronized.
13316 ///
13317 ///# Panics
13318 ///Panics if `vkCmdSetPerformanceMarkerINTEL` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13319 ///
13320 ///# Usage Notes
13321 ///
13322 ///Sets a performance marker in the command buffer to delimit a
13323 ///region of interest for Intel GPU profiling. Counters sampled
13324 ///between markers are attributed to the marked region.
13325 ///
13326 ///Requires `VK_INTEL_performance_query`.
13327 pub unsafe fn cmd_set_performance_marker_intel(
13328 &self,
13329 command_buffer: CommandBuffer,
13330 p_marker_info: &PerformanceMarkerInfoINTEL,
13331 ) -> VkResult<()> {
13332 let fp = self
13333 .commands()
13334 .cmd_set_performance_marker_intel
13335 .expect("vkCmdSetPerformanceMarkerINTEL not loaded");
13336 check(unsafe { fp(command_buffer, p_marker_info) })
13337 }
13338 ///Wraps [`vkCmdSetPerformanceStreamMarkerINTEL`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetPerformanceStreamMarkerINTEL.html).
13339 /**
13340 Provided by **VK_INTEL_performance_query**.*/
13341 ///
13342 ///# Errors
13343 ///- `VK_ERROR_TOO_MANY_OBJECTS`
13344 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13345 ///- `VK_ERROR_UNKNOWN`
13346 ///- `VK_ERROR_VALIDATION_FAILED`
13347 ///
13348 ///# Safety
13349 ///- `commandBuffer` (self) must be valid and not destroyed.
13350 ///- `commandBuffer` must be externally synchronized.
13351 ///
13352 ///# Panics
13353 ///Panics if `vkCmdSetPerformanceStreamMarkerINTEL` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13354 ///
13355 ///# Usage Notes
13356 ///
13357 ///Sets a performance stream marker in the command buffer. Stream
13358 ///markers identify points in the command stream for correlating
13359 ///performance counter data with specific GPU work.
13360 ///
13361 ///Requires `VK_INTEL_performance_query`.
13362 pub unsafe fn cmd_set_performance_stream_marker_intel(
13363 &self,
13364 command_buffer: CommandBuffer,
13365 p_marker_info: &PerformanceStreamMarkerInfoINTEL,
13366 ) -> VkResult<()> {
13367 let fp = self
13368 .commands()
13369 .cmd_set_performance_stream_marker_intel
13370 .expect("vkCmdSetPerformanceStreamMarkerINTEL not loaded");
13371 check(unsafe { fp(command_buffer, p_marker_info) })
13372 }
13373 ///Wraps [`vkCmdSetPerformanceOverrideINTEL`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetPerformanceOverrideINTEL.html).
13374 /**
13375 Provided by **VK_INTEL_performance_query**.*/
13376 ///
13377 ///# Errors
13378 ///- `VK_ERROR_TOO_MANY_OBJECTS`
13379 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13380 ///- `VK_ERROR_UNKNOWN`
13381 ///- `VK_ERROR_VALIDATION_FAILED`
13382 ///
13383 ///# Safety
13384 ///- `commandBuffer` (self) must be valid and not destroyed.
13385 ///- `commandBuffer` must be externally synchronized.
13386 ///
13387 ///# Panics
13388 ///Panics if `vkCmdSetPerformanceOverrideINTEL` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13389 ///
13390 ///# Usage Notes
13391 ///
13392 ///Overrides hardware performance settings for the remainder of the
13393 ///command buffer (e.g., forcing specific EU thread counts). Used
13394 ///for controlled profiling experiments.
13395 ///
13396 ///Requires `VK_INTEL_performance_query`.
13397 pub unsafe fn cmd_set_performance_override_intel(
13398 &self,
13399 command_buffer: CommandBuffer,
13400 p_override_info: &PerformanceOverrideInfoINTEL,
13401 ) -> VkResult<()> {
13402 let fp = self
13403 .commands()
13404 .cmd_set_performance_override_intel
13405 .expect("vkCmdSetPerformanceOverrideINTEL not loaded");
13406 check(unsafe { fp(command_buffer, p_override_info) })
13407 }
13408 ///Wraps [`vkAcquirePerformanceConfigurationINTEL`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAcquirePerformanceConfigurationINTEL.html).
13409 /**
13410 Provided by **VK_INTEL_performance_query**.*/
13411 ///
13412 ///# Errors
13413 ///- `VK_ERROR_TOO_MANY_OBJECTS`
13414 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13415 ///- `VK_ERROR_UNKNOWN`
13416 ///- `VK_ERROR_VALIDATION_FAILED`
13417 ///
13418 ///# Safety
13419 ///- `device` (self) must be valid and not destroyed.
13420 ///
13421 ///# Panics
13422 ///Panics if `vkAcquirePerformanceConfigurationINTEL` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13423 ///
13424 ///# Usage Notes
13425 ///
13426 ///Acquires a performance configuration that enables specific
13427 ///hardware counters for profiling. Apply to a queue with
13428 ///`queue_set_performance_configuration_intel`. Release with
13429 ///`release_performance_configuration_intel`.
13430 ///
13431 ///Requires `VK_INTEL_performance_query`.
13432 pub unsafe fn acquire_performance_configuration_intel(
13433 &self,
13434 p_acquire_info: &PerformanceConfigurationAcquireInfoINTEL,
13435 ) -> VkResult<PerformanceConfigurationINTEL> {
13436 let fp = self
13437 .commands()
13438 .acquire_performance_configuration_intel
13439 .expect("vkAcquirePerformanceConfigurationINTEL not loaded");
13440 let mut out = unsafe { core::mem::zeroed() };
13441 check(unsafe { fp(self.handle(), p_acquire_info, &mut out) })?;
13442 Ok(out)
13443 }
13444 ///Wraps [`vkReleasePerformanceConfigurationINTEL`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkReleasePerformanceConfigurationINTEL.html).
13445 /**
13446 Provided by **VK_INTEL_performance_query**.*/
13447 ///
13448 ///# Errors
13449 ///- `VK_ERROR_TOO_MANY_OBJECTS`
13450 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13451 ///- `VK_ERROR_UNKNOWN`
13452 ///- `VK_ERROR_VALIDATION_FAILED`
13453 ///
13454 ///# Safety
13455 ///- `device` (self) must be valid and not destroyed.
13456 ///- `configuration` must be externally synchronized.
13457 ///
13458 ///# Panics
13459 ///Panics if `vkReleasePerformanceConfigurationINTEL` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13460 ///
13461 ///# Usage Notes
13462 ///
13463 ///Releases a performance configuration acquired with
13464 ///`acquire_performance_configuration_intel`.
13465 ///
13466 ///Requires `VK_INTEL_performance_query`.
13467 pub unsafe fn release_performance_configuration_intel(
13468 &self,
13469 configuration: PerformanceConfigurationINTEL,
13470 ) -> VkResult<()> {
13471 let fp = self
13472 .commands()
13473 .release_performance_configuration_intel
13474 .expect("vkReleasePerformanceConfigurationINTEL not loaded");
13475 check(unsafe { fp(self.handle(), configuration) })
13476 }
13477 ///Wraps [`vkQueueSetPerformanceConfigurationINTEL`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueSetPerformanceConfigurationINTEL.html).
13478 /**
13479 Provided by **VK_INTEL_performance_query**.*/
13480 ///
13481 ///# Errors
13482 ///- `VK_ERROR_TOO_MANY_OBJECTS`
13483 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13484 ///- `VK_ERROR_UNKNOWN`
13485 ///- `VK_ERROR_VALIDATION_FAILED`
13486 ///
13487 ///# Safety
13488 ///- `queue` (self) must be valid and not destroyed.
13489 ///- `queue` must be externally synchronized.
13490 ///
13491 ///# Panics
13492 ///Panics if `vkQueueSetPerformanceConfigurationINTEL` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13493 ///
13494 ///# Usage Notes
13495 ///
13496 ///Applies a performance configuration to a queue, enabling the
13497 ///selected hardware counters for all subsequent submissions to
13498 ///that queue.
13499 ///
13500 ///Requires `VK_INTEL_performance_query`.
13501 pub unsafe fn queue_set_performance_configuration_intel(
13502 &self,
13503 queue: Queue,
13504 configuration: PerformanceConfigurationINTEL,
13505 ) -> VkResult<()> {
13506 let fp = self
13507 .commands()
13508 .queue_set_performance_configuration_intel
13509 .expect("vkQueueSetPerformanceConfigurationINTEL not loaded");
13510 check(unsafe { fp(queue, configuration) })
13511 }
13512 ///Wraps [`vkGetPerformanceParameterINTEL`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPerformanceParameterINTEL.html).
13513 /**
13514 Provided by **VK_INTEL_performance_query**.*/
13515 ///
13516 ///# Errors
13517 ///- `VK_ERROR_TOO_MANY_OBJECTS`
13518 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13519 ///- `VK_ERROR_UNKNOWN`
13520 ///- `VK_ERROR_VALIDATION_FAILED`
13521 ///
13522 ///# Safety
13523 ///- `device` (self) must be valid and not destroyed.
13524 ///
13525 ///# Panics
13526 ///Panics if `vkGetPerformanceParameterINTEL` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13527 ///
13528 ///# Usage Notes
13529 ///
13530 ///Queries a performance parameter value from the Intel driver, such
13531 ///as GPU clock frequency or EU count. Useful for normalizing
13532 ///profiling results.
13533 ///
13534 ///Requires `VK_INTEL_performance_query`.
13535 pub unsafe fn get_performance_parameter_intel(
13536 &self,
13537 parameter: PerformanceParameterTypeINTEL,
13538 ) -> VkResult<PerformanceValueINTEL> {
13539 let fp = self
13540 .commands()
13541 .get_performance_parameter_intel
13542 .expect("vkGetPerformanceParameterINTEL not loaded");
13543 let mut out = unsafe { core::mem::zeroed() };
13544 check(unsafe { fp(self.handle(), parameter, &mut out) })?;
13545 Ok(out)
13546 }
13547 ///Wraps [`vkGetDeviceMemoryOpaqueCaptureAddress`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceMemoryOpaqueCaptureAddress.html).
13548 /**
13549 Provided by **VK_BASE_VERSION_1_2**.*/
13550 ///
13551 ///# Safety
13552 ///- `device` (self) must be valid and not destroyed.
13553 ///
13554 ///# Panics
13555 ///Panics if `vkGetDeviceMemoryOpaqueCaptureAddress` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13556 ///
13557 ///# Usage Notes
13558 ///
13559 ///Returns an opaque capture address for a device memory allocation
13560 ///that was created with
13561 ///`MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY`. Used in conjunction
13562 ///with `get_buffer_opaque_capture_address` to replay buffer address
13563 ///assignments.
13564 ///
13565 ///This is a debugging/replay tool feature. Most applications do not
13566 ///need this.
13567 pub unsafe fn get_device_memory_opaque_capture_address(
13568 &self,
13569 p_info: &DeviceMemoryOpaqueCaptureAddressInfo,
13570 ) {
13571 let fp = self
13572 .commands()
13573 .get_device_memory_opaque_capture_address
13574 .expect("vkGetDeviceMemoryOpaqueCaptureAddress not loaded");
13575 unsafe { fp(self.handle(), p_info) };
13576 }
13577 ///Wraps [`vkGetPipelineExecutablePropertiesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPipelineExecutablePropertiesKHR.html).
13578 /**
13579 Provided by **VK_KHR_pipeline_executable_properties**.*/
13580 ///
13581 ///# Errors
13582 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13583 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
13584 ///- `VK_ERROR_UNKNOWN`
13585 ///- `VK_ERROR_VALIDATION_FAILED`
13586 ///
13587 ///# Safety
13588 ///- `device` (self) must be valid and not destroyed.
13589 ///
13590 ///# Panics
13591 ///Panics if `vkGetPipelineExecutablePropertiesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13592 ///
13593 ///# Usage Notes
13594 ///
13595 ///Lists the executable components within a pipeline. A single
13596 ///pipeline may contain multiple executables, for example, a
13597 ///graphics pipeline typically has separate vertex and fragment
13598 ///shader executables.
13599 ///
13600 ///Each returned `PipelineExecutablePropertiesKHR` contains a name,
13601 ///description, and shader stage flags identifying the executable.
13602 ///Use these to index into `get_pipeline_executable_statistics_khr`
13603 ///and `get_pipeline_executable_internal_representations_khr`.
13604 ///
13605 ///The pipeline must have been created with
13606 ///`PIPELINE_CREATE_CAPTURE_STATISTICS` or
13607 ///`PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS`. This is a
13608 ///debugging and profiling tool, not intended for shipping builds.
13609 pub unsafe fn get_pipeline_executable_properties_khr(
13610 &self,
13611 p_pipeline_info: &PipelineInfoKHR,
13612 ) -> VkResult<Vec<PipelineExecutablePropertiesKHR>> {
13613 let fp = self
13614 .commands()
13615 .get_pipeline_executable_properties_khr
13616 .expect("vkGetPipelineExecutablePropertiesKHR not loaded");
13617 enumerate_two_call(|count, data| unsafe { fp(self.handle(), p_pipeline_info, count, data) })
13618 }
13619 ///Wraps [`vkGetPipelineExecutableStatisticsKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPipelineExecutableStatisticsKHR.html).
13620 /**
13621 Provided by **VK_KHR_pipeline_executable_properties**.*/
13622 ///
13623 ///# Errors
13624 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13625 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
13626 ///- `VK_ERROR_UNKNOWN`
13627 ///- `VK_ERROR_VALIDATION_FAILED`
13628 ///
13629 ///# Safety
13630 ///- `device` (self) must be valid and not destroyed.
13631 ///
13632 ///# Panics
13633 ///Panics if `vkGetPipelineExecutableStatisticsKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13634 ///
13635 ///# Usage Notes
13636 ///
13637 ///Retrieves compiler statistics for a specific pipeline executable.
13638 ///Statistics include metrics like register usage, instruction count,
13639 ///scratch memory, and other driver-specific values.
13640 ///
13641 ///Identify the executable by index from
13642 ///`get_pipeline_executable_properties_khr` via
13643 ///`PipelineExecutableInfoKHR`.
13644 ///
13645 ///Each statistic has a name, description, format (bool, int, float,
13646 ///or string), and value. The available statistics are
13647 ///driver-specific, different vendors report different metrics.
13648 ///
13649 ///The pipeline must have been created with
13650 ///`PIPELINE_CREATE_CAPTURE_STATISTICS`. This is a profiling tool
13651 ///for shader optimization, use it to compare register pressure
13652 ///or instruction counts across shader variants.
13653 pub unsafe fn get_pipeline_executable_statistics_khr(
13654 &self,
13655 p_executable_info: &PipelineExecutableInfoKHR,
13656 ) -> VkResult<Vec<PipelineExecutableStatisticKHR>> {
13657 let fp = self
13658 .commands()
13659 .get_pipeline_executable_statistics_khr
13660 .expect("vkGetPipelineExecutableStatisticsKHR not loaded");
13661 enumerate_two_call(|count, data| unsafe {
13662 fp(self.handle(), p_executable_info, count, data)
13663 })
13664 }
13665 ///Wraps [`vkGetPipelineExecutableInternalRepresentationsKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPipelineExecutableInternalRepresentationsKHR.html).
13666 /**
13667 Provided by **VK_KHR_pipeline_executable_properties**.*/
13668 ///
13669 ///# Errors
13670 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13671 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
13672 ///- `VK_ERROR_UNKNOWN`
13673 ///- `VK_ERROR_VALIDATION_FAILED`
13674 ///
13675 ///# Safety
13676 ///- `device` (self) must be valid and not destroyed.
13677 ///
13678 ///# Panics
13679 ///Panics if `vkGetPipelineExecutableInternalRepresentationsKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13680 ///
13681 ///# Usage Notes
13682 ///
13683 ///Retrieves internal representations (IR) of a pipeline executable.
13684 ///These are driver-specific intermediate or final shader
13685 ///representations, for example, SPIR-V, vendor IR, or GPU ISA
13686 ///disassembly.
13687 ///
13688 ///Each representation has a name, description, and opaque data
13689 ///blob. Whether the data is human-readable text or binary depends
13690 ///on `is_text` in the returned structure.
13691 ///
13692 ///The pipeline must have been created with
13693 ///`PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS`. Enabling
13694 ///this flag may disable optimizations, so only use it for
13695 ///debugging and shader analysis, not in production.
13696 ///
13697 ///Identify the executable by index from
13698 ///`get_pipeline_executable_properties_khr`.
13699 pub unsafe fn get_pipeline_executable_internal_representations_khr(
13700 &self,
13701 p_executable_info: &PipelineExecutableInfoKHR,
13702 ) -> VkResult<Vec<PipelineExecutableInternalRepresentationKHR>> {
13703 let fp = self
13704 .commands()
13705 .get_pipeline_executable_internal_representations_khr
13706 .expect("vkGetPipelineExecutableInternalRepresentationsKHR not loaded");
13707 enumerate_two_call(|count, data| unsafe {
13708 fp(self.handle(), p_executable_info, count, data)
13709 })
13710 }
13711 ///Wraps [`vkCmdSetLineStipple`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetLineStipple.html).
13712 /**
13713 Provided by **VK_GRAPHICS_VERSION_1_4**.*/
13714 ///
13715 ///# Safety
13716 ///- `commandBuffer` (self) must be valid and not destroyed.
13717 ///- `commandBuffer` must be externally synchronized.
13718 ///
13719 ///# Panics
13720 ///Panics if `vkCmdSetLineStipple` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13721 ///
13722 ///# Usage Notes
13723 ///
13724 ///Dynamically sets the line stipple pattern and repeat factor. Only
13725 ///takes effect if the pipeline was created with
13726 ///`DYNAMIC_STATE_LINE_STIPPLE`.
13727 ///
13728 ///The `stipple_factor` (1–256) controls how many pixels each bit of
13729 ///the pattern spans. The `stipple_pattern` is a 16-bit bitmask where
13730 ///each bit represents a pixel, 1 is drawn, 0 is discarded.
13731 ///
13732 ///Line stippling requires `VK_EXT_line_rasterization` and the
13733 ///`stippled_*_lines` device features, depending on which line
13734 ///rasterisation mode you use.
13735 ///
13736 ///Core dynamic state in Vulkan 1.4.
13737 pub unsafe fn cmd_set_line_stipple(
13738 &self,
13739 command_buffer: CommandBuffer,
13740 line_stipple_factor: u32,
13741 line_stipple_pattern: u16,
13742 ) {
13743 let fp = self
13744 .commands()
13745 .cmd_set_line_stipple
13746 .expect("vkCmdSetLineStipple not loaded");
13747 unsafe { fp(command_buffer, line_stipple_factor, line_stipple_pattern) };
13748 }
13749 ///Wraps [`vkGetFaultData`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetFaultData.html).
13750 /**
13751 Provided by **VKSC_VERSION_1_0**.*/
13752 ///
13753 ///# Errors
13754 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13755 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
13756 ///- `VK_ERROR_UNKNOWN`
13757 ///- `VK_ERROR_VALIDATION_FAILED`
13758 ///
13759 ///# Safety
13760 ///- `device` (self) must be valid and not destroyed.
13761 ///
13762 ///# Panics
13763 ///Panics if `vkGetFaultData` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13764 ///
13765 ///# Usage Notes
13766 ///
13767 ///Queries recorded fault data from the device. Part of Vulkan SC
13768 ///(Safety Critical) for fault reporting in safety-certified
13769 ///environments. Uses the two-call idiom. The
13770 ///`fault_query_behavior` controls whether queried faults are
13771 ///cleared. Also reports the count of unrecorded faults that
13772 ///overflowed the internal buffer.
13773 ///
13774 ///Requires Vulkan SC.
13775 pub unsafe fn get_fault_data(
13776 &self,
13777 fault_query_behavior: FaultQueryBehavior,
13778 p_unrecorded_faults: *mut u32,
13779 ) -> VkResult<Vec<FaultData>> {
13780 let fp = self
13781 .commands()
13782 .get_fault_data
13783 .expect("vkGetFaultData not loaded");
13784 enumerate_two_call(|count, data| unsafe {
13785 fp(
13786 self.handle(),
13787 fault_query_behavior,
13788 p_unrecorded_faults,
13789 count,
13790 data,
13791 )
13792 })
13793 }
13794 ///Wraps [`vkCreateAccelerationStructureKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateAccelerationStructureKHR.html).
13795 /**
13796 Provided by **VK_KHR_acceleration_structure**.*/
13797 ///
13798 ///# Errors
13799 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13800 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
13801 ///- `VK_ERROR_UNKNOWN`
13802 ///- `VK_ERROR_VALIDATION_FAILED`
13803 ///
13804 ///# Safety
13805 ///- `device` (self) must be valid and not destroyed.
13806 ///
13807 ///# Panics
13808 ///Panics if `vkCreateAccelerationStructureKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13809 ///
13810 ///# Usage Notes
13811 ///
13812 ///Creates an acceleration structure for hardware ray tracing. An
13813 ///acceleration structure is a spatial data structure (typically a BVH)
13814 ///that the GPU traverses during ray intersection tests.
13815 ///
13816 ///**Two levels**:
13817 ///
13818 ///- **Bottom-level (BLAS)**: contains geometry (triangles or AABBs).
13819 /// Create one per mesh or mesh group.
13820 ///- **Top-level (TLAS)**: contains instances that reference BLASes
13821 /// with per-instance transforms. Create one per scene.
13822 ///
13823 ///The acceleration structure needs a backing buffer created with
13824 ///`BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE`. Query the required
13825 ///size with `get_acceleration_structure_build_sizes_khr` first.
13826 ///
13827 ///After creation, build the structure with
13828 ///`cmd_build_acceleration_structures_khr`. The structure is not usable
13829 ///for tracing until built.
13830 pub unsafe fn create_acceleration_structure_khr(
13831 &self,
13832 p_create_info: &AccelerationStructureCreateInfoKHR,
13833 allocator: Option<&AllocationCallbacks>,
13834 ) -> VkResult<AccelerationStructureKHR> {
13835 let fp = self
13836 .commands()
13837 .create_acceleration_structure_khr
13838 .expect("vkCreateAccelerationStructureKHR not loaded");
13839 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
13840 let mut out = unsafe { core::mem::zeroed() };
13841 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
13842 Ok(out)
13843 }
13844 ///Wraps [`vkCmdBuildAccelerationStructuresKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBuildAccelerationStructuresKHR.html).
13845 /**
13846 Provided by **VK_KHR_acceleration_structure**.*/
13847 ///
13848 ///# Safety
13849 ///- `commandBuffer` (self) must be valid and not destroyed.
13850 ///- `commandBuffer` must be externally synchronized.
13851 ///
13852 ///# Panics
13853 ///Panics if `vkCmdBuildAccelerationStructuresKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13854 ///
13855 ///# Usage Notes
13856 ///
13857 ///Records a GPU-side acceleration structure build or update. This is
13858 ///the primary way to build BLASes and TLASes for ray tracing.
13859 ///
13860 ///**Build vs update**: an initial build creates the structure from
13861 ///scratch. An update (`BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE`)
13862 ///modifies an existing structure in-place, which is faster but
13863 ///produces lower traversal quality. Use updates for dynamic geometry
13864 ///(e.g. animated characters) and full rebuilds when geometry changes
13865 ///significantly.
13866 ///
13867 ///**Scratch buffer**: builds require a temporary scratch buffer.
13868 ///Query the required size with
13869 ///`get_acceleration_structure_build_sizes_khr` and create a buffer
13870 ///with `BUFFER_USAGE_STORAGE_BUFFER`.
13871 ///
13872 ///Multiple builds can be batched in a single call. The driver may
13873 ///execute them in parallel.
13874 ///
13875 ///Must be recorded outside a render pass.
13876 pub unsafe fn cmd_build_acceleration_structures_khr(
13877 &self,
13878 command_buffer: CommandBuffer,
13879 p_infos: &[AccelerationStructureBuildGeometryInfoKHR],
13880 pp_build_range_infos: *const *const AccelerationStructureBuildRangeInfoKHR,
13881 ) {
13882 let fp = self
13883 .commands()
13884 .cmd_build_acceleration_structures_khr
13885 .expect("vkCmdBuildAccelerationStructuresKHR not loaded");
13886 unsafe {
13887 fp(
13888 command_buffer,
13889 p_infos.len() as u32,
13890 p_infos.as_ptr(),
13891 pp_build_range_infos,
13892 )
13893 };
13894 }
13895 ///Wraps [`vkCmdBuildAccelerationStructuresIndirectKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBuildAccelerationStructuresIndirectKHR.html).
13896 /**
13897 Provided by **VK_KHR_acceleration_structure**.*/
13898 ///
13899 ///# Safety
13900 ///- `commandBuffer` (self) must be valid and not destroyed.
13901 ///- `commandBuffer` must be externally synchronized.
13902 ///
13903 ///# Panics
13904 ///Panics if `vkCmdBuildAccelerationStructuresIndirectKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13905 ///
13906 ///# Usage Notes
13907 ///
13908 ///GPU-side acceleration structure build with indirect parameters. The
13909 ///primitive counts and build ranges are read from GPU buffers rather
13910 ///than specified on the CPU.
13911 ///
13912 ///This enables fully GPU-driven scene management where a compute
13913 ///shader determines which geometry to include and writes the build
13914 ///parameters.
13915 ///
13916 ///Requires the `acceleration_structure_indirect_build` feature.
13917 pub unsafe fn cmd_build_acceleration_structures_indirect_khr(
13918 &self,
13919 command_buffer: CommandBuffer,
13920 p_infos: &[AccelerationStructureBuildGeometryInfoKHR],
13921 p_indirect_device_addresses: &u64,
13922 p_indirect_strides: *const u32,
13923 pp_max_primitive_counts: *const *const u32,
13924 ) {
13925 let fp = self
13926 .commands()
13927 .cmd_build_acceleration_structures_indirect_khr
13928 .expect("vkCmdBuildAccelerationStructuresIndirectKHR not loaded");
13929 unsafe {
13930 fp(
13931 command_buffer,
13932 p_infos.len() as u32,
13933 p_infos.as_ptr(),
13934 p_indirect_device_addresses,
13935 p_indirect_strides,
13936 pp_max_primitive_counts,
13937 )
13938 };
13939 }
13940 ///Wraps [`vkBuildAccelerationStructuresKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBuildAccelerationStructuresKHR.html).
13941 /**
13942 Provided by **VK_KHR_acceleration_structure**.*/
13943 ///
13944 ///# Errors
13945 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13946 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
13947 ///- `VK_ERROR_UNKNOWN`
13948 ///- `VK_ERROR_VALIDATION_FAILED`
13949 ///
13950 ///# Safety
13951 ///- `device` (self) must be valid and not destroyed.
13952 ///
13953 ///# Panics
13954 ///Panics if `vkBuildAccelerationStructuresKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13955 ///
13956 ///# Usage Notes
13957 ///
13958 ///Builds or updates acceleration structures on the **host** (CPU).
13959 ///This is the CPU-side alternative to
13960 ///`cmd_build_acceleration_structures_khr`.
13961 ///
13962 ///Host builds are useful for offline processing, tools, or when GPU
13963 ///build capacity is limited. However, GPU builds are significantly
13964 ///faster for real-time applications.
13965 ///
13966 ///Requires the `acceleration_structure_host_commands` feature.
13967 pub unsafe fn build_acceleration_structures_khr(
13968 &self,
13969 deferred_operation: DeferredOperationKHR,
13970 p_infos: &[AccelerationStructureBuildGeometryInfoKHR],
13971 pp_build_range_infos: *const *const AccelerationStructureBuildRangeInfoKHR,
13972 ) -> VkResult<()> {
13973 let fp = self
13974 .commands()
13975 .build_acceleration_structures_khr
13976 .expect("vkBuildAccelerationStructuresKHR not loaded");
13977 check(unsafe {
13978 fp(
13979 self.handle(),
13980 deferred_operation,
13981 p_infos.len() as u32,
13982 p_infos.as_ptr(),
13983 pp_build_range_infos,
13984 )
13985 })
13986 }
13987 ///Wraps [`vkGetAccelerationStructureDeviceAddressKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetAccelerationStructureDeviceAddressKHR.html).
13988 /**
13989 Provided by **VK_KHR_acceleration_structure**.*/
13990 ///
13991 ///# Safety
13992 ///- `device` (self) must be valid and not destroyed.
13993 ///
13994 ///# Panics
13995 ///Panics if `vkGetAccelerationStructureDeviceAddressKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13996 ///
13997 ///# Usage Notes
13998 ///
13999 ///Returns the GPU device address of an acceleration structure. This
14000 ///address is used when building a TLAS, each instance in the TLAS
14001 ///references a BLAS by its device address.
14002 ///
14003 ///The address remains valid for the lifetime of the acceleration
14004 ///structure.
14005 pub unsafe fn get_acceleration_structure_device_address_khr(
14006 &self,
14007 p_info: &AccelerationStructureDeviceAddressInfoKHR,
14008 ) {
14009 let fp = self
14010 .commands()
14011 .get_acceleration_structure_device_address_khr
14012 .expect("vkGetAccelerationStructureDeviceAddressKHR not loaded");
14013 unsafe { fp(self.handle(), p_info) };
14014 }
14015 ///Wraps [`vkCreateDeferredOperationKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateDeferredOperationKHR.html).
14016 /**
14017 Provided by **VK_KHR_deferred_host_operations**.*/
14018 ///
14019 ///# Errors
14020 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
14021 ///- `VK_ERROR_UNKNOWN`
14022 ///- `VK_ERROR_VALIDATION_FAILED`
14023 ///
14024 ///# Safety
14025 ///- `device` (self) must be valid and not destroyed.
14026 ///
14027 ///# Panics
14028 ///Panics if `vkCreateDeferredOperationKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14029 ///
14030 ///# Usage Notes
14031 ///
14032 ///Creates a deferred operation handle. Deferred operations allow
14033 ///expensive host-side work (such as ray tracing pipeline compilation)
14034 ///to be split across multiple CPU threads.
14035 ///
14036 ///The typical workflow:
14037 ///
14038 ///1. Create a deferred operation with this command.
14039 ///2. Pass the handle to a deferrable command (e.g.,
14040 /// `create_ray_tracing_pipelines_khr`). If deferred, it returns
14041 /// `OPERATION_DEFERRED_KHR`.
14042 ///3. Query `get_deferred_operation_max_concurrency_khr` to learn
14043 /// how many threads can contribute.
14044 ///4. Call `deferred_operation_join_khr` from each worker thread.
14045 ///5. Once all joins return `SUCCESS`, retrieve the result with
14046 /// `get_deferred_operation_result_khr`.
14047 ///6. Destroy the handle with `destroy_deferred_operation_khr`.
14048 ///
14049 ///The handle itself is lightweight, it is just a token for tracking
14050 ///the deferred work.
14051 pub unsafe fn create_deferred_operation_khr(
14052 &self,
14053 allocator: Option<&AllocationCallbacks>,
14054 ) -> VkResult<DeferredOperationKHR> {
14055 let fp = self
14056 .commands()
14057 .create_deferred_operation_khr
14058 .expect("vkCreateDeferredOperationKHR not loaded");
14059 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
14060 let mut out = unsafe { core::mem::zeroed() };
14061 check(unsafe { fp(self.handle(), alloc_ptr, &mut out) })?;
14062 Ok(out)
14063 }
14064 ///Wraps [`vkDestroyDeferredOperationKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyDeferredOperationKHR.html).
14065 /**
14066 Provided by **VK_KHR_deferred_host_operations**.*/
14067 ///
14068 ///# Safety
14069 ///- `device` (self) must be valid and not destroyed.
14070 ///- `operation` must be externally synchronized.
14071 ///
14072 ///# Panics
14073 ///Panics if `vkDestroyDeferredOperationKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14074 ///
14075 ///# Usage Notes
14076 ///
14077 ///Destroys a deferred operation handle. The operation must have
14078 ///completed before destruction, either all joining threads returned
14079 ///`SUCCESS` or `THREAD_DONE_KHR`, or the operation was never
14080 ///deferred.
14081 ///
14082 ///Do not destroy while threads are still joined to the operation.
14083 pub unsafe fn destroy_deferred_operation_khr(
14084 &self,
14085 operation: DeferredOperationKHR,
14086 allocator: Option<&AllocationCallbacks>,
14087 ) {
14088 let fp = self
14089 .commands()
14090 .destroy_deferred_operation_khr
14091 .expect("vkDestroyDeferredOperationKHR not loaded");
14092 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
14093 unsafe { fp(self.handle(), operation, alloc_ptr) };
14094 }
14095 ///Wraps [`vkGetDeferredOperationMaxConcurrencyKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeferredOperationMaxConcurrencyKHR.html).
14096 /**
14097 Provided by **VK_KHR_deferred_host_operations**.*/
14098 ///
14099 ///# Safety
14100 ///- `device` (self) must be valid and not destroyed.
14101 ///
14102 ///# Panics
14103 ///Panics if `vkGetDeferredOperationMaxConcurrencyKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14104 ///
14105 ///# Usage Notes
14106 ///
14107 ///Returns the maximum number of threads that can usefully join this
14108 ///deferred operation. Spawning more threads than this value wastes
14109 ///resources, additional joins will return `THREAD_IDLE_KHR`.
14110 ///
14111 ///The returned value may decrease over time as work completes, so
14112 ///query it just before spawning worker threads.
14113 ///
14114 ///A return value of zero means the operation is already complete
14115 ///or requires no additional threads.
14116 pub unsafe fn get_deferred_operation_max_concurrency_khr(
14117 &self,
14118 operation: DeferredOperationKHR,
14119 ) {
14120 let fp = self
14121 .commands()
14122 .get_deferred_operation_max_concurrency_khr
14123 .expect("vkGetDeferredOperationMaxConcurrencyKHR not loaded");
14124 unsafe { fp(self.handle(), operation) };
14125 }
14126 ///Wraps [`vkGetDeferredOperationResultKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeferredOperationResultKHR.html).
14127 /**
14128 Provided by **VK_KHR_deferred_host_operations**.*/
14129 ///
14130 ///# Errors
14131 ///- `VK_ERROR_UNKNOWN`
14132 ///- `VK_ERROR_VALIDATION_FAILED`
14133 ///
14134 ///# Safety
14135 ///- `device` (self) must be valid and not destroyed.
14136 ///
14137 ///# Panics
14138 ///Panics if `vkGetDeferredOperationResultKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14139 ///
14140 ///# Usage Notes
14141 ///
14142 ///Returns the result of a completed deferred operation. The returned
14143 ///`VkResult` is the same value that the original deferrable command
14144 ///would have returned if it had executed synchronously.
14145 ///
14146 ///Only call this after the operation has fully completed (all joins
14147 ///returned `SUCCESS` or `THREAD_DONE_KHR`). Calling on an
14148 ///in-progress operation returns `NOT_READY`.
14149 ///
14150 ///For example, if `create_ray_tracing_pipelines_khr` was deferred,
14151 ///this returns whether pipeline creation succeeded or failed.
14152 pub unsafe fn get_deferred_operation_result_khr(
14153 &self,
14154 operation: DeferredOperationKHR,
14155 ) -> VkResult<()> {
14156 let fp = self
14157 .commands()
14158 .get_deferred_operation_result_khr
14159 .expect("vkGetDeferredOperationResultKHR not loaded");
14160 check(unsafe { fp(self.handle(), operation) })
14161 }
14162 ///Wraps [`vkDeferredOperationJoinKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDeferredOperationJoinKHR.html).
14163 /**
14164 Provided by **VK_KHR_deferred_host_operations**.*/
14165 ///
14166 ///# Errors
14167 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
14168 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
14169 ///- `VK_ERROR_UNKNOWN`
14170 ///- `VK_ERROR_VALIDATION_FAILED`
14171 ///
14172 ///# Safety
14173 ///- `device` (self) must be valid and not destroyed.
14174 ///
14175 ///# Panics
14176 ///Panics if `vkDeferredOperationJoinKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14177 ///
14178 ///# Usage Notes
14179 ///
14180 ///Joins the calling thread to a deferred operation, contributing
14181 ///CPU time to its completion. Multiple threads can join the same
14182 ///operation concurrently.
14183 ///
14184 ///Return values:
14185 ///
14186 ///- `SUCCESS`, the operation completed. The calling thread was
14187 /// the last one needed.
14188 ///- `THREAD_DONE_KHR`, this thread's contribution is finished,
14189 /// but the operation may still be in progress on other threads.
14190 ///- `THREAD_IDLE_KHR`, the operation has enough threads; this
14191 /// one was not needed. Retry later or move on.
14192 ///
14193 ///Call this in a loop per thread until it returns `SUCCESS` or
14194 ///`THREAD_DONE_KHR`. After all threads finish, check the final
14195 ///result with `get_deferred_operation_result_khr`.
14196 ///
14197 ///The number of useful threads is bounded by
14198 ///`get_deferred_operation_max_concurrency_khr`.
14199 pub unsafe fn deferred_operation_join_khr(
14200 &self,
14201 operation: DeferredOperationKHR,
14202 ) -> VkResult<()> {
14203 let fp = self
14204 .commands()
14205 .deferred_operation_join_khr
14206 .expect("vkDeferredOperationJoinKHR not loaded");
14207 check(unsafe { fp(self.handle(), operation) })
14208 }
14209 ///Wraps [`vkGetPipelineIndirectMemoryRequirementsNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPipelineIndirectMemoryRequirementsNV.html).
14210 /**
14211 Provided by **VK_NV_device_generated_commands_compute**.*/
14212 ///
14213 ///# Safety
14214 ///- `device` (self) must be valid and not destroyed.
14215 ///
14216 ///# Panics
14217 ///Panics if `vkGetPipelineIndirectMemoryRequirementsNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14218 ///
14219 ///# Usage Notes
14220 ///
14221 ///Queries the memory requirements for storing a compute pipeline's
14222 ///indirect dispatch metadata. Allocate a buffer of this size and
14223 ///pass it when creating the pipeline for device-generated compute
14224 ///dispatch.
14225 ///
14226 ///Requires `VK_NV_device_generated_commands_compute`.
14227 pub unsafe fn get_pipeline_indirect_memory_requirements_nv(
14228 &self,
14229 p_create_info: &ComputePipelineCreateInfo,
14230 p_memory_requirements: &mut MemoryRequirements2,
14231 ) {
14232 let fp = self
14233 .commands()
14234 .get_pipeline_indirect_memory_requirements_nv
14235 .expect("vkGetPipelineIndirectMemoryRequirementsNV not loaded");
14236 unsafe { fp(self.handle(), p_create_info, p_memory_requirements) };
14237 }
14238 ///Wraps [`vkGetPipelineIndirectDeviceAddressNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPipelineIndirectDeviceAddressNV.html).
14239 /**
14240 Provided by **VK_NV_device_generated_commands_compute**.*/
14241 ///
14242 ///# Safety
14243 ///- `device` (self) must be valid and not destroyed.
14244 ///
14245 ///# Panics
14246 ///Panics if `vkGetPipelineIndirectDeviceAddressNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14247 ///
14248 ///# Usage Notes
14249 ///
14250 ///Returns the device address of a compute pipeline's indirect
14251 ///dispatch metadata. The GPU writes to this address to select
14252 ///which pipeline to dispatch in device-generated compute workflows.
14253 ///
14254 ///Requires `VK_NV_device_generated_commands_compute`.
14255 pub unsafe fn get_pipeline_indirect_device_address_nv(
14256 &self,
14257 p_info: &PipelineIndirectDeviceAddressInfoNV,
14258 ) {
14259 let fp = self
14260 .commands()
14261 .get_pipeline_indirect_device_address_nv
14262 .expect("vkGetPipelineIndirectDeviceAddressNV not loaded");
14263 unsafe { fp(self.handle(), p_info) };
14264 }
14265 ///Wraps [`vkAntiLagUpdateAMD`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAntiLagUpdateAMD.html).
14266 /**
14267 Provided by **VK_AMD_anti_lag**.*/
14268 ///
14269 ///# Safety
14270 ///- `device` (self) must be valid and not destroyed.
14271 ///
14272 ///# Panics
14273 ///Panics if `vkAntiLagUpdateAMD` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14274 ///
14275 ///# Usage Notes
14276 ///
14277 ///Submits anti-lag timing data to reduce input-to-display latency.
14278 ///Called once per frame with presentation timing hints so the driver
14279 ///can pace GPU work to minimise latency.
14280 ///
14281 ///Requires `VK_AMD_anti_lag`.
14282 pub unsafe fn anti_lag_update_amd(&self, p_data: &AntiLagDataAMD) {
14283 let fp = self
14284 .commands()
14285 .anti_lag_update_amd
14286 .expect("vkAntiLagUpdateAMD not loaded");
14287 unsafe { fp(self.handle(), p_data) };
14288 }
14289 ///Wraps [`vkCmdSetCullMode`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetCullMode.html).
14290 /**
14291 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14292 ///
14293 ///# Safety
14294 ///- `commandBuffer` (self) must be valid and not destroyed.
14295 ///- `commandBuffer` must be externally synchronized.
14296 ///
14297 ///# Panics
14298 ///Panics if `vkCmdSetCullMode` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14299 ///
14300 ///# Usage Notes
14301 ///
14302 ///Dynamically sets the triangle culling mode. Only takes effect if
14303 ///the pipeline was created with `DYNAMIC_STATE_CULL_MODE`.
14304 ///
14305 ///Values: `CULL_MODE_NONE`, `CULL_MODE_FRONT`, `CULL_MODE_BACK`,
14306 ///`CULL_MODE_FRONT_AND_BACK`.
14307 ///
14308 ///Common pattern: set `CULL_MODE_BACK` for opaque geometry and
14309 ///`CULL_MODE_NONE` for double-sided or transparent materials, without
14310 ///needing separate pipelines.
14311 ///
14312 ///Core dynamic state in Vulkan 1.3.
14313 pub unsafe fn cmd_set_cull_mode(
14314 &self,
14315 command_buffer: CommandBuffer,
14316 cull_mode: CullModeFlags,
14317 ) {
14318 let fp = self
14319 .commands()
14320 .cmd_set_cull_mode
14321 .expect("vkCmdSetCullMode not loaded");
14322 unsafe { fp(command_buffer, cull_mode) };
14323 }
14324 ///Wraps [`vkCmdSetFrontFace`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetFrontFace.html).
14325 /**
14326 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14327 ///
14328 ///# Safety
14329 ///- `commandBuffer` (self) must be valid and not destroyed.
14330 ///- `commandBuffer` must be externally synchronized.
14331 ///
14332 ///# Panics
14333 ///Panics if `vkCmdSetFrontFace` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14334 ///
14335 ///# Usage Notes
14336 ///
14337 ///Dynamically sets which triangle winding order is considered
14338 ///front-facing. Only takes effect if the pipeline was created with
14339 ///`DYNAMIC_STATE_FRONT_FACE`.
14340 ///
14341 ///Values: `FRONT_FACE_COUNTER_CLOCKWISE` (the Vulkan default) or
14342 ///`FRONT_FACE_CLOCKWISE`.
14343 ///
14344 ///Useful when rendering mirrored or reflected geometry where the
14345 ///winding order is flipped, without needing a separate pipeline.
14346 ///
14347 ///Core dynamic state in Vulkan 1.3.
14348 pub unsafe fn cmd_set_front_face(&self, command_buffer: CommandBuffer, front_face: FrontFace) {
14349 let fp = self
14350 .commands()
14351 .cmd_set_front_face
14352 .expect("vkCmdSetFrontFace not loaded");
14353 unsafe { fp(command_buffer, front_face) };
14354 }
14355 ///Wraps [`vkCmdSetPrimitiveTopology`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetPrimitiveTopology.html).
14356 /**
14357 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14358 ///
14359 ///# Safety
14360 ///- `commandBuffer` (self) must be valid and not destroyed.
14361 ///- `commandBuffer` must be externally synchronized.
14362 ///
14363 ///# Panics
14364 ///Panics if `vkCmdSetPrimitiveTopology` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14365 ///
14366 ///# Usage Notes
14367 ///
14368 ///Dynamically sets the primitive topology. Only takes effect if the
14369 ///pipeline was created with `DYNAMIC_STATE_PRIMITIVE_TOPOLOGY`.
14370 ///
14371 ///Values include `POINT_LIST`, `LINE_LIST`, `LINE_STRIP`,
14372 ///`TRIANGLE_LIST`, `TRIANGLE_STRIP`, `TRIANGLE_FAN`,
14373 ///`LINE_LIST_WITH_ADJACENCY`, `PATCH_LIST`, etc.
14374 ///
14375 ///The dynamic topology must be in the same topology class as the
14376 ///pipeline's static topology (e.g. you can switch between
14377 ///`TRIANGLE_LIST` and `TRIANGLE_STRIP` since both are triangle
14378 ///topologies, but not between `TRIANGLE_LIST` and `LINE_LIST`).
14379 ///
14380 ///Core dynamic state in Vulkan 1.3.
14381 pub unsafe fn cmd_set_primitive_topology(
14382 &self,
14383 command_buffer: CommandBuffer,
14384 primitive_topology: PrimitiveTopology,
14385 ) {
14386 let fp = self
14387 .commands()
14388 .cmd_set_primitive_topology
14389 .expect("vkCmdSetPrimitiveTopology not loaded");
14390 unsafe { fp(command_buffer, primitive_topology) };
14391 }
14392 ///Wraps [`vkCmdSetViewportWithCount`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetViewportWithCount.html).
14393 /**
14394 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14395 ///
14396 ///# Safety
14397 ///- `commandBuffer` (self) must be valid and not destroyed.
14398 ///- `commandBuffer` must be externally synchronized.
14399 ///
14400 ///# Panics
14401 ///Panics if `vkCmdSetViewportWithCount` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14402 ///
14403 ///# Usage Notes
14404 ///
14405 ///Dynamically sets both the viewports and the viewport count. Only
14406 ///takes effect if the pipeline was created with
14407 ///`DYNAMIC_STATE_VIEWPORT_WITH_COUNT`.
14408 ///
14409 ///Unlike `cmd_set_viewport` (which requires the count to match the
14410 ///pipeline's static `viewport_count`), this command also sets the
14411 ///count dynamically. The viewport count must match the scissor count
14412 ///set by `cmd_set_scissor_with_count`.
14413 ///
14414 ///Core dynamic state in Vulkan 1.3.
14415 pub unsafe fn cmd_set_viewport_with_count(
14416 &self,
14417 command_buffer: CommandBuffer,
14418 p_viewports: &[Viewport],
14419 ) {
14420 let fp = self
14421 .commands()
14422 .cmd_set_viewport_with_count
14423 .expect("vkCmdSetViewportWithCount not loaded");
14424 unsafe {
14425 fp(
14426 command_buffer,
14427 p_viewports.len() as u32,
14428 p_viewports.as_ptr(),
14429 )
14430 };
14431 }
14432 ///Wraps [`vkCmdSetScissorWithCount`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetScissorWithCount.html).
14433 /**
14434 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14435 ///
14436 ///# Safety
14437 ///- `commandBuffer` (self) must be valid and not destroyed.
14438 ///- `commandBuffer` must be externally synchronized.
14439 ///
14440 ///# Panics
14441 ///Panics if `vkCmdSetScissorWithCount` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14442 ///
14443 ///# Usage Notes
14444 ///
14445 ///Dynamically sets both the scissor rectangles and the scissor count.
14446 ///Only takes effect if the pipeline was created with
14447 ///`DYNAMIC_STATE_SCISSOR_WITH_COUNT`.
14448 ///
14449 ///Unlike `cmd_set_scissor` (which requires the count to match the
14450 ///pipeline's static `viewport_count`), this command also sets the
14451 ///count dynamically. The scissor count must match the viewport count
14452 ///set by `cmd_set_viewport_with_count`.
14453 ///
14454 ///Core dynamic state in Vulkan 1.3.
14455 pub unsafe fn cmd_set_scissor_with_count(
14456 &self,
14457 command_buffer: CommandBuffer,
14458 p_scissors: &[Rect2D],
14459 ) {
14460 let fp = self
14461 .commands()
14462 .cmd_set_scissor_with_count
14463 .expect("vkCmdSetScissorWithCount not loaded");
14464 unsafe { fp(command_buffer, p_scissors.len() as u32, p_scissors.as_ptr()) };
14465 }
14466 ///Wraps [`vkCmdBindIndexBuffer2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindIndexBuffer2.html).
14467 /**
14468 Provided by **VK_GRAPHICS_VERSION_1_4**.*/
14469 ///
14470 ///# Safety
14471 ///- `commandBuffer` (self) must be valid and not destroyed.
14472 ///- `commandBuffer` must be externally synchronized.
14473 ///
14474 ///# Panics
14475 ///Panics if `vkCmdBindIndexBuffer2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14476 ///
14477 ///# Usage Notes
14478 ///
14479 ///Vulkan 1.4 version of `cmd_bind_index_buffer` that additionally
14480 ///accepts a `size` parameter specifying the valid range of the index
14481 ///buffer. This enables the driver to perform bounds checking.
14482 ///
14483 ///Pass `VK_WHOLE_SIZE` for the size to use the remainder of the buffer
14484 ///from the offset.
14485 ///
14486 ///Prefer this over `cmd_bind_index_buffer` when targeting Vulkan 1.4+.
14487 pub unsafe fn cmd_bind_index_buffer2(
14488 &self,
14489 command_buffer: CommandBuffer,
14490 buffer: Buffer,
14491 offset: u64,
14492 size: u64,
14493 index_type: IndexType,
14494 ) {
14495 let fp = self
14496 .commands()
14497 .cmd_bind_index_buffer2
14498 .expect("vkCmdBindIndexBuffer2 not loaded");
14499 unsafe { fp(command_buffer, buffer, offset, size, index_type) };
14500 }
14501 ///Wraps [`vkCmdBindVertexBuffers2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindVertexBuffers2.html).
14502 /**
14503 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14504 ///
14505 ///# Safety
14506 ///- `commandBuffer` (self) must be valid and not destroyed.
14507 ///- `commandBuffer` must be externally synchronized.
14508 ///
14509 ///# Panics
14510 ///Panics if `vkCmdBindVertexBuffers2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14511 ///
14512 ///# Usage Notes
14513 ///
14514 ///Vulkan 1.3 version of `cmd_bind_vertex_buffers` that additionally
14515 ///accepts optional buffer sizes and strides.
14516 ///
14517 ///**Sizes**: if provided, the driver knows where each buffer ends and
14518 ///can perform bounds checking. Pass null to use the full buffer size.
14519 ///
14520 ///**Strides**: if provided, overrides the stride specified in the
14521 ///pipeline's vertex input state. This enables dynamic vertex stride
14522 ///without creating separate pipeline permutations. Pass null to use
14523 ///the pipeline's static stride.
14524 ///
14525 ///Prefer this over `cmd_bind_vertex_buffers` when targeting
14526 ///Vulkan 1.3+.
14527 pub unsafe fn cmd_bind_vertex_buffers2(
14528 &self,
14529 command_buffer: CommandBuffer,
14530 first_binding: u32,
14531 p_buffers: &[Buffer],
14532 p_offsets: &u64,
14533 p_sizes: Option<&u64>,
14534 p_strides: Option<&u64>,
14535 ) {
14536 let fp = self
14537 .commands()
14538 .cmd_bind_vertex_buffers2
14539 .expect("vkCmdBindVertexBuffers2 not loaded");
14540 let p_sizes_ptr = p_sizes.map_or(core::ptr::null(), core::ptr::from_ref);
14541 let p_strides_ptr = p_strides.map_or(core::ptr::null(), core::ptr::from_ref);
14542 unsafe {
14543 fp(
14544 command_buffer,
14545 first_binding,
14546 p_buffers.len() as u32,
14547 p_buffers.as_ptr(),
14548 p_offsets,
14549 p_sizes_ptr,
14550 p_strides_ptr,
14551 )
14552 };
14553 }
14554 ///Wraps [`vkCmdSetDepthTestEnable`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthTestEnable.html).
14555 /**
14556 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14557 ///
14558 ///# Safety
14559 ///- `commandBuffer` (self) must be valid and not destroyed.
14560 ///- `commandBuffer` must be externally synchronized.
14561 ///
14562 ///# Panics
14563 ///Panics if `vkCmdSetDepthTestEnable` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14564 ///
14565 ///# Usage Notes
14566 ///
14567 ///Dynamically enables or disables depth testing. Only takes effect if
14568 ///the pipeline was created with `DYNAMIC_STATE_DEPTH_TEST_ENABLE`.
14569 ///
14570 ///When disabled, all fragments pass the depth test regardless of the
14571 ///depth buffer contents. Useful for UI overlays, skyboxes, or
14572 ///full-screen post-processing passes.
14573 ///
14574 ///Core dynamic state in Vulkan 1.3.
14575 pub unsafe fn cmd_set_depth_test_enable(
14576 &self,
14577 command_buffer: CommandBuffer,
14578 depth_test_enable: bool,
14579 ) {
14580 let fp = self
14581 .commands()
14582 .cmd_set_depth_test_enable
14583 .expect("vkCmdSetDepthTestEnable not loaded");
14584 unsafe { fp(command_buffer, depth_test_enable as u32) };
14585 }
14586 ///Wraps [`vkCmdSetDepthWriteEnable`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthWriteEnable.html).
14587 /**
14588 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14589 ///
14590 ///# Safety
14591 ///- `commandBuffer` (self) must be valid and not destroyed.
14592 ///- `commandBuffer` must be externally synchronized.
14593 ///
14594 ///# Panics
14595 ///Panics if `vkCmdSetDepthWriteEnable` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14596 ///
14597 ///# Usage Notes
14598 ///
14599 ///Dynamically enables or disables writes to the depth buffer. Only
14600 ///takes effect if the pipeline was created with
14601 ///`DYNAMIC_STATE_DEPTH_WRITE_ENABLE`.
14602 ///
14603 ///Disable depth writes when:
14604 ///
14605 ///- Drawing transparent objects (they should test against depth but
14606 /// not write to it).
14607 ///- Drawing skyboxes after the opaque pass.
14608 ///- Performing post-processing with depth reads but no depth output.
14609 ///
14610 ///Depth testing and depth writing are independent controls, you can
14611 ///test without writing, or write without testing.
14612 ///
14613 ///Core dynamic state in Vulkan 1.3.
14614 pub unsafe fn cmd_set_depth_write_enable(
14615 &self,
14616 command_buffer: CommandBuffer,
14617 depth_write_enable: bool,
14618 ) {
14619 let fp = self
14620 .commands()
14621 .cmd_set_depth_write_enable
14622 .expect("vkCmdSetDepthWriteEnable not loaded");
14623 unsafe { fp(command_buffer, depth_write_enable as u32) };
14624 }
14625 ///Wraps [`vkCmdSetDepthCompareOp`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthCompareOp.html).
14626 /**
14627 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14628 ///
14629 ///# Safety
14630 ///- `commandBuffer` (self) must be valid and not destroyed.
14631 ///- `commandBuffer` must be externally synchronized.
14632 ///
14633 ///# Panics
14634 ///Panics if `vkCmdSetDepthCompareOp` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14635 ///
14636 ///# Usage Notes
14637 ///
14638 ///Dynamically sets the depth comparison operator. Only takes effect if
14639 ///the pipeline was created with `DYNAMIC_STATE_DEPTH_COMPARE_OP`.
14640 ///
14641 ///Values: `COMPARE_OP_LESS` (the common default for forward rendering),
14642 ///`COMPARE_OP_GREATER` (for reverse-Z), `COMPARE_OP_LESS_OR_EQUAL`,
14643 ///`COMPARE_OP_ALWAYS`, etc.
14644 ///
14645 ///**Reverse-Z**: using a reversed depth buffer (near=1.0, far=0.0)
14646 ///with `COMPARE_OP_GREATER` provides better floating-point precision
14647 ///distribution across the depth range. This is the recommended setup
14648 ///for modern rendering.
14649 ///
14650 ///Core dynamic state in Vulkan 1.3.
14651 pub unsafe fn cmd_set_depth_compare_op(
14652 &self,
14653 command_buffer: CommandBuffer,
14654 depth_compare_op: CompareOp,
14655 ) {
14656 let fp = self
14657 .commands()
14658 .cmd_set_depth_compare_op
14659 .expect("vkCmdSetDepthCompareOp not loaded");
14660 unsafe { fp(command_buffer, depth_compare_op) };
14661 }
14662 ///Wraps [`vkCmdSetDepthBoundsTestEnable`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthBoundsTestEnable.html).
14663 /**
14664 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14665 ///
14666 ///# Safety
14667 ///- `commandBuffer` (self) must be valid and not destroyed.
14668 ///- `commandBuffer` must be externally synchronized.
14669 ///
14670 ///# Panics
14671 ///Panics if `vkCmdSetDepthBoundsTestEnable` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14672 ///
14673 ///# Usage Notes
14674 ///
14675 ///Dynamically enables or disables the depth bounds test. Only takes
14676 ///effect if the pipeline was created with
14677 ///`DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE`.
14678 ///
14679 ///When enabled, fragments are discarded if the existing depth buffer
14680 ///value falls outside the range set by `cmd_set_depth_bounds`. When
14681 ///disabled, the test is skipped.
14682 ///
14683 ///Requires the `depth_bounds` device feature.
14684 ///
14685 ///Core dynamic state in Vulkan 1.3.
14686 pub unsafe fn cmd_set_depth_bounds_test_enable(
14687 &self,
14688 command_buffer: CommandBuffer,
14689 depth_bounds_test_enable: bool,
14690 ) {
14691 let fp = self
14692 .commands()
14693 .cmd_set_depth_bounds_test_enable
14694 .expect("vkCmdSetDepthBoundsTestEnable not loaded");
14695 unsafe { fp(command_buffer, depth_bounds_test_enable as u32) };
14696 }
14697 ///Wraps [`vkCmdSetStencilTestEnable`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetStencilTestEnable.html).
14698 /**
14699 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14700 ///
14701 ///# Safety
14702 ///- `commandBuffer` (self) must be valid and not destroyed.
14703 ///- `commandBuffer` must be externally synchronized.
14704 ///
14705 ///# Panics
14706 ///Panics if `vkCmdSetStencilTestEnable` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14707 ///
14708 ///# Usage Notes
14709 ///
14710 ///Dynamically enables or disables stencil testing. Only takes effect
14711 ///if the pipeline was created with
14712 ///`DYNAMIC_STATE_STENCIL_TEST_ENABLE`.
14713 ///
14714 ///When disabled, fragments pass the stencil test unconditionally and
14715 ///no stencil writes occur.
14716 ///
14717 ///Core dynamic state in Vulkan 1.3.
14718 pub unsafe fn cmd_set_stencil_test_enable(
14719 &self,
14720 command_buffer: CommandBuffer,
14721 stencil_test_enable: bool,
14722 ) {
14723 let fp = self
14724 .commands()
14725 .cmd_set_stencil_test_enable
14726 .expect("vkCmdSetStencilTestEnable not loaded");
14727 unsafe { fp(command_buffer, stencil_test_enable as u32) };
14728 }
14729 ///Wraps [`vkCmdSetStencilOp`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetStencilOp.html).
14730 /**
14731 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14732 ///
14733 ///# Safety
14734 ///- `commandBuffer` (self) must be valid and not destroyed.
14735 ///- `commandBuffer` must be externally synchronized.
14736 ///
14737 ///# Panics
14738 ///Panics if `vkCmdSetStencilOp` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14739 ///
14740 ///# Usage Notes
14741 ///
14742 ///Dynamically sets the stencil operations for front-facing,
14743 ///back-facing, or both face sets. Only takes effect if the pipeline
14744 ///was created with `DYNAMIC_STATE_STENCIL_OP`.
14745 ///
14746 ///Sets four values per face:
14747 ///
14748 ///- **`fail_op`**: action when the stencil test fails.
14749 ///- **`pass_op`**: action when both stencil and depth tests pass.
14750 ///- **`depth_fail_op`**: action when stencil passes but depth fails.
14751 ///- **`compare_op`**: the stencil comparison function.
14752 ///
14753 ///Common operations: `KEEP`, `REPLACE`, `INCREMENT_AND_CLAMP`,
14754 ///`DECREMENT_AND_CLAMP`, `INVERT`, `ZERO`.
14755 ///
14756 ///Core dynamic state in Vulkan 1.3.
14757 pub unsafe fn cmd_set_stencil_op(
14758 &self,
14759 command_buffer: CommandBuffer,
14760 face_mask: StencilFaceFlags,
14761 fail_op: StencilOp,
14762 pass_op: StencilOp,
14763 depth_fail_op: StencilOp,
14764 compare_op: CompareOp,
14765 ) {
14766 let fp = self
14767 .commands()
14768 .cmd_set_stencil_op
14769 .expect("vkCmdSetStencilOp not loaded");
14770 unsafe {
14771 fp(
14772 command_buffer,
14773 face_mask,
14774 fail_op,
14775 pass_op,
14776 depth_fail_op,
14777 compare_op,
14778 )
14779 };
14780 }
14781 ///Wraps [`vkCmdSetPatchControlPointsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetPatchControlPointsEXT.html).
14782 /**
14783 Provided by **VK_EXT_extended_dynamic_state2**.*/
14784 ///
14785 ///# Safety
14786 ///- `commandBuffer` (self) must be valid and not destroyed.
14787 ///- `commandBuffer` must be externally synchronized.
14788 ///
14789 ///# Panics
14790 ///Panics if `vkCmdSetPatchControlPointsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14791 ///
14792 ///# Usage Notes
14793 ///
14794 ///Dynamically sets the number of control points per patch for
14795 ///tessellation. Overrides the value specified at pipeline creation.
14796 ///
14797 ///Typical values: 3 (triangles), 4 (quads), 16 (bicubic patches).
14798 ///The maximum is `maxTessellationPatchSize` (at least 32).
14799 ///
14800 ///Requires the `extendedDynamicState2PatchControlPoints` feature.
14801 ///
14802 ///Provided by `VK_EXT_extended_dynamic_state2`.
14803 pub unsafe fn cmd_set_patch_control_points_ext(
14804 &self,
14805 command_buffer: CommandBuffer,
14806 patch_control_points: u32,
14807 ) {
14808 let fp = self
14809 .commands()
14810 .cmd_set_patch_control_points_ext
14811 .expect("vkCmdSetPatchControlPointsEXT not loaded");
14812 unsafe { fp(command_buffer, patch_control_points) };
14813 }
14814 ///Wraps [`vkCmdSetRasterizerDiscardEnable`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetRasterizerDiscardEnable.html).
14815 /**
14816 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14817 ///
14818 ///# Safety
14819 ///- `commandBuffer` (self) must be valid and not destroyed.
14820 ///- `commandBuffer` must be externally synchronized.
14821 ///
14822 ///# Panics
14823 ///Panics if `vkCmdSetRasterizerDiscardEnable` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14824 ///
14825 ///# Usage Notes
14826 ///
14827 ///Dynamically enables or disables rasterizer discard. Only takes
14828 ///effect if the pipeline was created with
14829 ///`DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE`.
14830 ///
14831 ///When enabled, primitives are discarded before rasterisation, no
14832 ///fragments are generated and no colour/depth output is produced. The
14833 ///vertex and geometry shader stages still execute.
14834 ///
14835 ///Use cases:
14836 ///
14837 ///- **Transform feedback only**: capture transformed vertices without
14838 /// rendering.
14839 ///- **Occlusion pre-pass**: skip fragment shading when only the depth
14840 /// or stencil output matters (though depth writes still require
14841 /// rasterisation).
14842 ///
14843 ///Core dynamic state in Vulkan 1.3.
14844 pub unsafe fn cmd_set_rasterizer_discard_enable(
14845 &self,
14846 command_buffer: CommandBuffer,
14847 rasterizer_discard_enable: bool,
14848 ) {
14849 let fp = self
14850 .commands()
14851 .cmd_set_rasterizer_discard_enable
14852 .expect("vkCmdSetRasterizerDiscardEnable not loaded");
14853 unsafe { fp(command_buffer, rasterizer_discard_enable as u32) };
14854 }
14855 ///Wraps [`vkCmdSetDepthBiasEnable`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthBiasEnable.html).
14856 /**
14857 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14858 ///
14859 ///# Safety
14860 ///- `commandBuffer` (self) must be valid and not destroyed.
14861 ///- `commandBuffer` must be externally synchronized.
14862 ///
14863 ///# Panics
14864 ///Panics if `vkCmdSetDepthBiasEnable` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14865 ///
14866 ///# Usage Notes
14867 ///
14868 ///Dynamically enables or disables depth bias. Only takes effect if the
14869 ///pipeline was created with `DYNAMIC_STATE_DEPTH_BIAS_ENABLE`.
14870 ///
14871 ///When enabled, the depth bias values set by `cmd_set_depth_bias` are
14872 ///applied to fragment depth values. When disabled, no bias is applied
14873 ///regardless of the bias values.
14874 ///
14875 ///Useful for toggling shadow map bias without separate pipelines.
14876 ///
14877 ///Core dynamic state in Vulkan 1.3.
14878 pub unsafe fn cmd_set_depth_bias_enable(
14879 &self,
14880 command_buffer: CommandBuffer,
14881 depth_bias_enable: bool,
14882 ) {
14883 let fp = self
14884 .commands()
14885 .cmd_set_depth_bias_enable
14886 .expect("vkCmdSetDepthBiasEnable not loaded");
14887 unsafe { fp(command_buffer, depth_bias_enable as u32) };
14888 }
14889 ///Wraps [`vkCmdSetLogicOpEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetLogicOpEXT.html).
14890 /**
14891 Provided by **VK_EXT_extended_dynamic_state2**.*/
14892 ///
14893 ///# Safety
14894 ///- `commandBuffer` (self) must be valid and not destroyed.
14895 ///- `commandBuffer` must be externally synchronized.
14896 ///
14897 ///# Panics
14898 ///Panics if `vkCmdSetLogicOpEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14899 ///
14900 ///# Usage Notes
14901 ///
14902 ///Dynamically sets the logic operation used for color blending.
14903 ///Logic ops (AND, OR, XOR, etc.) operate on the raw integer bit
14904 ///patterns of the fragment and framebuffer values.
14905 ///
14906 ///Only effective when logic op is enabled in the pipeline
14907 ///(`logicOpEnable`). Requires the `extendedDynamicState2LogicOp`
14908 ///feature.
14909 ///
14910 ///Provided by `VK_EXT_extended_dynamic_state2`.
14911 pub unsafe fn cmd_set_logic_op_ext(&self, command_buffer: CommandBuffer, logic_op: LogicOp) {
14912 let fp = self
14913 .commands()
14914 .cmd_set_logic_op_ext
14915 .expect("vkCmdSetLogicOpEXT not loaded");
14916 unsafe { fp(command_buffer, logic_op) };
14917 }
14918 ///Wraps [`vkCmdSetPrimitiveRestartEnable`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetPrimitiveRestartEnable.html).
14919 /**
14920 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14921 ///
14922 ///# Safety
14923 ///- `commandBuffer` (self) must be valid and not destroyed.
14924 ///- `commandBuffer` must be externally synchronized.
14925 ///
14926 ///# Panics
14927 ///Panics if `vkCmdSetPrimitiveRestartEnable` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14928 ///
14929 ///# Usage Notes
14930 ///
14931 ///Dynamically enables or disables primitive restart. Only takes effect
14932 ///if the pipeline was created with
14933 ///`DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE`.
14934 ///
14935 ///When enabled, a special index value (0xFFFF for UINT16, 0xFFFFFFFF
14936 ///for UINT32) in the index buffer ends the current primitive and
14937 ///starts a new one. This lets you draw multiple triangle strips or
14938 ///line strips from a single draw call without degenerate triangles.
14939 ///
14940 ///Only meaningful for strip topologies (`TRIANGLE_STRIP`,
14941 ///`LINE_STRIP`, `TRIANGLE_FAN`, etc.).
14942 ///
14943 ///Core dynamic state in Vulkan 1.3.
14944 pub unsafe fn cmd_set_primitive_restart_enable(
14945 &self,
14946 command_buffer: CommandBuffer,
14947 primitive_restart_enable: bool,
14948 ) {
14949 let fp = self
14950 .commands()
14951 .cmd_set_primitive_restart_enable
14952 .expect("vkCmdSetPrimitiveRestartEnable not loaded");
14953 unsafe { fp(command_buffer, primitive_restart_enable as u32) };
14954 }
14955 ///Wraps [`vkCmdSetTessellationDomainOriginEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetTessellationDomainOriginEXT.html).
14956 /**
14957 Provided by **VK_EXT_extended_dynamic_state3**.*/
14958 ///
14959 ///# Safety
14960 ///- `commandBuffer` (self) must be valid and not destroyed.
14961 ///- `commandBuffer` must be externally synchronized.
14962 ///
14963 ///# Panics
14964 ///Panics if `vkCmdSetTessellationDomainOriginEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14965 ///
14966 ///# Usage Notes
14967 ///
14968 ///Dynamically sets the tessellation domain origin:
14969 ///- `UPPER_LEFT`: Vulkan default, (0,0) is the upper-left corner.
14970 ///- `LOWER_LEFT`: OpenGL convention, (0,0) is the lower-left.
14971 ///
14972 ///Affects how tessellation coordinates are interpreted. Useful when
14973 ///porting OpenGL tessellation shaders.
14974 ///
14975 ///Provided by `VK_EXT_extended_dynamic_state3`.
14976 pub unsafe fn cmd_set_tessellation_domain_origin_ext(
14977 &self,
14978 command_buffer: CommandBuffer,
14979 domain_origin: TessellationDomainOrigin,
14980 ) {
14981 let fp = self
14982 .commands()
14983 .cmd_set_tessellation_domain_origin_ext
14984 .expect("vkCmdSetTessellationDomainOriginEXT not loaded");
14985 unsafe { fp(command_buffer, domain_origin) };
14986 }
14987 ///Wraps [`vkCmdSetDepthClampEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthClampEnableEXT.html).
14988 /**
14989 Provided by **VK_EXT_extended_dynamic_state3**.*/
14990 ///
14991 ///# Safety
14992 ///- `commandBuffer` (self) must be valid and not destroyed.
14993 ///- `commandBuffer` must be externally synchronized.
14994 ///
14995 ///# Panics
14996 ///Panics if `vkCmdSetDepthClampEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14997 ///
14998 ///# Usage Notes
14999 ///
15000 ///Dynamically enables or disables depth clamping. When enabled,
15001 ///fragments outside the near/far depth range are clamped instead
15002 ///of being clipped.
15003 ///
15004 ///Useful for shadow mapping and other techniques where clipping
15005 ///at the near/far plane is undesirable.
15006 ///
15007 ///Requires the `depthClamp` device feature.
15008 ///
15009 ///Provided by `VK_EXT_extended_dynamic_state3`.
15010 pub unsafe fn cmd_set_depth_clamp_enable_ext(
15011 &self,
15012 command_buffer: CommandBuffer,
15013 depth_clamp_enable: bool,
15014 ) {
15015 let fp = self
15016 .commands()
15017 .cmd_set_depth_clamp_enable_ext
15018 .expect("vkCmdSetDepthClampEnableEXT not loaded");
15019 unsafe { fp(command_buffer, depth_clamp_enable as u32) };
15020 }
15021 ///Wraps [`vkCmdSetPolygonModeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetPolygonModeEXT.html).
15022 /**
15023 Provided by **VK_EXT_extended_dynamic_state3**.*/
15024 ///
15025 ///# Safety
15026 ///- `commandBuffer` (self) must be valid and not destroyed.
15027 ///- `commandBuffer` must be externally synchronized.
15028 ///
15029 ///# Panics
15030 ///Panics if `vkCmdSetPolygonModeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15031 ///
15032 ///# Usage Notes
15033 ///
15034 ///Dynamically sets the polygon rasterization mode:
15035 ///- `FILL`: normal filled triangles (default).
15036 ///- `LINE`: wireframe rendering.
15037 ///- `POINT`: vertices only.
15038 ///
15039 ///`LINE` and `POINT` require the `fillModeNonSolid` device feature.
15040 ///
15041 ///Provided by `VK_EXT_extended_dynamic_state3`.
15042 pub unsafe fn cmd_set_polygon_mode_ext(
15043 &self,
15044 command_buffer: CommandBuffer,
15045 polygon_mode: PolygonMode,
15046 ) {
15047 let fp = self
15048 .commands()
15049 .cmd_set_polygon_mode_ext
15050 .expect("vkCmdSetPolygonModeEXT not loaded");
15051 unsafe { fp(command_buffer, polygon_mode) };
15052 }
15053 ///Wraps [`vkCmdSetRasterizationSamplesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetRasterizationSamplesEXT.html).
15054 /**
15055 Provided by **VK_EXT_extended_dynamic_state3**.*/
15056 ///
15057 ///# Safety
15058 ///- `commandBuffer` (self) must be valid and not destroyed.
15059 ///- `commandBuffer` must be externally synchronized.
15060 ///
15061 ///# Panics
15062 ///Panics if `vkCmdSetRasterizationSamplesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15063 ///
15064 ///# Usage Notes
15065 ///
15066 ///Dynamically sets the number of rasterization samples
15067 ///(multisampling level). Overrides the sample count specified
15068 ///at pipeline creation.
15069 ///
15070 ///The sample count must be compatible with the render pass
15071 ///attachments.
15072 ///
15073 ///Provided by `VK_EXT_extended_dynamic_state3`.
15074 pub unsafe fn cmd_set_rasterization_samples_ext(
15075 &self,
15076 command_buffer: CommandBuffer,
15077 rasterization_samples: SampleCountFlagBits,
15078 ) {
15079 let fp = self
15080 .commands()
15081 .cmd_set_rasterization_samples_ext
15082 .expect("vkCmdSetRasterizationSamplesEXT not loaded");
15083 unsafe { fp(command_buffer, rasterization_samples) };
15084 }
15085 ///Wraps [`vkCmdSetSampleMaskEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetSampleMaskEXT.html).
15086 /**
15087 Provided by **VK_EXT_extended_dynamic_state3**.*/
15088 ///
15089 ///# Safety
15090 ///- `commandBuffer` (self) must be valid and not destroyed.
15091 ///- `commandBuffer` must be externally synchronized.
15092 ///
15093 ///# Panics
15094 ///Panics if `vkCmdSetSampleMaskEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15095 ///
15096 ///# Usage Notes
15097 ///
15098 ///Dynamically sets the sample mask. The sample mask is ANDed with
15099 ///the coverage mask to determine which samples are written. Bits
15100 ///that are zero disable the corresponding sample.
15101 ///
15102 ///The slice length must match `ceil(rasterizationSamples / 32)`.
15103 ///
15104 ///Provided by `VK_EXT_extended_dynamic_state3`.
15105 pub unsafe fn cmd_set_sample_mask_ext(
15106 &self,
15107 command_buffer: CommandBuffer,
15108 samples: SampleCountFlagBits,
15109 p_sample_mask: Option<&u32>,
15110 ) {
15111 let fp = self
15112 .commands()
15113 .cmd_set_sample_mask_ext
15114 .expect("vkCmdSetSampleMaskEXT not loaded");
15115 let p_sample_mask_ptr = p_sample_mask.map_or(core::ptr::null(), core::ptr::from_ref);
15116 unsafe { fp(command_buffer, samples, p_sample_mask_ptr) };
15117 }
15118 ///Wraps [`vkCmdSetAlphaToCoverageEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetAlphaToCoverageEnableEXT.html).
15119 /**
15120 Provided by **VK_EXT_extended_dynamic_state3**.*/
15121 ///
15122 ///# Safety
15123 ///- `commandBuffer` (self) must be valid and not destroyed.
15124 ///- `commandBuffer` must be externally synchronized.
15125 ///
15126 ///# Panics
15127 ///Panics if `vkCmdSetAlphaToCoverageEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15128 ///
15129 ///# Usage Notes
15130 ///
15131 ///Dynamically enables or disables alpha-to-coverage multisample
15132 ///mode. When enabled, the fragment's alpha value determines which
15133 ///samples are covered, providing order-independent transparency
15134 ///for foliage, fences, etc.
15135 ///
15136 ///Provided by `VK_EXT_extended_dynamic_state3`.
15137 pub unsafe fn cmd_set_alpha_to_coverage_enable_ext(
15138 &self,
15139 command_buffer: CommandBuffer,
15140 alpha_to_coverage_enable: bool,
15141 ) {
15142 let fp = self
15143 .commands()
15144 .cmd_set_alpha_to_coverage_enable_ext
15145 .expect("vkCmdSetAlphaToCoverageEnableEXT not loaded");
15146 unsafe { fp(command_buffer, alpha_to_coverage_enable as u32) };
15147 }
15148 ///Wraps [`vkCmdSetAlphaToOneEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetAlphaToOneEnableEXT.html).
15149 /**
15150 Provided by **VK_EXT_extended_dynamic_state3**.*/
15151 ///
15152 ///# Safety
15153 ///- `commandBuffer` (self) must be valid and not destroyed.
15154 ///- `commandBuffer` must be externally synchronized.
15155 ///
15156 ///# Panics
15157 ///Panics if `vkCmdSetAlphaToOneEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15158 ///
15159 ///# Usage Notes
15160 ///
15161 ///Dynamically enables or disables alpha-to-one mode. When enabled,
15162 ///the fragment's alpha value is replaced with 1.0 after
15163 ///alpha-to-coverage processing.
15164 ///
15165 ///Requires the `alphaToOne` device feature.
15166 ///
15167 ///Provided by `VK_EXT_extended_dynamic_state3`.
15168 pub unsafe fn cmd_set_alpha_to_one_enable_ext(
15169 &self,
15170 command_buffer: CommandBuffer,
15171 alpha_to_one_enable: bool,
15172 ) {
15173 let fp = self
15174 .commands()
15175 .cmd_set_alpha_to_one_enable_ext
15176 .expect("vkCmdSetAlphaToOneEnableEXT not loaded");
15177 unsafe { fp(command_buffer, alpha_to_one_enable as u32) };
15178 }
15179 ///Wraps [`vkCmdSetLogicOpEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetLogicOpEnableEXT.html).
15180 /**
15181 Provided by **VK_EXT_extended_dynamic_state3**.*/
15182 ///
15183 ///# Safety
15184 ///- `commandBuffer` (self) must be valid and not destroyed.
15185 ///- `commandBuffer` must be externally synchronized.
15186 ///
15187 ///# Panics
15188 ///Panics if `vkCmdSetLogicOpEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15189 ///
15190 ///# Usage Notes
15191 ///
15192 ///Dynamically enables or disables logic operations for color
15193 ///blending. When enabled, fragments are combined with framebuffer
15194 ///values using the logic op set by `cmd_set_logic_op_ext` instead
15195 ///of standard blend equations.
15196 ///
15197 ///Logic ops operate on integer bit patterns. They have no effect
15198 ///on floating-point color attachments.
15199 ///
15200 ///Provided by `VK_EXT_extended_dynamic_state3`.
15201 pub unsafe fn cmd_set_logic_op_enable_ext(
15202 &self,
15203 command_buffer: CommandBuffer,
15204 logic_op_enable: bool,
15205 ) {
15206 let fp = self
15207 .commands()
15208 .cmd_set_logic_op_enable_ext
15209 .expect("vkCmdSetLogicOpEnableEXT not loaded");
15210 unsafe { fp(command_buffer, logic_op_enable as u32) };
15211 }
15212 ///Wraps [`vkCmdSetColorBlendEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetColorBlendEnableEXT.html).
15213 /**
15214 Provided by **VK_EXT_extended_dynamic_state3**.*/
15215 ///
15216 ///# Safety
15217 ///- `commandBuffer` (self) must be valid and not destroyed.
15218 ///- `commandBuffer` must be externally synchronized.
15219 ///
15220 ///# Panics
15221 ///Panics if `vkCmdSetColorBlendEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15222 ///
15223 ///# Usage Notes
15224 ///
15225 ///Dynamically enables or disables color blending for each color
15226 ///attachment. Pass a slice of `Bool32` values, one per attachment
15227 ///starting at `first_attachment`.
15228 ///
15229 ///When blending is disabled for an attachment, the fragment color
15230 ///is written directly (no src/dst blending).
15231 ///
15232 ///Provided by `VK_EXT_extended_dynamic_state3`.
15233 pub unsafe fn cmd_set_color_blend_enable_ext(
15234 &self,
15235 command_buffer: CommandBuffer,
15236 first_attachment: u32,
15237 p_color_blend_enables: &[u32],
15238 ) {
15239 let fp = self
15240 .commands()
15241 .cmd_set_color_blend_enable_ext
15242 .expect("vkCmdSetColorBlendEnableEXT not loaded");
15243 unsafe {
15244 fp(
15245 command_buffer,
15246 first_attachment,
15247 p_color_blend_enables.len() as u32,
15248 p_color_blend_enables.as_ptr(),
15249 )
15250 };
15251 }
15252 ///Wraps [`vkCmdSetColorBlendEquationEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetColorBlendEquationEXT.html).
15253 /**
15254 Provided by **VK_EXT_extended_dynamic_state3**.*/
15255 ///
15256 ///# Safety
15257 ///- `commandBuffer` (self) must be valid and not destroyed.
15258 ///- `commandBuffer` must be externally synchronized.
15259 ///
15260 ///# Panics
15261 ///Panics if `vkCmdSetColorBlendEquationEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15262 ///
15263 ///# Usage Notes
15264 ///
15265 ///Dynamically sets the blend equation (src factor, dst factor,
15266 ///blend op) for each color attachment. Each `ColorBlendEquationEXT`
15267 ///specifies both the color and alpha blend parameters.
15268 ///
15269 ///Overrides the values set at pipeline creation. Only effective for
15270 ///attachments where blending is enabled.
15271 ///
15272 ///Provided by `VK_EXT_extended_dynamic_state3`.
15273 pub unsafe fn cmd_set_color_blend_equation_ext(
15274 &self,
15275 command_buffer: CommandBuffer,
15276 first_attachment: u32,
15277 p_color_blend_equations: &[ColorBlendEquationEXT],
15278 ) {
15279 let fp = self
15280 .commands()
15281 .cmd_set_color_blend_equation_ext
15282 .expect("vkCmdSetColorBlendEquationEXT not loaded");
15283 unsafe {
15284 fp(
15285 command_buffer,
15286 first_attachment,
15287 p_color_blend_equations.len() as u32,
15288 p_color_blend_equations.as_ptr(),
15289 )
15290 };
15291 }
15292 ///Wraps [`vkCmdSetColorWriteMaskEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetColorWriteMaskEXT.html).
15293 /**
15294 Provided by **VK_EXT_extended_dynamic_state3**.*/
15295 ///
15296 ///# Safety
15297 ///- `commandBuffer` (self) must be valid and not destroyed.
15298 ///- `commandBuffer` must be externally synchronized.
15299 ///
15300 ///# Panics
15301 ///Panics if `vkCmdSetColorWriteMaskEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15302 ///
15303 ///# Usage Notes
15304 ///
15305 ///Dynamically sets the color write mask for each color attachment.
15306 ///Each `ColorComponentFlags` value controls which channels (R, G,
15307 ///B, A) are written for the corresponding attachment.
15308 ///
15309 ///Provided by `VK_EXT_extended_dynamic_state3`.
15310 pub unsafe fn cmd_set_color_write_mask_ext(
15311 &self,
15312 command_buffer: CommandBuffer,
15313 first_attachment: u32,
15314 p_color_write_masks: &[ColorComponentFlags],
15315 ) {
15316 let fp = self
15317 .commands()
15318 .cmd_set_color_write_mask_ext
15319 .expect("vkCmdSetColorWriteMaskEXT not loaded");
15320 unsafe {
15321 fp(
15322 command_buffer,
15323 first_attachment,
15324 p_color_write_masks.len() as u32,
15325 p_color_write_masks.as_ptr(),
15326 )
15327 };
15328 }
15329 ///Wraps [`vkCmdSetRasterizationStreamEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetRasterizationStreamEXT.html).
15330 /**
15331 Provided by **VK_EXT_extended_dynamic_state3**.*/
15332 ///
15333 ///# Safety
15334 ///- `commandBuffer` (self) must be valid and not destroyed.
15335 ///- `commandBuffer` must be externally synchronized.
15336 ///
15337 ///# Panics
15338 ///Panics if `vkCmdSetRasterizationStreamEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15339 ///
15340 ///# Usage Notes
15341 ///
15342 ///Dynamically sets which vertex stream is used for rasterization
15343 ///when transform feedback is active. Stream 0 is always rasterized
15344 ///by default; other streams can be selected with this command.
15345 ///
15346 ///Requires `VK_EXT_transform_feedback` and the
15347 ///`geometryStreams` feature.
15348 ///
15349 ///Provided by `VK_EXT_extended_dynamic_state3`.
15350 pub unsafe fn cmd_set_rasterization_stream_ext(
15351 &self,
15352 command_buffer: CommandBuffer,
15353 rasterization_stream: u32,
15354 ) {
15355 let fp = self
15356 .commands()
15357 .cmd_set_rasterization_stream_ext
15358 .expect("vkCmdSetRasterizationStreamEXT not loaded");
15359 unsafe { fp(command_buffer, rasterization_stream) };
15360 }
15361 ///Wraps [`vkCmdSetConservativeRasterizationModeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetConservativeRasterizationModeEXT.html).
15362 /**
15363 Provided by **VK_EXT_extended_dynamic_state3**.*/
15364 ///
15365 ///# Safety
15366 ///- `commandBuffer` (self) must be valid and not destroyed.
15367 ///- `commandBuffer` must be externally synchronized.
15368 ///
15369 ///# Panics
15370 ///Panics if `vkCmdSetConservativeRasterizationModeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15371 ///
15372 ///# Usage Notes
15373 ///
15374 ///Dynamically sets the conservative rasterization mode:
15375 ///- `DISABLED`: normal rasterization.
15376 ///- `OVERESTIMATE`: a fragment is generated if the primitive
15377 /// overlaps any part of the pixel.
15378 ///- `UNDERESTIMATE`: a fragment is generated only if the pixel
15379 /// is fully covered.
15380 ///
15381 ///Requires `VK_EXT_conservative_rasterization`.
15382 ///
15383 ///Provided by `VK_EXT_extended_dynamic_state3`.
15384 pub unsafe fn cmd_set_conservative_rasterization_mode_ext(
15385 &self,
15386 command_buffer: CommandBuffer,
15387 conservative_rasterization_mode: ConservativeRasterizationModeEXT,
15388 ) {
15389 let fp = self
15390 .commands()
15391 .cmd_set_conservative_rasterization_mode_ext
15392 .expect("vkCmdSetConservativeRasterizationModeEXT not loaded");
15393 unsafe { fp(command_buffer, conservative_rasterization_mode) };
15394 }
15395 ///Wraps [`vkCmdSetExtraPrimitiveOverestimationSizeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetExtraPrimitiveOverestimationSizeEXT.html).
15396 /**
15397 Provided by **VK_EXT_extended_dynamic_state3**.*/
15398 ///
15399 ///# Safety
15400 ///- `commandBuffer` (self) must be valid and not destroyed.
15401 ///- `commandBuffer` must be externally synchronized.
15402 ///
15403 ///# Panics
15404 ///Panics if `vkCmdSetExtraPrimitiveOverestimationSizeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15405 ///
15406 ///# Usage Notes
15407 ///
15408 ///Dynamically sets the extra overestimation size for conservative
15409 ///rasterization. This expands the primitive by additional pixels
15410 ///beyond the minimum overestimation guaranteed by the implementation.
15411 ///
15412 ///The value is in units of pixels. 0.0 means no extra
15413 ///overestimation beyond the implementation minimum.
15414 ///
15415 ///Requires `VK_EXT_conservative_rasterization`.
15416 ///
15417 ///Provided by `VK_EXT_extended_dynamic_state3`.
15418 pub unsafe fn cmd_set_extra_primitive_overestimation_size_ext(
15419 &self,
15420 command_buffer: CommandBuffer,
15421 extra_primitive_overestimation_size: f32,
15422 ) {
15423 let fp = self
15424 .commands()
15425 .cmd_set_extra_primitive_overestimation_size_ext
15426 .expect("vkCmdSetExtraPrimitiveOverestimationSizeEXT not loaded");
15427 unsafe { fp(command_buffer, extra_primitive_overestimation_size) };
15428 }
15429 ///Wraps [`vkCmdSetDepthClipEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthClipEnableEXT.html).
15430 /**
15431 Provided by **VK_EXT_extended_dynamic_state3**.*/
15432 ///
15433 ///# Safety
15434 ///- `commandBuffer` (self) must be valid and not destroyed.
15435 ///- `commandBuffer` must be externally synchronized.
15436 ///
15437 ///# Panics
15438 ///Panics if `vkCmdSetDepthClipEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15439 ///
15440 ///# Usage Notes
15441 ///
15442 ///Dynamically enables or disables depth clipping. When disabled,
15443 ///primitives are not clipped against the near and far planes
15444 ///(equivalent to `depthClampEnable`, but controlled separately).
15445 ///
15446 ///Requires `VK_EXT_depth_clip_enable` and the `depthClipEnable`
15447 ///feature.
15448 ///
15449 ///Provided by `VK_EXT_extended_dynamic_state3`.
15450 pub unsafe fn cmd_set_depth_clip_enable_ext(
15451 &self,
15452 command_buffer: CommandBuffer,
15453 depth_clip_enable: bool,
15454 ) {
15455 let fp = self
15456 .commands()
15457 .cmd_set_depth_clip_enable_ext
15458 .expect("vkCmdSetDepthClipEnableEXT not loaded");
15459 unsafe { fp(command_buffer, depth_clip_enable as u32) };
15460 }
15461 ///Wraps [`vkCmdSetSampleLocationsEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetSampleLocationsEnableEXT.html).
15462 /**
15463 Provided by **VK_EXT_extended_dynamic_state3**.*/
15464 ///
15465 ///# Safety
15466 ///- `commandBuffer` (self) must be valid and not destroyed.
15467 ///- `commandBuffer` must be externally synchronized.
15468 ///
15469 ///# Panics
15470 ///Panics if `vkCmdSetSampleLocationsEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15471 ///
15472 ///# Usage Notes
15473 ///
15474 ///Dynamically enables or disables custom sample locations. When
15475 ///enabled, the sample positions used for multisampling are taken
15476 ///from the locations set by `cmd_set_sample_locations_ext` instead
15477 ///of the implementation defaults.
15478 ///
15479 ///Requires `VK_EXT_sample_locations`.
15480 ///
15481 ///Provided by `VK_EXT_extended_dynamic_state3`.
15482 pub unsafe fn cmd_set_sample_locations_enable_ext(
15483 &self,
15484 command_buffer: CommandBuffer,
15485 sample_locations_enable: bool,
15486 ) {
15487 let fp = self
15488 .commands()
15489 .cmd_set_sample_locations_enable_ext
15490 .expect("vkCmdSetSampleLocationsEnableEXT not loaded");
15491 unsafe { fp(command_buffer, sample_locations_enable as u32) };
15492 }
15493 ///Wraps [`vkCmdSetColorBlendAdvancedEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetColorBlendAdvancedEXT.html).
15494 /**
15495 Provided by **VK_EXT_extended_dynamic_state3**.*/
15496 ///
15497 ///# Safety
15498 ///- `commandBuffer` (self) must be valid and not destroyed.
15499 ///- `commandBuffer` must be externally synchronized.
15500 ///
15501 ///# Panics
15502 ///Panics if `vkCmdSetColorBlendAdvancedEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15503 ///
15504 ///# Usage Notes
15505 ///
15506 ///Dynamically sets advanced blend parameters per color attachment.
15507 ///Each `ColorBlendAdvancedEXT` specifies the advanced blend
15508 ///operation, whether src/dst are premultiplied, and the blend
15509 ///overlap mode (uncorrelated, disjoint, conjoint).
15510 ///
15511 ///Only applies when using advanced blend operations (not the
15512 ///standard blend factors). Requires `VK_EXT_blend_operation_advanced`.
15513 ///
15514 ///Provided by `VK_EXT_extended_dynamic_state3`.
15515 pub unsafe fn cmd_set_color_blend_advanced_ext(
15516 &self,
15517 command_buffer: CommandBuffer,
15518 first_attachment: u32,
15519 p_color_blend_advanced: &[ColorBlendAdvancedEXT],
15520 ) {
15521 let fp = self
15522 .commands()
15523 .cmd_set_color_blend_advanced_ext
15524 .expect("vkCmdSetColorBlendAdvancedEXT not loaded");
15525 unsafe {
15526 fp(
15527 command_buffer,
15528 first_attachment,
15529 p_color_blend_advanced.len() as u32,
15530 p_color_blend_advanced.as_ptr(),
15531 )
15532 };
15533 }
15534 ///Wraps [`vkCmdSetProvokingVertexModeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetProvokingVertexModeEXT.html).
15535 /**
15536 Provided by **VK_EXT_extended_dynamic_state3**.*/
15537 ///
15538 ///# Safety
15539 ///- `commandBuffer` (self) must be valid and not destroyed.
15540 ///- `commandBuffer` must be externally synchronized.
15541 ///
15542 ///# Panics
15543 ///Panics if `vkCmdSetProvokingVertexModeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15544 ///
15545 ///# Usage Notes
15546 ///
15547 ///Dynamically sets which vertex in a primitive is the provoking
15548 ///vertex (the vertex whose flat-shaded attributes are used):
15549 ///- `FIRST_VERTEX`: first vertex of the primitive (Vulkan default).
15550 ///- `LAST_VERTEX`: last vertex (OpenGL convention).
15551 ///
15552 ///Requires `VK_EXT_provoking_vertex` and the
15553 ///`provokingVertexLast` feature for `LAST_VERTEX` mode.
15554 ///
15555 ///Provided by `VK_EXT_extended_dynamic_state3`.
15556 pub unsafe fn cmd_set_provoking_vertex_mode_ext(
15557 &self,
15558 command_buffer: CommandBuffer,
15559 provoking_vertex_mode: ProvokingVertexModeEXT,
15560 ) {
15561 let fp = self
15562 .commands()
15563 .cmd_set_provoking_vertex_mode_ext
15564 .expect("vkCmdSetProvokingVertexModeEXT not loaded");
15565 unsafe { fp(command_buffer, provoking_vertex_mode) };
15566 }
15567 ///Wraps [`vkCmdSetLineRasterizationModeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetLineRasterizationModeEXT.html).
15568 /**
15569 Provided by **VK_EXT_extended_dynamic_state3**.*/
15570 ///
15571 ///# Safety
15572 ///- `commandBuffer` (self) must be valid and not destroyed.
15573 ///- `commandBuffer` must be externally synchronized.
15574 ///
15575 ///# Panics
15576 ///Panics if `vkCmdSetLineRasterizationModeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15577 ///
15578 ///# Usage Notes
15579 ///
15580 ///Dynamically sets the line rasterization mode:
15581 ///- `DEFAULT`: implementation default.
15582 ///- `RECTANGULAR`: lines are rasterized as parallelograms (Vulkan
15583 /// default).
15584 ///- `BRESENHAM`: pixel-exact Bresenham lines.
15585 ///- `RECTANGULAR_SMOOTH`: antialiased rectangular lines.
15586 ///
15587 ///Requires `VK_EXT_line_rasterization` and the corresponding
15588 ///device feature for the chosen mode.
15589 ///
15590 ///Provided by `VK_EXT_extended_dynamic_state3`.
15591 pub unsafe fn cmd_set_line_rasterization_mode_ext(
15592 &self,
15593 command_buffer: CommandBuffer,
15594 line_rasterization_mode: LineRasterizationModeEXT,
15595 ) {
15596 let fp = self
15597 .commands()
15598 .cmd_set_line_rasterization_mode_ext
15599 .expect("vkCmdSetLineRasterizationModeEXT not loaded");
15600 unsafe { fp(command_buffer, line_rasterization_mode) };
15601 }
15602 ///Wraps [`vkCmdSetLineStippleEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetLineStippleEnableEXT.html).
15603 /**
15604 Provided by **VK_EXT_extended_dynamic_state3**.*/
15605 ///
15606 ///# Safety
15607 ///- `commandBuffer` (self) must be valid and not destroyed.
15608 ///- `commandBuffer` must be externally synchronized.
15609 ///
15610 ///# Panics
15611 ///Panics if `vkCmdSetLineStippleEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15612 ///
15613 ///# Usage Notes
15614 ///
15615 ///Dynamically enables or disables line stippling. When enabled,
15616 ///lines are drawn with a repeating pattern defined by
15617 ///`cmd_set_line_stipple` (core 1.4) or `cmd_set_line_stipple_ext`.
15618 ///
15619 ///Requires `VK_EXT_line_rasterization` and the `stippledLineEnable`
15620 ///feature for the active line rasterization mode.
15621 ///
15622 ///Provided by `VK_EXT_extended_dynamic_state3`.
15623 pub unsafe fn cmd_set_line_stipple_enable_ext(
15624 &self,
15625 command_buffer: CommandBuffer,
15626 stippled_line_enable: bool,
15627 ) {
15628 let fp = self
15629 .commands()
15630 .cmd_set_line_stipple_enable_ext
15631 .expect("vkCmdSetLineStippleEnableEXT not loaded");
15632 unsafe { fp(command_buffer, stippled_line_enable as u32) };
15633 }
15634 ///Wraps [`vkCmdSetDepthClipNegativeOneToOneEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthClipNegativeOneToOneEXT.html).
15635 /**
15636 Provided by **VK_EXT_extended_dynamic_state3**.*/
15637 ///
15638 ///# Safety
15639 ///- `commandBuffer` (self) must be valid and not destroyed.
15640 ///- `commandBuffer` must be externally synchronized.
15641 ///
15642 ///# Panics
15643 ///Panics if `vkCmdSetDepthClipNegativeOneToOneEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15644 ///
15645 ///# Usage Notes
15646 ///
15647 ///Dynamically sets the depth clip range convention:
15648 ///- `true`: NDC depth range is [-1, 1] (OpenGL convention).
15649 ///- `false`: NDC depth range is [0, 1] (Vulkan default).
15650 ///
15651 ///Useful for porting OpenGL content or using reversed-Z with
15652 ///OpenGL-style projections.
15653 ///
15654 ///Requires `VK_EXT_depth_clip_control` and the
15655 ///`depthClipControl` feature.
15656 ///
15657 ///Provided by `VK_EXT_extended_dynamic_state3`.
15658 pub unsafe fn cmd_set_depth_clip_negative_one_to_one_ext(
15659 &self,
15660 command_buffer: CommandBuffer,
15661 negative_one_to_one: bool,
15662 ) {
15663 let fp = self
15664 .commands()
15665 .cmd_set_depth_clip_negative_one_to_one_ext
15666 .expect("vkCmdSetDepthClipNegativeOneToOneEXT not loaded");
15667 unsafe { fp(command_buffer, negative_one_to_one as u32) };
15668 }
15669 ///Wraps [`vkCmdSetViewportWScalingEnableNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetViewportWScalingEnableNV.html).
15670 /**
15671 Provided by **VK_EXT_extended_dynamic_state3**.*/
15672 ///
15673 ///# Safety
15674 ///- `commandBuffer` (self) must be valid and not destroyed.
15675 ///- `commandBuffer` must be externally synchronized.
15676 ///
15677 ///# Panics
15678 ///Panics if `vkCmdSetViewportWScalingEnableNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15679 ///
15680 ///# Usage Notes
15681 ///
15682 ///Dynamically enables or disables viewport W scaling. When enabled,
15683 ///the x and y viewport coordinates are divided by an additional
15684 ///per-viewport W scaling factor, which can be used for lens-matched
15685 ///shading in VR.
15686 ///
15687 ///Part of `VK_NV_clip_space_w_scaling`.
15688 ///
15689 ///Provided by `VK_EXT_extended_dynamic_state3`.
15690 pub unsafe fn cmd_set_viewport_w_scaling_enable_nv(
15691 &self,
15692 command_buffer: CommandBuffer,
15693 viewport_w_scaling_enable: bool,
15694 ) {
15695 let fp = self
15696 .commands()
15697 .cmd_set_viewport_w_scaling_enable_nv
15698 .expect("vkCmdSetViewportWScalingEnableNV not loaded");
15699 unsafe { fp(command_buffer, viewport_w_scaling_enable as u32) };
15700 }
15701 ///Wraps [`vkCmdSetViewportSwizzleNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetViewportSwizzleNV.html).
15702 /**
15703 Provided by **VK_EXT_extended_dynamic_state3**.*/
15704 ///
15705 ///# Safety
15706 ///- `commandBuffer` (self) must be valid and not destroyed.
15707 ///- `commandBuffer` must be externally synchronized.
15708 ///
15709 ///# Panics
15710 ///Panics if `vkCmdSetViewportSwizzleNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15711 ///
15712 ///# Usage Notes
15713 ///
15714 ///Dynamically sets the viewport swizzle for each viewport. A
15715 ///swizzle remaps each output component (x, y, z, w) to any input
15716 ///component, optionally negated.
15717 ///
15718 ///Useful for single-pass cubemap rendering and other multi-view
15719 ///projection tricks.
15720 ///
15721 ///Part of `VK_NV_viewport_swizzle`.
15722 ///
15723 ///Provided by `VK_EXT_extended_dynamic_state3`.
15724 pub unsafe fn cmd_set_viewport_swizzle_nv(
15725 &self,
15726 command_buffer: CommandBuffer,
15727 first_viewport: u32,
15728 p_viewport_swizzles: &[ViewportSwizzleNV],
15729 ) {
15730 let fp = self
15731 .commands()
15732 .cmd_set_viewport_swizzle_nv
15733 .expect("vkCmdSetViewportSwizzleNV not loaded");
15734 unsafe {
15735 fp(
15736 command_buffer,
15737 first_viewport,
15738 p_viewport_swizzles.len() as u32,
15739 p_viewport_swizzles.as_ptr(),
15740 )
15741 };
15742 }
15743 ///Wraps [`vkCmdSetCoverageToColorEnableNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetCoverageToColorEnableNV.html).
15744 /**
15745 Provided by **VK_EXT_extended_dynamic_state3**.*/
15746 ///
15747 ///# Safety
15748 ///- `commandBuffer` (self) must be valid and not destroyed.
15749 ///- `commandBuffer` must be externally synchronized.
15750 ///
15751 ///# Panics
15752 ///Panics if `vkCmdSetCoverageToColorEnableNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15753 ///
15754 ///# Usage Notes
15755 ///
15756 ///Dynamically enables or disables coverage-to-color mode. When
15757 ///enabled, the fragment coverage mask is written to a specified
15758 ///color attachment instead of (or in addition to) the normal color
15759 ///output.
15760 ///
15761 ///Part of `VK_NV_fragment_coverage_to_color`.
15762 ///
15763 ///Provided by `VK_EXT_extended_dynamic_state3`.
15764 pub unsafe fn cmd_set_coverage_to_color_enable_nv(
15765 &self,
15766 command_buffer: CommandBuffer,
15767 coverage_to_color_enable: bool,
15768 ) {
15769 let fp = self
15770 .commands()
15771 .cmd_set_coverage_to_color_enable_nv
15772 .expect("vkCmdSetCoverageToColorEnableNV not loaded");
15773 unsafe { fp(command_buffer, coverage_to_color_enable as u32) };
15774 }
15775 ///Wraps [`vkCmdSetCoverageToColorLocationNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetCoverageToColorLocationNV.html).
15776 /**
15777 Provided by **VK_EXT_extended_dynamic_state3**.*/
15778 ///
15779 ///# Safety
15780 ///- `commandBuffer` (self) must be valid and not destroyed.
15781 ///- `commandBuffer` must be externally synchronized.
15782 ///
15783 ///# Panics
15784 ///Panics if `vkCmdSetCoverageToColorLocationNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15785 ///
15786 ///# Usage Notes
15787 ///
15788 ///Dynamically sets which color attachment receives the coverage
15789 ///mask when coverage-to-color is enabled.
15790 ///
15791 ///Only effective when `cmd_set_coverage_to_color_enable_nv` is true.
15792 ///
15793 ///Part of `VK_NV_fragment_coverage_to_color`.
15794 ///
15795 ///Provided by `VK_EXT_extended_dynamic_state3`.
15796 pub unsafe fn cmd_set_coverage_to_color_location_nv(
15797 &self,
15798 command_buffer: CommandBuffer,
15799 coverage_to_color_location: u32,
15800 ) {
15801 let fp = self
15802 .commands()
15803 .cmd_set_coverage_to_color_location_nv
15804 .expect("vkCmdSetCoverageToColorLocationNV not loaded");
15805 unsafe { fp(command_buffer, coverage_to_color_location) };
15806 }
15807 ///Wraps [`vkCmdSetCoverageModulationModeNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetCoverageModulationModeNV.html).
15808 /**
15809 Provided by **VK_EXT_extended_dynamic_state3**.*/
15810 ///
15811 ///# Safety
15812 ///- `commandBuffer` (self) must be valid and not destroyed.
15813 ///- `commandBuffer` must be externally synchronized.
15814 ///
15815 ///# Panics
15816 ///Panics if `vkCmdSetCoverageModulationModeNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15817 ///
15818 ///# Usage Notes
15819 ///
15820 ///Dynamically sets how the coverage mask is combined with the
15821 ///fragment's color. Modes include `NONE`, `RGB`, `ALPHA`, and
15822 ///`RGBA`.
15823 ///
15824 ///Part of the NV coverage modulation feature used with
15825 ///`VK_NV_framebuffer_mixed_samples`.
15826 ///
15827 ///Provided by `VK_EXT_extended_dynamic_state3`.
15828 pub unsafe fn cmd_set_coverage_modulation_mode_nv(
15829 &self,
15830 command_buffer: CommandBuffer,
15831 coverage_modulation_mode: CoverageModulationModeNV,
15832 ) {
15833 let fp = self
15834 .commands()
15835 .cmd_set_coverage_modulation_mode_nv
15836 .expect("vkCmdSetCoverageModulationModeNV not loaded");
15837 unsafe { fp(command_buffer, coverage_modulation_mode) };
15838 }
15839 ///Wraps [`vkCmdSetCoverageModulationTableEnableNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetCoverageModulationTableEnableNV.html).
15840 /**
15841 Provided by **VK_EXT_extended_dynamic_state3**.*/
15842 ///
15843 ///# Safety
15844 ///- `commandBuffer` (self) must be valid and not destroyed.
15845 ///- `commandBuffer` must be externally synchronized.
15846 ///
15847 ///# Panics
15848 ///Panics if `vkCmdSetCoverageModulationTableEnableNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15849 ///
15850 ///# Usage Notes
15851 ///
15852 ///Dynamically enables or disables the coverage modulation lookup
15853 ///table. When enabled, the coverage value indexes into a table set
15854 ///by `cmd_set_coverage_modulation_table_nv` instead of using the
15855 ///default linear modulation.
15856 ///
15857 ///Part of `VK_NV_framebuffer_mixed_samples`.
15858 ///
15859 ///Provided by `VK_EXT_extended_dynamic_state3`.
15860 pub unsafe fn cmd_set_coverage_modulation_table_enable_nv(
15861 &self,
15862 command_buffer: CommandBuffer,
15863 coverage_modulation_table_enable: bool,
15864 ) {
15865 let fp = self
15866 .commands()
15867 .cmd_set_coverage_modulation_table_enable_nv
15868 .expect("vkCmdSetCoverageModulationTableEnableNV not loaded");
15869 unsafe { fp(command_buffer, coverage_modulation_table_enable as u32) };
15870 }
15871 ///Wraps [`vkCmdSetCoverageModulationTableNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetCoverageModulationTableNV.html).
15872 /**
15873 Provided by **VK_EXT_extended_dynamic_state3**.*/
15874 ///
15875 ///# Safety
15876 ///- `commandBuffer` (self) must be valid and not destroyed.
15877 ///- `commandBuffer` must be externally synchronized.
15878 ///
15879 ///# Panics
15880 ///Panics if `vkCmdSetCoverageModulationTableNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15881 ///
15882 ///# Usage Notes
15883 ///
15884 ///Dynamically sets the coverage modulation lookup table. Each entry
15885 ///maps a coverage sample count to a modulation factor (0.0–1.0).
15886 ///
15887 ///Only used when coverage modulation table is enabled via
15888 ///`cmd_set_coverage_modulation_table_enable_nv`.
15889 ///
15890 ///Part of `VK_NV_framebuffer_mixed_samples`.
15891 ///
15892 ///Provided by `VK_EXT_extended_dynamic_state3`.
15893 pub unsafe fn cmd_set_coverage_modulation_table_nv(
15894 &self,
15895 command_buffer: CommandBuffer,
15896 p_coverage_modulation_table: &[f32],
15897 ) {
15898 let fp = self
15899 .commands()
15900 .cmd_set_coverage_modulation_table_nv
15901 .expect("vkCmdSetCoverageModulationTableNV not loaded");
15902 unsafe {
15903 fp(
15904 command_buffer,
15905 p_coverage_modulation_table.len() as u32,
15906 p_coverage_modulation_table.as_ptr(),
15907 )
15908 };
15909 }
15910 ///Wraps [`vkCmdSetShadingRateImageEnableNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetShadingRateImageEnableNV.html).
15911 /**
15912 Provided by **VK_EXT_extended_dynamic_state3**.*/
15913 ///
15914 ///# Safety
15915 ///- `commandBuffer` (self) must be valid and not destroyed.
15916 ///- `commandBuffer` must be externally synchronized.
15917 ///
15918 ///# Panics
15919 ///Panics if `vkCmdSetShadingRateImageEnableNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15920 ///
15921 ///# Usage Notes
15922 ///
15923 ///Dynamically enables or disables the shading rate image. When
15924 ///enabled, fragment shading rate is read from a shading rate image
15925 ///attachment instead of using a uniform rate.
15926 ///
15927 ///Part of `VK_NV_shading_rate_image`.
15928 ///
15929 ///Provided by `VK_EXT_extended_dynamic_state3`.
15930 pub unsafe fn cmd_set_shading_rate_image_enable_nv(
15931 &self,
15932 command_buffer: CommandBuffer,
15933 shading_rate_image_enable: bool,
15934 ) {
15935 let fp = self
15936 .commands()
15937 .cmd_set_shading_rate_image_enable_nv
15938 .expect("vkCmdSetShadingRateImageEnableNV not loaded");
15939 unsafe { fp(command_buffer, shading_rate_image_enable as u32) };
15940 }
15941 ///Wraps [`vkCmdSetCoverageReductionModeNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetCoverageReductionModeNV.html).
15942 /**
15943 Provided by **VK_EXT_extended_dynamic_state3**.*/
15944 ///
15945 ///# Safety
15946 ///- `commandBuffer` (self) must be valid and not destroyed.
15947 ///- `commandBuffer` must be externally synchronized.
15948 ///
15949 ///# Panics
15950 ///Panics if `vkCmdSetCoverageReductionModeNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15951 ///
15952 ///# Usage Notes
15953 ///
15954 ///Dynamically sets the coverage reduction mode, which controls how
15955 ///the multisampled coverage mask is reduced to a color sample mask
15956 ///when the number of color samples is less than the rasterization
15957 ///samples.
15958 ///
15959 ///Part of `VK_NV_coverage_reduction_mode`.
15960 ///
15961 ///Provided by `VK_EXT_extended_dynamic_state3`.
15962 pub unsafe fn cmd_set_coverage_reduction_mode_nv(
15963 &self,
15964 command_buffer: CommandBuffer,
15965 coverage_reduction_mode: CoverageReductionModeNV,
15966 ) {
15967 let fp = self
15968 .commands()
15969 .cmd_set_coverage_reduction_mode_nv
15970 .expect("vkCmdSetCoverageReductionModeNV not loaded");
15971 unsafe { fp(command_buffer, coverage_reduction_mode) };
15972 }
15973 ///Wraps [`vkCmdSetRepresentativeFragmentTestEnableNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetRepresentativeFragmentTestEnableNV.html).
15974 /**
15975 Provided by **VK_EXT_extended_dynamic_state3**.*/
15976 ///
15977 ///# Safety
15978 ///- `commandBuffer` (self) must be valid and not destroyed.
15979 ///- `commandBuffer` must be externally synchronized.
15980 ///
15981 ///# Panics
15982 ///Panics if `vkCmdSetRepresentativeFragmentTestEnableNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15983 ///
15984 ///# Usage Notes
15985 ///
15986 ///Dynamically enables or disables the representative fragment test.
15987 ///When enabled, only one fragment per pixel is shaded (the
15988 ///"representative" fragment), and the rest are discarded early.
15989 ///
15990 ///Useful for visibility-only passes (e.g., occlusion culling)
15991 ///where full shading is unnecessary.
15992 ///
15993 ///Part of `VK_NV_representative_fragment_test`.
15994 ///
15995 ///Provided by `VK_EXT_extended_dynamic_state3`.
15996 pub unsafe fn cmd_set_representative_fragment_test_enable_nv(
15997 &self,
15998 command_buffer: CommandBuffer,
15999 representative_fragment_test_enable: bool,
16000 ) {
16001 let fp = self
16002 .commands()
16003 .cmd_set_representative_fragment_test_enable_nv
16004 .expect("vkCmdSetRepresentativeFragmentTestEnableNV not loaded");
16005 unsafe { fp(command_buffer, representative_fragment_test_enable as u32) };
16006 }
16007 ///Wraps [`vkCreatePrivateDataSlot`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreatePrivateDataSlot.html).
16008 /**
16009 Provided by **VK_BASE_VERSION_1_3**.*/
16010 ///
16011 ///# Errors
16012 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
16013 ///- `VK_ERROR_UNKNOWN`
16014 ///- `VK_ERROR_VALIDATION_FAILED`
16015 ///
16016 ///# Safety
16017 ///- `device` (self) must be valid and not destroyed.
16018 ///
16019 ///# Panics
16020 ///Panics if `vkCreatePrivateDataSlot` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16021 ///
16022 ///# Usage Notes
16023 ///
16024 ///Creates a private data slot that can be used to attach arbitrary
16025 ///application-defined `u64` values to any Vulkan object. Private data
16026 ///is a lightweight alternative to external hash maps for per-object
16027 ///metadata.
16028 ///
16029 ///Each slot represents one "key" that can be set on any object via
16030 ///`set_private_data` and read back via `get_private_data`.
16031 ///
16032 ///Use cases:
16033 ///
16034 ///- Tagging objects with debug IDs.
16035 ///- Associating application-specific state without a separate lookup
16036 /// table.
16037 ///- Layer and tool implementations that need per-object bookkeeping.
16038 ///
16039 ///Private data slots are cheap. The slot itself is just an index;
16040 ///the per-object storage is allocated lazily by the driver.
16041 pub unsafe fn create_private_data_slot(
16042 &self,
16043 p_create_info: &PrivateDataSlotCreateInfo,
16044 allocator: Option<&AllocationCallbacks>,
16045 ) -> VkResult<PrivateDataSlot> {
16046 let fp = self
16047 .commands()
16048 .create_private_data_slot
16049 .expect("vkCreatePrivateDataSlot not loaded");
16050 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
16051 let mut out = unsafe { core::mem::zeroed() };
16052 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
16053 Ok(out)
16054 }
16055 ///Wraps [`vkDestroyPrivateDataSlot`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyPrivateDataSlot.html).
16056 /**
16057 Provided by **VK_BASE_VERSION_1_3**.*/
16058 ///
16059 ///# Safety
16060 ///- `device` (self) must be valid and not destroyed.
16061 ///- `privateDataSlot` must be externally synchronized.
16062 ///
16063 ///# Panics
16064 ///Panics if `vkDestroyPrivateDataSlot` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16065 ///
16066 ///# Usage Notes
16067 ///
16068 ///Destroys a private data slot. Any data previously stored via
16069 ///`set_private_data` with this slot is discarded. Objects that had
16070 ///data set are not affected, they continue to exist normally.
16071 pub unsafe fn destroy_private_data_slot(
16072 &self,
16073 private_data_slot: PrivateDataSlot,
16074 allocator: Option<&AllocationCallbacks>,
16075 ) {
16076 let fp = self
16077 .commands()
16078 .destroy_private_data_slot
16079 .expect("vkDestroyPrivateDataSlot not loaded");
16080 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
16081 unsafe { fp(self.handle(), private_data_slot, alloc_ptr) };
16082 }
16083 ///Wraps [`vkSetPrivateData`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetPrivateData.html).
16084 /**
16085 Provided by **VK_BASE_VERSION_1_3**.*/
16086 ///
16087 ///# Errors
16088 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
16089 ///- `VK_ERROR_UNKNOWN`
16090 ///- `VK_ERROR_VALIDATION_FAILED`
16091 ///
16092 ///# Safety
16093 ///- `device` (self) must be valid and not destroyed.
16094 ///
16095 ///# Panics
16096 ///Panics if `vkSetPrivateData` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16097 ///
16098 ///# Usage Notes
16099 ///
16100 ///Stores a `u64` value on any Vulkan object for the given private data
16101 ///slot. Overwrites any previously stored value for this object/slot
16102 ///pair.
16103 ///
16104 ///Private data is per-device, the slot must have been created from
16105 ///the same device that owns the object. Setting data on an object from
16106 ///a different device is undefined behaviour.
16107 ///
16108 ///To clear the association, set the value to 0 or destroy the slot.
16109 pub unsafe fn set_private_data(
16110 &self,
16111 object_type: ObjectType,
16112 object_handle: u64,
16113 private_data_slot: PrivateDataSlot,
16114 data: u64,
16115 ) -> VkResult<()> {
16116 let fp = self
16117 .commands()
16118 .set_private_data
16119 .expect("vkSetPrivateData not loaded");
16120 check(unsafe {
16121 fp(
16122 self.handle(),
16123 object_type,
16124 object_handle,
16125 private_data_slot,
16126 data,
16127 )
16128 })
16129 }
16130 ///Wraps [`vkGetPrivateData`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPrivateData.html).
16131 /**
16132 Provided by **VK_BASE_VERSION_1_3**.*/
16133 ///
16134 ///# Safety
16135 ///- `device` (self) must be valid and not destroyed.
16136 ///
16137 ///# Panics
16138 ///Panics if `vkGetPrivateData` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16139 ///
16140 ///# Usage Notes
16141 ///
16142 ///Retrieves the `u64` value previously stored on a Vulkan object with
16143 ///`set_private_data` for the given private data slot. Returns 0 if no
16144 ///data was set for this object/slot combination.
16145 ///
16146 ///This is a lightweight per-object metadata lookup with no hash table
16147 ///overhead. See `create_private_data_slot` for usage patterns.
16148 pub unsafe fn get_private_data(
16149 &self,
16150 object_type: ObjectType,
16151 object_handle: u64,
16152 private_data_slot: PrivateDataSlot,
16153 ) -> u64 {
16154 let fp = self
16155 .commands()
16156 .get_private_data
16157 .expect("vkGetPrivateData not loaded");
16158 let mut out = unsafe { core::mem::zeroed() };
16159 unsafe {
16160 fp(
16161 self.handle(),
16162 object_type,
16163 object_handle,
16164 private_data_slot,
16165 &mut out,
16166 )
16167 };
16168 out
16169 }
16170 ///Wraps [`vkCmdCopyBuffer2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyBuffer2.html).
16171 /**
16172 Provided by **VK_BASE_VERSION_1_3**.*/
16173 ///
16174 ///# Safety
16175 ///- `commandBuffer` (self) must be valid and not destroyed.
16176 ///- `commandBuffer` must be externally synchronized.
16177 ///
16178 ///# Panics
16179 ///Panics if `vkCmdCopyBuffer2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16180 ///
16181 ///# Usage Notes
16182 ///
16183 ///Vulkan 1.3 version of `cmd_copy_buffer` that uses an extensible
16184 ///`CopyBufferInfo2` struct. Functionally identical to the 1.0 version
16185 ///but supports future extensions via pNext.
16186 ///
16187 ///Prefer this over `cmd_copy_buffer` when targeting Vulkan 1.3+.
16188 pub unsafe fn cmd_copy_buffer2(
16189 &self,
16190 command_buffer: CommandBuffer,
16191 p_copy_buffer_info: &CopyBufferInfo2,
16192 ) {
16193 let fp = self
16194 .commands()
16195 .cmd_copy_buffer2
16196 .expect("vkCmdCopyBuffer2 not loaded");
16197 unsafe { fp(command_buffer, p_copy_buffer_info) };
16198 }
16199 ///Wraps [`vkCmdCopyImage2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyImage2.html).
16200 /**
16201 Provided by **VK_BASE_VERSION_1_3**.*/
16202 ///
16203 ///# Safety
16204 ///- `commandBuffer` (self) must be valid and not destroyed.
16205 ///- `commandBuffer` must be externally synchronized.
16206 ///
16207 ///# Panics
16208 ///Panics if `vkCmdCopyImage2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16209 ///
16210 ///# Usage Notes
16211 ///
16212 ///Vulkan 1.3 version of `cmd_copy_image` that uses an extensible
16213 ///`CopyImageInfo2` struct.
16214 ///
16215 ///Functionally identical to the 1.0 version. Prefer this when
16216 ///targeting Vulkan 1.3+.
16217 pub unsafe fn cmd_copy_image2(
16218 &self,
16219 command_buffer: CommandBuffer,
16220 p_copy_image_info: &CopyImageInfo2,
16221 ) {
16222 let fp = self
16223 .commands()
16224 .cmd_copy_image2
16225 .expect("vkCmdCopyImage2 not loaded");
16226 unsafe { fp(command_buffer, p_copy_image_info) };
16227 }
16228 ///Wraps [`vkCmdBlitImage2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBlitImage2.html).
16229 /**
16230 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
16231 ///
16232 ///# Safety
16233 ///- `commandBuffer` (self) must be valid and not destroyed.
16234 ///- `commandBuffer` must be externally synchronized.
16235 ///
16236 ///# Panics
16237 ///Panics if `vkCmdBlitImage2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16238 ///
16239 ///# Usage Notes
16240 ///
16241 ///Vulkan 1.3 version of `cmd_blit_image` that uses an extensible
16242 ///`BlitImageInfo2` struct.
16243 ///
16244 ///Chain `BlitImageCubicWeightsInfoQCOM` for cubic filtering on
16245 ///Qualcomm hardware. Otherwise functionally identical to
16246 ///`cmd_blit_image`.
16247 ///
16248 ///Prefer this when targeting Vulkan 1.3+.
16249 pub unsafe fn cmd_blit_image2(
16250 &self,
16251 command_buffer: CommandBuffer,
16252 p_blit_image_info: &BlitImageInfo2,
16253 ) {
16254 let fp = self
16255 .commands()
16256 .cmd_blit_image2
16257 .expect("vkCmdBlitImage2 not loaded");
16258 unsafe { fp(command_buffer, p_blit_image_info) };
16259 }
16260 ///Wraps [`vkCmdCopyBufferToImage2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyBufferToImage2.html).
16261 /**
16262 Provided by **VK_BASE_VERSION_1_3**.*/
16263 ///
16264 ///# Safety
16265 ///- `commandBuffer` (self) must be valid and not destroyed.
16266 ///- `commandBuffer` must be externally synchronized.
16267 ///
16268 ///# Panics
16269 ///Panics if `vkCmdCopyBufferToImage2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16270 ///
16271 ///# Usage Notes
16272 ///
16273 ///Vulkan 1.3 version of `cmd_copy_buffer_to_image` that uses an
16274 ///extensible `CopyBufferToImageInfo2` struct.
16275 ///
16276 ///Functionally identical to the 1.0 version. Prefer this when
16277 ///targeting Vulkan 1.3+.
16278 pub unsafe fn cmd_copy_buffer_to_image2(
16279 &self,
16280 command_buffer: CommandBuffer,
16281 p_copy_buffer_to_image_info: &CopyBufferToImageInfo2,
16282 ) {
16283 let fp = self
16284 .commands()
16285 .cmd_copy_buffer_to_image2
16286 .expect("vkCmdCopyBufferToImage2 not loaded");
16287 unsafe { fp(command_buffer, p_copy_buffer_to_image_info) };
16288 }
16289 ///Wraps [`vkCmdCopyImageToBuffer2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyImageToBuffer2.html).
16290 /**
16291 Provided by **VK_BASE_VERSION_1_3**.*/
16292 ///
16293 ///# Safety
16294 ///- `commandBuffer` (self) must be valid and not destroyed.
16295 ///- `commandBuffer` must be externally synchronized.
16296 ///
16297 ///# Panics
16298 ///Panics if `vkCmdCopyImageToBuffer2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16299 ///
16300 ///# Usage Notes
16301 ///
16302 ///Vulkan 1.3 version of `cmd_copy_image_to_buffer` that uses an
16303 ///extensible `CopyImageToBufferInfo2` struct.
16304 ///
16305 ///Functionally identical to the 1.0 version. Prefer this when
16306 ///targeting Vulkan 1.3+.
16307 pub unsafe fn cmd_copy_image_to_buffer2(
16308 &self,
16309 command_buffer: CommandBuffer,
16310 p_copy_image_to_buffer_info: &CopyImageToBufferInfo2,
16311 ) {
16312 let fp = self
16313 .commands()
16314 .cmd_copy_image_to_buffer2
16315 .expect("vkCmdCopyImageToBuffer2 not loaded");
16316 unsafe { fp(command_buffer, p_copy_image_to_buffer_info) };
16317 }
16318 ///Wraps [`vkCmdResolveImage2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdResolveImage2.html).
16319 /**
16320 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
16321 ///
16322 ///# Safety
16323 ///- `commandBuffer` (self) must be valid and not destroyed.
16324 ///- `commandBuffer` must be externally synchronized.
16325 ///
16326 ///# Panics
16327 ///Panics if `vkCmdResolveImage2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16328 ///
16329 ///# Usage Notes
16330 ///
16331 ///Vulkan 1.3 version of `cmd_resolve_image` that uses an extensible
16332 ///`ResolveImageInfo2` struct.
16333 ///
16334 ///Functionally identical to `cmd_resolve_image`. Prefer this when
16335 ///targeting Vulkan 1.3+.
16336 pub unsafe fn cmd_resolve_image2(
16337 &self,
16338 command_buffer: CommandBuffer,
16339 p_resolve_image_info: &ResolveImageInfo2,
16340 ) {
16341 let fp = self
16342 .commands()
16343 .cmd_resolve_image2
16344 .expect("vkCmdResolveImage2 not loaded");
16345 unsafe { fp(command_buffer, p_resolve_image_info) };
16346 }
16347 ///Wraps [`vkCmdRefreshObjectsKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdRefreshObjectsKHR.html).
16348 ///
16349 ///# Safety
16350 ///- `commandBuffer` (self) must be valid and not destroyed.
16351 ///- `commandBuffer` must be externally synchronized.
16352 ///
16353 ///# Panics
16354 ///Panics if `vkCmdRefreshObjectsKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16355 ///
16356 ///# Usage Notes
16357 ///
16358 ///Refreshes a set of Vulkan objects managed by a refreshable object
16359 ///type, resetting their internal state. Used in safety-critical
16360 ///Vulkan SC environments to periodically refresh objects and detect
16361 ///hardware faults.
16362 ///
16363 ///Not relevant for desktop Vulkan. This is part of the
16364 ///`VK_KHR_object_refresh` extension used in automotive and embedded
16365 ///safety-critical environments.
16366 pub unsafe fn cmd_refresh_objects_khr(
16367 &self,
16368 command_buffer: CommandBuffer,
16369 p_refresh_objects: &RefreshObjectListKHR,
16370 ) {
16371 let fp = self
16372 .commands()
16373 .cmd_refresh_objects_khr
16374 .expect("vkCmdRefreshObjectsKHR not loaded");
16375 unsafe { fp(command_buffer, p_refresh_objects) };
16376 }
16377 ///Wraps [`vkCmdSetFragmentShadingRateKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetFragmentShadingRateKHR.html).
16378 /**
16379 Provided by **VK_KHR_fragment_shading_rate**.*/
16380 ///
16381 ///# Safety
16382 ///- `commandBuffer` (self) must be valid and not destroyed.
16383 ///- `commandBuffer` must be externally synchronized.
16384 ///
16385 ///# Panics
16386 ///Panics if `vkCmdSetFragmentShadingRateKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16387 ///
16388 ///# Usage Notes
16389 ///
16390 ///Sets the pipeline fragment shading rate and combiner operations
16391 ///as dynamic state. This controls how many pixels each fragment
16392 ///shader invocation covers, larger fragment sizes reduce shading
16393 ///cost at the expense of detail.
16394 ///
16395 ///`p_fragment_size` specifies the fragment size (e.g., 1x1, 1x2,
16396 ///2x2, 2x4, 4x4). Not all sizes are supported, query
16397 ///`get_physical_device_fragment_shading_rates_khr` for the list.
16398 ///
16399 ///`combiner_ops` defines how the pipeline rate, primitive rate
16400 ///(from the vertex shader), and attachment rate (from a shading
16401 ///rate image) are combined to produce the final rate.
16402 ///
16403 ///Requires `VK_KHR_fragment_shading_rate` and the
16404 ///`pipelineFragmentShadingRate` device feature.
16405 pub unsafe fn cmd_set_fragment_shading_rate_khr(
16406 &self,
16407 command_buffer: CommandBuffer,
16408 p_fragment_size: &Extent2D,
16409 combiner_ops: FragmentShadingRateCombinerOpKHR,
16410 ) {
16411 let fp = self
16412 .commands()
16413 .cmd_set_fragment_shading_rate_khr
16414 .expect("vkCmdSetFragmentShadingRateKHR not loaded");
16415 unsafe { fp(command_buffer, p_fragment_size, combiner_ops) };
16416 }
16417 ///Wraps [`vkCmdSetFragmentShadingRateEnumNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetFragmentShadingRateEnumNV.html).
16418 /**
16419 Provided by **VK_NV_fragment_shading_rate_enums**.*/
16420 ///
16421 ///# Safety
16422 ///- `commandBuffer` (self) must be valid and not destroyed.
16423 ///- `commandBuffer` must be externally synchronized.
16424 ///
16425 ///# Panics
16426 ///Panics if `vkCmdSetFragmentShadingRateEnumNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16427 ///
16428 ///# Usage Notes
16429 ///
16430 ///Dynamically sets the fragment shading rate using the NV-specific
16431 ///enum values. Provides finer control than the KHR variant,
16432 ///including support for supersample and no-invocations rates.
16433 ///
16434 ///Requires `VK_NV_fragment_shading_rate_enums`.
16435 pub unsafe fn cmd_set_fragment_shading_rate_enum_nv(
16436 &self,
16437 command_buffer: CommandBuffer,
16438 shading_rate: FragmentShadingRateNV,
16439 combiner_ops: FragmentShadingRateCombinerOpKHR,
16440 ) {
16441 let fp = self
16442 .commands()
16443 .cmd_set_fragment_shading_rate_enum_nv
16444 .expect("vkCmdSetFragmentShadingRateEnumNV not loaded");
16445 unsafe { fp(command_buffer, shading_rate, combiner_ops) };
16446 }
16447 ///Wraps [`vkGetAccelerationStructureBuildSizesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetAccelerationStructureBuildSizesKHR.html).
16448 /**
16449 Provided by **VK_KHR_acceleration_structure**.*/
16450 ///
16451 ///# Safety
16452 ///- `device` (self) must be valid and not destroyed.
16453 ///
16454 ///# Panics
16455 ///Panics if `vkGetAccelerationStructureBuildSizesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16456 ///
16457 ///# Usage Notes
16458 ///
16459 ///Queries the buffer sizes needed to build an acceleration structure:
16460 ///the final structure size, the scratch buffer size for builds, and
16461 ///the scratch buffer size for updates.
16462 ///
16463 ///Call this before creating the acceleration structure and scratch
16464 ///buffers. The `max_primitive_counts` parameter specifies the maximum
16465 ///number of primitives per geometry, the returned sizes are
16466 ///worst-case guarantees for those counts.
16467 ///
16468 ///The actual built size may be smaller. For BLASes, build with
16469 ///`ALLOW_COMPACTION` and query the compacted size afterwards to
16470 ///reclaim excess memory.
16471 pub unsafe fn get_acceleration_structure_build_sizes_khr(
16472 &self,
16473 build_type: AccelerationStructureBuildTypeKHR,
16474 p_build_info: &AccelerationStructureBuildGeometryInfoKHR,
16475 p_max_primitive_counts: *const u32,
16476 p_size_info: &mut AccelerationStructureBuildSizesInfoKHR,
16477 ) {
16478 let fp = self
16479 .commands()
16480 .get_acceleration_structure_build_sizes_khr
16481 .expect("vkGetAccelerationStructureBuildSizesKHR not loaded");
16482 unsafe {
16483 fp(
16484 self.handle(),
16485 build_type,
16486 p_build_info,
16487 p_max_primitive_counts,
16488 p_size_info,
16489 )
16490 };
16491 }
16492 ///Wraps [`vkCmdSetVertexInputEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetVertexInputEXT.html).
16493 /**
16494 Provided by **VK_EXT_vertex_input_dynamic_state**.*/
16495 ///
16496 ///# Safety
16497 ///- `commandBuffer` (self) must be valid and not destroyed.
16498 ///- `commandBuffer` must be externally synchronized.
16499 ///
16500 ///# Panics
16501 ///Panics if `vkCmdSetVertexInputEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16502 ///
16503 ///# Usage Notes
16504 ///
16505 ///Dynamically sets the complete vertex input state: bindings
16506 ///(stride, input rate) and attributes (location, format, offset).
16507 ///
16508 ///Replaces `VertexInputBindingDescription` and
16509 ///`VertexInputAttributeDescription` from pipeline creation. Pass
16510 ///arrays of `VertexInputBindingDescription2EXT` and
16511 ///`VertexInputAttributeDescription2EXT`.
16512 ///
16513 ///Provided by `VK_EXT_vertex_input_dynamic_state`.
16514 pub unsafe fn cmd_set_vertex_input_ext(
16515 &self,
16516 command_buffer: CommandBuffer,
16517 p_vertex_binding_descriptions: &[VertexInputBindingDescription2EXT],
16518 p_vertex_attribute_descriptions: &[VertexInputAttributeDescription2EXT],
16519 ) {
16520 let fp = self
16521 .commands()
16522 .cmd_set_vertex_input_ext
16523 .expect("vkCmdSetVertexInputEXT not loaded");
16524 unsafe {
16525 fp(
16526 command_buffer,
16527 p_vertex_binding_descriptions.len() as u32,
16528 p_vertex_binding_descriptions.as_ptr(),
16529 p_vertex_attribute_descriptions.len() as u32,
16530 p_vertex_attribute_descriptions.as_ptr(),
16531 )
16532 };
16533 }
16534 ///Wraps [`vkCmdSetColorWriteEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetColorWriteEnableEXT.html).
16535 /**
16536 Provided by **VK_EXT_color_write_enable**.*/
16537 ///
16538 ///# Safety
16539 ///- `commandBuffer` (self) must be valid and not destroyed.
16540 ///- `commandBuffer` must be externally synchronized.
16541 ///
16542 ///# Panics
16543 ///Panics if `vkCmdSetColorWriteEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16544 ///
16545 ///# Usage Notes
16546 ///
16547 ///Dynamically enables or disables color writing for each color
16548 ///attachment. Pass a slice of `Bool32` values, one per attachment.
16549 ///
16550 ///When color write is disabled for an attachment, no color output
16551 ///is written regardless of blend state.
16552 ///
16553 ///Unlike `cmd_set_color_write_mask_ext` (which controls per-channel
16554 ///masking), this is a simple on/off toggle per attachment.
16555 ///
16556 ///Provided by `VK_EXT_color_write_enable`.
16557 pub unsafe fn cmd_set_color_write_enable_ext(
16558 &self,
16559 command_buffer: CommandBuffer,
16560 p_color_write_enables: &[u32],
16561 ) {
16562 let fp = self
16563 .commands()
16564 .cmd_set_color_write_enable_ext
16565 .expect("vkCmdSetColorWriteEnableEXT not loaded");
16566 unsafe {
16567 fp(
16568 command_buffer,
16569 p_color_write_enables.len() as u32,
16570 p_color_write_enables.as_ptr(),
16571 )
16572 };
16573 }
16574 ///Wraps [`vkCmdSetEvent2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetEvent2.html).
16575 /**
16576 Provided by **VK_COMPUTE_VERSION_1_3**.*/
16577 ///
16578 ///# Safety
16579 ///- `commandBuffer` (self) must be valid and not destroyed.
16580 ///- `commandBuffer` must be externally synchronized.
16581 ///
16582 ///# Panics
16583 ///Panics if `vkCmdSetEvent2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16584 ///
16585 ///# Usage Notes
16586 ///
16587 ///Vulkan 1.3 version of `cmd_set_event` that takes a `DependencyInfo`
16588 ///describing the memory dependencies, rather than just a stage mask.
16589 ///
16590 ///This provides more precise dependency information to the driver and
16591 ///supports 64-bit stage and access flags. The dependency info specifies
16592 ///exactly what memory accesses and pipeline stages are involved, which
16593 ///can reduce unnecessary stalls.
16594 ///
16595 ///Prefer this over `cmd_set_event` when targeting Vulkan 1.3+.
16596 pub unsafe fn cmd_set_event2(
16597 &self,
16598 command_buffer: CommandBuffer,
16599 event: Event,
16600 p_dependency_info: &DependencyInfo,
16601 ) {
16602 let fp = self
16603 .commands()
16604 .cmd_set_event2
16605 .expect("vkCmdSetEvent2 not loaded");
16606 unsafe { fp(command_buffer, event, p_dependency_info) };
16607 }
16608 ///Wraps [`vkCmdResetEvent2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdResetEvent2.html).
16609 /**
16610 Provided by **VK_COMPUTE_VERSION_1_3**.*/
16611 ///
16612 ///# Safety
16613 ///- `commandBuffer` (self) must be valid and not destroyed.
16614 ///- `commandBuffer` must be externally synchronized.
16615 ///
16616 ///# Panics
16617 ///Panics if `vkCmdResetEvent2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16618 ///
16619 ///# Usage Notes
16620 ///
16621 ///Vulkan 1.3 version of `cmd_reset_event` that uses 64-bit pipeline
16622 ///stage flags. Supports newer stages not available in the original
16623 ///32-bit field.
16624 ///
16625 ///Prefer this over `cmd_reset_event` when targeting Vulkan 1.3+.
16626 pub unsafe fn cmd_reset_event2(
16627 &self,
16628 command_buffer: CommandBuffer,
16629 event: Event,
16630 stage_mask: PipelineStageFlags2,
16631 ) {
16632 let fp = self
16633 .commands()
16634 .cmd_reset_event2
16635 .expect("vkCmdResetEvent2 not loaded");
16636 unsafe { fp(command_buffer, event, stage_mask) };
16637 }
16638 ///Wraps [`vkCmdWaitEvents2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWaitEvents2.html).
16639 /**
16640 Provided by **VK_COMPUTE_VERSION_1_3**.*/
16641 ///
16642 ///# Safety
16643 ///- `commandBuffer` (self) must be valid and not destroyed.
16644 ///- `commandBuffer` must be externally synchronized.
16645 ///
16646 ///# Panics
16647 ///Panics if `vkCmdWaitEvents2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16648 ///
16649 ///# Usage Notes
16650 ///
16651 ///Vulkan 1.3 version of `cmd_wait_events` that takes per-event
16652 ///`DependencyInfo` structs instead of global stage masks and barriers.
16653 ///
16654 ///Each event can have its own set of memory barriers and stage masks,
16655 ///giving the driver more precise information about what each event
16656 ///protects.
16657 ///
16658 ///Prefer this over `cmd_wait_events` when targeting Vulkan 1.3+.
16659 pub unsafe fn cmd_wait_events2(
16660 &self,
16661 command_buffer: CommandBuffer,
16662 p_events: &[Event],
16663 p_dependency_infos: &DependencyInfo,
16664 ) {
16665 let fp = self
16666 .commands()
16667 .cmd_wait_events2
16668 .expect("vkCmdWaitEvents2 not loaded");
16669 unsafe {
16670 fp(
16671 command_buffer,
16672 p_events.len() as u32,
16673 p_events.as_ptr(),
16674 p_dependency_infos,
16675 )
16676 };
16677 }
16678 ///Wraps [`vkCmdPipelineBarrier2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPipelineBarrier2.html).
16679 /**
16680 Provided by **VK_BASE_VERSION_1_3**.*/
16681 ///
16682 ///# Safety
16683 ///- `commandBuffer` (self) must be valid and not destroyed.
16684 ///- `commandBuffer` must be externally synchronized.
16685 ///
16686 ///# Panics
16687 ///Panics if `vkCmdPipelineBarrier2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16688 ///
16689 ///# Usage Notes
16690 ///
16691 ///Vulkan 1.3 version of `cmd_pipeline_barrier` that uses
16692 ///`DependencyInfo` with `MemoryBarrier2`, `BufferMemoryBarrier2`, and
16693 ///`ImageMemoryBarrier2` structs.
16694 ///
16695 ///The key improvement over the 1.0 version is that stage and access
16696 ///masks are specified **per barrier** rather than globally for the
16697 ///entire call. This gives the driver more precise dependency
16698 ///information, which can reduce unnecessary stalls.
16699 ///
16700 ///The 1.3 barrier structs also use 64-bit stage and access flags,
16701 ///supporting stages and access types that do not fit in the original
16702 ///32-bit fields (e.g. ray tracing, mesh shading).
16703 ///
16704 ///Prefer this over `cmd_pipeline_barrier` when targeting Vulkan 1.3+.
16705 pub unsafe fn cmd_pipeline_barrier2(
16706 &self,
16707 command_buffer: CommandBuffer,
16708 p_dependency_info: &DependencyInfo,
16709 ) {
16710 let fp = self
16711 .commands()
16712 .cmd_pipeline_barrier2
16713 .expect("vkCmdPipelineBarrier2 not loaded");
16714 unsafe { fp(command_buffer, p_dependency_info) };
16715 }
16716 ///Wraps [`vkQueueSubmit2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueSubmit2.html).
16717 /**
16718 Provided by **VK_BASE_VERSION_1_3**.*/
16719 ///
16720 ///# Errors
16721 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
16722 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
16723 ///- `VK_ERROR_DEVICE_LOST`
16724 ///- `VK_ERROR_UNKNOWN`
16725 ///- `VK_ERROR_VALIDATION_FAILED`
16726 ///
16727 ///# Safety
16728 ///- `queue` (self) must be valid and not destroyed.
16729 ///- `queue` must be externally synchronized.
16730 ///- `fence` must be externally synchronized.
16731 ///
16732 ///# Panics
16733 ///Panics if `vkQueueSubmit2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16734 ///
16735 ///# Usage Notes
16736 ///
16737 ///Vulkan 1.3 version of `queue_submit` that uses `SubmitInfo2` with
16738 ///per-semaphore stage masks and 64-bit pipeline stage flags.
16739 ///
16740 ///Key improvements over `queue_submit`:
16741 ///
16742 ///- **Per-semaphore stage masks**: each wait semaphore has its own
16743 /// stage mask in `SemaphoreSubmitInfo`, instead of a parallel array.
16744 /// Clearer and less error-prone.
16745 ///- **64-bit stages**: supports newer pipeline stages.
16746 ///- **Timeline semaphores**: timeline values are embedded in
16747 /// `SemaphoreSubmitInfo` instead of requiring a separate pNext
16748 /// chain.
16749 ///
16750 ///Prefer this over `queue_submit` when targeting Vulkan 1.3+. The
16751 ///fence parameter works identically.
16752 pub unsafe fn queue_submit2(
16753 &self,
16754 queue: Queue,
16755 p_submits: &[SubmitInfo2],
16756 fence: Fence,
16757 ) -> VkResult<()> {
16758 let fp = self
16759 .commands()
16760 .queue_submit2
16761 .expect("vkQueueSubmit2 not loaded");
16762 check(unsafe { fp(queue, p_submits.len() as u32, p_submits.as_ptr(), fence) })
16763 }
16764 ///Wraps [`vkCmdWriteTimestamp2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWriteTimestamp2.html).
16765 /**
16766 Provided by **VK_BASE_VERSION_1_3**.*/
16767 ///
16768 ///# Safety
16769 ///- `commandBuffer` (self) must be valid and not destroyed.
16770 ///- `commandBuffer` must be externally synchronized.
16771 ///
16772 ///# Panics
16773 ///Panics if `vkCmdWriteTimestamp2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16774 ///
16775 ///# Usage Notes
16776 ///
16777 ///Vulkan 1.3 version of `cmd_write_timestamp` that uses 64-bit
16778 ///pipeline stage flags (`PipelineStageFlags2`).
16779 ///
16780 ///The wider stage flags support newer stages like
16781 ///`PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_KHR` and
16782 ///`PIPELINE_STAGE_2_MESH_SHADER_BIT_EXT` that do not fit in the
16783 ///original 32-bit field.
16784 ///
16785 ///Prefer this over `cmd_write_timestamp` when targeting Vulkan 1.3+.
16786 pub unsafe fn cmd_write_timestamp2(
16787 &self,
16788 command_buffer: CommandBuffer,
16789 stage: PipelineStageFlags2,
16790 query_pool: QueryPool,
16791 query: u32,
16792 ) {
16793 let fp = self
16794 .commands()
16795 .cmd_write_timestamp2
16796 .expect("vkCmdWriteTimestamp2 not loaded");
16797 unsafe { fp(command_buffer, stage, query_pool, query) };
16798 }
16799 ///Wraps [`vkCmdWriteBufferMarker2AMD`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWriteBufferMarker2AMD.html).
16800 /**
16801 Provided by **VK_AMD_buffer_marker**.*/
16802 ///
16803 ///# Safety
16804 ///- `commandBuffer` (self) must be valid and not destroyed.
16805 ///- `commandBuffer` must be externally synchronized.
16806 ///
16807 ///# Panics
16808 ///Panics if `vkCmdWriteBufferMarker2AMD` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16809 ///
16810 ///# Usage Notes
16811 ///
16812 ///Extended version of `cmd_write_buffer_marker_amd` that uses
16813 ///`PipelineStageFlags2` for the stage mask. Supports the full
16814 ///synchronization2 stage flags.
16815 ///
16816 ///Requires `VK_AMD_buffer_marker` + `VK_KHR_synchronization2`.
16817 pub unsafe fn cmd_write_buffer_marker2_amd(
16818 &self,
16819 command_buffer: CommandBuffer,
16820 stage: PipelineStageFlags2,
16821 dst_buffer: Buffer,
16822 dst_offset: u64,
16823 marker: u32,
16824 ) {
16825 let fp = self
16826 .commands()
16827 .cmd_write_buffer_marker2_amd
16828 .expect("vkCmdWriteBufferMarker2AMD not loaded");
16829 unsafe { fp(command_buffer, stage, dst_buffer, dst_offset, marker) };
16830 }
16831 ///Wraps [`vkGetQueueCheckpointData2NV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetQueueCheckpointData2NV.html).
16832 /**
16833 Provided by **VK_NV_device_diagnostic_checkpoints**.*/
16834 ///
16835 ///# Safety
16836 ///- `queue` (self) must be valid and not destroyed.
16837 ///
16838 ///# Panics
16839 ///Panics if `vkGetQueueCheckpointData2NV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16840 ///
16841 ///# Usage Notes
16842 ///
16843 ///Extended version of `get_queue_checkpoint_data_nv` that returns
16844 ///pipeline stage information alongside the checkpoint markers.
16845 ///Use for finer-grained post-mortem debugging after device loss.
16846 ///
16847 ///Requires `VK_NV_device_diagnostic_checkpoints` +
16848 ///`VK_KHR_synchronization2`.
16849 pub unsafe fn get_queue_checkpoint_data2_nv(&self, queue: Queue) -> Vec<CheckpointData2NV> {
16850 let fp = self
16851 .commands()
16852 .get_queue_checkpoint_data2_nv
16853 .expect("vkGetQueueCheckpointData2NV not loaded");
16854 fill_two_call(|count, data| unsafe { fp(queue, count, data) })
16855 }
16856 ///Wraps [`vkCopyMemoryToImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCopyMemoryToImage.html).
16857 /**
16858 Provided by **VK_BASE_VERSION_1_4**.*/
16859 ///
16860 ///# Errors
16861 ///- `VK_ERROR_INITIALIZATION_FAILED`
16862 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
16863 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
16864 ///- `VK_ERROR_MEMORY_MAP_FAILED`
16865 ///- `VK_ERROR_UNKNOWN`
16866 ///- `VK_ERROR_VALIDATION_FAILED`
16867 ///
16868 ///# Safety
16869 ///- `device` (self) must be valid and not destroyed.
16870 ///
16871 ///# Panics
16872 ///Panics if `vkCopyMemoryToImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16873 ///
16874 ///# Usage Notes
16875 ///
16876 ///Vulkan 1.4 host-side image upload. Copies texel data from a host
16877 ///memory pointer directly into an image without a staging buffer or
16878 ///command buffer.
16879 ///
16880 ///The image must be in `GENERAL` layout and must have been created
16881 ///with `HOST_TRANSFER` usage. The copy happens synchronously.
16882 ///
16883 ///This simplifies upload workflows that previously required a staging
16884 ///buffer + `cmd_copy_buffer_to_image` + layout transitions. However,
16885 ///the image must support host transfer and be in `GENERAL` layout,
16886 ///which may not be optimal for subsequent GPU reads.
16887 pub unsafe fn copy_memory_to_image(
16888 &self,
16889 p_copy_memory_to_image_info: &CopyMemoryToImageInfo,
16890 ) -> VkResult<()> {
16891 let fp = self
16892 .commands()
16893 .copy_memory_to_image
16894 .expect("vkCopyMemoryToImage not loaded");
16895 check(unsafe { fp(self.handle(), p_copy_memory_to_image_info) })
16896 }
16897 ///Wraps [`vkCopyImageToMemory`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCopyImageToMemory.html).
16898 /**
16899 Provided by **VK_BASE_VERSION_1_4**.*/
16900 ///
16901 ///# Errors
16902 ///- `VK_ERROR_INITIALIZATION_FAILED`
16903 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
16904 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
16905 ///- `VK_ERROR_MEMORY_MAP_FAILED`
16906 ///- `VK_ERROR_UNKNOWN`
16907 ///- `VK_ERROR_VALIDATION_FAILED`
16908 ///
16909 ///# Safety
16910 ///- `device` (self) must be valid and not destroyed.
16911 ///
16912 ///# Panics
16913 ///Panics if `vkCopyImageToMemory` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16914 ///
16915 ///# Usage Notes
16916 ///
16917 ///Vulkan 1.4 host-side image readback. Copies texel data from an
16918 ///image directly to a host memory pointer without a staging buffer or
16919 ///command buffer.
16920 ///
16921 ///The image must be in `GENERAL` layout and must have been created
16922 ///with `HOST_TRANSFER` usage. The copy happens synchronously.
16923 ///
16924 ///This simplifies CPU readback workflows that previously required a
16925 ///staging buffer + `cmd_copy_image_to_buffer` + fence wait + map.
16926 ///However, it requires the image to support host transfer, which not
16927 ///all implementations or formats support.
16928 pub unsafe fn copy_image_to_memory(
16929 &self,
16930 p_copy_image_to_memory_info: &CopyImageToMemoryInfo,
16931 ) -> VkResult<()> {
16932 let fp = self
16933 .commands()
16934 .copy_image_to_memory
16935 .expect("vkCopyImageToMemory not loaded");
16936 check(unsafe { fp(self.handle(), p_copy_image_to_memory_info) })
16937 }
16938 ///Wraps [`vkCopyImageToImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCopyImageToImage.html).
16939 /**
16940 Provided by **VK_BASE_VERSION_1_4**.*/
16941 ///
16942 ///# Errors
16943 ///- `VK_ERROR_INITIALIZATION_FAILED`
16944 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
16945 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
16946 ///- `VK_ERROR_MEMORY_MAP_FAILED`
16947 ///- `VK_ERROR_UNKNOWN`
16948 ///- `VK_ERROR_VALIDATION_FAILED`
16949 ///
16950 ///# Safety
16951 ///- `device` (self) must be valid and not destroyed.
16952 ///
16953 ///# Panics
16954 ///Panics if `vkCopyImageToImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16955 ///
16956 ///# Usage Notes
16957 ///
16958 ///Vulkan 1.4 host-side image-to-image copy. Copies texel data between
16959 ///two images from the CPU without recording a command buffer.
16960 ///
16961 ///Both images must be in `GENERAL` layout and must have been created
16962 ///with `HOST_TRANSFER` usage. The copy happens synchronously on the
16963 ///calling thread.
16964 ///
16965 ///Use cases are limited to CPU-side image manipulation (e.g. test
16966 ///utilities, offline processing). For GPU-side copies in a render
16967 ///loop, `cmd_copy_image2` is the standard path.
16968 pub unsafe fn copy_image_to_image(
16969 &self,
16970 p_copy_image_to_image_info: &CopyImageToImageInfo,
16971 ) -> VkResult<()> {
16972 let fp = self
16973 .commands()
16974 .copy_image_to_image
16975 .expect("vkCopyImageToImage not loaded");
16976 check(unsafe { fp(self.handle(), p_copy_image_to_image_info) })
16977 }
16978 ///Wraps [`vkTransitionImageLayout`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkTransitionImageLayout.html).
16979 /**
16980 Provided by **VK_BASE_VERSION_1_4**.*/
16981 ///
16982 ///# Errors
16983 ///- `VK_ERROR_INITIALIZATION_FAILED`
16984 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
16985 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
16986 ///- `VK_ERROR_MEMORY_MAP_FAILED`
16987 ///- `VK_ERROR_UNKNOWN`
16988 ///- `VK_ERROR_VALIDATION_FAILED`
16989 ///
16990 ///# Safety
16991 ///- `device` (self) must be valid and not destroyed.
16992 ///
16993 ///# Panics
16994 ///Panics if `vkTransitionImageLayout` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16995 ///
16996 ///# Usage Notes
16997 ///
16998 ///Vulkan 1.4 host-side image layout transition. Transitions an image
16999 ///between layouts from the CPU without recording a command buffer.
17000 ///
17001 ///The image must have been created with `HOST_TRANSFER` usage. The
17002 ///transition happens synchronously on the calling thread.
17003 ///
17004 ///This simplifies workflows where you need to transition an image
17005 ///layout outside of a command buffer, for example, transitioning a
17006 ///newly created host-transfer image from `UNDEFINED` to `GENERAL`
17007 ///before performing host-side copies.
17008 ///
17009 ///For GPU-side layout transitions (the common case), use
17010 ///`cmd_pipeline_barrier2` with an image memory barrier.
17011 pub unsafe fn transition_image_layout(
17012 &self,
17013 p_transitions: &[HostImageLayoutTransitionInfo],
17014 ) -> VkResult<()> {
17015 let fp = self
17016 .commands()
17017 .transition_image_layout
17018 .expect("vkTransitionImageLayout not loaded");
17019 check(unsafe {
17020 fp(
17021 self.handle(),
17022 p_transitions.len() as u32,
17023 p_transitions.as_ptr(),
17024 )
17025 })
17026 }
17027 ///Wraps [`vkGetCommandPoolMemoryConsumption`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetCommandPoolMemoryConsumption.html).
17028 /**
17029 Provided by **VKSC_VERSION_1_0**.*/
17030 ///
17031 ///# Safety
17032 ///- `device` (self) must be valid and not destroyed.
17033 ///- `commandPool` must be externally synchronized.
17034 ///- `commandBuffer` must be externally synchronized.
17035 ///
17036 ///# Panics
17037 ///Panics if `vkGetCommandPoolMemoryConsumption` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17038 ///
17039 ///# Usage Notes
17040 ///
17041 ///Queries the memory consumption of a command pool or a specific
17042 ///command buffer within it. Part of Vulkan SC (Safety Critical)
17043 ///for tracking resource budgets in safety-certified environments.
17044 ///Pass a null command buffer to query the entire pool.
17045 ///
17046 ///Requires Vulkan SC.
17047 pub unsafe fn get_command_pool_memory_consumption(
17048 &self,
17049 command_pool: CommandPool,
17050 command_buffer: CommandBuffer,
17051 p_consumption: &mut CommandPoolMemoryConsumption,
17052 ) {
17053 let fp = self
17054 .commands()
17055 .get_command_pool_memory_consumption
17056 .expect("vkGetCommandPoolMemoryConsumption not loaded");
17057 unsafe { fp(self.handle(), command_pool, command_buffer, p_consumption) };
17058 }
17059 ///Wraps [`vkCreateVideoSessionKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateVideoSessionKHR.html).
17060 /**
17061 Provided by **VK_KHR_video_queue**.*/
17062 ///
17063 ///# Errors
17064 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
17065 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
17066 ///- `VK_ERROR_INITIALIZATION_FAILED`
17067 ///- `VK_ERROR_VIDEO_STD_VERSION_NOT_SUPPORTED_KHR`
17068 ///- `VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR`
17069 ///- `VK_ERROR_UNKNOWN`
17070 ///- `VK_ERROR_VALIDATION_FAILED`
17071 ///
17072 ///# Safety
17073 ///- `device` (self) must be valid and not destroyed.
17074 ///
17075 ///# Panics
17076 ///Panics if `vkCreateVideoSessionKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17077 ///
17078 ///# Usage Notes
17079 ///
17080 ///Creates a video session for hardware-accelerated video decoding
17081 ///or encoding. The session defines the video codec profile,
17082 ///resolution range, format, and maximum reference picture count.
17083 ///
17084 ///Key fields in `VideoSessionCreateInfoKHR`:
17085 ///
17086 ///- `video_profile`: codec (H.264, H.265, AV1) and profile/level.
17087 ///- `max_coded_extent`: maximum frame resolution.
17088 ///- `picture_format` / `reference_picture_format`: image formats
17089 /// for decoded pictures and DPB (decoded picture buffer) slots.
17090 ///- `max_dpb_slots` / `max_active_reference_pictures`: reference
17091 /// frame capacity.
17092 ///
17093 ///After creation, query memory requirements with
17094 ///`get_video_session_memory_requirements_khr`, allocate and bind
17095 ///memory with `bind_video_session_memory_khr`, then create session
17096 ///parameters with `create_video_session_parameters_khr`.
17097 pub unsafe fn create_video_session_khr(
17098 &self,
17099 p_create_info: &VideoSessionCreateInfoKHR,
17100 allocator: Option<&AllocationCallbacks>,
17101 ) -> VkResult<VideoSessionKHR> {
17102 let fp = self
17103 .commands()
17104 .create_video_session_khr
17105 .expect("vkCreateVideoSessionKHR not loaded");
17106 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
17107 let mut out = unsafe { core::mem::zeroed() };
17108 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
17109 Ok(out)
17110 }
17111 ///Wraps [`vkDestroyVideoSessionKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyVideoSessionKHR.html).
17112 /**
17113 Provided by **VK_KHR_video_queue**.*/
17114 ///
17115 ///# Safety
17116 ///- `device` (self) must be valid and not destroyed.
17117 ///- `videoSession` must be externally synchronized.
17118 ///
17119 ///# Panics
17120 ///Panics if `vkDestroyVideoSessionKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17121 ///
17122 ///# Usage Notes
17123 ///
17124 ///Destroys a video session and releases its internal resources.
17125 ///Any video session parameters created against this session become
17126 ///invalid, destroy them first.
17127 ///
17128 ///All command buffers referencing this session must have completed
17129 ///execution before destruction.
17130 pub unsafe fn destroy_video_session_khr(
17131 &self,
17132 video_session: VideoSessionKHR,
17133 allocator: Option<&AllocationCallbacks>,
17134 ) {
17135 let fp = self
17136 .commands()
17137 .destroy_video_session_khr
17138 .expect("vkDestroyVideoSessionKHR not loaded");
17139 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
17140 unsafe { fp(self.handle(), video_session, alloc_ptr) };
17141 }
17142 ///Wraps [`vkCreateVideoSessionParametersKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateVideoSessionParametersKHR.html).
17143 /**
17144 Provided by **VK_KHR_video_queue**.*/
17145 ///
17146 ///# Errors
17147 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
17148 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
17149 ///- `VK_ERROR_INITIALIZATION_FAILED`
17150 ///- `VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR`
17151 ///- `VK_ERROR_UNKNOWN`
17152 ///- `VK_ERROR_VALIDATION_FAILED`
17153 ///
17154 ///# Safety
17155 ///- `device` (self) must be valid and not destroyed.
17156 ///
17157 ///# Panics
17158 ///Panics if `vkCreateVideoSessionParametersKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17159 ///
17160 ///# Usage Notes
17161 ///
17162 ///Creates a video session parameters object that holds codec-specific
17163 ///parameter sets (SPS, PPS for H.264/H.265, sequence headers for
17164 ///AV1). These are referenced during decode/encode operations.
17165 ///
17166 ///Chain the appropriate codec-specific struct into `pNext`:
17167 ///
17168 ///- `VideoDecodeH264SessionParametersCreateInfoKHR` for H.264 decode.
17169 ///- `VideoDecodeH265SessionParametersCreateInfoKHR` for H.265 decode.
17170 ///- `VideoEncodeH264SessionParametersCreateInfoKHR` for H.264 encode.
17171 ///
17172 ///Parameters can be added incrementally with
17173 ///`update_video_session_parameters_khr`. A template parameter object
17174 ///can be specified to inherit existing parameters.
17175 pub unsafe fn create_video_session_parameters_khr(
17176 &self,
17177 p_create_info: &VideoSessionParametersCreateInfoKHR,
17178 allocator: Option<&AllocationCallbacks>,
17179 ) -> VkResult<VideoSessionParametersKHR> {
17180 let fp = self
17181 .commands()
17182 .create_video_session_parameters_khr
17183 .expect("vkCreateVideoSessionParametersKHR not loaded");
17184 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
17185 let mut out = unsafe { core::mem::zeroed() };
17186 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
17187 Ok(out)
17188 }
17189 ///Wraps [`vkUpdateVideoSessionParametersKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkUpdateVideoSessionParametersKHR.html).
17190 /**
17191 Provided by **VK_KHR_video_queue**.*/
17192 ///
17193 ///# Errors
17194 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
17195 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
17196 ///- `VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR`
17197 ///- `VK_ERROR_UNKNOWN`
17198 ///- `VK_ERROR_VALIDATION_FAILED`
17199 ///
17200 ///# Safety
17201 ///- `device` (self) must be valid and not destroyed.
17202 ///
17203 ///# Panics
17204 ///Panics if `vkUpdateVideoSessionParametersKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17205 ///
17206 ///# Usage Notes
17207 ///
17208 ///Adds new codec-specific parameter sets to an existing video
17209 ///session parameters object. For example, adding new SPS/PPS
17210 ///entries for H.264 as they are encountered in the bitstream.
17211 ///
17212 ///Chain the codec-specific update struct into the `pNext` of
17213 ///`VideoSessionParametersUpdateInfoKHR`. The `update_sequence_count`
17214 ///must increment monotonically with each update.
17215 ///
17216 ///Parameters cannot be removed or modified, only new entries can
17217 ///be added. If a parameter set with the same ID already exists,
17218 ///the update fails.
17219 pub unsafe fn update_video_session_parameters_khr(
17220 &self,
17221 video_session_parameters: VideoSessionParametersKHR,
17222 p_update_info: &VideoSessionParametersUpdateInfoKHR,
17223 ) -> VkResult<()> {
17224 let fp = self
17225 .commands()
17226 .update_video_session_parameters_khr
17227 .expect("vkUpdateVideoSessionParametersKHR not loaded");
17228 check(unsafe { fp(self.handle(), video_session_parameters, p_update_info) })
17229 }
17230 ///Wraps [`vkGetEncodedVideoSessionParametersKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetEncodedVideoSessionParametersKHR.html).
17231 /**
17232 Provided by **VK_KHR_video_encode_queue**.*/
17233 ///
17234 ///# Errors
17235 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
17236 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
17237 ///- `VK_ERROR_UNKNOWN`
17238 ///- `VK_ERROR_VALIDATION_FAILED`
17239 ///
17240 ///# Safety
17241 ///- `device` (self) must be valid and not destroyed.
17242 ///
17243 ///# Panics
17244 ///Panics if `vkGetEncodedVideoSessionParametersKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17245 ///
17246 ///# Usage Notes
17247 ///
17248 ///Retrieves the encoded (serialized) form of video session
17249 ///parameters, typically codec headers (SPS/PPS for H.264/H.265,
17250 ///sequence header for AV1) that must be prepended to the encoded
17251 ///bitstream.
17252 ///
17253 ///Uses the two-call pattern: call with null `p_data` to query
17254 ///the size, allocate, then call again to fill the buffer.
17255 ///
17256 ///The `p_feedback_info` output indicates whether the driver
17257 ///modified or overrode any parameters relative to what was
17258 ///requested (check `has_overrides`).
17259 ///
17260 ///This data is the codec parameter payload that decoders need to
17261 ///initialize before processing encoded frames.
17262 pub unsafe fn get_encoded_video_session_parameters_khr(
17263 &self,
17264 p_video_session_parameters_info: &VideoEncodeSessionParametersGetInfoKHR,
17265 p_feedback_info: &mut VideoEncodeSessionParametersFeedbackInfoKHR,
17266 p_data: *mut core::ffi::c_void,
17267 ) -> VkResult<usize> {
17268 let fp = self
17269 .commands()
17270 .get_encoded_video_session_parameters_khr
17271 .expect("vkGetEncodedVideoSessionParametersKHR not loaded");
17272 let mut out = unsafe { core::mem::zeroed() };
17273 check(unsafe {
17274 fp(
17275 self.handle(),
17276 p_video_session_parameters_info,
17277 p_feedback_info,
17278 &mut out,
17279 p_data,
17280 )
17281 })?;
17282 Ok(out)
17283 }
17284 ///Wraps [`vkDestroyVideoSessionParametersKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyVideoSessionParametersKHR.html).
17285 /**
17286 Provided by **VK_KHR_video_queue**.*/
17287 ///
17288 ///# Safety
17289 ///- `device` (self) must be valid and not destroyed.
17290 ///- `videoSessionParameters` must be externally synchronized.
17291 ///
17292 ///# Panics
17293 ///Panics if `vkDestroyVideoSessionParametersKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17294 ///
17295 ///# Usage Notes
17296 ///
17297 ///Destroys a video session parameters object. All command buffers
17298 ///referencing these parameters must have completed execution before
17299 ///destruction.
17300 ///
17301 ///The video session itself is not affected, other parameter objects
17302 ///associated with the same session remain valid.
17303 pub unsafe fn destroy_video_session_parameters_khr(
17304 &self,
17305 video_session_parameters: VideoSessionParametersKHR,
17306 allocator: Option<&AllocationCallbacks>,
17307 ) {
17308 let fp = self
17309 .commands()
17310 .destroy_video_session_parameters_khr
17311 .expect("vkDestroyVideoSessionParametersKHR not loaded");
17312 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
17313 unsafe { fp(self.handle(), video_session_parameters, alloc_ptr) };
17314 }
17315 ///Wraps [`vkGetVideoSessionMemoryRequirementsKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetVideoSessionMemoryRequirementsKHR.html).
17316 /**
17317 Provided by **VK_KHR_video_queue**.*/
17318 ///
17319 ///# Errors
17320 ///- `VK_ERROR_UNKNOWN`
17321 ///- `VK_ERROR_VALIDATION_FAILED`
17322 ///
17323 ///# Safety
17324 ///- `device` (self) must be valid and not destroyed.
17325 ///
17326 ///# Panics
17327 ///Panics if `vkGetVideoSessionMemoryRequirementsKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17328 ///
17329 ///# Usage Notes
17330 ///
17331 ///Queries the memory requirements for a video session. A video
17332 ///session may require multiple memory bindings (each with different
17333 ///memory type requirements) for internal buffers used during
17334 ///decode/encode.
17335 ///
17336 ///Each returned `VideoSessionMemoryRequirementsKHR` has a
17337 ///`memory_bind_index` and a `MemoryRequirements` describing the
17338 ///size, alignment, and compatible memory types.
17339 ///
17340 ///Allocate a `DeviceMemory` for each requirement and bind them all
17341 ///with `bind_video_session_memory_khr` before using the session.
17342 pub unsafe fn get_video_session_memory_requirements_khr(
17343 &self,
17344 video_session: VideoSessionKHR,
17345 ) -> VkResult<Vec<VideoSessionMemoryRequirementsKHR>> {
17346 let fp = self
17347 .commands()
17348 .get_video_session_memory_requirements_khr
17349 .expect("vkGetVideoSessionMemoryRequirementsKHR not loaded");
17350 enumerate_two_call(|count, data| unsafe { fp(self.handle(), video_session, count, data) })
17351 }
17352 ///Wraps [`vkBindVideoSessionMemoryKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBindVideoSessionMemoryKHR.html).
17353 /**
17354 Provided by **VK_KHR_video_queue**.*/
17355 ///
17356 ///# Errors
17357 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
17358 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
17359 ///- `VK_ERROR_UNKNOWN`
17360 ///- `VK_ERROR_VALIDATION_FAILED`
17361 ///
17362 ///# Safety
17363 ///- `device` (self) must be valid and not destroyed.
17364 ///- `videoSession` must be externally synchronized.
17365 ///
17366 ///# Panics
17367 ///Panics if `vkBindVideoSessionMemoryKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17368 ///
17369 ///# Usage Notes
17370 ///
17371 ///Binds device memory to a video session. Each binding corresponds
17372 ///to a `memory_bind_index` from
17373 ///`get_video_session_memory_requirements_khr`.
17374 ///
17375 ///All required memory bindings must be satisfied before the session
17376 ///can be used in video coding operations. Each
17377 ///`BindVideoSessionMemoryInfoKHR` specifies the bind index, memory
17378 ///object, offset, and size.
17379 ///
17380 ///Memory can only be bound once per index, rebinding is not
17381 ///allowed.
17382 pub unsafe fn bind_video_session_memory_khr(
17383 &self,
17384 video_session: VideoSessionKHR,
17385 p_bind_session_memory_infos: &[BindVideoSessionMemoryInfoKHR],
17386 ) -> VkResult<()> {
17387 let fp = self
17388 .commands()
17389 .bind_video_session_memory_khr
17390 .expect("vkBindVideoSessionMemoryKHR not loaded");
17391 check(unsafe {
17392 fp(
17393 self.handle(),
17394 video_session,
17395 p_bind_session_memory_infos.len() as u32,
17396 p_bind_session_memory_infos.as_ptr(),
17397 )
17398 })
17399 }
17400 ///Wraps [`vkCmdDecodeVideoKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDecodeVideoKHR.html).
17401 /**
17402 Provided by **VK_KHR_video_decode_queue**.*/
17403 ///
17404 ///# Safety
17405 ///- `commandBuffer` (self) must be valid and not destroyed.
17406 ///- `commandBuffer` must be externally synchronized.
17407 ///
17408 ///# Panics
17409 ///Panics if `vkCmdDecodeVideoKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17410 ///
17411 ///# Usage Notes
17412 ///
17413 ///Decodes a single video frame from a compressed bitstream.
17414 ///Must be recorded within a video coding scope
17415 ///(`cmd_begin_video_coding_khr` / `cmd_end_video_coding_khr`).
17416 ///
17417 ///`VideoDecodeInfoKHR` specifies:
17418 ///
17419 ///- `src_buffer` / `src_buffer_offset` / `src_buffer_range`: the
17420 /// bitstream data containing the compressed frame.
17421 ///- `dst_picture_resource`: the output image view for the decoded
17422 /// frame.
17423 ///- `setup_reference_slot`: DPB slot to store this frame for use
17424 /// as a reference by future frames.
17425 ///- `reference_slots`: previously decoded reference frames needed
17426 /// to decode this frame.
17427 ///
17428 ///Chain codec-specific decode info (e.g.,
17429 ///`VideoDecodeH264PictureInfoKHR`) into `pNext`.
17430 pub unsafe fn cmd_decode_video_khr(
17431 &self,
17432 command_buffer: CommandBuffer,
17433 p_decode_info: &VideoDecodeInfoKHR,
17434 ) {
17435 let fp = self
17436 .commands()
17437 .cmd_decode_video_khr
17438 .expect("vkCmdDecodeVideoKHR not loaded");
17439 unsafe { fp(command_buffer, p_decode_info) };
17440 }
17441 ///Wraps [`vkCmdBeginVideoCodingKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginVideoCodingKHR.html).
17442 /**
17443 Provided by **VK_KHR_video_queue**.*/
17444 ///
17445 ///# Safety
17446 ///- `commandBuffer` (self) must be valid and not destroyed.
17447 ///- `commandBuffer` must be externally synchronized.
17448 ///
17449 ///# Panics
17450 ///Panics if `vkCmdBeginVideoCodingKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17451 ///
17452 ///# Usage Notes
17453 ///
17454 ///Begins a video coding scope within a command buffer. All video
17455 ///decode and encode commands must be recorded between
17456 ///`cmd_begin_video_coding_khr` and `cmd_end_video_coding_khr`.
17457 ///
17458 ///`VideoBeginCodingInfoKHR` specifies:
17459 ///
17460 ///- `video_session`: the session to use.
17461 ///- `video_session_parameters`: codec parameters (SPS/PPS, etc.).
17462 ///- `reference_slots`: DPB (decoded picture buffer) slots and their
17463 /// associated image views for reference pictures.
17464 ///
17465 ///The command buffer must be allocated from a queue family that
17466 ///supports the appropriate video operations (decode or encode),
17467 ///as reported by `QueueFamilyVideoPropertiesKHR`.
17468 pub unsafe fn cmd_begin_video_coding_khr(
17469 &self,
17470 command_buffer: CommandBuffer,
17471 p_begin_info: &VideoBeginCodingInfoKHR,
17472 ) {
17473 let fp = self
17474 .commands()
17475 .cmd_begin_video_coding_khr
17476 .expect("vkCmdBeginVideoCodingKHR not loaded");
17477 unsafe { fp(command_buffer, p_begin_info) };
17478 }
17479 ///Wraps [`vkCmdControlVideoCodingKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdControlVideoCodingKHR.html).
17480 /**
17481 Provided by **VK_KHR_video_queue**.*/
17482 ///
17483 ///# Safety
17484 ///- `commandBuffer` (self) must be valid and not destroyed.
17485 ///- `commandBuffer` must be externally synchronized.
17486 ///
17487 ///# Panics
17488 ///Panics if `vkCmdControlVideoCodingKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17489 ///
17490 ///# Usage Notes
17491 ///
17492 ///Issues control commands within a video coding scope. Used to
17493 ///reset the video session state or set encode quality/rate control
17494 ///parameters.
17495 ///
17496 ///`VideoCodingControlInfoKHR` flags include:
17497 ///
17498 ///- `RESET`: resets the video session to a clean state, clearing
17499 /// all DPB slots and internal codec state.
17500 ///- `ENCODE_RATE_CONTROL`: applies rate control settings (chain
17501 /// `VideoEncodeRateControlInfoKHR` into `pNext`).
17502 ///- `ENCODE_QUALITY_LEVEL`: sets the encode quality level.
17503 ///
17504 ///Must be recorded between `cmd_begin_video_coding_khr` and
17505 ///`cmd_end_video_coding_khr`.
17506 pub unsafe fn cmd_control_video_coding_khr(
17507 &self,
17508 command_buffer: CommandBuffer,
17509 p_coding_control_info: &VideoCodingControlInfoKHR,
17510 ) {
17511 let fp = self
17512 .commands()
17513 .cmd_control_video_coding_khr
17514 .expect("vkCmdControlVideoCodingKHR not loaded");
17515 unsafe { fp(command_buffer, p_coding_control_info) };
17516 }
17517 ///Wraps [`vkCmdEndVideoCodingKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndVideoCodingKHR.html).
17518 /**
17519 Provided by **VK_KHR_video_queue**.*/
17520 ///
17521 ///# Safety
17522 ///- `commandBuffer` (self) must be valid and not destroyed.
17523 ///- `commandBuffer` must be externally synchronized.
17524 ///
17525 ///# Panics
17526 ///Panics if `vkCmdEndVideoCodingKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17527 ///
17528 ///# Usage Notes
17529 ///
17530 ///Ends a video coding scope previously started with
17531 ///`cmd_begin_video_coding_khr`. After this call, video decode and
17532 ///encode commands can no longer be recorded until a new scope is
17533 ///started.
17534 ///
17535 ///The `VideoEndCodingInfoKHR` struct is currently reserved for
17536 ///future use (no flags defined).
17537 pub unsafe fn cmd_end_video_coding_khr(
17538 &self,
17539 command_buffer: CommandBuffer,
17540 p_end_coding_info: &VideoEndCodingInfoKHR,
17541 ) {
17542 let fp = self
17543 .commands()
17544 .cmd_end_video_coding_khr
17545 .expect("vkCmdEndVideoCodingKHR not loaded");
17546 unsafe { fp(command_buffer, p_end_coding_info) };
17547 }
17548 ///Wraps [`vkCmdEncodeVideoKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEncodeVideoKHR.html).
17549 /**
17550 Provided by **VK_KHR_video_encode_queue**.*/
17551 ///
17552 ///# Safety
17553 ///- `commandBuffer` (self) must be valid and not destroyed.
17554 ///- `commandBuffer` must be externally synchronized.
17555 ///
17556 ///# Panics
17557 ///Panics if `vkCmdEncodeVideoKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17558 ///
17559 ///# Usage Notes
17560 ///
17561 ///Encodes a single video frame into a compressed bitstream.
17562 ///Must be recorded within a video coding scope
17563 ///(`cmd_begin_video_coding_khr` / `cmd_end_video_coding_khr`).
17564 ///
17565 ///`VideoEncodeInfoKHR` specifies:
17566 ///
17567 ///- `dst_buffer` / `dst_buffer_offset` / `dst_buffer_range`: where
17568 /// to write the compressed output.
17569 ///- `src_picture_resource`: the input image view to encode.
17570 ///- `setup_reference_slot`: DPB slot to store the reconstructed
17571 /// frame for future reference.
17572 ///- `reference_slots`: reference frames for inter-prediction.
17573 ///
17574 ///Chain codec-specific encode info (e.g.,
17575 ///`VideoEncodeH264PictureInfoKHR`) into `pNext`. Configure rate
17576 ///control beforehand with `cmd_control_video_coding_khr`.
17577 pub unsafe fn cmd_encode_video_khr(
17578 &self,
17579 command_buffer: CommandBuffer,
17580 p_encode_info: &VideoEncodeInfoKHR,
17581 ) {
17582 let fp = self
17583 .commands()
17584 .cmd_encode_video_khr
17585 .expect("vkCmdEncodeVideoKHR not loaded");
17586 unsafe { fp(command_buffer, p_encode_info) };
17587 }
17588 ///Wraps [`vkCmdDecompressMemoryNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDecompressMemoryNV.html).
17589 /**
17590 Provided by **VK_NV_memory_decompression**.*/
17591 ///
17592 ///# Safety
17593 ///- `commandBuffer` (self) must be valid and not destroyed.
17594 ///- `commandBuffer` must be externally synchronized.
17595 ///
17596 ///# Panics
17597 ///Panics if `vkCmdDecompressMemoryNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17598 ///
17599 ///# Usage Notes
17600 ///
17601 ///Decompresses one or more memory regions on the GPU. Each region
17602 ///specifies source, destination, size, and decompression method.
17603 ///
17604 ///Requires `VK_NV_memory_decompression`.
17605 pub unsafe fn cmd_decompress_memory_nv(
17606 &self,
17607 command_buffer: CommandBuffer,
17608 p_decompress_memory_regions: &[DecompressMemoryRegionNV],
17609 ) {
17610 let fp = self
17611 .commands()
17612 .cmd_decompress_memory_nv
17613 .expect("vkCmdDecompressMemoryNV not loaded");
17614 unsafe {
17615 fp(
17616 command_buffer,
17617 p_decompress_memory_regions.len() as u32,
17618 p_decompress_memory_regions.as_ptr(),
17619 )
17620 };
17621 }
17622 ///Wraps [`vkCmdDecompressMemoryIndirectCountNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDecompressMemoryIndirectCountNV.html).
17623 /**
17624 Provided by **VK_NV_memory_decompression**.*/
17625 ///
17626 ///# Safety
17627 ///- `commandBuffer` (self) must be valid and not destroyed.
17628 ///- `commandBuffer` must be externally synchronized.
17629 ///
17630 ///# Panics
17631 ///Panics if `vkCmdDecompressMemoryIndirectCountNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17632 ///
17633 ///# Usage Notes
17634 ///
17635 ///Indirect-count variant of `cmd_decompress_memory_nv`. Reads the
17636 ///decompression region descriptors and count from GPU buffer
17637 ///addresses, enabling fully GPU-driven decompression.
17638 ///
17639 ///Requires `VK_NV_memory_decompression`.
17640 pub unsafe fn cmd_decompress_memory_indirect_count_nv(
17641 &self,
17642 command_buffer: CommandBuffer,
17643 indirect_commands_address: u64,
17644 indirect_commands_count_address: u64,
17645 stride: u32,
17646 ) {
17647 let fp = self
17648 .commands()
17649 .cmd_decompress_memory_indirect_count_nv
17650 .expect("vkCmdDecompressMemoryIndirectCountNV not loaded");
17651 unsafe {
17652 fp(
17653 command_buffer,
17654 indirect_commands_address,
17655 indirect_commands_count_address,
17656 stride,
17657 )
17658 };
17659 }
17660 ///Wraps [`vkGetPartitionedAccelerationStructuresBuildSizesNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPartitionedAccelerationStructuresBuildSizesNV.html).
17661 /**
17662 Provided by **VK_NV_partitioned_acceleration_structure**.*/
17663 ///
17664 ///# Safety
17665 ///- `device` (self) must be valid and not destroyed.
17666 ///
17667 ///# Panics
17668 ///Panics if `vkGetPartitionedAccelerationStructuresBuildSizesNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17669 ///
17670 ///# Usage Notes
17671 ///
17672 ///Queries the buffer sizes needed to build a partitioned
17673 ///acceleration structure. Use the returned sizes to allocate
17674 ///destination and scratch buffers.
17675 ///
17676 ///Requires `VK_NV_partitioned_acceleration_structure`.
17677 pub unsafe fn get_partitioned_acceleration_structures_build_sizes_nv(
17678 &self,
17679 p_info: &PartitionedAccelerationStructureInstancesInputNV,
17680 p_size_info: &mut AccelerationStructureBuildSizesInfoKHR,
17681 ) {
17682 let fp = self
17683 .commands()
17684 .get_partitioned_acceleration_structures_build_sizes_nv
17685 .expect("vkGetPartitionedAccelerationStructuresBuildSizesNV not loaded");
17686 unsafe { fp(self.handle(), p_info, p_size_info) };
17687 }
17688 ///Wraps [`vkCmdBuildPartitionedAccelerationStructuresNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBuildPartitionedAccelerationStructuresNV.html).
17689 /**
17690 Provided by **VK_NV_partitioned_acceleration_structure**.*/
17691 ///
17692 ///# Safety
17693 ///- `commandBuffer` (self) must be valid and not destroyed.
17694 ///- `commandBuffer` must be externally synchronized.
17695 ///
17696 ///# Panics
17697 ///Panics if `vkCmdBuildPartitionedAccelerationStructuresNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17698 ///
17699 ///# Usage Notes
17700 ///
17701 ///Builds a partitioned acceleration structure where instances are
17702 ///grouped into independently updatable partitions. This allows
17703 ///updating subsets of the TLAS without rebuilding the entire
17704 ///structure.
17705 ///
17706 ///Requires `VK_NV_partitioned_acceleration_structure`.
17707 pub unsafe fn cmd_build_partitioned_acceleration_structures_nv(
17708 &self,
17709 command_buffer: CommandBuffer,
17710 p_build_info: &BuildPartitionedAccelerationStructureInfoNV,
17711 ) {
17712 let fp = self
17713 .commands()
17714 .cmd_build_partitioned_acceleration_structures_nv
17715 .expect("vkCmdBuildPartitionedAccelerationStructuresNV not loaded");
17716 unsafe { fp(command_buffer, p_build_info) };
17717 }
17718 ///Wraps [`vkCmdDecompressMemoryEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDecompressMemoryEXT.html).
17719 /**
17720 Provided by **VK_EXT_memory_decompression**.*/
17721 ///
17722 ///# Safety
17723 ///- `commandBuffer` (self) must be valid and not destroyed.
17724 ///- `commandBuffer` must be externally synchronized.
17725 ///
17726 ///# Panics
17727 ///Panics if `vkCmdDecompressMemoryEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17728 ///
17729 ///# Usage Notes
17730 ///
17731 ///Decompresses data from one memory region into another on the GPU.
17732 ///The decompression algorithm is specified in the info structure.
17733 ///
17734 ///Useful for loading compressed assets directly on the GPU without
17735 ///a CPU round-trip.
17736 ///
17737 ///Requires `VK_EXT_memory_decompression`.
17738 pub unsafe fn cmd_decompress_memory_ext(
17739 &self,
17740 command_buffer: CommandBuffer,
17741 p_decompress_memory_info_ext: &DecompressMemoryInfoEXT,
17742 ) {
17743 let fp = self
17744 .commands()
17745 .cmd_decompress_memory_ext
17746 .expect("vkCmdDecompressMemoryEXT not loaded");
17747 unsafe { fp(command_buffer, p_decompress_memory_info_ext) };
17748 }
17749 ///Wraps [`vkCmdDecompressMemoryIndirectCountEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDecompressMemoryIndirectCountEXT.html).
17750 /**
17751 Provided by **VK_EXT_memory_decompression**.*/
17752 ///
17753 ///# Safety
17754 ///- `commandBuffer` (self) must be valid and not destroyed.
17755 ///- `commandBuffer` must be externally synchronized.
17756 ///
17757 ///# Panics
17758 ///Panics if `vkCmdDecompressMemoryIndirectCountEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17759 ///
17760 ///# Usage Notes
17761 ///
17762 ///Indirect variant of `cmd_decompress_memory_ext`. Reads the
17763 ///decompression parameters and count from GPU-visible buffer
17764 ///addresses, enabling fully GPU-driven decompression workflows.
17765 ///
17766 ///Requires `VK_EXT_memory_decompression`.
17767 pub unsafe fn cmd_decompress_memory_indirect_count_ext(
17768 &self,
17769 command_buffer: CommandBuffer,
17770 decompression_method: MemoryDecompressionMethodFlagsEXT,
17771 indirect_commands_address: u64,
17772 indirect_commands_count_address: u64,
17773 max_decompression_count: u32,
17774 stride: u32,
17775 ) {
17776 let fp = self
17777 .commands()
17778 .cmd_decompress_memory_indirect_count_ext
17779 .expect("vkCmdDecompressMemoryIndirectCountEXT not loaded");
17780 unsafe {
17781 fp(
17782 command_buffer,
17783 decompression_method,
17784 indirect_commands_address,
17785 indirect_commands_count_address,
17786 max_decompression_count,
17787 stride,
17788 )
17789 };
17790 }
17791 ///Wraps [`vkCreateCuModuleNVX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateCuModuleNVX.html).
17792 /**
17793 Provided by **VK_NVX_binary_import**.*/
17794 ///
17795 ///# Errors
17796 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
17797 ///- `VK_ERROR_INITIALIZATION_FAILED`
17798 ///- `VK_ERROR_UNKNOWN`
17799 ///- `VK_ERROR_VALIDATION_FAILED`
17800 ///
17801 ///# Safety
17802 ///- `device` (self) must be valid and not destroyed.
17803 ///
17804 ///# Panics
17805 ///Panics if `vkCreateCuModuleNVX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17806 ///
17807 ///# Usage Notes
17808 ///
17809 ///Creates a CUDA module from binary data using the legacy NVX
17810 ///path. Prefer `create_cuda_module_nv` for new code.
17811 ///
17812 ///Destroy with `destroy_cu_module_nvx`.
17813 ///
17814 ///Requires `VK_NVX_binary_import`.
17815 pub unsafe fn create_cu_module_nvx(
17816 &self,
17817 p_create_info: &CuModuleCreateInfoNVX,
17818 allocator: Option<&AllocationCallbacks>,
17819 ) -> VkResult<CuModuleNVX> {
17820 let fp = self
17821 .commands()
17822 .create_cu_module_nvx
17823 .expect("vkCreateCuModuleNVX not loaded");
17824 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
17825 let mut out = unsafe { core::mem::zeroed() };
17826 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
17827 Ok(out)
17828 }
17829 ///Wraps [`vkCreateCuFunctionNVX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateCuFunctionNVX.html).
17830 /**
17831 Provided by **VK_NVX_binary_import**.*/
17832 ///
17833 ///# Errors
17834 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
17835 ///- `VK_ERROR_INITIALIZATION_FAILED`
17836 ///- `VK_ERROR_UNKNOWN`
17837 ///- `VK_ERROR_VALIDATION_FAILED`
17838 ///
17839 ///# Safety
17840 ///- `device` (self) must be valid and not destroyed.
17841 ///
17842 ///# Panics
17843 ///Panics if `vkCreateCuFunctionNVX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17844 ///
17845 ///# Usage Notes
17846 ///
17847 ///Creates a CUDA function handle from an NVX binary module. This
17848 ///is the legacy NVX path; prefer `create_cuda_function_nv` for
17849 ///new code.
17850 ///
17851 ///Destroy with `destroy_cu_function_nvx`.
17852 ///
17853 ///Requires `VK_NVX_binary_import`.
17854 pub unsafe fn create_cu_function_nvx(
17855 &self,
17856 p_create_info: &CuFunctionCreateInfoNVX,
17857 allocator: Option<&AllocationCallbacks>,
17858 ) -> VkResult<CuFunctionNVX> {
17859 let fp = self
17860 .commands()
17861 .create_cu_function_nvx
17862 .expect("vkCreateCuFunctionNVX not loaded");
17863 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
17864 let mut out = unsafe { core::mem::zeroed() };
17865 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
17866 Ok(out)
17867 }
17868 ///Wraps [`vkDestroyCuModuleNVX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyCuModuleNVX.html).
17869 /**
17870 Provided by **VK_NVX_binary_import**.*/
17871 ///
17872 ///# Safety
17873 ///- `device` (self) must be valid and not destroyed.
17874 ///
17875 ///# Panics
17876 ///Panics if `vkDestroyCuModuleNVX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17877 ///
17878 ///# Usage Notes
17879 ///
17880 ///Destroys a CUDA module created with `create_cu_module_nvx`.
17881 ///
17882 ///Requires `VK_NVX_binary_import`.
17883 pub unsafe fn destroy_cu_module_nvx(
17884 &self,
17885 module: CuModuleNVX,
17886 allocator: Option<&AllocationCallbacks>,
17887 ) {
17888 let fp = self
17889 .commands()
17890 .destroy_cu_module_nvx
17891 .expect("vkDestroyCuModuleNVX not loaded");
17892 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
17893 unsafe { fp(self.handle(), module, alloc_ptr) };
17894 }
17895 ///Wraps [`vkDestroyCuFunctionNVX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyCuFunctionNVX.html).
17896 /**
17897 Provided by **VK_NVX_binary_import**.*/
17898 ///
17899 ///# Safety
17900 ///- `device` (self) must be valid and not destroyed.
17901 ///
17902 ///# Panics
17903 ///Panics if `vkDestroyCuFunctionNVX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17904 ///
17905 ///# Usage Notes
17906 ///
17907 ///Destroys a CUDA function handle created with
17908 ///`create_cu_function_nvx`.
17909 ///
17910 ///Requires `VK_NVX_binary_import`.
17911 pub unsafe fn destroy_cu_function_nvx(
17912 &self,
17913 function: CuFunctionNVX,
17914 allocator: Option<&AllocationCallbacks>,
17915 ) {
17916 let fp = self
17917 .commands()
17918 .destroy_cu_function_nvx
17919 .expect("vkDestroyCuFunctionNVX not loaded");
17920 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
17921 unsafe { fp(self.handle(), function, alloc_ptr) };
17922 }
17923 ///Wraps [`vkCmdCuLaunchKernelNVX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCuLaunchKernelNVX.html).
17924 /**
17925 Provided by **VK_NVX_binary_import**.*/
17926 ///
17927 ///# Safety
17928 ///- `commandBuffer` (self) must be valid and not destroyed.
17929 ///
17930 ///# Panics
17931 ///Panics if `vkCmdCuLaunchKernelNVX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17932 ///
17933 ///# Usage Notes
17934 ///
17935 ///Launches a CUDA kernel from a Vulkan command buffer using the
17936 ///legacy NVX binary import path. Prefer `cmd_cuda_launch_kernel_nv`
17937 ///for new code.
17938 ///
17939 ///Requires `VK_NVX_binary_import`.
17940 pub unsafe fn cmd_cu_launch_kernel_nvx(
17941 &self,
17942 command_buffer: CommandBuffer,
17943 p_launch_info: &CuLaunchInfoNVX,
17944 ) {
17945 let fp = self
17946 .commands()
17947 .cmd_cu_launch_kernel_nvx
17948 .expect("vkCmdCuLaunchKernelNVX not loaded");
17949 unsafe { fp(command_buffer, p_launch_info) };
17950 }
17951 ///Wraps [`vkGetDescriptorSetLayoutSizeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDescriptorSetLayoutSizeEXT.html).
17952 /**
17953 Provided by **VK_EXT_descriptor_buffer**.*/
17954 ///
17955 ///# Safety
17956 ///- `device` (self) must be valid and not destroyed.
17957 ///
17958 ///# Panics
17959 ///Panics if `vkGetDescriptorSetLayoutSizeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17960 ///
17961 ///# Usage Notes
17962 ///
17963 ///Returns the total byte size required to store all descriptors for
17964 ///the given descriptor set layout in a descriptor buffer.
17965 ///
17966 ///Use this to allocate the correct amount of buffer memory for each
17967 ///descriptor set, then write individual descriptors at offsets
17968 ///obtained from `get_descriptor_set_layout_binding_offset_ext`.
17969 ///
17970 ///Requires `VK_EXT_descriptor_buffer`.
17971 pub unsafe fn get_descriptor_set_layout_size_ext(&self, layout: DescriptorSetLayout) -> u64 {
17972 let fp = self
17973 .commands()
17974 .get_descriptor_set_layout_size_ext
17975 .expect("vkGetDescriptorSetLayoutSizeEXT not loaded");
17976 let mut out = unsafe { core::mem::zeroed() };
17977 unsafe { fp(self.handle(), layout, &mut out) };
17978 out
17979 }
17980 ///Wraps [`vkGetDescriptorSetLayoutBindingOffsetEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDescriptorSetLayoutBindingOffsetEXT.html).
17981 /**
17982 Provided by **VK_EXT_descriptor_buffer**.*/
17983 ///
17984 ///# Safety
17985 ///- `device` (self) must be valid and not destroyed.
17986 ///
17987 ///# Panics
17988 ///Panics if `vkGetDescriptorSetLayoutBindingOffsetEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17989 ///
17990 ///# Usage Notes
17991 ///
17992 ///Returns the byte offset of a specific binding within the
17993 ///descriptor buffer layout for the given descriptor set layout.
17994 ///
17995 ///Use this to compute where to write a descriptor with
17996 ///`get_descriptor_ext` within the buffer region for a set.
17997 ///
17998 ///Requires `VK_EXT_descriptor_buffer`.
17999 pub unsafe fn get_descriptor_set_layout_binding_offset_ext(
18000 &self,
18001 layout: DescriptorSetLayout,
18002 binding: u32,
18003 ) -> u64 {
18004 let fp = self
18005 .commands()
18006 .get_descriptor_set_layout_binding_offset_ext
18007 .expect("vkGetDescriptorSetLayoutBindingOffsetEXT not loaded");
18008 let mut out = unsafe { core::mem::zeroed() };
18009 unsafe { fp(self.handle(), layout, binding, &mut out) };
18010 out
18011 }
18012 ///Wraps [`vkGetDescriptorEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDescriptorEXT.html).
18013 /**
18014 Provided by **VK_EXT_descriptor_buffer**.*/
18015 ///
18016 ///# Safety
18017 ///- `device` (self) must be valid and not destroyed.
18018 ///
18019 ///# Panics
18020 ///Panics if `vkGetDescriptorEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18021 ///
18022 ///# Usage Notes
18023 ///
18024 ///Writes a descriptor directly into caller-provided memory.
18025 ///`DescriptorGetInfoEXT` specifies the descriptor type and resource
18026 ///(buffer, image, sampler, etc.). The descriptor is written to
18027 ///`p_descriptor` and must be `data_size` bytes.
18028 ///
18029 ///Query the required size per descriptor type with
18030 ///`PhysicalDeviceDescriptorBufferPropertiesEXT`.
18031 ///
18032 ///This is the core operation of descriptor buffers, instead of
18033 ///allocating descriptor sets, you write descriptors directly into
18034 ///mapped buffer memory.
18035 ///
18036 ///Requires `VK_EXT_descriptor_buffer`.
18037 pub unsafe fn get_descriptor_ext(
18038 &self,
18039 p_descriptor_info: &DescriptorGetInfoEXT,
18040 data_size: usize,
18041 p_descriptor: *mut core::ffi::c_void,
18042 ) {
18043 let fp = self
18044 .commands()
18045 .get_descriptor_ext
18046 .expect("vkGetDescriptorEXT not loaded");
18047 unsafe { fp(self.handle(), p_descriptor_info, data_size, p_descriptor) };
18048 }
18049 ///Wraps [`vkCmdBindDescriptorBuffersEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindDescriptorBuffersEXT.html).
18050 /**
18051 Provided by **VK_EXT_descriptor_buffer**.*/
18052 ///
18053 ///# Safety
18054 ///- `commandBuffer` (self) must be valid and not destroyed.
18055 ///- `commandBuffer` must be externally synchronized.
18056 ///
18057 ///# Panics
18058 ///Panics if `vkCmdBindDescriptorBuffersEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18059 ///
18060 ///# Usage Notes
18061 ///
18062 ///Binds one or more descriptor buffers to a command buffer. Each
18063 ///`DescriptorBufferBindingInfoEXT` specifies a buffer address and
18064 ///usage (resource descriptors, sampler descriptors, or push
18065 ///descriptors).
18066 ///
18067 ///After binding, use `cmd_set_descriptor_buffer_offsets_ext` to
18068 ///point specific descriptor sets at offsets within the bound buffers.
18069 ///
18070 ///Descriptor buffers are an alternative to descriptor sets/pools
18071 ///that stores descriptors inline in buffer memory.
18072 ///
18073 ///Requires `VK_EXT_descriptor_buffer`.
18074 pub unsafe fn cmd_bind_descriptor_buffers_ext(
18075 &self,
18076 command_buffer: CommandBuffer,
18077 p_binding_infos: &[DescriptorBufferBindingInfoEXT],
18078 ) {
18079 let fp = self
18080 .commands()
18081 .cmd_bind_descriptor_buffers_ext
18082 .expect("vkCmdBindDescriptorBuffersEXT not loaded");
18083 unsafe {
18084 fp(
18085 command_buffer,
18086 p_binding_infos.len() as u32,
18087 p_binding_infos.as_ptr(),
18088 )
18089 };
18090 }
18091 ///Wraps [`vkCmdSetDescriptorBufferOffsetsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDescriptorBufferOffsetsEXT.html).
18092 /**
18093 Provided by **VK_EXT_descriptor_buffer**.*/
18094 ///
18095 ///# Safety
18096 ///- `commandBuffer` (self) must be valid and not destroyed.
18097 ///- `commandBuffer` must be externally synchronized.
18098 ///
18099 ///# Panics
18100 ///Panics if `vkCmdSetDescriptorBufferOffsetsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18101 ///
18102 ///# Usage Notes
18103 ///
18104 ///Sets the offsets into bound descriptor buffers for one or more
18105 ///descriptor set slots. Each pair of (buffer_index, offset) maps
18106 ///a descriptor set to a region of a previously bound descriptor
18107 ///buffer.
18108 ///
18109 ///Must be called after `cmd_bind_descriptor_buffers_ext`.
18110 ///
18111 ///For the pNext-extensible variant, see
18112 ///`cmd_set_descriptor_buffer_offsets2_ext`.
18113 ///
18114 ///Requires `VK_EXT_descriptor_buffer`.
18115 pub unsafe fn cmd_set_descriptor_buffer_offsets_ext(
18116 &self,
18117 command_buffer: CommandBuffer,
18118 pipeline_bind_point: PipelineBindPoint,
18119 layout: PipelineLayout,
18120 first_set: u32,
18121 p_buffer_indices: &[u32],
18122 p_offsets: &u64,
18123 ) {
18124 let fp = self
18125 .commands()
18126 .cmd_set_descriptor_buffer_offsets_ext
18127 .expect("vkCmdSetDescriptorBufferOffsetsEXT not loaded");
18128 unsafe {
18129 fp(
18130 command_buffer,
18131 pipeline_bind_point,
18132 layout,
18133 first_set,
18134 p_buffer_indices.len() as u32,
18135 p_buffer_indices.as_ptr(),
18136 p_offsets,
18137 )
18138 };
18139 }
18140 ///Wraps [`vkCmdBindDescriptorBufferEmbeddedSamplersEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindDescriptorBufferEmbeddedSamplersEXT.html).
18141 /**
18142 Provided by **VK_EXT_descriptor_buffer**.*/
18143 ///
18144 ///# Safety
18145 ///- `commandBuffer` (self) must be valid and not destroyed.
18146 ///- `commandBuffer` must be externally synchronized.
18147 ///
18148 ///# Panics
18149 ///Panics if `vkCmdBindDescriptorBufferEmbeddedSamplersEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18150 ///
18151 ///# Usage Notes
18152 ///
18153 ///Binds embedded immutable samplers from a descriptor set layout
18154 ///that was created with `CREATE_EMBEDDED_IMMUTABLE_SAMPLERS_BIT`.
18155 ///These samplers are baked into the layout and do not need buffer
18156 ///memory.
18157 ///
18158 ///Specify the `pipeline_bind_point`, `layout`, and `set` index.
18159 ///
18160 ///For the pNext-extensible variant, see
18161 ///`cmd_bind_descriptor_buffer_embedded_samplers2_ext`.
18162 ///
18163 ///Requires `VK_EXT_descriptor_buffer`.
18164 pub unsafe fn cmd_bind_descriptor_buffer_embedded_samplers_ext(
18165 &self,
18166 command_buffer: CommandBuffer,
18167 pipeline_bind_point: PipelineBindPoint,
18168 layout: PipelineLayout,
18169 set: u32,
18170 ) {
18171 let fp = self
18172 .commands()
18173 .cmd_bind_descriptor_buffer_embedded_samplers_ext
18174 .expect("vkCmdBindDescriptorBufferEmbeddedSamplersEXT not loaded");
18175 unsafe { fp(command_buffer, pipeline_bind_point, layout, set) };
18176 }
18177 ///Wraps [`vkGetBufferOpaqueCaptureDescriptorDataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetBufferOpaqueCaptureDescriptorDataEXT.html).
18178 /**
18179 Provided by **VK_EXT_descriptor_buffer**.*/
18180 ///
18181 ///# Errors
18182 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18183 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
18184 ///- `VK_ERROR_UNKNOWN`
18185 ///- `VK_ERROR_VALIDATION_FAILED`
18186 ///
18187 ///# Safety
18188 ///- `device` (self) must be valid and not destroyed.
18189 ///
18190 ///# Panics
18191 ///Panics if `vkGetBufferOpaqueCaptureDescriptorDataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18192 ///
18193 ///# Usage Notes
18194 ///
18195 ///Retrieves opaque capture data for a buffer descriptor. The
18196 ///returned data can be used to reconstruct the descriptor in a
18197 ///replay or capture/replay scenario.
18198 ///
18199 ///The buffer must have been created with
18200 ///`CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT`.
18201 ///
18202 ///Requires `VK_EXT_descriptor_buffer` and
18203 ///`descriptorBufferCaptureReplay`.
18204 pub unsafe fn get_buffer_opaque_capture_descriptor_data_ext(
18205 &self,
18206 p_info: &BufferCaptureDescriptorDataInfoEXT,
18207 ) -> VkResult<core::ffi::c_void> {
18208 let fp = self
18209 .commands()
18210 .get_buffer_opaque_capture_descriptor_data_ext
18211 .expect("vkGetBufferOpaqueCaptureDescriptorDataEXT not loaded");
18212 let mut out = unsafe { core::mem::zeroed() };
18213 check(unsafe { fp(self.handle(), p_info, &mut out) })?;
18214 Ok(out)
18215 }
18216 ///Wraps [`vkGetImageOpaqueCaptureDescriptorDataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageOpaqueCaptureDescriptorDataEXT.html).
18217 /**
18218 Provided by **VK_EXT_descriptor_buffer**.*/
18219 ///
18220 ///# Errors
18221 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18222 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
18223 ///- `VK_ERROR_UNKNOWN`
18224 ///- `VK_ERROR_VALIDATION_FAILED`
18225 ///
18226 ///# Safety
18227 ///- `device` (self) must be valid and not destroyed.
18228 ///
18229 ///# Panics
18230 ///Panics if `vkGetImageOpaqueCaptureDescriptorDataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18231 ///
18232 ///# Usage Notes
18233 ///
18234 ///Retrieves opaque capture data for an image descriptor. The
18235 ///returned data can be used to reconstruct the descriptor in a
18236 ///capture/replay scenario.
18237 ///
18238 ///The image must have been created with
18239 ///`CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT`.
18240 ///
18241 ///Requires `VK_EXT_descriptor_buffer` and
18242 ///`descriptorBufferCaptureReplay`.
18243 pub unsafe fn get_image_opaque_capture_descriptor_data_ext(
18244 &self,
18245 p_info: &ImageCaptureDescriptorDataInfoEXT,
18246 ) -> VkResult<core::ffi::c_void> {
18247 let fp = self
18248 .commands()
18249 .get_image_opaque_capture_descriptor_data_ext
18250 .expect("vkGetImageOpaqueCaptureDescriptorDataEXT not loaded");
18251 let mut out = unsafe { core::mem::zeroed() };
18252 check(unsafe { fp(self.handle(), p_info, &mut out) })?;
18253 Ok(out)
18254 }
18255 ///Wraps [`vkGetImageViewOpaqueCaptureDescriptorDataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageViewOpaqueCaptureDescriptorDataEXT.html).
18256 /**
18257 Provided by **VK_EXT_descriptor_buffer**.*/
18258 ///
18259 ///# Errors
18260 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18261 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
18262 ///- `VK_ERROR_UNKNOWN`
18263 ///- `VK_ERROR_VALIDATION_FAILED`
18264 ///
18265 ///# Safety
18266 ///- `device` (self) must be valid and not destroyed.
18267 ///
18268 ///# Panics
18269 ///Panics if `vkGetImageViewOpaqueCaptureDescriptorDataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18270 ///
18271 ///# Usage Notes
18272 ///
18273 ///Retrieves opaque capture data for an image view descriptor. The
18274 ///returned data can be used to reconstruct the descriptor in a
18275 ///capture/replay scenario.
18276 ///
18277 ///The image view must have been created with
18278 ///`CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT`.
18279 ///
18280 ///Requires `VK_EXT_descriptor_buffer` and
18281 ///`descriptorBufferCaptureReplay`.
18282 pub unsafe fn get_image_view_opaque_capture_descriptor_data_ext(
18283 &self,
18284 p_info: &ImageViewCaptureDescriptorDataInfoEXT,
18285 ) -> VkResult<core::ffi::c_void> {
18286 let fp = self
18287 .commands()
18288 .get_image_view_opaque_capture_descriptor_data_ext
18289 .expect("vkGetImageViewOpaqueCaptureDescriptorDataEXT not loaded");
18290 let mut out = unsafe { core::mem::zeroed() };
18291 check(unsafe { fp(self.handle(), p_info, &mut out) })?;
18292 Ok(out)
18293 }
18294 ///Wraps [`vkGetSamplerOpaqueCaptureDescriptorDataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSamplerOpaqueCaptureDescriptorDataEXT.html).
18295 /**
18296 Provided by **VK_EXT_descriptor_buffer**.*/
18297 ///
18298 ///# Errors
18299 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18300 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
18301 ///- `VK_ERROR_UNKNOWN`
18302 ///- `VK_ERROR_VALIDATION_FAILED`
18303 ///
18304 ///# Safety
18305 ///- `device` (self) must be valid and not destroyed.
18306 ///
18307 ///# Panics
18308 ///Panics if `vkGetSamplerOpaqueCaptureDescriptorDataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18309 ///
18310 ///# Usage Notes
18311 ///
18312 ///Retrieves opaque capture data for a sampler descriptor. The
18313 ///returned data can be used to reconstruct the descriptor in a
18314 ///capture/replay scenario.
18315 ///
18316 ///The sampler must have been created with
18317 ///`CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT`.
18318 ///
18319 ///Requires `VK_EXT_descriptor_buffer` and
18320 ///`descriptorBufferCaptureReplay`.
18321 pub unsafe fn get_sampler_opaque_capture_descriptor_data_ext(
18322 &self,
18323 p_info: &SamplerCaptureDescriptorDataInfoEXT,
18324 ) -> VkResult<core::ffi::c_void> {
18325 let fp = self
18326 .commands()
18327 .get_sampler_opaque_capture_descriptor_data_ext
18328 .expect("vkGetSamplerOpaqueCaptureDescriptorDataEXT not loaded");
18329 let mut out = unsafe { core::mem::zeroed() };
18330 check(unsafe { fp(self.handle(), p_info, &mut out) })?;
18331 Ok(out)
18332 }
18333 ///Wraps [`vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT.html).
18334 /**
18335 Provided by **VK_EXT_descriptor_buffer**.*/
18336 ///
18337 ///# Errors
18338 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18339 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
18340 ///- `VK_ERROR_UNKNOWN`
18341 ///- `VK_ERROR_VALIDATION_FAILED`
18342 ///
18343 ///# Safety
18344 ///- `device` (self) must be valid and not destroyed.
18345 ///
18346 ///# Panics
18347 ///Panics if `vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18348 ///
18349 ///# Usage Notes
18350 ///
18351 ///Retrieves opaque capture data for an acceleration structure
18352 ///descriptor. The returned data can be used to reconstruct the
18353 ///descriptor in a replay or capture/replay scenario.
18354 ///
18355 ///The acceleration structure must have been created with
18356 ///`CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT`.
18357 ///
18358 ///Requires `VK_EXT_descriptor_buffer` and
18359 ///`descriptorBufferCaptureReplay`.
18360 pub unsafe fn get_acceleration_structure_opaque_capture_descriptor_data_ext(
18361 &self,
18362 p_info: &AccelerationStructureCaptureDescriptorDataInfoEXT,
18363 ) -> VkResult<core::ffi::c_void> {
18364 let fp = self
18365 .commands()
18366 .get_acceleration_structure_opaque_capture_descriptor_data_ext
18367 .expect("vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT not loaded");
18368 let mut out = unsafe { core::mem::zeroed() };
18369 check(unsafe { fp(self.handle(), p_info, &mut out) })?;
18370 Ok(out)
18371 }
18372 ///Wraps [`vkSetDeviceMemoryPriorityEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetDeviceMemoryPriorityEXT.html).
18373 /**
18374 Provided by **VK_EXT_pageable_device_local_memory**.*/
18375 ///
18376 ///# Safety
18377 ///- `device` (self) must be valid and not destroyed.
18378 ///
18379 ///# Panics
18380 ///Panics if `vkSetDeviceMemoryPriorityEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18381 ///
18382 ///# Usage Notes
18383 ///
18384 ///Dynamically updates the priority of a device memory allocation.
18385 ///Higher-priority allocations are less likely to be evicted under
18386 ///memory pressure. Use this to promote frequently accessed
18387 ///resources or demote resources that are no longer critical.
18388 ///
18389 ///Requires `VK_EXT_pageable_device_local_memory`.
18390 pub unsafe fn set_device_memory_priority_ext(&self, memory: DeviceMemory, priority: f32) {
18391 let fp = self
18392 .commands()
18393 .set_device_memory_priority_ext
18394 .expect("vkSetDeviceMemoryPriorityEXT not loaded");
18395 unsafe { fp(self.handle(), memory, priority) };
18396 }
18397 ///Wraps [`vkWaitForPresent2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkWaitForPresent2KHR.html).
18398 /**
18399 Provided by **VK_KHR_present_wait2**.*/
18400 ///
18401 ///# Errors
18402 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18403 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
18404 ///- `VK_ERROR_DEVICE_LOST`
18405 ///- `VK_ERROR_OUT_OF_DATE_KHR`
18406 ///- `VK_ERROR_SURFACE_LOST_KHR`
18407 ///- `VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT`
18408 ///- `VK_ERROR_UNKNOWN`
18409 ///- `VK_ERROR_VALIDATION_FAILED`
18410 ///
18411 ///# Safety
18412 ///- `device` (self) must be valid and not destroyed.
18413 ///- `swapchain` must be externally synchronized.
18414 ///
18415 ///# Panics
18416 ///Panics if `vkWaitForPresent2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18417 ///
18418 ///# Usage Notes
18419 ///
18420 ///Extensible version of `wait_for_present_khr`. Takes a
18421 ///`PresentWait2InfoKHR` struct (with `pNext` support) instead of
18422 ///separate `present_id` and `timeout` parameters.
18423 ///
18424 ///Provided by `VK_KHR_present_wait2`. Otherwise identical in
18425 ///behavior, blocks until the specified present ID completes or
18426 ///the timeout expires.
18427 pub unsafe fn wait_for_present2_khr(
18428 &self,
18429 swapchain: SwapchainKHR,
18430 p_present_wait2_info: &PresentWait2InfoKHR,
18431 ) -> VkResult<()> {
18432 let fp = self
18433 .commands()
18434 .wait_for_present2_khr
18435 .expect("vkWaitForPresent2KHR not loaded");
18436 check(unsafe { fp(self.handle(), swapchain, p_present_wait2_info) })
18437 }
18438 ///Wraps [`vkWaitForPresentKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkWaitForPresentKHR.html).
18439 /**
18440 Provided by **VK_KHR_present_wait**.*/
18441 ///
18442 ///# Errors
18443 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18444 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
18445 ///- `VK_ERROR_DEVICE_LOST`
18446 ///- `VK_ERROR_OUT_OF_DATE_KHR`
18447 ///- `VK_ERROR_SURFACE_LOST_KHR`
18448 ///- `VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT`
18449 ///- `VK_ERROR_UNKNOWN`
18450 ///- `VK_ERROR_VALIDATION_FAILED`
18451 ///
18452 ///# Safety
18453 ///- `device` (self) must be valid and not destroyed.
18454 ///- `swapchain` must be externally synchronized.
18455 ///
18456 ///# Panics
18457 ///Panics if `vkWaitForPresentKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18458 ///
18459 ///# Usage Notes
18460 ///
18461 ///Blocks the calling thread until a specific present operation
18462 ///completes on the display. `present_id` identifies which present
18463 ///to wait for, set it via `PresentIdKHR` chained into
18464 ///`PresentInfoKHR` during `queue_present_khr`.
18465 ///
18466 ///`timeout` is in nanoseconds. Returns `TIMEOUT` if the deadline
18467 ///expires before the present completes, `SUCCESS` if the present
18468 ///finished. Use `u64::MAX` for an indefinite wait.
18469 ///
18470 ///Requires `VK_KHR_present_wait` and `VK_KHR_present_id`.
18471 ///
18472 ///This is useful for frame pacing, wait for the previous frame's
18473 ///present to complete before starting the next frame's work to
18474 ///avoid queuing excessive frames.
18475 pub unsafe fn wait_for_present_khr(
18476 &self,
18477 swapchain: SwapchainKHR,
18478 present_id: u64,
18479 timeout: u64,
18480 ) -> VkResult<()> {
18481 let fp = self
18482 .commands()
18483 .wait_for_present_khr
18484 .expect("vkWaitForPresentKHR not loaded");
18485 check(unsafe { fp(self.handle(), swapchain, present_id, timeout) })
18486 }
18487 ///Wraps [`vkCreateBufferCollectionFUCHSIA`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateBufferCollectionFUCHSIA.html).
18488 /**
18489 Provided by **VK_FUCHSIA_buffer_collection**.*/
18490 ///
18491 ///# Errors
18492 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18493 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
18494 ///- `VK_ERROR_INITIALIZATION_FAILED`
18495 ///- `VK_ERROR_UNKNOWN`
18496 ///- `VK_ERROR_VALIDATION_FAILED`
18497 ///
18498 ///# Safety
18499 ///- `device` (self) must be valid and not destroyed.
18500 ///
18501 ///# Panics
18502 ///Panics if `vkCreateBufferCollectionFUCHSIA` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18503 ///
18504 ///# Usage Notes
18505 ///
18506 ///Creates a Fuchsia buffer collection that negotiates memory
18507 ///constraints between Vulkan and other Fuchsia services (e.g.
18508 ///scenic, camera). Fuchsia OS only. After creation, set buffer
18509 ///or image constraints before allocating.
18510 ///
18511 ///Requires `VK_FUCHSIA_buffer_collection`.
18512 pub unsafe fn create_buffer_collection_fuchsia(
18513 &self,
18514 p_create_info: &BufferCollectionCreateInfoFUCHSIA,
18515 allocator: Option<&AllocationCallbacks>,
18516 ) -> VkResult<BufferCollectionFUCHSIA> {
18517 let fp = self
18518 .commands()
18519 .create_buffer_collection_fuchsia
18520 .expect("vkCreateBufferCollectionFUCHSIA not loaded");
18521 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
18522 let mut out = unsafe { core::mem::zeroed() };
18523 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
18524 Ok(out)
18525 }
18526 ///Wraps [`vkSetBufferCollectionBufferConstraintsFUCHSIA`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetBufferCollectionBufferConstraintsFUCHSIA.html).
18527 /**
18528 Provided by **VK_FUCHSIA_buffer_collection**.*/
18529 ///
18530 ///# Errors
18531 ///- `VK_ERROR_INITIALIZATION_FAILED`
18532 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18533 ///- `VK_ERROR_FORMAT_NOT_SUPPORTED`
18534 ///- `VK_ERROR_UNKNOWN`
18535 ///- `VK_ERROR_VALIDATION_FAILED`
18536 ///
18537 ///# Safety
18538 ///- `device` (self) must be valid and not destroyed.
18539 ///
18540 ///# Panics
18541 ///Panics if `vkSetBufferCollectionBufferConstraintsFUCHSIA` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18542 ///
18543 ///# Usage Notes
18544 ///
18545 ///Sets buffer constraints on a Fuchsia buffer collection. The
18546 ///constraints describe the Vulkan buffer usage requirements that
18547 ///must be negotiated with other collection participants. Fuchsia
18548 ///OS only.
18549 ///
18550 ///Requires `VK_FUCHSIA_buffer_collection`.
18551 pub unsafe fn set_buffer_collection_buffer_constraints_fuchsia(
18552 &self,
18553 collection: BufferCollectionFUCHSIA,
18554 p_buffer_constraints_info: &BufferConstraintsInfoFUCHSIA,
18555 ) -> VkResult<()> {
18556 let fp = self
18557 .commands()
18558 .set_buffer_collection_buffer_constraints_fuchsia
18559 .expect("vkSetBufferCollectionBufferConstraintsFUCHSIA not loaded");
18560 check(unsafe { fp(self.handle(), collection, p_buffer_constraints_info) })
18561 }
18562 ///Wraps [`vkSetBufferCollectionImageConstraintsFUCHSIA`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetBufferCollectionImageConstraintsFUCHSIA.html).
18563 /**
18564 Provided by **VK_FUCHSIA_buffer_collection**.*/
18565 ///
18566 ///# Errors
18567 ///- `VK_ERROR_INITIALIZATION_FAILED`
18568 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18569 ///- `VK_ERROR_FORMAT_NOT_SUPPORTED`
18570 ///- `VK_ERROR_UNKNOWN`
18571 ///- `VK_ERROR_VALIDATION_FAILED`
18572 ///
18573 ///# Safety
18574 ///- `device` (self) must be valid and not destroyed.
18575 ///
18576 ///# Panics
18577 ///Panics if `vkSetBufferCollectionImageConstraintsFUCHSIA` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18578 ///
18579 ///# Usage Notes
18580 ///
18581 ///Sets image constraints on a Fuchsia buffer collection. The
18582 ///constraints describe the Vulkan image format and usage
18583 ///requirements that must be negotiated with other collection
18584 ///participants. Fuchsia OS only.
18585 ///
18586 ///Requires `VK_FUCHSIA_buffer_collection`.
18587 pub unsafe fn set_buffer_collection_image_constraints_fuchsia(
18588 &self,
18589 collection: BufferCollectionFUCHSIA,
18590 p_image_constraints_info: &ImageConstraintsInfoFUCHSIA,
18591 ) -> VkResult<()> {
18592 let fp = self
18593 .commands()
18594 .set_buffer_collection_image_constraints_fuchsia
18595 .expect("vkSetBufferCollectionImageConstraintsFUCHSIA not loaded");
18596 check(unsafe { fp(self.handle(), collection, p_image_constraints_info) })
18597 }
18598 ///Wraps [`vkDestroyBufferCollectionFUCHSIA`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyBufferCollectionFUCHSIA.html).
18599 /**
18600 Provided by **VK_FUCHSIA_buffer_collection**.*/
18601 ///
18602 ///# Safety
18603 ///- `device` (self) must be valid and not destroyed.
18604 ///
18605 ///# Panics
18606 ///Panics if `vkDestroyBufferCollectionFUCHSIA` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18607 ///
18608 ///# Usage Notes
18609 ///
18610 ///Destroys a Fuchsia buffer collection. The collection must not
18611 ///be in use by any pending operations. Fuchsia OS only.
18612 ///
18613 ///Requires `VK_FUCHSIA_buffer_collection`.
18614 pub unsafe fn destroy_buffer_collection_fuchsia(
18615 &self,
18616 collection: BufferCollectionFUCHSIA,
18617 allocator: Option<&AllocationCallbacks>,
18618 ) {
18619 let fp = self
18620 .commands()
18621 .destroy_buffer_collection_fuchsia
18622 .expect("vkDestroyBufferCollectionFUCHSIA not loaded");
18623 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
18624 unsafe { fp(self.handle(), collection, alloc_ptr) };
18625 }
18626 ///Wraps [`vkGetBufferCollectionPropertiesFUCHSIA`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetBufferCollectionPropertiesFUCHSIA.html).
18627 /**
18628 Provided by **VK_FUCHSIA_buffer_collection**.*/
18629 ///
18630 ///# Errors
18631 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18632 ///- `VK_ERROR_INITIALIZATION_FAILED`
18633 ///- `VK_ERROR_UNKNOWN`
18634 ///- `VK_ERROR_VALIDATION_FAILED`
18635 ///
18636 ///# Safety
18637 ///- `device` (self) must be valid and not destroyed.
18638 ///
18639 ///# Panics
18640 ///Panics if `vkGetBufferCollectionPropertiesFUCHSIA` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18641 ///
18642 ///# Usage Notes
18643 ///
18644 ///Queries the negotiated properties of a Fuchsia buffer
18645 ///collection after constraints have been set. Returns memory
18646 ///type index, format, and other details needed for allocation.
18647 ///Fuchsia OS only.
18648 ///
18649 ///Requires `VK_FUCHSIA_buffer_collection`.
18650 pub unsafe fn get_buffer_collection_properties_fuchsia(
18651 &self,
18652 collection: BufferCollectionFUCHSIA,
18653 p_properties: &mut BufferCollectionPropertiesFUCHSIA,
18654 ) -> VkResult<()> {
18655 let fp = self
18656 .commands()
18657 .get_buffer_collection_properties_fuchsia
18658 .expect("vkGetBufferCollectionPropertiesFUCHSIA not loaded");
18659 check(unsafe { fp(self.handle(), collection, p_properties) })
18660 }
18661 ///Wraps [`vkCreateCudaModuleNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateCudaModuleNV.html).
18662 /**
18663 Provided by **VK_NV_cuda_kernel_launch**.*/
18664 ///
18665 ///# Errors
18666 ///- `VK_ERROR_INITIALIZATION_FAILED`
18667 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18668 ///- `VK_ERROR_UNKNOWN`
18669 ///- `VK_ERROR_VALIDATION_FAILED`
18670 ///
18671 ///# Safety
18672 ///- `device` (self) must be valid and not destroyed.
18673 ///
18674 ///# Panics
18675 ///Panics if `vkCreateCudaModuleNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18676 ///
18677 ///# Usage Notes
18678 ///
18679 ///Creates a CUDA module from PTX or cubin data. The module
18680 ///contains one or more kernel entry points that can be extracted
18681 ///with `create_cuda_function_nv`.
18682 ///
18683 ///Destroy with `destroy_cuda_module_nv`.
18684 ///
18685 ///Requires `VK_NV_cuda_kernel_launch`.
18686 pub unsafe fn create_cuda_module_nv(
18687 &self,
18688 p_create_info: &CudaModuleCreateInfoNV,
18689 allocator: Option<&AllocationCallbacks>,
18690 ) -> VkResult<CudaModuleNV> {
18691 let fp = self
18692 .commands()
18693 .create_cuda_module_nv
18694 .expect("vkCreateCudaModuleNV not loaded");
18695 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
18696 let mut out = unsafe { core::mem::zeroed() };
18697 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
18698 Ok(out)
18699 }
18700 ///Wraps [`vkGetCudaModuleCacheNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetCudaModuleCacheNV.html).
18701 /**
18702 Provided by **VK_NV_cuda_kernel_launch**.*/
18703 ///
18704 ///# Errors
18705 ///- `VK_ERROR_INITIALIZATION_FAILED`
18706 ///- `VK_ERROR_UNKNOWN`
18707 ///- `VK_ERROR_VALIDATION_FAILED`
18708 ///
18709 ///# Safety
18710 ///- `device` (self) must be valid and not destroyed.
18711 ///
18712 ///# Panics
18713 ///Panics if `vkGetCudaModuleCacheNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18714 ///
18715 ///# Usage Notes
18716 ///
18717 ///Retrieves the compiled cache data from a CUDA module for
18718 ///serialization. Call once with a null buffer to query the size,
18719 ///then again with an appropriately sized buffer. Feed the data
18720 ///back into `create_cuda_module_nv` on the next run to skip
18721 ///compilation.
18722 ///
18723 ///Requires `VK_NV_cuda_kernel_launch`.
18724 pub unsafe fn get_cuda_module_cache_nv(
18725 &self,
18726 module: CudaModuleNV,
18727 p_cache_data: *mut core::ffi::c_void,
18728 ) -> VkResult<usize> {
18729 let fp = self
18730 .commands()
18731 .get_cuda_module_cache_nv
18732 .expect("vkGetCudaModuleCacheNV not loaded");
18733 let mut out = unsafe { core::mem::zeroed() };
18734 check(unsafe { fp(self.handle(), module, &mut out, p_cache_data) })?;
18735 Ok(out)
18736 }
18737 ///Wraps [`vkCreateCudaFunctionNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateCudaFunctionNV.html).
18738 /**
18739 Provided by **VK_NV_cuda_kernel_launch**.*/
18740 ///
18741 ///# Errors
18742 ///- `VK_ERROR_INITIALIZATION_FAILED`
18743 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18744 ///- `VK_ERROR_UNKNOWN`
18745 ///- `VK_ERROR_VALIDATION_FAILED`
18746 ///
18747 ///# Safety
18748 ///- `device` (self) must be valid and not destroyed.
18749 ///
18750 ///# Panics
18751 ///Panics if `vkCreateCudaFunctionNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18752 ///
18753 ///# Usage Notes
18754 ///
18755 ///Creates a CUDA function handle from a CUDA module, identifying
18756 ///a specific kernel entry point. Use with
18757 ///`cmd_cuda_launch_kernel_nv` to dispatch the kernel.
18758 ///
18759 ///Destroy with `destroy_cuda_function_nv`.
18760 ///
18761 ///Requires `VK_NV_cuda_kernel_launch`.
18762 pub unsafe fn create_cuda_function_nv(
18763 &self,
18764 p_create_info: &CudaFunctionCreateInfoNV,
18765 allocator: Option<&AllocationCallbacks>,
18766 ) -> VkResult<CudaFunctionNV> {
18767 let fp = self
18768 .commands()
18769 .create_cuda_function_nv
18770 .expect("vkCreateCudaFunctionNV not loaded");
18771 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
18772 let mut out = unsafe { core::mem::zeroed() };
18773 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
18774 Ok(out)
18775 }
18776 ///Wraps [`vkDestroyCudaModuleNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyCudaModuleNV.html).
18777 /**
18778 Provided by **VK_NV_cuda_kernel_launch**.*/
18779 ///
18780 ///# Safety
18781 ///- `device` (self) must be valid and not destroyed.
18782 ///
18783 ///# Panics
18784 ///Panics if `vkDestroyCudaModuleNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18785 ///
18786 ///# Usage Notes
18787 ///
18788 ///Destroys a CUDA module created with `create_cuda_module_nv`.
18789 ///All functions extracted from this module must be destroyed first.
18790 ///
18791 ///Requires `VK_NV_cuda_kernel_launch`.
18792 pub unsafe fn destroy_cuda_module_nv(
18793 &self,
18794 module: CudaModuleNV,
18795 allocator: Option<&AllocationCallbacks>,
18796 ) {
18797 let fp = self
18798 .commands()
18799 .destroy_cuda_module_nv
18800 .expect("vkDestroyCudaModuleNV not loaded");
18801 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
18802 unsafe { fp(self.handle(), module, alloc_ptr) };
18803 }
18804 ///Wraps [`vkDestroyCudaFunctionNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyCudaFunctionNV.html).
18805 /**
18806 Provided by **VK_NV_cuda_kernel_launch**.*/
18807 ///
18808 ///# Safety
18809 ///- `device` (self) must be valid and not destroyed.
18810 ///
18811 ///# Panics
18812 ///Panics if `vkDestroyCudaFunctionNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18813 ///
18814 ///# Usage Notes
18815 ///
18816 ///Destroys a CUDA function handle created with
18817 ///`create_cuda_function_nv`.
18818 ///
18819 ///Requires `VK_NV_cuda_kernel_launch`.
18820 pub unsafe fn destroy_cuda_function_nv(
18821 &self,
18822 function: CudaFunctionNV,
18823 allocator: Option<&AllocationCallbacks>,
18824 ) {
18825 let fp = self
18826 .commands()
18827 .destroy_cuda_function_nv
18828 .expect("vkDestroyCudaFunctionNV not loaded");
18829 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
18830 unsafe { fp(self.handle(), function, alloc_ptr) };
18831 }
18832 ///Wraps [`vkCmdCudaLaunchKernelNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCudaLaunchKernelNV.html).
18833 /**
18834 Provided by **VK_NV_cuda_kernel_launch**.*/
18835 ///
18836 ///# Safety
18837 ///- `commandBuffer` (self) must be valid and not destroyed.
18838 ///
18839 ///# Panics
18840 ///Panics if `vkCmdCudaLaunchKernelNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18841 ///
18842 ///# Usage Notes
18843 ///
18844 ///Launches a CUDA kernel from within a Vulkan command buffer.
18845 ///The kernel is specified by a CUDA function handle created with
18846 ///`create_cuda_function_nv`. Grid dimensions and parameters are
18847 ///provided in the launch info.
18848 ///
18849 ///Requires `VK_NV_cuda_kernel_launch`.
18850 pub unsafe fn cmd_cuda_launch_kernel_nv(
18851 &self,
18852 command_buffer: CommandBuffer,
18853 p_launch_info: &CudaLaunchInfoNV,
18854 ) {
18855 let fp = self
18856 .commands()
18857 .cmd_cuda_launch_kernel_nv
18858 .expect("vkCmdCudaLaunchKernelNV not loaded");
18859 unsafe { fp(command_buffer, p_launch_info) };
18860 }
18861 ///Wraps [`vkCmdBeginRendering`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginRendering.html).
18862 /**
18863 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
18864 ///
18865 ///# Safety
18866 ///- `commandBuffer` (self) must be valid and not destroyed.
18867 ///- `commandBuffer` must be externally synchronized.
18868 ///
18869 ///# Panics
18870 ///Panics if `vkCmdBeginRendering` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18871 ///
18872 ///# Usage Notes
18873 ///
18874 ///Begins dynamic rendering, a Vulkan 1.3 alternative to render pass
18875 ///objects that specifies attachments inline at command recording time.
18876 ///
18877 ///**Advantages over render passes**:
18878 ///
18879 ///- No `RenderPass` or `Framebuffer` objects to create and manage.
18880 ///- Attachments are specified directly as image views in
18881 /// `RenderingInfo`.
18882 ///- Simpler code for applications that do not benefit from tile-based
18883 /// subpass optimisations.
18884 ///
18885 ///**`RenderingInfo`** specifies:
18886 ///
18887 ///- **Colour attachments**: image views, load/store ops, clear values.
18888 ///- **Depth attachment**: optional, with its own load/store ops.
18889 ///- **Stencil attachment**: optional, can share the same image view as
18890 /// depth.
18891 ///- **Render area and layer count**.
18892 ///
18893 ///**Flags**:
18894 ///
18895 ///- `RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS`: draw commands come
18896 /// from secondary command buffers.
18897 ///- `RENDERING_SUSPENDING` / `RENDERING_RESUMING`: split rendering
18898 /// across multiple command buffers.
18899 ///
18900 ///Graphics pipelines used with dynamic rendering must be created with
18901 ///`PipelineRenderingCreateInfo` instead of a render pass handle.
18902 pub unsafe fn cmd_begin_rendering(
18903 &self,
18904 command_buffer: CommandBuffer,
18905 p_rendering_info: &RenderingInfo,
18906 ) {
18907 let fp = self
18908 .commands()
18909 .cmd_begin_rendering
18910 .expect("vkCmdBeginRendering not loaded");
18911 unsafe { fp(command_buffer, p_rendering_info) };
18912 }
18913 ///Wraps [`vkCmdEndRendering`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndRendering.html).
18914 /**
18915 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
18916 ///
18917 ///# Safety
18918 ///- `commandBuffer` (self) must be valid and not destroyed.
18919 ///- `commandBuffer` must be externally synchronized.
18920 ///
18921 ///# Panics
18922 ///Panics if `vkCmdEndRendering` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18923 ///
18924 ///# Usage Notes
18925 ///
18926 ///Ends a dynamic rendering instance started by `cmd_begin_rendering`.
18927 ///Store operations and any resolve operations specified in the
18928 ///`RenderingInfo` are executed at this point.
18929 ///
18930 ///After this call, no draw commands may be recorded until a new
18931 ///rendering or render pass instance is begun.
18932 pub unsafe fn cmd_end_rendering(&self, command_buffer: CommandBuffer) {
18933 let fp = self
18934 .commands()
18935 .cmd_end_rendering
18936 .expect("vkCmdEndRendering not loaded");
18937 unsafe { fp(command_buffer) };
18938 }
18939 ///Wraps [`vkCmdEndRendering2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndRendering2KHR.html).
18940 /**
18941 Provided by **VK_KHR_maintenance10**.*/
18942 ///
18943 ///# Safety
18944 ///- `commandBuffer` (self) must be valid and not destroyed.
18945 ///- `commandBuffer` must be externally synchronized.
18946 ///
18947 ///# Panics
18948 ///Panics if `vkCmdEndRendering2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18949 ///
18950 ///# Usage Notes
18951 ///
18952 ///Extended version of `cmd_end_rendering` (core 1.3) that accepts
18953 ///an optional `RenderingEndInfoKHR` with pNext extensibility.
18954 ///
18955 ///Ends the current dynamic rendering pass. If `p_rendering_end_info`
18956 ///is `None`, behaves identically to `cmd_end_rendering`.
18957 ///
18958 ///Provided by `VK_KHR_maintenance7`.
18959 pub unsafe fn cmd_end_rendering2_khr(
18960 &self,
18961 command_buffer: CommandBuffer,
18962 p_rendering_end_info: Option<&RenderingEndInfoKHR>,
18963 ) {
18964 let fp = self
18965 .commands()
18966 .cmd_end_rendering2_khr
18967 .expect("vkCmdEndRendering2KHR not loaded");
18968 let p_rendering_end_info_ptr =
18969 p_rendering_end_info.map_or(core::ptr::null(), core::ptr::from_ref);
18970 unsafe { fp(command_buffer, p_rendering_end_info_ptr) };
18971 }
18972 ///Wraps [`vkGetDescriptorSetLayoutHostMappingInfoVALVE`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDescriptorSetLayoutHostMappingInfoVALVE.html).
18973 /**
18974 Provided by **VK_VALVE_descriptor_set_host_mapping**.*/
18975 ///
18976 ///# Safety
18977 ///- `device` (self) must be valid and not destroyed.
18978 ///
18979 ///# Panics
18980 ///Panics if `vkGetDescriptorSetLayoutHostMappingInfoVALVE` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18981 ///
18982 ///# Usage Notes
18983 ///
18984 ///Queries the host memory layout for a specific binding within a
18985 ///descriptor set layout. Returns the stride and offset needed to
18986 ///write descriptors directly via the host pointer obtained from
18987 ///`get_descriptor_set_host_mapping_valve`.
18988 ///
18989 ///Requires `VK_VALVE_descriptor_set_host_mapping`.
18990 pub unsafe fn get_descriptor_set_layout_host_mapping_info_valve(
18991 &self,
18992 p_binding_reference: &DescriptorSetBindingReferenceVALVE,
18993 p_host_mapping: &mut DescriptorSetLayoutHostMappingInfoVALVE,
18994 ) {
18995 let fp = self
18996 .commands()
18997 .get_descriptor_set_layout_host_mapping_info_valve
18998 .expect("vkGetDescriptorSetLayoutHostMappingInfoVALVE not loaded");
18999 unsafe { fp(self.handle(), p_binding_reference, p_host_mapping) };
19000 }
19001 ///Wraps [`vkGetDescriptorSetHostMappingVALVE`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDescriptorSetHostMappingVALVE.html).
19002 /**
19003 Provided by **VK_VALVE_descriptor_set_host_mapping**.*/
19004 ///
19005 ///# Safety
19006 ///- `device` (self) must be valid and not destroyed.
19007 ///
19008 ///# Panics
19009 ///Panics if `vkGetDescriptorSetHostMappingVALVE` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19010 ///
19011 ///# Usage Notes
19012 ///
19013 ///Retrieves a host pointer to the internal memory backing a
19014 ///descriptor set. Allows direct CPU writes to descriptor data,
19015 ///bypassing the normal `update_descriptor_sets` path for lower
19016 ///overhead. The layout must match what was queried with
19017 ///`get_descriptor_set_layout_host_mapping_info_valve`.
19018 ///
19019 ///Requires `VK_VALVE_descriptor_set_host_mapping`.
19020 pub unsafe fn get_descriptor_set_host_mapping_valve(
19021 &self,
19022 descriptor_set: DescriptorSet,
19023 pp_data: *mut *mut core::ffi::c_void,
19024 ) {
19025 let fp = self
19026 .commands()
19027 .get_descriptor_set_host_mapping_valve
19028 .expect("vkGetDescriptorSetHostMappingVALVE not loaded");
19029 unsafe { fp(self.handle(), descriptor_set, pp_data) };
19030 }
19031 ///Wraps [`vkCreateMicromapEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateMicromapEXT.html).
19032 /**
19033 Provided by **VK_EXT_opacity_micromap**.*/
19034 ///
19035 ///# Errors
19036 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19037 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
19038 ///- `VK_ERROR_UNKNOWN`
19039 ///- `VK_ERROR_VALIDATION_FAILED`
19040 ///
19041 ///# Safety
19042 ///- `device` (self) must be valid and not destroyed.
19043 ///
19044 ///# Panics
19045 ///Panics if `vkCreateMicromapEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19046 ///
19047 ///# Usage Notes
19048 ///
19049 ///Creates an opacity micromap object. Micromaps store per-triangle
19050 ///opacity or hit data at sub-triangle granularity, enabling the
19051 ///ray tracing implementation to skip fully transparent micro-
19052 ///triangles without invoking any-hit shaders.
19053 ///
19054 ///The `MicromapCreateInfoEXT` specifies the backing buffer, size,
19055 ///and type (`OPACITY_MICROMAP`).
19056 ///
19057 ///Build with `cmd_build_micromaps_ext` or `build_micromaps_ext`.
19058 ///Destroy with `destroy_micromap_ext`.
19059 ///
19060 ///Requires `VK_EXT_opacity_micromap`.
19061 pub unsafe fn create_micromap_ext(
19062 &self,
19063 p_create_info: &MicromapCreateInfoEXT,
19064 allocator: Option<&AllocationCallbacks>,
19065 ) -> VkResult<MicromapEXT> {
19066 let fp = self
19067 .commands()
19068 .create_micromap_ext
19069 .expect("vkCreateMicromapEXT not loaded");
19070 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
19071 let mut out = unsafe { core::mem::zeroed() };
19072 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
19073 Ok(out)
19074 }
19075 ///Wraps [`vkCmdBuildMicromapsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBuildMicromapsEXT.html).
19076 /**
19077 Provided by **VK_EXT_opacity_micromap**.*/
19078 ///
19079 ///# Safety
19080 ///- `commandBuffer` (self) must be valid and not destroyed.
19081 ///- `commandBuffer` must be externally synchronized.
19082 ///
19083 ///# Panics
19084 ///Panics if `vkCmdBuildMicromapsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19085 ///
19086 ///# Usage Notes
19087 ///
19088 ///Records a GPU-side micromap build into a command buffer. Each
19089 ///`MicromapBuildInfoEXT` specifies the source triangle opacity
19090 ///data, destination micromap, and scratch memory.
19091 ///
19092 ///For the CPU-side equivalent, see `build_micromaps_ext`.
19093 ///
19094 ///Requires `VK_EXT_opacity_micromap`.
19095 pub unsafe fn cmd_build_micromaps_ext(
19096 &self,
19097 command_buffer: CommandBuffer,
19098 p_infos: &[MicromapBuildInfoEXT],
19099 ) {
19100 let fp = self
19101 .commands()
19102 .cmd_build_micromaps_ext
19103 .expect("vkCmdBuildMicromapsEXT not loaded");
19104 unsafe { fp(command_buffer, p_infos.len() as u32, p_infos.as_ptr()) };
19105 }
19106 ///Wraps [`vkBuildMicromapsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBuildMicromapsEXT.html).
19107 /**
19108 Provided by **VK_EXT_opacity_micromap**.*/
19109 ///
19110 ///# Errors
19111 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19112 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
19113 ///- `VK_ERROR_UNKNOWN`
19114 ///- `VK_ERROR_VALIDATION_FAILED`
19115 ///
19116 ///# Safety
19117 ///- `device` (self) must be valid and not destroyed.
19118 ///
19119 ///# Panics
19120 ///Panics if `vkBuildMicromapsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19121 ///
19122 ///# Usage Notes
19123 ///
19124 ///Builds one or more micromaps on the host. This is the CPU-side
19125 ///equivalent of `cmd_build_micromaps_ext`.
19126 ///
19127 ///Each `MicromapBuildInfoEXT` specifies the source triangle data,
19128 ///destination micromap, and scratch memory.
19129 ///
19130 ///Requires `VK_EXT_opacity_micromap` and the
19131 ///`micromapHostCommands` feature.
19132 pub unsafe fn build_micromaps_ext(
19133 &self,
19134 deferred_operation: DeferredOperationKHR,
19135 p_infos: &[MicromapBuildInfoEXT],
19136 ) -> VkResult<()> {
19137 let fp = self
19138 .commands()
19139 .build_micromaps_ext
19140 .expect("vkBuildMicromapsEXT not loaded");
19141 check(unsafe {
19142 fp(
19143 self.handle(),
19144 deferred_operation,
19145 p_infos.len() as u32,
19146 p_infos.as_ptr(),
19147 )
19148 })
19149 }
19150 ///Wraps [`vkDestroyMicromapEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyMicromapEXT.html).
19151 /**
19152 Provided by **VK_EXT_opacity_micromap**.*/
19153 ///
19154 ///# Safety
19155 ///- `device` (self) must be valid and not destroyed.
19156 ///- `micromap` must be externally synchronized.
19157 ///
19158 ///# Panics
19159 ///Panics if `vkDestroyMicromapEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19160 ///
19161 ///# Usage Notes
19162 ///
19163 ///Destroys a micromap created with `create_micromap_ext`. The
19164 ///backing buffer is not freed, the application must manage buffer
19165 ///lifetime separately.
19166 ///
19167 ///Requires `VK_EXT_opacity_micromap`.
19168 pub unsafe fn destroy_micromap_ext(
19169 &self,
19170 micromap: MicromapEXT,
19171 allocator: Option<&AllocationCallbacks>,
19172 ) {
19173 let fp = self
19174 .commands()
19175 .destroy_micromap_ext
19176 .expect("vkDestroyMicromapEXT not loaded");
19177 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
19178 unsafe { fp(self.handle(), micromap, alloc_ptr) };
19179 }
19180 ///Wraps [`vkCmdCopyMicromapEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMicromapEXT.html).
19181 /**
19182 Provided by **VK_EXT_opacity_micromap**.*/
19183 ///
19184 ///# Safety
19185 ///- `commandBuffer` (self) must be valid and not destroyed.
19186 ///- `commandBuffer` must be externally synchronized.
19187 ///
19188 ///# Panics
19189 ///Panics if `vkCmdCopyMicromapEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19190 ///
19191 ///# Usage Notes
19192 ///
19193 ///Copies or compacts a micromap. The `CopyMicromapInfoEXT` specifies
19194 ///source, destination, and mode (`CLONE` or `COMPACT`).
19195 ///
19196 ///Use `COMPACT` after building with `BUILD_ALLOW_COMPACTION` to
19197 ///reduce memory usage. Query the compacted size with
19198 ///`cmd_write_micromaps_properties_ext`.
19199 ///
19200 ///Requires `VK_EXT_opacity_micromap`.
19201 pub unsafe fn cmd_copy_micromap_ext(
19202 &self,
19203 command_buffer: CommandBuffer,
19204 p_info: &CopyMicromapInfoEXT,
19205 ) {
19206 let fp = self
19207 .commands()
19208 .cmd_copy_micromap_ext
19209 .expect("vkCmdCopyMicromapEXT not loaded");
19210 unsafe { fp(command_buffer, p_info) };
19211 }
19212 ///Wraps [`vkCopyMicromapEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCopyMicromapEXT.html).
19213 /**
19214 Provided by **VK_EXT_opacity_micromap**.*/
19215 ///
19216 ///# Errors
19217 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19218 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
19219 ///- `VK_ERROR_UNKNOWN`
19220 ///- `VK_ERROR_VALIDATION_FAILED`
19221 ///
19222 ///# Safety
19223 ///- `device` (self) must be valid and not destroyed.
19224 ///
19225 ///# Panics
19226 ///Panics if `vkCopyMicromapEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19227 ///
19228 ///# Usage Notes
19229 ///
19230 ///Host-side micromap copy or compaction. This is the CPU equivalent
19231 ///of `cmd_copy_micromap_ext`.
19232 ///
19233 ///Requires `VK_EXT_opacity_micromap` and the
19234 ///`micromapHostCommands` feature.
19235 pub unsafe fn copy_micromap_ext(
19236 &self,
19237 deferred_operation: DeferredOperationKHR,
19238 p_info: &CopyMicromapInfoEXT,
19239 ) -> VkResult<()> {
19240 let fp = self
19241 .commands()
19242 .copy_micromap_ext
19243 .expect("vkCopyMicromapEXT not loaded");
19244 check(unsafe { fp(self.handle(), deferred_operation, p_info) })
19245 }
19246 ///Wraps [`vkCmdCopyMicromapToMemoryEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMicromapToMemoryEXT.html).
19247 /**
19248 Provided by **VK_EXT_opacity_micromap**.*/
19249 ///
19250 ///# Safety
19251 ///- `commandBuffer` (self) must be valid and not destroyed.
19252 ///- `commandBuffer` must be externally synchronized.
19253 ///
19254 ///# Panics
19255 ///Panics if `vkCmdCopyMicromapToMemoryEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19256 ///
19257 ///# Usage Notes
19258 ///
19259 ///Serializes a micromap into a buffer for storage or transfer.
19260 ///The `CopyMicromapToMemoryInfoEXT` specifies the source micromap
19261 ///and destination device address.
19262 ///
19263 ///Deserialize with `cmd_copy_memory_to_micromap_ext`.
19264 ///
19265 ///Requires `VK_EXT_opacity_micromap`.
19266 pub unsafe fn cmd_copy_micromap_to_memory_ext(
19267 &self,
19268 command_buffer: CommandBuffer,
19269 p_info: &CopyMicromapToMemoryInfoEXT,
19270 ) {
19271 let fp = self
19272 .commands()
19273 .cmd_copy_micromap_to_memory_ext
19274 .expect("vkCmdCopyMicromapToMemoryEXT not loaded");
19275 unsafe { fp(command_buffer, p_info) };
19276 }
19277 ///Wraps [`vkCopyMicromapToMemoryEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCopyMicromapToMemoryEXT.html).
19278 /**
19279 Provided by **VK_EXT_opacity_micromap**.*/
19280 ///
19281 ///# Errors
19282 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19283 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
19284 ///- `VK_ERROR_UNKNOWN`
19285 ///- `VK_ERROR_VALIDATION_FAILED`
19286 ///
19287 ///# Safety
19288 ///- `device` (self) must be valid and not destroyed.
19289 ///
19290 ///# Panics
19291 ///Panics if `vkCopyMicromapToMemoryEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19292 ///
19293 ///# Usage Notes
19294 ///
19295 ///Host-side serialization of a micromap into a buffer. This is the
19296 ///CPU equivalent of `cmd_copy_micromap_to_memory_ext`.
19297 ///
19298 ///Requires `VK_EXT_opacity_micromap` and the
19299 ///`micromapHostCommands` feature.
19300 pub unsafe fn copy_micromap_to_memory_ext(
19301 &self,
19302 deferred_operation: DeferredOperationKHR,
19303 p_info: &CopyMicromapToMemoryInfoEXT,
19304 ) -> VkResult<()> {
19305 let fp = self
19306 .commands()
19307 .copy_micromap_to_memory_ext
19308 .expect("vkCopyMicromapToMemoryEXT not loaded");
19309 check(unsafe { fp(self.handle(), deferred_operation, p_info) })
19310 }
19311 ///Wraps [`vkCmdCopyMemoryToMicromapEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMemoryToMicromapEXT.html).
19312 /**
19313 Provided by **VK_EXT_opacity_micromap**.*/
19314 ///
19315 ///# Safety
19316 ///- `commandBuffer` (self) must be valid and not destroyed.
19317 ///- `commandBuffer` must be externally synchronized.
19318 ///
19319 ///# Panics
19320 ///Panics if `vkCmdCopyMemoryToMicromapEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19321 ///
19322 ///# Usage Notes
19323 ///
19324 ///Deserializes a micromap from a buffer into a micromap object.
19325 ///This is the reverse of `cmd_copy_micromap_to_memory_ext`.
19326 ///
19327 ///Used for loading previously serialized micromaps from disk or
19328 ///transferring between devices.
19329 ///
19330 ///Requires `VK_EXT_opacity_micromap`.
19331 pub unsafe fn cmd_copy_memory_to_micromap_ext(
19332 &self,
19333 command_buffer: CommandBuffer,
19334 p_info: &CopyMemoryToMicromapInfoEXT,
19335 ) {
19336 let fp = self
19337 .commands()
19338 .cmd_copy_memory_to_micromap_ext
19339 .expect("vkCmdCopyMemoryToMicromapEXT not loaded");
19340 unsafe { fp(command_buffer, p_info) };
19341 }
19342 ///Wraps [`vkCopyMemoryToMicromapEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCopyMemoryToMicromapEXT.html).
19343 /**
19344 Provided by **VK_EXT_opacity_micromap**.*/
19345 ///
19346 ///# Errors
19347 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19348 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
19349 ///- `VK_ERROR_UNKNOWN`
19350 ///- `VK_ERROR_VALIDATION_FAILED`
19351 ///
19352 ///# Safety
19353 ///- `device` (self) must be valid and not destroyed.
19354 ///
19355 ///# Panics
19356 ///Panics if `vkCopyMemoryToMicromapEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19357 ///
19358 ///# Usage Notes
19359 ///
19360 ///Host-side deserialization of a micromap from a buffer. This is
19361 ///the CPU equivalent of `cmd_copy_memory_to_micromap_ext`.
19362 ///
19363 ///Requires `VK_EXT_opacity_micromap` and the
19364 ///`micromapHostCommands` feature.
19365 pub unsafe fn copy_memory_to_micromap_ext(
19366 &self,
19367 deferred_operation: DeferredOperationKHR,
19368 p_info: &CopyMemoryToMicromapInfoEXT,
19369 ) -> VkResult<()> {
19370 let fp = self
19371 .commands()
19372 .copy_memory_to_micromap_ext
19373 .expect("vkCopyMemoryToMicromapEXT not loaded");
19374 check(unsafe { fp(self.handle(), deferred_operation, p_info) })
19375 }
19376 ///Wraps [`vkCmdWriteMicromapsPropertiesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWriteMicromapsPropertiesEXT.html).
19377 /**
19378 Provided by **VK_EXT_opacity_micromap**.*/
19379 ///
19380 ///# Safety
19381 ///- `commandBuffer` (self) must be valid and not destroyed.
19382 ///- `commandBuffer` must be externally synchronized.
19383 ///
19384 ///# Panics
19385 ///Panics if `vkCmdWriteMicromapsPropertiesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19386 ///
19387 ///# Usage Notes
19388 ///
19389 ///Writes micromap properties (e.g., compacted size) to a query pool.
19390 ///Use `QUERY_TYPE_MICROMAP_COMPACTED_SIZE_EXT` to query the size
19391 ///needed for a compacted copy.
19392 ///
19393 ///Requires `VK_EXT_opacity_micromap`.
19394 pub unsafe fn cmd_write_micromaps_properties_ext(
19395 &self,
19396 command_buffer: CommandBuffer,
19397 p_micromaps: &[MicromapEXT],
19398 query_type: QueryType,
19399 query_pool: QueryPool,
19400 first_query: u32,
19401 ) {
19402 let fp = self
19403 .commands()
19404 .cmd_write_micromaps_properties_ext
19405 .expect("vkCmdWriteMicromapsPropertiesEXT not loaded");
19406 unsafe {
19407 fp(
19408 command_buffer,
19409 p_micromaps.len() as u32,
19410 p_micromaps.as_ptr(),
19411 query_type,
19412 query_pool,
19413 first_query,
19414 )
19415 };
19416 }
19417 ///Wraps [`vkWriteMicromapsPropertiesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkWriteMicromapsPropertiesEXT.html).
19418 /**
19419 Provided by **VK_EXT_opacity_micromap**.*/
19420 ///
19421 ///# Errors
19422 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19423 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
19424 ///- `VK_ERROR_UNKNOWN`
19425 ///- `VK_ERROR_VALIDATION_FAILED`
19426 ///
19427 ///# Safety
19428 ///- `device` (self) must be valid and not destroyed.
19429 ///
19430 ///# Panics
19431 ///Panics if `vkWriteMicromapsPropertiesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19432 ///
19433 ///# Usage Notes
19434 ///
19435 ///Host-side query of micromap properties. This is the CPU equivalent
19436 ///of `cmd_write_micromaps_properties_ext`.
19437 ///
19438 ///Typically used to query compacted size
19439 ///(`QUERY_TYPE_MICROMAP_COMPACTED_SIZE_EXT`) without going through
19440 ///a query pool.
19441 ///
19442 ///Requires `VK_EXT_opacity_micromap` and the
19443 ///`micromapHostCommands` feature.
19444 pub unsafe fn write_micromaps_properties_ext(
19445 &self,
19446 p_micromaps: &[MicromapEXT],
19447 query_type: QueryType,
19448 data_size: usize,
19449 p_data: *mut core::ffi::c_void,
19450 stride: usize,
19451 ) -> VkResult<()> {
19452 let fp = self
19453 .commands()
19454 .write_micromaps_properties_ext
19455 .expect("vkWriteMicromapsPropertiesEXT not loaded");
19456 check(unsafe {
19457 fp(
19458 self.handle(),
19459 p_micromaps.len() as u32,
19460 p_micromaps.as_ptr(),
19461 query_type,
19462 data_size,
19463 p_data,
19464 stride,
19465 )
19466 })
19467 }
19468 ///Wraps [`vkGetDeviceMicromapCompatibilityEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceMicromapCompatibilityEXT.html).
19469 /**
19470 Provided by **VK_EXT_opacity_micromap**.*/
19471 ///
19472 ///# Safety
19473 ///- `device` (self) must be valid and not destroyed.
19474 ///
19475 ///# Panics
19476 ///Panics if `vkGetDeviceMicromapCompatibilityEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19477 ///
19478 ///# Usage Notes
19479 ///
19480 ///Checks whether a serialized micromap is compatible with the
19481 ///current device. Returns `COMPATIBLE` or `INCOMPATIBLE`.
19482 ///
19483 ///Use this before deserializing a micromap (via
19484 ///`cmd_copy_memory_to_micromap_ext` or `copy_memory_to_micromap_ext`)
19485 ///to verify it will work on this device.
19486 ///
19487 ///Requires `VK_EXT_opacity_micromap`.
19488 pub unsafe fn get_device_micromap_compatibility_ext(
19489 &self,
19490 p_version_info: &MicromapVersionInfoEXT,
19491 ) -> AccelerationStructureCompatibilityKHR {
19492 let fp = self
19493 .commands()
19494 .get_device_micromap_compatibility_ext
19495 .expect("vkGetDeviceMicromapCompatibilityEXT not loaded");
19496 let mut out = unsafe { core::mem::zeroed() };
19497 unsafe { fp(self.handle(), p_version_info, &mut out) };
19498 out
19499 }
19500 ///Wraps [`vkGetMicromapBuildSizesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMicromapBuildSizesEXT.html).
19501 /**
19502 Provided by **VK_EXT_opacity_micromap**.*/
19503 ///
19504 ///# Safety
19505 ///- `device` (self) must be valid and not destroyed.
19506 ///
19507 ///# Panics
19508 ///Panics if `vkGetMicromapBuildSizesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19509 ///
19510 ///# Usage Notes
19511 ///
19512 ///Queries the memory requirements for building a micromap. Returns
19513 ///the destination micromap size and scratch memory size needed.
19514 ///
19515 ///Provide a `MicromapBuildInfoEXT` with the triangle counts and
19516 ///format. The addresses can be null, only the sizes and counts
19517 ///matter for this query.
19518 ///
19519 ///Use the results to allocate the micromap buffer and scratch buffer
19520 ///before calling `cmd_build_micromaps_ext`.
19521 ///
19522 ///Requires `VK_EXT_opacity_micromap`.
19523 pub unsafe fn get_micromap_build_sizes_ext(
19524 &self,
19525 build_type: AccelerationStructureBuildTypeKHR,
19526 p_build_info: &MicromapBuildInfoEXT,
19527 p_size_info: &mut MicromapBuildSizesInfoEXT,
19528 ) {
19529 let fp = self
19530 .commands()
19531 .get_micromap_build_sizes_ext
19532 .expect("vkGetMicromapBuildSizesEXT not loaded");
19533 unsafe { fp(self.handle(), build_type, p_build_info, p_size_info) };
19534 }
19535 ///Wraps [`vkGetShaderModuleIdentifierEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetShaderModuleIdentifierEXT.html).
19536 /**
19537 Provided by **VK_EXT_shader_module_identifier**.*/
19538 ///
19539 ///# Safety
19540 ///- `device` (self) must be valid and not destroyed.
19541 ///
19542 ///# Panics
19543 ///Panics if `vkGetShaderModuleIdentifierEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19544 ///
19545 ///# Usage Notes
19546 ///
19547 ///Retrieves the identifier for an existing shader module. The
19548 ///identifier can be used for pipeline cache lookups via
19549 ///`PipelineShaderStageModuleIdentifierCreateInfoEXT`.
19550 ///
19551 ///The identifier is deterministic for the same SPIR-V content
19552 ///on the same implementation.
19553 ///
19554 ///Requires `VK_EXT_shader_module_identifier`.
19555 pub unsafe fn get_shader_module_identifier_ext(
19556 &self,
19557 shader_module: ShaderModule,
19558 p_identifier: &mut ShaderModuleIdentifierEXT,
19559 ) {
19560 let fp = self
19561 .commands()
19562 .get_shader_module_identifier_ext
19563 .expect("vkGetShaderModuleIdentifierEXT not loaded");
19564 unsafe { fp(self.handle(), shader_module, p_identifier) };
19565 }
19566 ///Wraps [`vkGetShaderModuleCreateInfoIdentifierEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetShaderModuleCreateInfoIdentifierEXT.html).
19567 /**
19568 Provided by **VK_EXT_shader_module_identifier**.*/
19569 ///
19570 ///# Safety
19571 ///- `device` (self) must be valid and not destroyed.
19572 ///
19573 ///# Panics
19574 ///Panics if `vkGetShaderModuleCreateInfoIdentifierEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19575 ///
19576 ///# Usage Notes
19577 ///
19578 ///Computes an identifier for a shader module from its create info
19579 ///(SPIR-V code) without creating the module. The identifier can be
19580 ///used in `PipelineShaderStageModuleIdentifierCreateInfoEXT` to
19581 ///create pipelines from cached shader data.
19582 ///
19583 ///Useful for pipeline caching workflows where the SPIR-V is
19584 ///available but you want to avoid full module creation.
19585 ///
19586 ///Requires `VK_EXT_shader_module_identifier`.
19587 pub unsafe fn get_shader_module_create_info_identifier_ext(
19588 &self,
19589 p_create_info: &ShaderModuleCreateInfo,
19590 p_identifier: &mut ShaderModuleIdentifierEXT,
19591 ) {
19592 let fp = self
19593 .commands()
19594 .get_shader_module_create_info_identifier_ext
19595 .expect("vkGetShaderModuleCreateInfoIdentifierEXT not loaded");
19596 unsafe { fp(self.handle(), p_create_info, p_identifier) };
19597 }
19598 ///Wraps [`vkGetImageSubresourceLayout2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageSubresourceLayout2.html).
19599 /**
19600 Provided by **VK_BASE_VERSION_1_4**.*/
19601 ///
19602 ///# Safety
19603 ///- `device` (self) must be valid and not destroyed.
19604 ///
19605 ///# Panics
19606 ///Panics if `vkGetImageSubresourceLayout2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19607 ///
19608 ///# Usage Notes
19609 ///
19610 ///Vulkan 1.4 version of `get_image_subresource_layout` that uses
19611 ///extensible structs via pNext.
19612 ///
19613 ///Returns the layout (offset, size, row pitch, array pitch, depth
19614 ///pitch) for a given subresource of an existing image. Chain
19615 ///`ImageCompressionPropertiesEXT` to query fixed-rate compression
19616 ///state.
19617 ///
19618 ///For linear-tiling images, this tells you how to access texels
19619 ///through a mapped pointer. For optimal-tiling images, the layout is
19620 ///opaque and implementation-defined.
19621 pub unsafe fn get_image_subresource_layout2(
19622 &self,
19623 image: Image,
19624 p_subresource: &ImageSubresource2,
19625 p_layout: &mut SubresourceLayout2,
19626 ) {
19627 let fp = self
19628 .commands()
19629 .get_image_subresource_layout2
19630 .expect("vkGetImageSubresourceLayout2 not loaded");
19631 unsafe { fp(self.handle(), image, p_subresource, p_layout) };
19632 }
19633 ///Wraps [`vkGetPipelinePropertiesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPipelinePropertiesEXT.html).
19634 /**
19635 Provided by **VK_EXT_pipeline_properties**.*/
19636 ///
19637 ///# Errors
19638 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19639 ///- `VK_ERROR_UNKNOWN`
19640 ///- `VK_ERROR_VALIDATION_FAILED`
19641 ///
19642 ///# Safety
19643 ///- `device` (self) must be valid and not destroyed.
19644 ///
19645 ///# Panics
19646 ///Panics if `vkGetPipelinePropertiesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19647 ///
19648 ///# Usage Notes
19649 ///
19650 ///Queries properties of a pipeline, such as its pipeline identifier.
19651 ///The identifier can be used to correlate pipelines across processes
19652 ///or with external tools.
19653 ///
19654 ///Requires `VK_EXT_pipeline_properties`.
19655 pub unsafe fn get_pipeline_properties_ext(
19656 &self,
19657 p_pipeline_info: &PipelineInfoEXT,
19658 p_pipeline_properties: &mut BaseOutStructure,
19659 ) -> VkResult<()> {
19660 let fp = self
19661 .commands()
19662 .get_pipeline_properties_ext
19663 .expect("vkGetPipelinePropertiesEXT not loaded");
19664 check(unsafe { fp(self.handle(), p_pipeline_info, p_pipeline_properties) })
19665 }
19666 ///Wraps [`vkExportMetalObjectsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkExportMetalObjectsEXT.html).
19667 /**
19668 Provided by **VK_EXT_metal_objects**.*/
19669 ///
19670 ///# Safety
19671 ///- `device` (self) must be valid and not destroyed.
19672 ///
19673 ///# Panics
19674 ///Panics if `vkExportMetalObjectsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19675 ///
19676 ///# Usage Notes
19677 ///
19678 ///Exports the underlying Metal objects (device, command queue,
19679 ///textures, buffers, etc.) from Vulkan objects. Chain the
19680 ///appropriate export struct into the pNext of the info structure
19681 ///to select which Metal object to retrieve.
19682 ///
19683 ///Useful for Metal interop on Apple platforms where both APIs
19684 ///share the same GPU resources.
19685 ///
19686 ///Requires `VK_EXT_metal_objects`. macOS/iOS only.
19687 pub unsafe fn export_metal_objects_ext(
19688 &self,
19689 p_metal_objects_info: &mut ExportMetalObjectsInfoEXT,
19690 ) {
19691 let fp = self
19692 .commands()
19693 .export_metal_objects_ext
19694 .expect("vkExportMetalObjectsEXT not loaded");
19695 unsafe { fp(self.handle(), p_metal_objects_info) };
19696 }
19697 ///Wraps [`vkCmdBindTileMemoryQCOM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindTileMemoryQCOM.html).
19698 /**
19699 Provided by **VK_QCOM_tile_memory_heap**.*/
19700 ///
19701 ///# Safety
19702 ///- `commandBuffer` (self) must be valid and not destroyed.
19703 ///- `commandBuffer` must be externally synchronized.
19704 ///
19705 ///# Panics
19706 ///Panics if `vkCmdBindTileMemoryQCOM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19707 ///
19708 ///# Usage Notes
19709 ///
19710 ///Binds tile memory for use within a per-tile execution region on
19711 ///Qualcomm tile-based GPUs. Pass `None` to unbind. Tile memory
19712 ///provides fast on-chip scratch storage scoped to each tile.
19713 ///
19714 ///Requires `VK_QCOM_tile_shading`.
19715 pub unsafe fn cmd_bind_tile_memory_qcom(
19716 &self,
19717 command_buffer: CommandBuffer,
19718 p_tile_memory_bind_info: Option<&TileMemoryBindInfoQCOM>,
19719 ) {
19720 let fp = self
19721 .commands()
19722 .cmd_bind_tile_memory_qcom
19723 .expect("vkCmdBindTileMemoryQCOM not loaded");
19724 let p_tile_memory_bind_info_ptr =
19725 p_tile_memory_bind_info.map_or(core::ptr::null(), core::ptr::from_ref);
19726 unsafe { fp(command_buffer, p_tile_memory_bind_info_ptr) };
19727 }
19728 ///Wraps [`vkGetFramebufferTilePropertiesQCOM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetFramebufferTilePropertiesQCOM.html).
19729 /**
19730 Provided by **VK_QCOM_tile_properties**.*/
19731 ///
19732 ///# Errors
19733 ///- `VK_ERROR_UNKNOWN`
19734 ///- `VK_ERROR_VALIDATION_FAILED`
19735 ///
19736 ///# Safety
19737 ///- `device` (self) must be valid and not destroyed.
19738 ///
19739 ///# Panics
19740 ///Panics if `vkGetFramebufferTilePropertiesQCOM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19741 ///
19742 ///# Usage Notes
19743 ///
19744 ///Queries tile properties (tile dimensions and extents) for a
19745 ///framebuffer on Qualcomm tile-based GPUs. Uses the two-call
19746 ///idiom. Useful for optimising rendering to match the hardware
19747 ///tile layout.
19748 ///
19749 ///Requires `VK_QCOM_tile_properties`.
19750 pub unsafe fn get_framebuffer_tile_properties_qcom(
19751 &self,
19752 framebuffer: Framebuffer,
19753 ) -> VkResult<Vec<TilePropertiesQCOM>> {
19754 let fp = self
19755 .commands()
19756 .get_framebuffer_tile_properties_qcom
19757 .expect("vkGetFramebufferTilePropertiesQCOM not loaded");
19758 enumerate_two_call(|count, data| unsafe { fp(self.handle(), framebuffer, count, data) })
19759 }
19760 ///Wraps [`vkGetDynamicRenderingTilePropertiesQCOM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDynamicRenderingTilePropertiesQCOM.html).
19761 /**
19762 Provided by **VK_QCOM_tile_properties**.*/
19763 ///
19764 ///# Errors
19765 ///- `VK_ERROR_UNKNOWN`
19766 ///- `VK_ERROR_VALIDATION_FAILED`
19767 ///
19768 ///# Safety
19769 ///- `device` (self) must be valid and not destroyed.
19770 ///
19771 ///# Panics
19772 ///Panics if `vkGetDynamicRenderingTilePropertiesQCOM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19773 ///
19774 ///# Usage Notes
19775 ///
19776 ///Queries tile properties for a dynamic rendering pass (as opposed
19777 ///to a framebuffer-based render pass). Returns tile dimensions that
19778 ///would be used for the given rendering info on Qualcomm tile-based
19779 ///GPUs.
19780 ///
19781 ///Requires `VK_QCOM_tile_properties`.
19782 pub unsafe fn get_dynamic_rendering_tile_properties_qcom(
19783 &self,
19784 p_rendering_info: &RenderingInfo,
19785 p_properties: &mut TilePropertiesQCOM,
19786 ) -> VkResult<()> {
19787 let fp = self
19788 .commands()
19789 .get_dynamic_rendering_tile_properties_qcom
19790 .expect("vkGetDynamicRenderingTilePropertiesQCOM not loaded");
19791 check(unsafe { fp(self.handle(), p_rendering_info, p_properties) })
19792 }
19793 ///Wraps [`vkCreateOpticalFlowSessionNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateOpticalFlowSessionNV.html).
19794 /**
19795 Provided by **VK_NV_optical_flow**.*/
19796 ///
19797 ///# Errors
19798 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19799 ///- `VK_ERROR_INITIALIZATION_FAILED`
19800 ///- `VK_ERROR_UNKNOWN`
19801 ///- `VK_ERROR_VALIDATION_FAILED`
19802 ///
19803 ///# Safety
19804 ///- `device` (self) must be valid and not destroyed.
19805 ///
19806 ///# Panics
19807 ///Panics if `vkCreateOpticalFlowSessionNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19808 ///
19809 ///# Usage Notes
19810 ///
19811 ///Creates an optical flow session for GPU-accelerated motion
19812 ///estimation between image pairs. Configure the session with image
19813 ///format, resolution, and flow precision in the create info.
19814 ///
19815 ///Destroy with `destroy_optical_flow_session_nv`.
19816 ///
19817 ///Requires `VK_NV_optical_flow`.
19818 pub unsafe fn create_optical_flow_session_nv(
19819 &self,
19820 p_create_info: &OpticalFlowSessionCreateInfoNV,
19821 allocator: Option<&AllocationCallbacks>,
19822 ) -> VkResult<OpticalFlowSessionNV> {
19823 let fp = self
19824 .commands()
19825 .create_optical_flow_session_nv
19826 .expect("vkCreateOpticalFlowSessionNV not loaded");
19827 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
19828 let mut out = unsafe { core::mem::zeroed() };
19829 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
19830 Ok(out)
19831 }
19832 ///Wraps [`vkDestroyOpticalFlowSessionNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyOpticalFlowSessionNV.html).
19833 /**
19834 Provided by **VK_NV_optical_flow**.*/
19835 ///
19836 ///# Safety
19837 ///- `device` (self) must be valid and not destroyed.
19838 ///
19839 ///# Panics
19840 ///Panics if `vkDestroyOpticalFlowSessionNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19841 ///
19842 ///# Usage Notes
19843 ///
19844 ///Destroys an optical flow session created with
19845 ///`create_optical_flow_session_nv`.
19846 ///
19847 ///Requires `VK_NV_optical_flow`.
19848 pub unsafe fn destroy_optical_flow_session_nv(
19849 &self,
19850 session: OpticalFlowSessionNV,
19851 allocator: Option<&AllocationCallbacks>,
19852 ) {
19853 let fp = self
19854 .commands()
19855 .destroy_optical_flow_session_nv
19856 .expect("vkDestroyOpticalFlowSessionNV not loaded");
19857 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
19858 unsafe { fp(self.handle(), session, alloc_ptr) };
19859 }
19860 ///Wraps [`vkBindOpticalFlowSessionImageNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBindOpticalFlowSessionImageNV.html).
19861 /**
19862 Provided by **VK_NV_optical_flow**.*/
19863 ///
19864 ///# Errors
19865 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19866 ///- `VK_ERROR_INITIALIZATION_FAILED`
19867 ///- `VK_ERROR_UNKNOWN`
19868 ///- `VK_ERROR_VALIDATION_FAILED`
19869 ///
19870 ///# Safety
19871 ///- `device` (self) must be valid and not destroyed.
19872 ///
19873 ///# Panics
19874 ///Panics if `vkBindOpticalFlowSessionImageNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19875 ///
19876 ///# Usage Notes
19877 ///
19878 ///Binds an image view to an optical flow session at a specific
19879 ///binding point (reference, target, flow vector output, etc.).
19880 ///All required binding points must be bound before executing the
19881 ///optical flow.
19882 ///
19883 ///Requires `VK_NV_optical_flow`.
19884 pub unsafe fn bind_optical_flow_session_image_nv(
19885 &self,
19886 session: OpticalFlowSessionNV,
19887 binding_point: OpticalFlowSessionBindingPointNV,
19888 view: ImageView,
19889 layout: ImageLayout,
19890 ) -> VkResult<()> {
19891 let fp = self
19892 .commands()
19893 .bind_optical_flow_session_image_nv
19894 .expect("vkBindOpticalFlowSessionImageNV not loaded");
19895 check(unsafe { fp(self.handle(), session, binding_point, view, layout) })
19896 }
19897 ///Wraps [`vkCmdOpticalFlowExecuteNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdOpticalFlowExecuteNV.html).
19898 /**
19899 Provided by **VK_NV_optical_flow**.*/
19900 ///
19901 ///# Safety
19902 ///- `commandBuffer` (self) must be valid and not destroyed.
19903 ///
19904 ///# Panics
19905 ///Panics if `vkCmdOpticalFlowExecuteNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19906 ///
19907 ///# Usage Notes
19908 ///
19909 ///Executes optical flow estimation on the GPU using the bound
19910 ///reference and target images. Results are written to the bound
19911 ///flow vector output image.
19912 ///
19913 ///Requires `VK_NV_optical_flow`.
19914 pub unsafe fn cmd_optical_flow_execute_nv(
19915 &self,
19916 command_buffer: CommandBuffer,
19917 session: OpticalFlowSessionNV,
19918 p_execute_info: &OpticalFlowExecuteInfoNV,
19919 ) {
19920 let fp = self
19921 .commands()
19922 .cmd_optical_flow_execute_nv
19923 .expect("vkCmdOpticalFlowExecuteNV not loaded");
19924 unsafe { fp(command_buffer, session, p_execute_info) };
19925 }
19926 ///Wraps [`vkGetDeviceFaultInfoEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceFaultInfoEXT.html).
19927 /**
19928 Provided by **VK_EXT_device_fault**.*/
19929 ///
19930 ///# Errors
19931 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19932 ///- `VK_ERROR_UNKNOWN`
19933 ///- `VK_ERROR_VALIDATION_FAILED`
19934 ///
19935 ///# Safety
19936 ///- `device` (self) must be valid and not destroyed.
19937 ///
19938 ///# Panics
19939 ///Panics if `vkGetDeviceFaultInfoEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19940 ///
19941 ///# Usage Notes
19942 ///
19943 ///Retrieves diagnostic information after a device-lost error. Call
19944 ///once with a null info pointer to query the fault counts, then
19945 ///again with allocated structures to retrieve the fault details.
19946 ///
19947 ///The returned data is vendor-specific and intended for crash
19948 ///reporting and post-mortem debugging.
19949 ///
19950 ///Requires `VK_EXT_device_fault`.
19951 pub unsafe fn get_device_fault_info_ext(
19952 &self,
19953 p_fault_counts: &mut DeviceFaultCountsEXT,
19954 p_fault_info: &mut DeviceFaultInfoEXT,
19955 ) -> VkResult<()> {
19956 let fp = self
19957 .commands()
19958 .get_device_fault_info_ext
19959 .expect("vkGetDeviceFaultInfoEXT not loaded");
19960 check(unsafe { fp(self.handle(), p_fault_counts, p_fault_info) })
19961 }
19962 ///Wraps [`vkGetDeviceFaultReportsKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceFaultReportsKHR.html).
19963 /**
19964 Provided by **VK_KHR_device_fault**.*/
19965 ///
19966 ///# Errors
19967 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19968 ///- `VK_ERROR_UNKNOWN`
19969 ///- `VK_ERROR_VALIDATION_FAILED`
19970 ///
19971 ///# Safety
19972 ///- `device` (self) must be valid and not destroyed.
19973 ///
19974 ///# Panics
19975 ///Panics if `vkGetDeviceFaultReportsKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19976 ///
19977 ///# Usage Notes
19978 ///
19979 ///Retrieves fault reports after a device loss (`ERROR_DEVICE_LOST`).
19980 ///Returns a list of `DeviceFaultInfoKHR` structs describing what
19981 ///went wrong, address faults, vendor-specific fault codes, etc.
19982 ///
19983 ///`timeout` specifies how long to wait (in nanoseconds) for the
19984 ///driver to collect fault data. Use `UINT64_MAX` to wait
19985 ///indefinitely.
19986 ///
19987 ///For raw debug data suitable for vendor tools, follow up with
19988 ///`get_device_fault_debug_info_khr`.
19989 ///
19990 ///Requires `VK_KHR_device_fault`.
19991 pub unsafe fn get_device_fault_reports_khr(
19992 &self,
19993 timeout: u64,
19994 ) -> VkResult<Vec<DeviceFaultInfoKHR>> {
19995 let fp = self
19996 .commands()
19997 .get_device_fault_reports_khr
19998 .expect("vkGetDeviceFaultReportsKHR not loaded");
19999 enumerate_two_call(|count, data| unsafe { fp(self.handle(), timeout, count, data) })
20000 }
20001 ///Wraps [`vkGetDeviceFaultDebugInfoKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceFaultDebugInfoKHR.html).
20002 /**
20003 Provided by **VK_KHR_device_fault**.*/
20004 ///
20005 ///# Errors
20006 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20007 ///- `VK_ERROR_NOT_ENOUGH_SPACE_KHR`
20008 ///- `VK_ERROR_UNKNOWN`
20009 ///- `VK_ERROR_VALIDATION_FAILED`
20010 ///
20011 ///# Safety
20012 ///- `device` (self) must be valid and not destroyed.
20013 ///
20014 ///# Panics
20015 ///Panics if `vkGetDeviceFaultDebugInfoKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20016 ///
20017 ///# Usage Notes
20018 ///
20019 ///Retrieves debug information after a device fault (GPU crash or
20020 ///hang). The returned `DeviceFaultDebugInfoKHR` contains
20021 ///vendor-specific binary data that can be passed to GPU vendor
20022 ///diagnostic tools.
20023 ///
20024 ///Call `get_device_fault_reports_khr` first to get the high-level
20025 ///fault reports; this call provides the raw debug blob.
20026 ///
20027 ///Requires `VK_KHR_device_fault`.
20028 pub unsafe fn get_device_fault_debug_info_khr(
20029 &self,
20030 p_debug_info: &mut DeviceFaultDebugInfoKHR,
20031 ) -> VkResult<()> {
20032 let fp = self
20033 .commands()
20034 .get_device_fault_debug_info_khr
20035 .expect("vkGetDeviceFaultDebugInfoKHR not loaded");
20036 check(unsafe { fp(self.handle(), p_debug_info) })
20037 }
20038 ///Wraps [`vkCmdSetDepthBias2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthBias2EXT.html).
20039 /**
20040 Provided by **VK_EXT_depth_bias_control**.*/
20041 ///
20042 ///# Safety
20043 ///- `commandBuffer` (self) must be valid and not destroyed.
20044 ///- `commandBuffer` must be externally synchronized.
20045 ///
20046 ///# Panics
20047 ///Panics if `vkCmdSetDepthBias2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20048 ///
20049 ///# Usage Notes
20050 ///
20051 ///Extended version of `cmd_set_depth_bias` that takes a
20052 ///`DepthBiasInfoEXT` struct with pNext extensibility. This allows
20053 ///chaining `DepthBiasRepresentationInfoEXT` to control the depth
20054 ///bias representation (least-representable-value vs. float).
20055 ///
20056 ///Requires `VK_EXT_depth_bias_control`.
20057 pub unsafe fn cmd_set_depth_bias2_ext(
20058 &self,
20059 command_buffer: CommandBuffer,
20060 p_depth_bias_info: &DepthBiasInfoEXT,
20061 ) {
20062 let fp = self
20063 .commands()
20064 .cmd_set_depth_bias2_ext
20065 .expect("vkCmdSetDepthBias2EXT not loaded");
20066 unsafe { fp(command_buffer, p_depth_bias_info) };
20067 }
20068 ///Wraps [`vkReleaseSwapchainImagesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkReleaseSwapchainImagesKHR.html).
20069 /**
20070 Provided by **VK_KHR_swapchain_maintenance1**.*/
20071 ///
20072 ///# Errors
20073 ///- `VK_ERROR_SURFACE_LOST_KHR`
20074 ///- `VK_ERROR_UNKNOWN`
20075 ///- `VK_ERROR_VALIDATION_FAILED`
20076 ///
20077 ///# Safety
20078 ///- `device` (self) must be valid and not destroyed.
20079 ///
20080 ///# Panics
20081 ///Panics if `vkReleaseSwapchainImagesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20082 ///
20083 ///# Usage Notes
20084 ///
20085 ///Releases acquired swapchain images back to the swapchain without
20086 ///presenting them. Provided by `VK_KHR_swapchain_maintenance1`.
20087 ///
20088 ///Use this when you have acquired an image but decided not to render
20089 ///to it, for example, when aborting a frame due to a resize or
20090 ///error. Without this extension, the only way to return an acquired
20091 ///image is to present it.
20092 ///
20093 ///The released images return to the pool and can be acquired again.
20094 pub unsafe fn release_swapchain_images_khr(
20095 &self,
20096 p_release_info: &ReleaseSwapchainImagesInfoKHR,
20097 ) -> VkResult<()> {
20098 let fp = self
20099 .commands()
20100 .release_swapchain_images_khr
20101 .expect("vkReleaseSwapchainImagesKHR not loaded");
20102 check(unsafe { fp(self.handle(), p_release_info) })
20103 }
20104 ///Wraps [`vkGetDeviceImageSubresourceLayout`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceImageSubresourceLayout.html).
20105 /**
20106 Provided by **VK_BASE_VERSION_1_4**.*/
20107 ///
20108 ///# Safety
20109 ///- `device` (self) must be valid and not destroyed.
20110 ///
20111 ///# Panics
20112 ///Panics if `vkGetDeviceImageSubresourceLayout` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20113 ///
20114 ///# Usage Notes
20115 ///
20116 ///Vulkan 1.4 command that queries the subresource layout for an image
20117 ///**without creating it first**. Returns the offset, size, row pitch,
20118 ///array pitch, and depth pitch for a given subresource of a
20119 ///hypothetical image.
20120 ///
20121 ///Useful for pre-planning host-side memory layouts when using
20122 ///`HOST_TRANSFER` images, or for calculating buffer sizes for staging
20123 ///uploads.
20124 pub unsafe fn get_device_image_subresource_layout(
20125 &self,
20126 p_info: &DeviceImageSubresourceInfo,
20127 p_layout: &mut SubresourceLayout2,
20128 ) {
20129 let fp = self
20130 .commands()
20131 .get_device_image_subresource_layout
20132 .expect("vkGetDeviceImageSubresourceLayout not loaded");
20133 unsafe { fp(self.handle(), p_info, p_layout) };
20134 }
20135 ///Wraps [`vkUnmapMemory2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkUnmapMemory2.html).
20136 /**
20137 Provided by **VK_BASE_VERSION_1_4**.*/
20138 ///
20139 ///# Errors
20140 ///- `VK_ERROR_MEMORY_MAP_FAILED`
20141 ///- `VK_ERROR_UNKNOWN`
20142 ///- `VK_ERROR_VALIDATION_FAILED`
20143 ///
20144 ///# Safety
20145 ///- `device` (self) must be valid and not destroyed.
20146 ///
20147 ///# Panics
20148 ///Panics if `vkUnmapMemory2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20149 ///
20150 ///# Usage Notes
20151 ///
20152 ///Vulkan 1.4 version of `unmap_memory` that uses an extensible
20153 ///`MemoryUnmapInfo` struct. Supports `MEMORY_UNMAP_RESERVE` (if
20154 ///available) to keep the virtual address range reserved after
20155 ///unmapping, useful for placed mappings.
20156 ///
20157 ///For most applications, `unmap_memory` and `unmap_memory2` are
20158 ///equivalent. Prefer this when targeting Vulkan 1.4+.
20159 pub unsafe fn unmap_memory2(&self, p_memory_unmap_info: &MemoryUnmapInfo) -> VkResult<()> {
20160 let fp = self
20161 .commands()
20162 .unmap_memory2
20163 .expect("vkUnmapMemory2 not loaded");
20164 check(unsafe { fp(self.handle(), p_memory_unmap_info) })
20165 }
20166 ///Wraps [`vkCreateShadersEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateShadersEXT.html).
20167 /**
20168 Provided by **VK_EXT_shader_object**.*/
20169 ///
20170 ///# Errors
20171 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20172 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
20173 ///- `VK_ERROR_INITIALIZATION_FAILED`
20174 ///- `VK_ERROR_UNKNOWN`
20175 ///- `VK_ERROR_VALIDATION_FAILED`
20176 ///
20177 ///# Safety
20178 ///- `device` (self) must be valid and not destroyed.
20179 ///
20180 ///# Panics
20181 ///Panics if `vkCreateShadersEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20182 ///
20183 ///# Usage Notes
20184 ///
20185 ///Creates one or more shader objects from SPIR-V code. Shader
20186 ///objects are an alternative to pipelines, instead of baking
20187 ///shaders into monolithic pipeline objects, individual shader
20188 ///stages can be bound independently.
20189 ///
20190 ///Each `ShaderCreateInfoEXT` specifies the stage, code, entry
20191 ///point, and optional specialization constants.
20192 ///
20193 ///Bind with `cmd_bind_shaders_ext`. Destroy with
20194 ///`destroy_shader_ext`.
20195 ///
20196 ///Requires `VK_EXT_shader_object`.
20197 pub unsafe fn create_shaders_ext(
20198 &self,
20199 p_create_infos: &[ShaderCreateInfoEXT],
20200 allocator: Option<&AllocationCallbacks>,
20201 ) -> VkResult<Vec<ShaderEXT>> {
20202 let fp = self
20203 .commands()
20204 .create_shaders_ext
20205 .expect("vkCreateShadersEXT not loaded");
20206 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
20207 let count = p_create_infos.len();
20208 let mut out = vec![unsafe { core::mem::zeroed() }; count];
20209 check(unsafe {
20210 fp(
20211 self.handle(),
20212 p_create_infos.len() as u32,
20213 p_create_infos.as_ptr(),
20214 alloc_ptr,
20215 out.as_mut_ptr(),
20216 )
20217 })?;
20218 Ok(out)
20219 }
20220 ///Wraps [`vkDestroyShaderEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyShaderEXT.html).
20221 /**
20222 Provided by **VK_EXT_shader_object**.*/
20223 ///
20224 ///# Safety
20225 ///- `device` (self) must be valid and not destroyed.
20226 ///- `shader` must be externally synchronized.
20227 ///
20228 ///# Panics
20229 ///Panics if `vkDestroyShaderEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20230 ///
20231 ///# Usage Notes
20232 ///
20233 ///Destroys a shader object created with `create_shaders_ext`.
20234 ///
20235 ///Requires `VK_EXT_shader_object`.
20236 pub unsafe fn destroy_shader_ext(
20237 &self,
20238 shader: ShaderEXT,
20239 allocator: Option<&AllocationCallbacks>,
20240 ) {
20241 let fp = self
20242 .commands()
20243 .destroy_shader_ext
20244 .expect("vkDestroyShaderEXT not loaded");
20245 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
20246 unsafe { fp(self.handle(), shader, alloc_ptr) };
20247 }
20248 ///Wraps [`vkGetShaderBinaryDataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetShaderBinaryDataEXT.html).
20249 /**
20250 Provided by **VK_EXT_shader_object**.*/
20251 ///
20252 ///# Errors
20253 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20254 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
20255 ///- `VK_ERROR_UNKNOWN`
20256 ///- `VK_ERROR_VALIDATION_FAILED`
20257 ///
20258 ///# Safety
20259 ///- `device` (self) must be valid and not destroyed.
20260 ///
20261 ///# Panics
20262 ///Panics if `vkGetShaderBinaryDataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20263 ///
20264 ///# Usage Notes
20265 ///
20266 ///Retrieves the binary representation of a compiled shader object.
20267 ///The binary data can be cached to disk and used to create shader
20268 ///objects without recompiling from SPIR-V on subsequent runs.
20269 ///
20270 ///Call once with a null buffer to query the size, then again with
20271 ///an appropriately sized buffer. Shader binaries are
20272 ///implementation-specific and not portable between devices or
20273 ///driver versions.
20274 ///
20275 ///Requires `VK_EXT_shader_object`.
20276 pub unsafe fn get_shader_binary_data_ext(
20277 &self,
20278 shader: ShaderEXT,
20279 p_data: *mut core::ffi::c_void,
20280 ) -> VkResult<usize> {
20281 let fp = self
20282 .commands()
20283 .get_shader_binary_data_ext
20284 .expect("vkGetShaderBinaryDataEXT not loaded");
20285 let mut out = unsafe { core::mem::zeroed() };
20286 check(unsafe { fp(self.handle(), shader, &mut out, p_data) })?;
20287 Ok(out)
20288 }
20289 ///Wraps [`vkCmdBindShadersEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindShadersEXT.html).
20290 /**
20291 Provided by **VK_EXT_shader_object**.*/
20292 ///
20293 ///# Safety
20294 ///- `commandBuffer` (self) must be valid and not destroyed.
20295 ///- `commandBuffer` must be externally synchronized.
20296 ///
20297 ///# Panics
20298 ///Panics if `vkCmdBindShadersEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20299 ///
20300 ///# Usage Notes
20301 ///
20302 ///Binds shader objects to specified shader stages for subsequent
20303 ///draw or dispatch commands. Pass arrays of stages and
20304 ///corresponding shader handles.
20305 ///
20306 ///To unbind a stage, pass a null handle for that stage. All
20307 ///required stages for the draw/dispatch type must be bound.
20308 ///
20309 ///When using shader objects, you must also set all relevant dynamic
20310 ///state, there is no pipeline to provide defaults.
20311 ///
20312 ///Requires `VK_EXT_shader_object`.
20313 pub unsafe fn cmd_bind_shaders_ext(
20314 &self,
20315 command_buffer: CommandBuffer,
20316 p_stages: &[ShaderStageFlagBits],
20317 p_shaders: Option<&ShaderEXT>,
20318 ) {
20319 let fp = self
20320 .commands()
20321 .cmd_bind_shaders_ext
20322 .expect("vkCmdBindShadersEXT not loaded");
20323 let p_shaders_ptr = p_shaders.map_or(core::ptr::null(), core::ptr::from_ref);
20324 unsafe {
20325 fp(
20326 command_buffer,
20327 p_stages.len() as u32,
20328 p_stages.as_ptr(),
20329 p_shaders_ptr,
20330 )
20331 };
20332 }
20333 ///Wraps [`vkSetSwapchainPresentTimingQueueSizeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetSwapchainPresentTimingQueueSizeEXT.html).
20334 /**
20335 Provided by **VK_EXT_present_timing**.*/
20336 ///
20337 ///# Errors
20338 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20339 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
20340 ///- `VK_ERROR_UNKNOWN`
20341 ///- `VK_ERROR_VALIDATION_FAILED`
20342 ///
20343 ///# Safety
20344 ///- `device` (self) must be valid and not destroyed.
20345 ///- `swapchain` must be externally synchronized.
20346 ///
20347 ///# Panics
20348 ///Panics if `vkSetSwapchainPresentTimingQueueSizeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20349 ///
20350 ///# Usage Notes
20351 ///
20352 ///Sets the maximum number of present timing results the driver
20353 ///will queue for later retrieval via `get_past_presentation_timing_ext`.
20354 ///A larger queue prevents timing data from being lost when the
20355 ///application cannot poll frequently.
20356 ///
20357 ///Requires `VK_EXT_present_timing`.
20358 pub unsafe fn set_swapchain_present_timing_queue_size_ext(
20359 &self,
20360 swapchain: SwapchainKHR,
20361 size: u32,
20362 ) -> VkResult<()> {
20363 let fp = self
20364 .commands()
20365 .set_swapchain_present_timing_queue_size_ext
20366 .expect("vkSetSwapchainPresentTimingQueueSizeEXT not loaded");
20367 check(unsafe { fp(self.handle(), swapchain, size) })
20368 }
20369 ///Wraps [`vkGetSwapchainTimingPropertiesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSwapchainTimingPropertiesEXT.html).
20370 /**
20371 Provided by **VK_EXT_present_timing**.*/
20372 ///
20373 ///# Errors
20374 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20375 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
20376 ///- `VK_ERROR_SURFACE_LOST_KHR`
20377 ///- `VK_ERROR_UNKNOWN`
20378 ///- `VK_ERROR_VALIDATION_FAILED`
20379 ///
20380 ///# Safety
20381 ///- `device` (self) must be valid and not destroyed.
20382 ///- `swapchain` must be externally synchronized.
20383 ///
20384 ///# Panics
20385 ///Panics if `vkGetSwapchainTimingPropertiesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20386 ///
20387 ///# Usage Notes
20388 ///
20389 ///Queries the timing properties of a swapchain, such as the refresh
20390 ///duration and present margin. Use this to calibrate frame pacing
20391 ///and target the display's native refresh interval.
20392 ///
20393 ///Requires `VK_EXT_present_timing`.
20394 pub unsafe fn get_swapchain_timing_properties_ext(
20395 &self,
20396 swapchain: SwapchainKHR,
20397 p_swapchain_timing_properties: &mut SwapchainTimingPropertiesEXT,
20398 ) -> VkResult<u64> {
20399 let fp = self
20400 .commands()
20401 .get_swapchain_timing_properties_ext
20402 .expect("vkGetSwapchainTimingPropertiesEXT not loaded");
20403 let mut out = unsafe { core::mem::zeroed() };
20404 check(unsafe {
20405 fp(
20406 self.handle(),
20407 swapchain,
20408 p_swapchain_timing_properties,
20409 &mut out,
20410 )
20411 })?;
20412 Ok(out)
20413 }
20414 ///Wraps [`vkGetSwapchainTimeDomainPropertiesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSwapchainTimeDomainPropertiesEXT.html).
20415 /**
20416 Provided by **VK_EXT_present_timing**.*/
20417 ///
20418 ///# Errors
20419 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20420 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
20421 ///- `VK_ERROR_SURFACE_LOST_KHR`
20422 ///- `VK_ERROR_UNKNOWN`
20423 ///- `VK_ERROR_VALIDATION_FAILED`
20424 ///
20425 ///# Safety
20426 ///- `device` (self) must be valid and not destroyed.
20427 ///- `swapchain` must be externally synchronized.
20428 ///
20429 ///# Panics
20430 ///Panics if `vkGetSwapchainTimeDomainPropertiesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20431 ///
20432 ///# Usage Notes
20433 ///
20434 ///Queries which time domains the swapchain supports for present
20435 ///timing. Use this to determine whether you can correlate present
20436 ///timestamps with the system clock or device-specific counters.
20437 ///
20438 ///Requires `VK_EXT_present_timing`.
20439 pub unsafe fn get_swapchain_time_domain_properties_ext(
20440 &self,
20441 swapchain: SwapchainKHR,
20442 p_swapchain_time_domain_properties: &mut SwapchainTimeDomainPropertiesEXT,
20443 ) -> VkResult<u64> {
20444 let fp = self
20445 .commands()
20446 .get_swapchain_time_domain_properties_ext
20447 .expect("vkGetSwapchainTimeDomainPropertiesEXT not loaded");
20448 let mut out = unsafe { core::mem::zeroed() };
20449 check(unsafe {
20450 fp(
20451 self.handle(),
20452 swapchain,
20453 p_swapchain_time_domain_properties,
20454 &mut out,
20455 )
20456 })?;
20457 Ok(out)
20458 }
20459 ///Wraps [`vkGetPastPresentationTimingEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPastPresentationTimingEXT.html).
20460 /**
20461 Provided by **VK_EXT_present_timing**.*/
20462 ///
20463 ///# Errors
20464 ///- `VK_ERROR_DEVICE_LOST`
20465 ///- `VK_ERROR_OUT_OF_DATE_KHR`
20466 ///- `VK_ERROR_SURFACE_LOST_KHR`
20467 ///- `VK_ERROR_UNKNOWN`
20468 ///- `VK_ERROR_VALIDATION_FAILED`
20469 ///
20470 ///# Safety
20471 ///- `device` (self) must be valid and not destroyed.
20472 ///
20473 ///# Panics
20474 ///Panics if `vkGetPastPresentationTimingEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20475 ///
20476 ///# Usage Notes
20477 ///
20478 ///Retrieves presentation timing data for previously presented images.
20479 ///Use this to measure actual vs. requested present times and detect
20480 ///missed frames or compositor latency.
20481 ///
20482 ///Requires `VK_EXT_present_timing`.
20483 pub unsafe fn get_past_presentation_timing_ext(
20484 &self,
20485 p_past_presentation_timing_info: &PastPresentationTimingInfoEXT,
20486 p_past_presentation_timing_properties: &mut PastPresentationTimingPropertiesEXT,
20487 ) -> VkResult<()> {
20488 let fp = self
20489 .commands()
20490 .get_past_presentation_timing_ext
20491 .expect("vkGetPastPresentationTimingEXT not loaded");
20492 check(unsafe {
20493 fp(
20494 self.handle(),
20495 p_past_presentation_timing_info,
20496 p_past_presentation_timing_properties,
20497 )
20498 })
20499 }
20500 ///Wraps [`vkGetScreenBufferPropertiesQNX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetScreenBufferPropertiesQNX.html).
20501 /**
20502 Provided by **VK_QNX_external_memory_screen_buffer**.*/
20503 ///
20504 ///# Errors
20505 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20506 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR`
20507 ///- `VK_ERROR_UNKNOWN`
20508 ///- `VK_ERROR_VALIDATION_FAILED`
20509 ///
20510 ///# Safety
20511 ///- `device` (self) must be valid and not destroyed.
20512 ///
20513 ///# Panics
20514 ///Panics if `vkGetScreenBufferPropertiesQNX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20515 ///
20516 ///# Usage Notes
20517 ///
20518 ///Queries Vulkan memory properties for a QNX Screen buffer. Use
20519 ///before importing the buffer as Vulkan memory to determine
20520 ///compatible memory types and size. QNX only.
20521 ///
20522 ///Requires `VK_QNX_external_memory_screen_buffer`.
20523 pub unsafe fn get_screen_buffer_properties_qnx(
20524 &self,
20525 buffer: *const core::ffi::c_void,
20526 p_properties: &mut ScreenBufferPropertiesQNX,
20527 ) -> VkResult<()> {
20528 let fp = self
20529 .commands()
20530 .get_screen_buffer_properties_qnx
20531 .expect("vkGetScreenBufferPropertiesQNX not loaded");
20532 check(unsafe { fp(self.handle(), buffer, p_properties) })
20533 }
20534 ///Wraps [`vkGetExecutionGraphPipelineScratchSizeAMDX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetExecutionGraphPipelineScratchSizeAMDX.html).
20535 /**
20536 Provided by **VK_AMDX_shader_enqueue**.*/
20537 ///
20538 ///# Errors
20539 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20540 ///- `VK_ERROR_UNKNOWN`
20541 ///- `VK_ERROR_VALIDATION_FAILED`
20542 ///
20543 ///# Safety
20544 ///- `device` (self) must be valid and not destroyed.
20545 ///
20546 ///# Panics
20547 ///Panics if `vkGetExecutionGraphPipelineScratchSizeAMDX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20548 ///
20549 ///# Usage Notes
20550 ///
20551 ///Queries the scratch memory size required to execute an execution
20552 ///graph pipeline. Allocate a buffer of at least this size and
20553 ///initialize it with `cmd_initialize_graph_scratch_memory_amdx`
20554 ///before dispatching the graph.
20555 ///
20556 ///Requires `VK_AMDX_shader_enqueue`.
20557 pub unsafe fn get_execution_graph_pipeline_scratch_size_amdx(
20558 &self,
20559 execution_graph: Pipeline,
20560 p_size_info: &mut ExecutionGraphPipelineScratchSizeAMDX,
20561 ) -> VkResult<()> {
20562 let fp = self
20563 .commands()
20564 .get_execution_graph_pipeline_scratch_size_amdx
20565 .expect("vkGetExecutionGraphPipelineScratchSizeAMDX not loaded");
20566 check(unsafe { fp(self.handle(), execution_graph, p_size_info) })
20567 }
20568 ///Wraps [`vkGetExecutionGraphPipelineNodeIndexAMDX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetExecutionGraphPipelineNodeIndexAMDX.html).
20569 /**
20570 Provided by **VK_AMDX_shader_enqueue**.*/
20571 ///
20572 ///# Errors
20573 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20574 ///- `VK_ERROR_UNKNOWN`
20575 ///- `VK_ERROR_VALIDATION_FAILED`
20576 ///
20577 ///# Safety
20578 ///- `device` (self) must be valid and not destroyed.
20579 ///
20580 ///# Panics
20581 ///Panics if `vkGetExecutionGraphPipelineNodeIndexAMDX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20582 ///
20583 ///# Usage Notes
20584 ///
20585 ///Queries the node index for a named shader node in an execution
20586 ///graph pipeline. The index is used when dispatching or enqueuing
20587 ///work to a specific node in the graph.
20588 ///
20589 ///Requires `VK_AMDX_shader_enqueue`.
20590 pub unsafe fn get_execution_graph_pipeline_node_index_amdx(
20591 &self,
20592 execution_graph: Pipeline,
20593 p_node_info: &PipelineShaderStageNodeCreateInfoAMDX,
20594 ) -> VkResult<u32> {
20595 let fp = self
20596 .commands()
20597 .get_execution_graph_pipeline_node_index_amdx
20598 .expect("vkGetExecutionGraphPipelineNodeIndexAMDX not loaded");
20599 let mut out = unsafe { core::mem::zeroed() };
20600 check(unsafe { fp(self.handle(), execution_graph, p_node_info, &mut out) })?;
20601 Ok(out)
20602 }
20603 ///Wraps [`vkCreateExecutionGraphPipelinesAMDX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateExecutionGraphPipelinesAMDX.html).
20604 /**
20605 Provided by **VK_AMDX_shader_enqueue**.*/
20606 ///
20607 ///# Errors
20608 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20609 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
20610 ///- `VK_ERROR_UNKNOWN`
20611 ///- `VK_ERROR_VALIDATION_FAILED`
20612 ///
20613 ///# Safety
20614 ///- `device` (self) must be valid and not destroyed.
20615 ///- `pipelineCache` must be externally synchronized.
20616 ///
20617 ///# Panics
20618 ///Panics if `vkCreateExecutionGraphPipelinesAMDX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20619 ///
20620 ///# Usage Notes
20621 ///
20622 ///Creates one or more execution graph pipelines for GPU-driven
20623 ///shader dispatch. An execution graph is a DAG of shader nodes
20624 ///where each node can enqueue work to other nodes, enabling complex
20625 ///GPU-driven workflows without CPU round-trips.
20626 ///
20627 ///Requires `VK_AMDX_shader_enqueue`.
20628 pub unsafe fn create_execution_graph_pipelines_amdx(
20629 &self,
20630 pipeline_cache: PipelineCache,
20631 p_create_infos: &[ExecutionGraphPipelineCreateInfoAMDX],
20632 allocator: Option<&AllocationCallbacks>,
20633 ) -> VkResult<Vec<Pipeline>> {
20634 let fp = self
20635 .commands()
20636 .create_execution_graph_pipelines_amdx
20637 .expect("vkCreateExecutionGraphPipelinesAMDX not loaded");
20638 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
20639 let count = p_create_infos.len();
20640 let mut out = vec![unsafe { core::mem::zeroed() }; count];
20641 check(unsafe {
20642 fp(
20643 self.handle(),
20644 pipeline_cache,
20645 p_create_infos.len() as u32,
20646 p_create_infos.as_ptr(),
20647 alloc_ptr,
20648 out.as_mut_ptr(),
20649 )
20650 })?;
20651 Ok(out)
20652 }
20653 ///Wraps [`vkCmdInitializeGraphScratchMemoryAMDX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdInitializeGraphScratchMemoryAMDX.html).
20654 /**
20655 Provided by **VK_AMDX_shader_enqueue**.*/
20656 ///
20657 ///# Safety
20658 ///- `commandBuffer` (self) must be valid and not destroyed.
20659 ///
20660 ///# Panics
20661 ///Panics if `vkCmdInitializeGraphScratchMemoryAMDX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20662 ///
20663 ///# Usage Notes
20664 ///
20665 ///Initializes the scratch memory buffer for an execution graph
20666 ///pipeline. Must be called before any `cmd_dispatch_graph_*_amdx`
20667 ///command that uses this scratch buffer.
20668 ///
20669 ///Requires `VK_AMDX_shader_enqueue`.
20670 pub unsafe fn cmd_initialize_graph_scratch_memory_amdx(
20671 &self,
20672 command_buffer: CommandBuffer,
20673 execution_graph: Pipeline,
20674 scratch: u64,
20675 scratch_size: u64,
20676 ) {
20677 let fp = self
20678 .commands()
20679 .cmd_initialize_graph_scratch_memory_amdx
20680 .expect("vkCmdInitializeGraphScratchMemoryAMDX not loaded");
20681 unsafe { fp(command_buffer, execution_graph, scratch, scratch_size) };
20682 }
20683 ///Wraps [`vkCmdDispatchGraphAMDX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDispatchGraphAMDX.html).
20684 /**
20685 Provided by **VK_AMDX_shader_enqueue**.*/
20686 ///
20687 ///# Safety
20688 ///- `commandBuffer` (self) must be valid and not destroyed.
20689 ///
20690 ///# Panics
20691 ///Panics if `vkCmdDispatchGraphAMDX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20692 ///
20693 ///# Usage Notes
20694 ///
20695 ///Dispatches an execution graph starting from the specified root
20696 ///nodes. The scratch buffer must have been initialized with
20697 ///`cmd_initialize_graph_scratch_memory_amdx`.
20698 ///
20699 ///Requires `VK_AMDX_shader_enqueue`.
20700 pub unsafe fn cmd_dispatch_graph_amdx(
20701 &self,
20702 command_buffer: CommandBuffer,
20703 scratch: u64,
20704 scratch_size: u64,
20705 p_count_info: &DispatchGraphCountInfoAMDX,
20706 ) {
20707 let fp = self
20708 .commands()
20709 .cmd_dispatch_graph_amdx
20710 .expect("vkCmdDispatchGraphAMDX not loaded");
20711 unsafe { fp(command_buffer, scratch, scratch_size, p_count_info) };
20712 }
20713 ///Wraps [`vkCmdDispatchGraphIndirectAMDX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDispatchGraphIndirectAMDX.html).
20714 /**
20715 Provided by **VK_AMDX_shader_enqueue**.*/
20716 ///
20717 ///# Safety
20718 ///- `commandBuffer` (self) must be valid and not destroyed.
20719 ///
20720 ///# Panics
20721 ///Panics if `vkCmdDispatchGraphIndirectAMDX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20722 ///
20723 ///# Usage Notes
20724 ///
20725 ///Indirect variant of `cmd_dispatch_graph_amdx`. Reads the graph
20726 ///dispatch payloads from a GPU buffer while the count info is
20727 ///provided on the CPU side.
20728 ///
20729 ///Requires `VK_AMDX_shader_enqueue`.
20730 pub unsafe fn cmd_dispatch_graph_indirect_amdx(
20731 &self,
20732 command_buffer: CommandBuffer,
20733 scratch: u64,
20734 scratch_size: u64,
20735 p_count_info: &DispatchGraphCountInfoAMDX,
20736 ) {
20737 let fp = self
20738 .commands()
20739 .cmd_dispatch_graph_indirect_amdx
20740 .expect("vkCmdDispatchGraphIndirectAMDX not loaded");
20741 unsafe { fp(command_buffer, scratch, scratch_size, p_count_info) };
20742 }
20743 ///Wraps [`vkCmdDispatchGraphIndirectCountAMDX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDispatchGraphIndirectCountAMDX.html).
20744 /**
20745 Provided by **VK_AMDX_shader_enqueue**.*/
20746 ///
20747 ///# Safety
20748 ///- `commandBuffer` (self) must be valid and not destroyed.
20749 ///
20750 ///# Panics
20751 ///Panics if `vkCmdDispatchGraphIndirectCountAMDX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20752 ///
20753 ///# Usage Notes
20754 ///
20755 ///Fully indirect variant of `cmd_dispatch_graph_amdx`. Both the
20756 ///dispatch payloads and the count are read from GPU buffers,
20757 ///enabling fully GPU-driven execution graph dispatch.
20758 ///
20759 ///Requires `VK_AMDX_shader_enqueue`.
20760 pub unsafe fn cmd_dispatch_graph_indirect_count_amdx(
20761 &self,
20762 command_buffer: CommandBuffer,
20763 scratch: u64,
20764 scratch_size: u64,
20765 count_info: u64,
20766 ) {
20767 let fp = self
20768 .commands()
20769 .cmd_dispatch_graph_indirect_count_amdx
20770 .expect("vkCmdDispatchGraphIndirectCountAMDX not loaded");
20771 unsafe { fp(command_buffer, scratch, scratch_size, count_info) };
20772 }
20773 ///Wraps [`vkCmdBindDescriptorSets2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindDescriptorSets2.html).
20774 /**
20775 Provided by **VK_COMPUTE_VERSION_1_4**.*/
20776 ///
20777 ///# Safety
20778 ///- `commandBuffer` (self) must be valid and not destroyed.
20779 ///- `commandBuffer` must be externally synchronized.
20780 ///
20781 ///# Panics
20782 ///Panics if `vkCmdBindDescriptorSets2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20783 ///
20784 ///# Usage Notes
20785 ///
20786 ///Vulkan 1.4 version of `cmd_bind_descriptor_sets` that uses an
20787 ///extensible `BindDescriptorSetsInfo` struct.
20788 ///
20789 ///Functionally equivalent to the 1.0 version. The extensible struct
20790 ///enables future extensions to modify binding behaviour via pNext.
20791 ///
20792 ///Prefer this when targeting Vulkan 1.4+.
20793 pub unsafe fn cmd_bind_descriptor_sets2(
20794 &self,
20795 command_buffer: CommandBuffer,
20796 p_bind_descriptor_sets_info: &BindDescriptorSetsInfo,
20797 ) {
20798 let fp = self
20799 .commands()
20800 .cmd_bind_descriptor_sets2
20801 .expect("vkCmdBindDescriptorSets2 not loaded");
20802 unsafe { fp(command_buffer, p_bind_descriptor_sets_info) };
20803 }
20804 ///Wraps [`vkCmdPushConstants2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPushConstants2.html).
20805 /**
20806 Provided by **VK_COMPUTE_VERSION_1_4**.*/
20807 ///
20808 ///# Safety
20809 ///- `commandBuffer` (self) must be valid and not destroyed.
20810 ///- `commandBuffer` must be externally synchronized.
20811 ///
20812 ///# Panics
20813 ///Panics if `vkCmdPushConstants2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20814 ///
20815 ///# Usage Notes
20816 ///
20817 ///Vulkan 1.4 version of `cmd_push_constants` that uses an extensible
20818 ///`PushConstantsInfo` struct.
20819 ///
20820 ///Functionally equivalent to the 1.0 version. Prefer this when
20821 ///targeting Vulkan 1.4+.
20822 pub unsafe fn cmd_push_constants2(
20823 &self,
20824 command_buffer: CommandBuffer,
20825 p_push_constants_info: &PushConstantsInfo,
20826 ) {
20827 let fp = self
20828 .commands()
20829 .cmd_push_constants2
20830 .expect("vkCmdPushConstants2 not loaded");
20831 unsafe { fp(command_buffer, p_push_constants_info) };
20832 }
20833 ///Wraps [`vkCmdPushDescriptorSet2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPushDescriptorSet2.html).
20834 /**
20835 Provided by **VK_COMPUTE_VERSION_1_4**.*/
20836 ///
20837 ///# Safety
20838 ///- `commandBuffer` (self) must be valid and not destroyed.
20839 ///- `commandBuffer` must be externally synchronized.
20840 ///
20841 ///# Panics
20842 ///Panics if `vkCmdPushDescriptorSet2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20843 ///
20844 ///# Usage Notes
20845 ///
20846 ///Vulkan 1.4 version of `cmd_push_descriptor_set` that uses an
20847 ///extensible `PushDescriptorSetInfo` struct.
20848 ///
20849 ///Functionally equivalent to the base version. Prefer this when
20850 ///targeting Vulkan 1.4+.
20851 pub unsafe fn cmd_push_descriptor_set2(
20852 &self,
20853 command_buffer: CommandBuffer,
20854 p_push_descriptor_set_info: &PushDescriptorSetInfo,
20855 ) {
20856 let fp = self
20857 .commands()
20858 .cmd_push_descriptor_set2
20859 .expect("vkCmdPushDescriptorSet2 not loaded");
20860 unsafe { fp(command_buffer, p_push_descriptor_set_info) };
20861 }
20862 ///Wraps [`vkCmdPushDescriptorSetWithTemplate2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPushDescriptorSetWithTemplate2.html).
20863 /**
20864 Provided by **VK_COMPUTE_VERSION_1_4**.*/
20865 ///
20866 ///# Safety
20867 ///- `commandBuffer` (self) must be valid and not destroyed.
20868 ///- `commandBuffer` must be externally synchronized.
20869 ///
20870 ///# Panics
20871 ///Panics if `vkCmdPushDescriptorSetWithTemplate2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20872 ///
20873 ///# Usage Notes
20874 ///
20875 ///Vulkan 1.4 version of `cmd_push_descriptor_set_with_template` that
20876 ///uses an extensible `PushDescriptorSetWithTemplateInfo` struct.
20877 ///
20878 ///Functionally equivalent to the base version. Prefer this when
20879 ///targeting Vulkan 1.4+.
20880 pub unsafe fn cmd_push_descriptor_set_with_template2(
20881 &self,
20882 command_buffer: CommandBuffer,
20883 p_push_descriptor_set_with_template_info: &PushDescriptorSetWithTemplateInfo,
20884 ) {
20885 let fp = self
20886 .commands()
20887 .cmd_push_descriptor_set_with_template2
20888 .expect("vkCmdPushDescriptorSetWithTemplate2 not loaded");
20889 unsafe { fp(command_buffer, p_push_descriptor_set_with_template_info) };
20890 }
20891 ///Wraps [`vkCmdSetDescriptorBufferOffsets2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDescriptorBufferOffsets2EXT.html).
20892 /**
20893 Provided by **VK_KHR_maintenance6**.*/
20894 ///
20895 ///# Safety
20896 ///- `commandBuffer` (self) must be valid and not destroyed.
20897 ///- `commandBuffer` must be externally synchronized.
20898 ///
20899 ///# Panics
20900 ///Panics if `vkCmdSetDescriptorBufferOffsets2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20901 ///
20902 ///# Usage Notes
20903 ///
20904 ///Extended version of `cmd_set_descriptor_buffer_offsets_ext` that
20905 ///takes a `SetDescriptorBufferOffsetsInfoEXT` struct with pNext
20906 ///extensibility.
20907 ///
20908 ///Sets the offsets into bound descriptor buffers for the specified
20909 ///pipeline layout. Each offset points to the start of a descriptor
20910 ///set's data within the bound descriptor buffer.
20911 ///
20912 ///Provided by `VK_KHR_maintenance6` (for the pNext-extensible
20913 ///variant of the `VK_EXT_descriptor_buffer` command).
20914 pub unsafe fn cmd_set_descriptor_buffer_offsets2_ext(
20915 &self,
20916 command_buffer: CommandBuffer,
20917 p_set_descriptor_buffer_offsets_info: &SetDescriptorBufferOffsetsInfoEXT,
20918 ) {
20919 let fp = self
20920 .commands()
20921 .cmd_set_descriptor_buffer_offsets2_ext
20922 .expect("vkCmdSetDescriptorBufferOffsets2EXT not loaded");
20923 unsafe { fp(command_buffer, p_set_descriptor_buffer_offsets_info) };
20924 }
20925 ///Wraps [`vkCmdBindDescriptorBufferEmbeddedSamplers2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindDescriptorBufferEmbeddedSamplers2EXT.html).
20926 /**
20927 Provided by **VK_KHR_maintenance6**.*/
20928 ///
20929 ///# Safety
20930 ///- `commandBuffer` (self) must be valid and not destroyed.
20931 ///- `commandBuffer` must be externally synchronized.
20932 ///
20933 ///# Panics
20934 ///Panics if `vkCmdBindDescriptorBufferEmbeddedSamplers2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20935 ///
20936 ///# Usage Notes
20937 ///
20938 ///Extended version of `cmd_bind_descriptor_buffer_embedded_samplers_ext`
20939 ///that takes a `BindDescriptorBufferEmbeddedSamplersInfoEXT` struct
20940 ///with pNext extensibility.
20941 ///
20942 ///Binds embedded immutable samplers from a descriptor set layout
20943 ///that was created with `CREATE_EMBEDDED_IMMUTABLE_SAMPLERS_BIT`.
20944 ///
20945 ///Provided by `VK_KHR_maintenance6` (for the pNext-extensible
20946 ///variant of the `VK_EXT_descriptor_buffer` command).
20947 pub unsafe fn cmd_bind_descriptor_buffer_embedded_samplers2_ext(
20948 &self,
20949 command_buffer: CommandBuffer,
20950 p_bind_descriptor_buffer_embedded_samplers_info: &BindDescriptorBufferEmbeddedSamplersInfoEXT,
20951 ) {
20952 let fp = self
20953 .commands()
20954 .cmd_bind_descriptor_buffer_embedded_samplers2_ext
20955 .expect("vkCmdBindDescriptorBufferEmbeddedSamplers2EXT not loaded");
20956 unsafe {
20957 fp(
20958 command_buffer,
20959 p_bind_descriptor_buffer_embedded_samplers_info,
20960 )
20961 };
20962 }
20963 ///Wraps [`vkSetLatencySleepModeNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetLatencySleepModeNV.html).
20964 /**
20965 Provided by **VK_NV_low_latency2**.*/
20966 ///
20967 ///# Errors
20968 ///- `VK_ERROR_INITIALIZATION_FAILED`
20969 ///- `VK_ERROR_UNKNOWN`
20970 ///- `VK_ERROR_VALIDATION_FAILED`
20971 ///
20972 ///# Safety
20973 ///- `device` (self) must be valid and not destroyed.
20974 ///
20975 ///# Panics
20976 ///Panics if `vkSetLatencySleepModeNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20977 ///
20978 ///# Usage Notes
20979 ///
20980 ///Configures the NVIDIA Reflex low-latency sleep mode for a
20981 ///swapchain. Enables or disables latency sleep and sets the target
20982 ///sleep duration. Call before `latency_sleep_nv` to activate the
20983 ///system.
20984 ///
20985 ///Requires `VK_NV_low_latency2`.
20986 pub unsafe fn set_latency_sleep_mode_nv(
20987 &self,
20988 swapchain: SwapchainKHR,
20989 p_sleep_mode_info: &LatencySleepModeInfoNV,
20990 ) -> VkResult<()> {
20991 let fp = self
20992 .commands()
20993 .set_latency_sleep_mode_nv
20994 .expect("vkSetLatencySleepModeNV not loaded");
20995 check(unsafe { fp(self.handle(), swapchain, p_sleep_mode_info) })
20996 }
20997 ///Wraps [`vkLatencySleepNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkLatencySleepNV.html).
20998 /**
20999 Provided by **VK_NV_low_latency2**.*/
21000 ///
21001 ///# Errors
21002 ///- `VK_ERROR_UNKNOWN`
21003 ///- `VK_ERROR_VALIDATION_FAILED`
21004 ///
21005 ///# Safety
21006 ///- `device` (self) must be valid and not destroyed.
21007 ///
21008 ///# Panics
21009 ///Panics if `vkLatencySleepNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21010 ///
21011 ///# Usage Notes
21012 ///
21013 ///Sleeps the calling thread until the optimal time to begin the
21014 ///next frame, as determined by the NVIDIA Reflex low-latency
21015 ///system. Reduces input-to-display latency by preventing the CPU
21016 ///from running too far ahead of the GPU.
21017 ///
21018 ///Requires `VK_NV_low_latency2`.
21019 pub unsafe fn latency_sleep_nv(
21020 &self,
21021 swapchain: SwapchainKHR,
21022 p_sleep_info: &LatencySleepInfoNV,
21023 ) -> VkResult<()> {
21024 let fp = self
21025 .commands()
21026 .latency_sleep_nv
21027 .expect("vkLatencySleepNV not loaded");
21028 check(unsafe { fp(self.handle(), swapchain, p_sleep_info) })
21029 }
21030 ///Wraps [`vkSetLatencyMarkerNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetLatencyMarkerNV.html).
21031 /**
21032 Provided by **VK_NV_low_latency2**.*/
21033 ///
21034 ///# Safety
21035 ///- `device` (self) must be valid and not destroyed.
21036 ///
21037 ///# Panics
21038 ///Panics if `vkSetLatencyMarkerNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21039 ///
21040 ///# Usage Notes
21041 ///
21042 ///Sets a latency marker at a specific point in the frame lifecycle
21043 ///(simulation start, render start, present, etc.). The markers are
21044 ///later retrieved with `get_latency_timings_nv` to measure per-
21045 ///stage latency.
21046 ///
21047 ///Requires `VK_NV_low_latency2`.
21048 pub unsafe fn set_latency_marker_nv(
21049 &self,
21050 swapchain: SwapchainKHR,
21051 p_latency_marker_info: &SetLatencyMarkerInfoNV,
21052 ) {
21053 let fp = self
21054 .commands()
21055 .set_latency_marker_nv
21056 .expect("vkSetLatencyMarkerNV not loaded");
21057 unsafe { fp(self.handle(), swapchain, p_latency_marker_info) };
21058 }
21059 ///Wraps [`vkGetLatencyTimingsNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetLatencyTimingsNV.html).
21060 /**
21061 Provided by **VK_NV_low_latency2**.*/
21062 ///
21063 ///# Safety
21064 ///- `device` (self) must be valid and not destroyed.
21065 ///
21066 ///# Panics
21067 ///Panics if `vkGetLatencyTimingsNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21068 ///
21069 ///# Usage Notes
21070 ///
21071 ///Retrieves per-frame latency timing data for a swapchain. Returns
21072 ///timestamps for each marker set with `set_latency_marker_nv`,
21073 ///enabling measurement of simulation, render, and present latency.
21074 ///
21075 ///Requires `VK_NV_low_latency2`.
21076 pub unsafe fn get_latency_timings_nv(
21077 &self,
21078 swapchain: SwapchainKHR,
21079 p_latency_marker_info: &mut GetLatencyMarkerInfoNV,
21080 ) {
21081 let fp = self
21082 .commands()
21083 .get_latency_timings_nv
21084 .expect("vkGetLatencyTimingsNV not loaded");
21085 unsafe { fp(self.handle(), swapchain, p_latency_marker_info) };
21086 }
21087 ///Wraps [`vkQueueNotifyOutOfBandNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueNotifyOutOfBandNV.html).
21088 /**
21089 Provided by **VK_NV_low_latency2**.*/
21090 ///
21091 ///# Safety
21092 ///- `queue` (self) must be valid and not destroyed.
21093 ///
21094 ///# Panics
21095 ///Panics if `vkQueueNotifyOutOfBandNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21096 ///
21097 ///# Usage Notes
21098 ///
21099 ///Notifies the low-latency system that a queue submission is
21100 ///out-of-band (e.g., a loading or async compute submission that
21101 ///should not be counted toward frame latency tracking).
21102 ///
21103 ///Requires `VK_NV_low_latency2`.
21104 pub unsafe fn queue_notify_out_of_band_nv(
21105 &self,
21106 queue: Queue,
21107 p_queue_type_info: &OutOfBandQueueTypeInfoNV,
21108 ) {
21109 let fp = self
21110 .commands()
21111 .queue_notify_out_of_band_nv
21112 .expect("vkQueueNotifyOutOfBandNV not loaded");
21113 unsafe { fp(queue, p_queue_type_info) };
21114 }
21115 ///Wraps [`vkCmdSetRenderingAttachmentLocations`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetRenderingAttachmentLocations.html).
21116 /**
21117 Provided by **VK_GRAPHICS_VERSION_1_4**.*/
21118 ///
21119 ///# Safety
21120 ///- `commandBuffer` (self) must be valid and not destroyed.
21121 ///- `commandBuffer` must be externally synchronized.
21122 ///
21123 ///# Panics
21124 ///Panics if `vkCmdSetRenderingAttachmentLocations` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21125 ///
21126 ///# Usage Notes
21127 ///
21128 ///Dynamically remaps colour attachment indices within a dynamic
21129 ///rendering instance. Allows fragment shader outputs to target
21130 ///different attachment slots without changing the pipeline.
21131 ///
21132 ///This is useful when the same shader outputs different data to
21133 ///different attachments depending on the rendering pass (e.g.
21134 ///G-buffer vs forward).
21135 ///
21136 ///Requires `dynamic_rendering_local_read` feature. Core in
21137 ///Vulkan 1.4.
21138 pub unsafe fn cmd_set_rendering_attachment_locations(
21139 &self,
21140 command_buffer: CommandBuffer,
21141 p_location_info: &RenderingAttachmentLocationInfo,
21142 ) {
21143 let fp = self
21144 .commands()
21145 .cmd_set_rendering_attachment_locations
21146 .expect("vkCmdSetRenderingAttachmentLocations not loaded");
21147 unsafe { fp(command_buffer, p_location_info) };
21148 }
21149 ///Wraps [`vkCmdSetRenderingInputAttachmentIndices`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetRenderingInputAttachmentIndices.html).
21150 /**
21151 Provided by **VK_GRAPHICS_VERSION_1_4**.*/
21152 ///
21153 ///# Safety
21154 ///- `commandBuffer` (self) must be valid and not destroyed.
21155 ///- `commandBuffer` must be externally synchronized.
21156 ///
21157 ///# Panics
21158 ///Panics if `vkCmdSetRenderingInputAttachmentIndices` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21159 ///
21160 ///# Usage Notes
21161 ///
21162 ///Dynamically remaps input attachment indices within a dynamic
21163 ///rendering instance. Allows fragment shaders to read from different
21164 ///colour or depth/stencil attachments without changing the pipeline.
21165 ///
21166 ///Paired with `cmd_set_rendering_attachment_locations` to enable
21167 ///flexible attachment routing in multi-pass rendering with dynamic
21168 ///rendering.
21169 ///
21170 ///Requires `dynamic_rendering_local_read` feature. Core in
21171 ///Vulkan 1.4.
21172 pub unsafe fn cmd_set_rendering_input_attachment_indices(
21173 &self,
21174 command_buffer: CommandBuffer,
21175 p_input_attachment_index_info: &RenderingInputAttachmentIndexInfo,
21176 ) {
21177 let fp = self
21178 .commands()
21179 .cmd_set_rendering_input_attachment_indices
21180 .expect("vkCmdSetRenderingInputAttachmentIndices not loaded");
21181 unsafe { fp(command_buffer, p_input_attachment_index_info) };
21182 }
21183 ///Wraps [`vkCmdSetDepthClampRangeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthClampRangeEXT.html).
21184 /**
21185 Provided by **VK_EXT_shader_object**.*/
21186 ///
21187 ///# Safety
21188 ///- `commandBuffer` (self) must be valid and not destroyed.
21189 ///- `commandBuffer` must be externally synchronized.
21190 ///
21191 ///# Panics
21192 ///Panics if `vkCmdSetDepthClampRangeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21193 ///
21194 ///# Usage Notes
21195 ///
21196 ///Dynamically sets the depth clamp range. When depth clamping is
21197 ///enabled, fragments are clamped to the specified min/max depth
21198 ///values instead of the viewport near/far range.
21199 ///
21200 ///Pass null to use the default viewport depth range for clamping.
21201 ///
21202 ///Requires `VK_EXT_depth_clamp_control` and the
21203 ///`depthClampControl` feature.
21204 pub unsafe fn cmd_set_depth_clamp_range_ext(
21205 &self,
21206 command_buffer: CommandBuffer,
21207 depth_clamp_mode: DepthClampModeEXT,
21208 p_depth_clamp_range: Option<&DepthClampRangeEXT>,
21209 ) {
21210 let fp = self
21211 .commands()
21212 .cmd_set_depth_clamp_range_ext
21213 .expect("vkCmdSetDepthClampRangeEXT not loaded");
21214 let p_depth_clamp_range_ptr =
21215 p_depth_clamp_range.map_or(core::ptr::null(), core::ptr::from_ref);
21216 unsafe { fp(command_buffer, depth_clamp_mode, p_depth_clamp_range_ptr) };
21217 }
21218 ///Wraps [`vkGetMemoryMetalHandleEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryMetalHandleEXT.html).
21219 /**
21220 Provided by **VK_EXT_external_memory_metal**.*/
21221 ///
21222 ///# Errors
21223 ///- `VK_ERROR_TOO_MANY_OBJECTS`
21224 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21225 ///- `VK_ERROR_UNKNOWN`
21226 ///- `VK_ERROR_VALIDATION_FAILED`
21227 ///
21228 ///# Safety
21229 ///- `device` (self) must be valid and not destroyed.
21230 ///
21231 ///# Panics
21232 ///Panics if `vkGetMemoryMetalHandleEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21233 ///
21234 ///# Usage Notes
21235 ///
21236 ///Exports a Vulkan device memory allocation as a Metal resource
21237 ///handle for cross-API interop on Apple platforms.
21238 ///
21239 ///Requires `VK_EXT_external_memory_metal`. macOS/iOS only.
21240 pub unsafe fn get_memory_metal_handle_ext(
21241 &self,
21242 p_get_metal_handle_info: &MemoryGetMetalHandleInfoEXT,
21243 p_handle: *mut *mut core::ffi::c_void,
21244 ) -> VkResult<()> {
21245 let fp = self
21246 .commands()
21247 .get_memory_metal_handle_ext
21248 .expect("vkGetMemoryMetalHandleEXT not loaded");
21249 check(unsafe { fp(self.handle(), p_get_metal_handle_info, p_handle) })
21250 }
21251 ///Wraps [`vkGetMemoryMetalHandlePropertiesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryMetalHandlePropertiesEXT.html).
21252 /**
21253 Provided by **VK_EXT_external_memory_metal**.*/
21254 ///
21255 ///# Errors
21256 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21257 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
21258 ///- `VK_ERROR_UNKNOWN`
21259 ///- `VK_ERROR_VALIDATION_FAILED`
21260 ///
21261 ///# Safety
21262 ///- `device` (self) must be valid and not destroyed.
21263 ///
21264 ///# Panics
21265 ///Panics if `vkGetMemoryMetalHandlePropertiesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21266 ///
21267 ///# Usage Notes
21268 ///
21269 ///Queries which Vulkan memory types are compatible with importing
21270 ///a Metal resource handle as external memory. Use before allocating
21271 ///device memory to determine valid memory type bits.
21272 ///
21273 ///Requires `VK_EXT_external_memory_metal`. macOS/iOS only.
21274 pub unsafe fn get_memory_metal_handle_properties_ext(
21275 &self,
21276 handle_type: ExternalMemoryHandleTypeFlagBits,
21277 p_handle: *const core::ffi::c_void,
21278 p_memory_metal_handle_properties: &mut MemoryMetalHandlePropertiesEXT,
21279 ) -> VkResult<()> {
21280 let fp = self
21281 .commands()
21282 .get_memory_metal_handle_properties_ext
21283 .expect("vkGetMemoryMetalHandlePropertiesEXT not loaded");
21284 check(unsafe {
21285 fp(
21286 self.handle(),
21287 handle_type,
21288 p_handle,
21289 p_memory_metal_handle_properties,
21290 )
21291 })
21292 }
21293 ///Wraps [`vkConvertCooperativeVectorMatrixNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkConvertCooperativeVectorMatrixNV.html).
21294 /**
21295 Provided by **VK_NV_cooperative_vector**.*/
21296 ///
21297 ///# Errors
21298 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21299 ///- `VK_ERROR_UNKNOWN`
21300 ///- `VK_ERROR_VALIDATION_FAILED`
21301 ///
21302 ///# Safety
21303 ///- `device` (self) must be valid and not destroyed.
21304 ///
21305 ///# Panics
21306 ///Panics if `vkConvertCooperativeVectorMatrixNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21307 ///
21308 ///# Usage Notes
21309 ///
21310 ///Host-side conversion of cooperative vector matrix data between
21311 ///formats or layouts. Use to prepare weight matrices on the CPU
21312 ///before uploading to the GPU for cooperative vector operations.
21313 ///
21314 ///Requires `VK_NV_cooperative_vector`.
21315 pub unsafe fn convert_cooperative_vector_matrix_nv(
21316 &self,
21317 p_info: &ConvertCooperativeVectorMatrixInfoNV,
21318 ) -> VkResult<()> {
21319 let fp = self
21320 .commands()
21321 .convert_cooperative_vector_matrix_nv
21322 .expect("vkConvertCooperativeVectorMatrixNV not loaded");
21323 check(unsafe { fp(self.handle(), p_info) })
21324 }
21325 ///Wraps [`vkCmdConvertCooperativeVectorMatrixNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdConvertCooperativeVectorMatrixNV.html).
21326 /**
21327 Provided by **VK_NV_cooperative_vector**.*/
21328 ///
21329 ///# Safety
21330 ///- `commandBuffer` (self) must be valid and not destroyed.
21331 ///- `commandBuffer` must be externally synchronized.
21332 ///
21333 ///# Panics
21334 ///Panics if `vkCmdConvertCooperativeVectorMatrixNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21335 ///
21336 ///# Usage Notes
21337 ///
21338 ///GPU-side conversion of cooperative vector matrix data between
21339 ///formats or layouts. Converts one or more matrices in a command
21340 ///buffer. Use for repacking weight matrices for neural network
21341 ///inference on the GPU.
21342 ///
21343 ///Requires `VK_NV_cooperative_vector`.
21344 pub unsafe fn cmd_convert_cooperative_vector_matrix_nv(
21345 &self,
21346 command_buffer: CommandBuffer,
21347 p_infos: &[ConvertCooperativeVectorMatrixInfoNV],
21348 ) {
21349 let fp = self
21350 .commands()
21351 .cmd_convert_cooperative_vector_matrix_nv
21352 .expect("vkCmdConvertCooperativeVectorMatrixNV not loaded");
21353 unsafe { fp(command_buffer, p_infos.len() as u32, p_infos.as_ptr()) };
21354 }
21355 ///Wraps [`vkCmdDispatchTileQCOM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDispatchTileQCOM.html).
21356 /**
21357 Provided by **VK_QCOM_tile_shading**.*/
21358 ///
21359 ///# Safety
21360 ///- `commandBuffer` (self) must be valid and not destroyed.
21361 ///
21362 ///# Panics
21363 ///Panics if `vkCmdDispatchTileQCOM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21364 ///
21365 ///# Usage Notes
21366 ///
21367 ///Dispatches compute work within a per-tile execution region on
21368 ///Qualcomm tile-based GPUs. Must be called between
21369 ///`cmd_begin_per_tile_execution_qcom` and
21370 ///`cmd_end_per_tile_execution_qcom`.
21371 ///
21372 ///Requires `VK_QCOM_tile_shading`.
21373 pub unsafe fn cmd_dispatch_tile_qcom(
21374 &self,
21375 command_buffer: CommandBuffer,
21376 p_dispatch_tile_info: &DispatchTileInfoQCOM,
21377 ) {
21378 let fp = self
21379 .commands()
21380 .cmd_dispatch_tile_qcom
21381 .expect("vkCmdDispatchTileQCOM not loaded");
21382 unsafe { fp(command_buffer, p_dispatch_tile_info) };
21383 }
21384 ///Wraps [`vkCmdBeginPerTileExecutionQCOM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginPerTileExecutionQCOM.html).
21385 /**
21386 Provided by **VK_QCOM_tile_shading**.*/
21387 ///
21388 ///# Safety
21389 ///- `commandBuffer` (self) must be valid and not destroyed.
21390 ///
21391 ///# Panics
21392 ///Panics if `vkCmdBeginPerTileExecutionQCOM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21393 ///
21394 ///# Usage Notes
21395 ///
21396 ///Begins a per-tile execution region within a render pass on
21397 ///Qualcomm tile-based GPUs. Commands recorded between this and
21398 ///`cmd_end_per_tile_execution_qcom` are executed once per tile,
21399 ///enabling tile-local compute and shading optimisations.
21400 ///
21401 ///Requires `VK_QCOM_tile_shading`.
21402 pub unsafe fn cmd_begin_per_tile_execution_qcom(
21403 &self,
21404 command_buffer: CommandBuffer,
21405 p_per_tile_begin_info: &PerTileBeginInfoQCOM,
21406 ) {
21407 let fp = self
21408 .commands()
21409 .cmd_begin_per_tile_execution_qcom
21410 .expect("vkCmdBeginPerTileExecutionQCOM not loaded");
21411 unsafe { fp(command_buffer, p_per_tile_begin_info) };
21412 }
21413 ///Wraps [`vkCmdEndPerTileExecutionQCOM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndPerTileExecutionQCOM.html).
21414 /**
21415 Provided by **VK_QCOM_tile_shading**.*/
21416 ///
21417 ///# Safety
21418 ///- `commandBuffer` (self) must be valid and not destroyed.
21419 ///
21420 ///# Panics
21421 ///Panics if `vkCmdEndPerTileExecutionQCOM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21422 ///
21423 ///# Usage Notes
21424 ///
21425 ///Ends a per-tile execution region started by
21426 ///`cmd_begin_per_tile_execution_qcom`. After this call, the
21427 ///command buffer returns to normal (non-tile-local) recording.
21428 ///
21429 ///Requires `VK_QCOM_tile_shading`.
21430 pub unsafe fn cmd_end_per_tile_execution_qcom(
21431 &self,
21432 command_buffer: CommandBuffer,
21433 p_per_tile_end_info: &PerTileEndInfoQCOM,
21434 ) {
21435 let fp = self
21436 .commands()
21437 .cmd_end_per_tile_execution_qcom
21438 .expect("vkCmdEndPerTileExecutionQCOM not loaded");
21439 unsafe { fp(command_buffer, p_per_tile_end_info) };
21440 }
21441 ///Wraps [`vkCreateExternalComputeQueueNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateExternalComputeQueueNV.html).
21442 /**
21443 Provided by **VK_NV_external_compute_queue**.*/
21444 ///
21445 ///# Errors
21446 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21447 ///- `VK_ERROR_TOO_MANY_OBJECTS`
21448 ///- `VK_ERROR_UNKNOWN`
21449 ///- `VK_ERROR_VALIDATION_FAILED`
21450 ///
21451 ///# Safety
21452 ///- `device` (self) must be valid and not destroyed.
21453 ///
21454 ///# Panics
21455 ///Panics if `vkCreateExternalComputeQueueNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21456 ///
21457 ///# Usage Notes
21458 ///
21459 ///Creates an external compute queue that can be used to submit
21460 ///work from outside the Vulkan runtime (e.g., CUDA interop).
21461 ///Destroy with `destroy_external_compute_queue_nv`.
21462 ///
21463 ///Requires `VK_NV_external_compute_queue`.
21464 pub unsafe fn create_external_compute_queue_nv(
21465 &self,
21466 p_create_info: &ExternalComputeQueueCreateInfoNV,
21467 allocator: Option<&AllocationCallbacks>,
21468 ) -> VkResult<ExternalComputeQueueNV> {
21469 let fp = self
21470 .commands()
21471 .create_external_compute_queue_nv
21472 .expect("vkCreateExternalComputeQueueNV not loaded");
21473 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
21474 let mut out = unsafe { core::mem::zeroed() };
21475 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
21476 Ok(out)
21477 }
21478 ///Wraps [`vkDestroyExternalComputeQueueNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyExternalComputeQueueNV.html).
21479 /**
21480 Provided by **VK_NV_external_compute_queue**.*/
21481 ///
21482 ///# Safety
21483 ///- `device` (self) must be valid and not destroyed.
21484 ///
21485 ///# Panics
21486 ///Panics if `vkDestroyExternalComputeQueueNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21487 ///
21488 ///# Usage Notes
21489 ///
21490 ///Destroys an external compute queue created with
21491 ///`create_external_compute_queue_nv`.
21492 ///
21493 ///Requires `VK_NV_external_compute_queue`.
21494 pub unsafe fn destroy_external_compute_queue_nv(
21495 &self,
21496 external_queue: ExternalComputeQueueNV,
21497 allocator: Option<&AllocationCallbacks>,
21498 ) {
21499 let fp = self
21500 .commands()
21501 .destroy_external_compute_queue_nv
21502 .expect("vkDestroyExternalComputeQueueNV not loaded");
21503 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
21504 unsafe { fp(self.handle(), external_queue, alloc_ptr) };
21505 }
21506 ///Wraps [`vkCreateShaderInstrumentationARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateShaderInstrumentationARM.html).
21507 /**
21508 Provided by **VK_ARM_shader_instrumentation**.*/
21509 ///
21510 ///# Errors
21511 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21512 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
21513 ///- `VK_ERROR_UNKNOWN`
21514 ///- `VK_ERROR_VALIDATION_FAILED`
21515 ///
21516 ///# Safety
21517 ///- `device` (self) must be valid and not destroyed.
21518 ///
21519 ///# Panics
21520 ///Panics if `vkCreateShaderInstrumentationARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21521 ///
21522 ///# Usage Notes
21523 ///
21524 ///Creates a shader instrumentation object that configures which
21525 ///metrics to collect during shader execution. The instrumentation
21526 ///is later bound to command buffers with
21527 ///`cmd_begin_shader_instrumentation_arm`.
21528 ///
21529 ///Requires `VK_ARM_shader_instrumentation`.
21530 pub unsafe fn create_shader_instrumentation_arm(
21531 &self,
21532 p_create_info: &ShaderInstrumentationCreateInfoARM,
21533 allocator: Option<&AllocationCallbacks>,
21534 ) -> VkResult<ShaderInstrumentationARM> {
21535 let fp = self
21536 .commands()
21537 .create_shader_instrumentation_arm
21538 .expect("vkCreateShaderInstrumentationARM not loaded");
21539 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
21540 let mut out = unsafe { core::mem::zeroed() };
21541 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
21542 Ok(out)
21543 }
21544 ///Wraps [`vkDestroyShaderInstrumentationARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyShaderInstrumentationARM.html).
21545 /**
21546 Provided by **VK_ARM_shader_instrumentation**.*/
21547 ///
21548 ///# Safety
21549 ///- `device` (self) must be valid and not destroyed.
21550 ///- `instrumentation` must be externally synchronized.
21551 ///
21552 ///# Panics
21553 ///Panics if `vkDestroyShaderInstrumentationARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21554 ///
21555 ///# Usage Notes
21556 ///
21557 ///Destroys a shader instrumentation object. The object must not be
21558 ///in use by any command buffer.
21559 ///
21560 ///Requires `VK_ARM_shader_instrumentation`.
21561 pub unsafe fn destroy_shader_instrumentation_arm(
21562 &self,
21563 instrumentation: ShaderInstrumentationARM,
21564 allocator: Option<&AllocationCallbacks>,
21565 ) {
21566 let fp = self
21567 .commands()
21568 .destroy_shader_instrumentation_arm
21569 .expect("vkDestroyShaderInstrumentationARM not loaded");
21570 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
21571 unsafe { fp(self.handle(), instrumentation, alloc_ptr) };
21572 }
21573 ///Wraps [`vkCmdBeginShaderInstrumentationARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginShaderInstrumentationARM.html).
21574 /**
21575 Provided by **VK_ARM_shader_instrumentation**.*/
21576 ///
21577 ///# Safety
21578 ///- `commandBuffer` (self) must be valid and not destroyed.
21579 ///- `commandBuffer` must be externally synchronized.
21580 ///- `instrumentation` must be externally synchronized.
21581 ///
21582 ///# Panics
21583 ///Panics if `vkCmdBeginShaderInstrumentationARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21584 ///
21585 ///# Usage Notes
21586 ///
21587 ///Begins shader instrumentation collection in a command buffer.
21588 ///All subsequent draw and dispatch commands will collect the
21589 ///metrics configured in the instrumentation object until
21590 ///`cmd_end_shader_instrumentation_arm` is called.
21591 ///
21592 ///Requires `VK_ARM_shader_instrumentation`.
21593 pub unsafe fn cmd_begin_shader_instrumentation_arm(
21594 &self,
21595 command_buffer: CommandBuffer,
21596 instrumentation: ShaderInstrumentationARM,
21597 ) {
21598 let fp = self
21599 .commands()
21600 .cmd_begin_shader_instrumentation_arm
21601 .expect("vkCmdBeginShaderInstrumentationARM not loaded");
21602 unsafe { fp(command_buffer, instrumentation) };
21603 }
21604 ///Wraps [`vkCmdEndShaderInstrumentationARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndShaderInstrumentationARM.html).
21605 /**
21606 Provided by **VK_ARM_shader_instrumentation**.*/
21607 ///
21608 ///# Safety
21609 ///- `commandBuffer` (self) must be valid and not destroyed.
21610 ///- `commandBuffer` must be externally synchronized.
21611 ///
21612 ///# Panics
21613 ///Panics if `vkCmdEndShaderInstrumentationARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21614 ///
21615 ///# Usage Notes
21616 ///
21617 ///Ends shader instrumentation collection in a command buffer.
21618 ///Metrics collected since the matching
21619 ///`cmd_begin_shader_instrumentation_arm` can be retrieved with
21620 ///`get_shader_instrumentation_values_arm` after submission
21621 ///completes.
21622 ///
21623 ///Requires `VK_ARM_shader_instrumentation`.
21624 pub unsafe fn cmd_end_shader_instrumentation_arm(&self, command_buffer: CommandBuffer) {
21625 let fp = self
21626 .commands()
21627 .cmd_end_shader_instrumentation_arm
21628 .expect("vkCmdEndShaderInstrumentationARM not loaded");
21629 unsafe { fp(command_buffer) };
21630 }
21631 ///Wraps [`vkGetShaderInstrumentationValuesARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetShaderInstrumentationValuesARM.html).
21632 /**
21633 Provided by **VK_ARM_shader_instrumentation**.*/
21634 ///
21635 ///# Errors
21636 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21637 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
21638 ///- `VK_ERROR_UNKNOWN`
21639 ///- `VK_ERROR_VALIDATION_FAILED`
21640 ///
21641 ///# Safety
21642 ///- `device` (self) must be valid and not destroyed.
21643 ///
21644 ///# Panics
21645 ///Panics if `vkGetShaderInstrumentationValuesARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21646 ///
21647 ///# Usage Notes
21648 ///
21649 ///Retrieves collected shader instrumentation metric values after
21650 ///instrumented commands have completed execution. Returns metric
21651 ///blocks whose count is written to `p_metric_block_count`. Ensure
21652 ///the instrumented submission has finished before querying.
21653 ///
21654 ///Requires `VK_ARM_shader_instrumentation`.
21655 pub unsafe fn get_shader_instrumentation_values_arm(
21656 &self,
21657 instrumentation: ShaderInstrumentationARM,
21658 p_metric_block_count: *mut u32,
21659 flags: ShaderInstrumentationValuesFlagsARM,
21660 ) -> VkResult<core::ffi::c_void> {
21661 let fp = self
21662 .commands()
21663 .get_shader_instrumentation_values_arm
21664 .expect("vkGetShaderInstrumentationValuesARM not loaded");
21665 let mut out = unsafe { core::mem::zeroed() };
21666 check(unsafe {
21667 fp(
21668 self.handle(),
21669 instrumentation,
21670 p_metric_block_count,
21671 &mut out,
21672 flags,
21673 )
21674 })?;
21675 Ok(out)
21676 }
21677 ///Wraps [`vkClearShaderInstrumentationMetricsARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkClearShaderInstrumentationMetricsARM.html).
21678 /**
21679 Provided by **VK_ARM_shader_instrumentation**.*/
21680 ///
21681 ///# Safety
21682 ///- `device` (self) must be valid and not destroyed.
21683 ///
21684 ///# Panics
21685 ///Panics if `vkClearShaderInstrumentationMetricsARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21686 ///
21687 ///# Usage Notes
21688 ///
21689 ///Resets accumulated metrics for a shader instrumentation object.
21690 ///Call between frames or profiling sessions to start collecting
21691 ///fresh data without destroying and recreating the object.
21692 ///
21693 ///Requires `VK_ARM_shader_instrumentation`.
21694 pub unsafe fn clear_shader_instrumentation_metrics_arm(
21695 &self,
21696 instrumentation: ShaderInstrumentationARM,
21697 ) {
21698 let fp = self
21699 .commands()
21700 .clear_shader_instrumentation_metrics_arm
21701 .expect("vkClearShaderInstrumentationMetricsARM not loaded");
21702 unsafe { fp(self.handle(), instrumentation) };
21703 }
21704 ///Wraps [`vkCreateTensorARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateTensorARM.html).
21705 /**
21706 Provided by **VK_ARM_tensors**.*/
21707 ///
21708 ///# Errors
21709 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21710 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
21711 ///- `VK_ERROR_UNKNOWN`
21712 ///- `VK_ERROR_VALIDATION_FAILED`
21713 ///
21714 ///# Safety
21715 ///- `device` (self) must be valid and not destroyed.
21716 ///
21717 ///# Panics
21718 ///Panics if `vkCreateTensorARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21719 ///
21720 ///# Usage Notes
21721 ///
21722 ///Creates a tensor object for ARM's tensor extension. Tensors are
21723 ///multi-dimensional arrays with a defined format, dimensions, and
21724 ///usage flags. Must be bound to memory before use, similar to
21725 ///images and buffers.
21726 ///
21727 ///Requires `VK_ARM_tensors`.
21728 pub unsafe fn create_tensor_arm(
21729 &self,
21730 p_create_info: &TensorCreateInfoARM,
21731 allocator: Option<&AllocationCallbacks>,
21732 ) -> VkResult<TensorARM> {
21733 let fp = self
21734 .commands()
21735 .create_tensor_arm
21736 .expect("vkCreateTensorARM not loaded");
21737 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
21738 let mut out = unsafe { core::mem::zeroed() };
21739 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
21740 Ok(out)
21741 }
21742 ///Wraps [`vkDestroyTensorARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyTensorARM.html).
21743 /**
21744 Provided by **VK_ARM_tensors**.*/
21745 ///
21746 ///# Safety
21747 ///- `device` (self) must be valid and not destroyed.
21748 ///- `tensor` must be externally synchronized.
21749 ///
21750 ///# Panics
21751 ///Panics if `vkDestroyTensorARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21752 ///
21753 ///# Usage Notes
21754 ///
21755 ///Destroys a tensor object. The tensor must not be in use by any
21756 ///command buffer or referenced by any tensor view.
21757 ///
21758 ///Requires `VK_ARM_tensors`.
21759 pub unsafe fn destroy_tensor_arm(
21760 &self,
21761 tensor: TensorARM,
21762 allocator: Option<&AllocationCallbacks>,
21763 ) {
21764 let fp = self
21765 .commands()
21766 .destroy_tensor_arm
21767 .expect("vkDestroyTensorARM not loaded");
21768 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
21769 unsafe { fp(self.handle(), tensor, alloc_ptr) };
21770 }
21771 ///Wraps [`vkCreateTensorViewARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateTensorViewARM.html).
21772 /**
21773 Provided by **VK_ARM_tensors**.*/
21774 ///
21775 ///# Errors
21776 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21777 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
21778 ///- `VK_ERROR_UNKNOWN`
21779 ///- `VK_ERROR_VALIDATION_FAILED`
21780 ///
21781 ///# Safety
21782 ///- `device` (self) must be valid and not destroyed.
21783 ///
21784 ///# Panics
21785 ///Panics if `vkCreateTensorViewARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21786 ///
21787 ///# Usage Notes
21788 ///
21789 ///Creates a view into a tensor, analogous to image views. A tensor
21790 ///view selects a subset of the tensor's dimensions or reinterprets
21791 ///its format for use in descriptors and shaders.
21792 ///
21793 ///Requires `VK_ARM_tensors`.
21794 pub unsafe fn create_tensor_view_arm(
21795 &self,
21796 p_create_info: &TensorViewCreateInfoARM,
21797 allocator: Option<&AllocationCallbacks>,
21798 ) -> VkResult<TensorViewARM> {
21799 let fp = self
21800 .commands()
21801 .create_tensor_view_arm
21802 .expect("vkCreateTensorViewARM not loaded");
21803 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
21804 let mut out = unsafe { core::mem::zeroed() };
21805 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
21806 Ok(out)
21807 }
21808 ///Wraps [`vkDestroyTensorViewARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyTensorViewARM.html).
21809 /**
21810 Provided by **VK_ARM_tensors**.*/
21811 ///
21812 ///# Safety
21813 ///- `device` (self) must be valid and not destroyed.
21814 ///- `tensorView` must be externally synchronized.
21815 ///
21816 ///# Panics
21817 ///Panics if `vkDestroyTensorViewARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21818 ///
21819 ///# Usage Notes
21820 ///
21821 ///Destroys a tensor view. The view must not be in use by any
21822 ///command buffer or referenced by any descriptor set.
21823 ///
21824 ///Requires `VK_ARM_tensors`.
21825 pub unsafe fn destroy_tensor_view_arm(
21826 &self,
21827 tensor_view: TensorViewARM,
21828 allocator: Option<&AllocationCallbacks>,
21829 ) {
21830 let fp = self
21831 .commands()
21832 .destroy_tensor_view_arm
21833 .expect("vkDestroyTensorViewARM not loaded");
21834 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
21835 unsafe { fp(self.handle(), tensor_view, alloc_ptr) };
21836 }
21837 ///Wraps [`vkGetTensorMemoryRequirementsARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetTensorMemoryRequirementsARM.html).
21838 /**
21839 Provided by **VK_ARM_tensors**.*/
21840 ///
21841 ///# Safety
21842 ///- `device` (self) must be valid and not destroyed.
21843 ///
21844 ///# Panics
21845 ///Panics if `vkGetTensorMemoryRequirementsARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21846 ///
21847 ///# Usage Notes
21848 ///
21849 ///Queries the memory requirements (size, alignment, memory type
21850 ///bits) for an existing tensor object. Call before
21851 ///`bind_tensor_memory_arm` to determine the allocation needed.
21852 ///
21853 ///Requires `VK_ARM_tensors`.
21854 pub unsafe fn get_tensor_memory_requirements_arm(
21855 &self,
21856 p_info: &TensorMemoryRequirementsInfoARM,
21857 p_memory_requirements: &mut MemoryRequirements2,
21858 ) {
21859 let fp = self
21860 .commands()
21861 .get_tensor_memory_requirements_arm
21862 .expect("vkGetTensorMemoryRequirementsARM not loaded");
21863 unsafe { fp(self.handle(), p_info, p_memory_requirements) };
21864 }
21865 ///Wraps [`vkBindTensorMemoryARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBindTensorMemoryARM.html).
21866 /**
21867 Provided by **VK_ARM_tensors**.*/
21868 ///
21869 ///# Errors
21870 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21871 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
21872 ///- `VK_ERROR_UNKNOWN`
21873 ///- `VK_ERROR_VALIDATION_FAILED`
21874 ///
21875 ///# Safety
21876 ///- `device` (self) must be valid and not destroyed.
21877 ///
21878 ///# Panics
21879 ///Panics if `vkBindTensorMemoryARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21880 ///
21881 ///# Usage Notes
21882 ///
21883 ///Binds device memory to one or more tensors. Each bind info
21884 ///specifies the tensor, memory, and offset. Must be called before
21885 ///the tensor is used in any command. Similar to
21886 ///`bind_buffer_memory2` / `bind_image_memory2`.
21887 ///
21888 ///Requires `VK_ARM_tensors`.
21889 pub unsafe fn bind_tensor_memory_arm(
21890 &self,
21891 p_bind_infos: &[BindTensorMemoryInfoARM],
21892 ) -> VkResult<()> {
21893 let fp = self
21894 .commands()
21895 .bind_tensor_memory_arm
21896 .expect("vkBindTensorMemoryARM not loaded");
21897 check(unsafe {
21898 fp(
21899 self.handle(),
21900 p_bind_infos.len() as u32,
21901 p_bind_infos.as_ptr(),
21902 )
21903 })
21904 }
21905 ///Wraps [`vkGetDeviceTensorMemoryRequirementsARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceTensorMemoryRequirementsARM.html).
21906 /**
21907 Provided by **VK_ARM_tensors**.*/
21908 ///
21909 ///# Safety
21910 ///- `device` (self) must be valid and not destroyed.
21911 ///
21912 ///# Panics
21913 ///Panics if `vkGetDeviceTensorMemoryRequirementsARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21914 ///
21915 ///# Usage Notes
21916 ///
21917 ///Queries memory requirements for a tensor described by its create
21918 ///info, without creating the tensor first. Analogous to
21919 ///`get_device_buffer_memory_requirements` /
21920 ///`get_device_image_memory_requirements`.
21921 ///
21922 ///Requires `VK_ARM_tensors`.
21923 pub unsafe fn get_device_tensor_memory_requirements_arm(
21924 &self,
21925 p_info: &DeviceTensorMemoryRequirementsARM,
21926 p_memory_requirements: &mut MemoryRequirements2,
21927 ) {
21928 let fp = self
21929 .commands()
21930 .get_device_tensor_memory_requirements_arm
21931 .expect("vkGetDeviceTensorMemoryRequirementsARM not loaded");
21932 unsafe { fp(self.handle(), p_info, p_memory_requirements) };
21933 }
21934 ///Wraps [`vkCmdCopyTensorARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyTensorARM.html).
21935 /**
21936 Provided by **VK_ARM_tensors**.*/
21937 ///
21938 ///# Safety
21939 ///- `commandBuffer` (self) must be valid and not destroyed.
21940 ///- `commandBuffer` must be externally synchronized.
21941 ///
21942 ///# Panics
21943 ///Panics if `vkCmdCopyTensorARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21944 ///
21945 ///# Usage Notes
21946 ///
21947 ///Copies data between tensors or between a tensor and a buffer.
21948 ///The copy info structure specifies the source and destination
21949 ///regions, similar to `cmd_copy_buffer` or `cmd_copy_image`.
21950 ///
21951 ///Requires `VK_ARM_tensors`.
21952 pub unsafe fn cmd_copy_tensor_arm(
21953 &self,
21954 command_buffer: CommandBuffer,
21955 p_copy_tensor_info: &CopyTensorInfoARM,
21956 ) {
21957 let fp = self
21958 .commands()
21959 .cmd_copy_tensor_arm
21960 .expect("vkCmdCopyTensorARM not loaded");
21961 unsafe { fp(command_buffer, p_copy_tensor_info) };
21962 }
21963 ///Wraps [`vkGetTensorOpaqueCaptureDescriptorDataARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetTensorOpaqueCaptureDescriptorDataARM.html).
21964 /**
21965 Provided by **VK_ARM_tensors**.*/
21966 ///
21967 ///# Errors
21968 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21969 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
21970 ///- `VK_ERROR_UNKNOWN`
21971 ///- `VK_ERROR_VALIDATION_FAILED`
21972 ///
21973 ///# Safety
21974 ///- `device` (self) must be valid and not destroyed.
21975 ///
21976 ///# Panics
21977 ///Panics if `vkGetTensorOpaqueCaptureDescriptorDataARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21978 ///
21979 ///# Usage Notes
21980 ///
21981 ///Retrieves opaque capture data for a tensor's descriptor, used
21982 ///for descriptor buffer capture and replay. The returned data can
21983 ///be stored and replayed to recreate an equivalent descriptor.
21984 ///
21985 ///Requires `VK_ARM_tensors` + `VK_EXT_descriptor_buffer`.
21986 pub unsafe fn get_tensor_opaque_capture_descriptor_data_arm(
21987 &self,
21988 p_info: &TensorCaptureDescriptorDataInfoARM,
21989 ) -> VkResult<core::ffi::c_void> {
21990 let fp = self
21991 .commands()
21992 .get_tensor_opaque_capture_descriptor_data_arm
21993 .expect("vkGetTensorOpaqueCaptureDescriptorDataARM not loaded");
21994 let mut out = unsafe { core::mem::zeroed() };
21995 check(unsafe { fp(self.handle(), p_info, &mut out) })?;
21996 Ok(out)
21997 }
21998 ///Wraps [`vkGetTensorViewOpaqueCaptureDescriptorDataARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetTensorViewOpaqueCaptureDescriptorDataARM.html).
21999 /**
22000 Provided by **VK_ARM_tensors**.*/
22001 ///
22002 ///# Errors
22003 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22004 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22005 ///- `VK_ERROR_UNKNOWN`
22006 ///- `VK_ERROR_VALIDATION_FAILED`
22007 ///
22008 ///# Safety
22009 ///- `device` (self) must be valid and not destroyed.
22010 ///
22011 ///# Panics
22012 ///Panics if `vkGetTensorViewOpaqueCaptureDescriptorDataARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22013 ///
22014 ///# Usage Notes
22015 ///
22016 ///Retrieves opaque capture data for a tensor view's descriptor,
22017 ///used for descriptor buffer capture and replay. Similar to
22018 ///`get_tensor_opaque_capture_descriptor_data_arm` but for tensor
22019 ///views.
22020 ///
22021 ///Requires `VK_ARM_tensors` + `VK_EXT_descriptor_buffer`.
22022 pub unsafe fn get_tensor_view_opaque_capture_descriptor_data_arm(
22023 &self,
22024 p_info: &TensorViewCaptureDescriptorDataInfoARM,
22025 ) -> VkResult<core::ffi::c_void> {
22026 let fp = self
22027 .commands()
22028 .get_tensor_view_opaque_capture_descriptor_data_arm
22029 .expect("vkGetTensorViewOpaqueCaptureDescriptorDataARM not loaded");
22030 let mut out = unsafe { core::mem::zeroed() };
22031 check(unsafe { fp(self.handle(), p_info, &mut out) })?;
22032 Ok(out)
22033 }
22034 ///Wraps [`vkCreateDataGraphPipelinesARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateDataGraphPipelinesARM.html).
22035 /**
22036 Provided by **VK_ARM_data_graph**.*/
22037 ///
22038 ///# Errors
22039 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22040 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22041 ///- `VK_ERROR_UNKNOWN`
22042 ///- `VK_ERROR_VALIDATION_FAILED`
22043 ///
22044 ///# Safety
22045 ///- `device` (self) must be valid and not destroyed.
22046 ///
22047 ///# Panics
22048 ///Panics if `vkCreateDataGraphPipelinesARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22049 ///
22050 ///# Usage Notes
22051 ///
22052 ///Creates one or more data graph pipelines for ARM's data graph
22053 ///extension. Supports deferred compilation via a
22054 ///`DeferredOperationKHR` handle and pipeline caching. Data graph
22055 ///pipelines define GPU-side data processing graphs.
22056 ///
22057 ///Requires `VK_ARM_data_graph`.
22058 pub unsafe fn create_data_graph_pipelines_arm(
22059 &self,
22060 deferred_operation: DeferredOperationKHR,
22061 pipeline_cache: PipelineCache,
22062 p_create_infos: &[DataGraphPipelineCreateInfoARM],
22063 allocator: Option<&AllocationCallbacks>,
22064 ) -> VkResult<Vec<Pipeline>> {
22065 let fp = self
22066 .commands()
22067 .create_data_graph_pipelines_arm
22068 .expect("vkCreateDataGraphPipelinesARM not loaded");
22069 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
22070 let count = p_create_infos.len();
22071 let mut out = vec![unsafe { core::mem::zeroed() }; count];
22072 check(unsafe {
22073 fp(
22074 self.handle(),
22075 deferred_operation,
22076 pipeline_cache,
22077 p_create_infos.len() as u32,
22078 p_create_infos.as_ptr(),
22079 alloc_ptr,
22080 out.as_mut_ptr(),
22081 )
22082 })?;
22083 Ok(out)
22084 }
22085 ///Wraps [`vkCreateDataGraphPipelineSessionARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateDataGraphPipelineSessionARM.html).
22086 /**
22087 Provided by **VK_ARM_data_graph**.*/
22088 ///
22089 ///# Errors
22090 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22091 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22092 ///- `VK_ERROR_UNKNOWN`
22093 ///- `VK_ERROR_VALIDATION_FAILED`
22094 ///
22095 ///# Safety
22096 ///- `device` (self) must be valid and not destroyed.
22097 ///
22098 ///# Panics
22099 ///Panics if `vkCreateDataGraphPipelineSessionARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22100 ///
22101 ///# Usage Notes
22102 ///
22103 ///Creates a session for executing a data graph pipeline. A session
22104 ///holds the runtime state and memory bindings needed to dispatch
22105 ///the graph. Must be bound to memory before dispatch.
22106 ///
22107 ///Requires `VK_ARM_data_graph`.
22108 pub unsafe fn create_data_graph_pipeline_session_arm(
22109 &self,
22110 p_create_info: &DataGraphPipelineSessionCreateInfoARM,
22111 allocator: Option<&AllocationCallbacks>,
22112 ) -> VkResult<DataGraphPipelineSessionARM> {
22113 let fp = self
22114 .commands()
22115 .create_data_graph_pipeline_session_arm
22116 .expect("vkCreateDataGraphPipelineSessionARM not loaded");
22117 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
22118 let mut out = unsafe { core::mem::zeroed() };
22119 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
22120 Ok(out)
22121 }
22122 ///Wraps [`vkGetDataGraphPipelineSessionBindPointRequirementsARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDataGraphPipelineSessionBindPointRequirementsARM.html).
22123 /**
22124 Provided by **VK_ARM_data_graph**.*/
22125 ///
22126 ///# Errors
22127 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22128 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22129 ///- `VK_ERROR_UNKNOWN`
22130 ///- `VK_ERROR_VALIDATION_FAILED`
22131 ///
22132 ///# Safety
22133 ///- `device` (self) must be valid and not destroyed.
22134 ///
22135 ///# Panics
22136 ///Panics if `vkGetDataGraphPipelineSessionBindPointRequirementsARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22137 ///
22138 ///# Usage Notes
22139 ///
22140 ///Queries the memory bind point requirements for a data graph
22141 ///pipeline session. Uses the two-call idiom. Each returned
22142 ///requirement describes a bind point that must be satisfied with
22143 ///`bind_data_graph_pipeline_session_memory_arm` before dispatch.
22144 ///
22145 ///Requires `VK_ARM_data_graph`.
22146 pub unsafe fn get_data_graph_pipeline_session_bind_point_requirements_arm(
22147 &self,
22148 p_info: &DataGraphPipelineSessionBindPointRequirementsInfoARM,
22149 ) -> VkResult<Vec<DataGraphPipelineSessionBindPointRequirementARM>> {
22150 let fp = self
22151 .commands()
22152 .get_data_graph_pipeline_session_bind_point_requirements_arm
22153 .expect("vkGetDataGraphPipelineSessionBindPointRequirementsARM not loaded");
22154 enumerate_two_call(|count, data| unsafe { fp(self.handle(), p_info, count, data) })
22155 }
22156 ///Wraps [`vkGetDataGraphPipelineSessionMemoryRequirementsARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDataGraphPipelineSessionMemoryRequirementsARM.html).
22157 /**
22158 Provided by **VK_ARM_data_graph**.*/
22159 ///
22160 ///# Safety
22161 ///- `device` (self) must be valid and not destroyed.
22162 ///
22163 ///# Panics
22164 ///Panics if `vkGetDataGraphPipelineSessionMemoryRequirementsARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22165 ///
22166 ///# Usage Notes
22167 ///
22168 ///Queries the memory requirements for a specific bind point within
22169 ///a data graph pipeline session. Returns a `MemoryRequirements2`
22170 ///describing the size, alignment, and compatible memory types.
22171 ///
22172 ///Requires `VK_ARM_data_graph`.
22173 pub unsafe fn get_data_graph_pipeline_session_memory_requirements_arm(
22174 &self,
22175 p_info: &DataGraphPipelineSessionMemoryRequirementsInfoARM,
22176 p_memory_requirements: &mut MemoryRequirements2,
22177 ) {
22178 let fp = self
22179 .commands()
22180 .get_data_graph_pipeline_session_memory_requirements_arm
22181 .expect("vkGetDataGraphPipelineSessionMemoryRequirementsARM not loaded");
22182 unsafe { fp(self.handle(), p_info, p_memory_requirements) };
22183 }
22184 ///Wraps [`vkBindDataGraphPipelineSessionMemoryARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBindDataGraphPipelineSessionMemoryARM.html).
22185 /**
22186 Provided by **VK_ARM_data_graph**.*/
22187 ///
22188 ///# Errors
22189 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22190 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22191 ///- `VK_ERROR_UNKNOWN`
22192 ///- `VK_ERROR_VALIDATION_FAILED`
22193 ///
22194 ///# Safety
22195 ///- `device` (self) must be valid and not destroyed.
22196 ///
22197 ///# Panics
22198 ///Panics if `vkBindDataGraphPipelineSessionMemoryARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22199 ///
22200 ///# Usage Notes
22201 ///
22202 ///Binds device memory to a data graph pipeline session at the bind
22203 ///points returned by
22204 ///`get_data_graph_pipeline_session_bind_point_requirements_arm`.
22205 ///Must be called before dispatching the session.
22206 ///
22207 ///Requires `VK_ARM_data_graph`.
22208 pub unsafe fn bind_data_graph_pipeline_session_memory_arm(
22209 &self,
22210 p_bind_infos: &[BindDataGraphPipelineSessionMemoryInfoARM],
22211 ) -> VkResult<()> {
22212 let fp = self
22213 .commands()
22214 .bind_data_graph_pipeline_session_memory_arm
22215 .expect("vkBindDataGraphPipelineSessionMemoryARM not loaded");
22216 check(unsafe {
22217 fp(
22218 self.handle(),
22219 p_bind_infos.len() as u32,
22220 p_bind_infos.as_ptr(),
22221 )
22222 })
22223 }
22224 ///Wraps [`vkDestroyDataGraphPipelineSessionARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyDataGraphPipelineSessionARM.html).
22225 /**
22226 Provided by **VK_ARM_data_graph**.*/
22227 ///
22228 ///# Safety
22229 ///- `device` (self) must be valid and not destroyed.
22230 ///- `session` must be externally synchronized.
22231 ///
22232 ///# Panics
22233 ///Panics if `vkDestroyDataGraphPipelineSessionARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22234 ///
22235 ///# Usage Notes
22236 ///
22237 ///Destroys a data graph pipeline session and frees associated host
22238 ///resources. The session must not be in use by any command buffer.
22239 ///
22240 ///Requires `VK_ARM_data_graph`.
22241 pub unsafe fn destroy_data_graph_pipeline_session_arm(
22242 &self,
22243 session: DataGraphPipelineSessionARM,
22244 allocator: Option<&AllocationCallbacks>,
22245 ) {
22246 let fp = self
22247 .commands()
22248 .destroy_data_graph_pipeline_session_arm
22249 .expect("vkDestroyDataGraphPipelineSessionARM not loaded");
22250 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
22251 unsafe { fp(self.handle(), session, alloc_ptr) };
22252 }
22253 ///Wraps [`vkCmdDispatchDataGraphARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDispatchDataGraphARM.html).
22254 /**
22255 Provided by **VK_ARM_data_graph**.*/
22256 ///
22257 ///# Safety
22258 ///- `commandBuffer` (self) must be valid and not destroyed.
22259 ///- `commandBuffer` must be externally synchronized.
22260 ///
22261 ///# Panics
22262 ///Panics if `vkCmdDispatchDataGraphARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22263 ///
22264 ///# Usage Notes
22265 ///
22266 ///Records a data graph pipeline dispatch into a command buffer.
22267 ///The session must have been created and bound to memory before
22268 ///dispatch. Optional dispatch info can configure execution
22269 ///parameters.
22270 ///
22271 ///Requires `VK_ARM_data_graph`.
22272 pub unsafe fn cmd_dispatch_data_graph_arm(
22273 &self,
22274 command_buffer: CommandBuffer,
22275 session: DataGraphPipelineSessionARM,
22276 p_info: Option<&DataGraphPipelineDispatchInfoARM>,
22277 ) {
22278 let fp = self
22279 .commands()
22280 .cmd_dispatch_data_graph_arm
22281 .expect("vkCmdDispatchDataGraphARM not loaded");
22282 let p_info_ptr = p_info.map_or(core::ptr::null(), core::ptr::from_ref);
22283 unsafe { fp(command_buffer, session, p_info_ptr) };
22284 }
22285 ///Wraps [`vkGetDataGraphPipelineAvailablePropertiesARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDataGraphPipelineAvailablePropertiesARM.html).
22286 /**
22287 Provided by **VK_ARM_data_graph**.*/
22288 ///
22289 ///# Errors
22290 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22291 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22292 ///- `VK_ERROR_UNKNOWN`
22293 ///- `VK_ERROR_VALIDATION_FAILED`
22294 ///
22295 ///# Safety
22296 ///- `device` (self) must be valid and not destroyed.
22297 ///
22298 ///# Panics
22299 ///Panics if `vkGetDataGraphPipelineAvailablePropertiesARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22300 ///
22301 ///# Usage Notes
22302 ///
22303 ///Enumerates the queryable properties for a data graph pipeline.
22304 ///Uses the two-call idiom. The returned property descriptors can
22305 ///then be queried with `get_data_graph_pipeline_properties_arm`.
22306 ///
22307 ///Requires `VK_ARM_data_graph`.
22308 pub unsafe fn get_data_graph_pipeline_available_properties_arm(
22309 &self,
22310 p_pipeline_info: &DataGraphPipelineInfoARM,
22311 ) -> VkResult<Vec<DataGraphPipelinePropertyARM>> {
22312 let fp = self
22313 .commands()
22314 .get_data_graph_pipeline_available_properties_arm
22315 .expect("vkGetDataGraphPipelineAvailablePropertiesARM not loaded");
22316 enumerate_two_call(|count, data| unsafe { fp(self.handle(), p_pipeline_info, count, data) })
22317 }
22318 ///Wraps [`vkGetDataGraphPipelinePropertiesARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDataGraphPipelinePropertiesARM.html).
22319 /**
22320 Provided by **VK_ARM_data_graph**.*/
22321 ///
22322 ///# Errors
22323 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22324 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22325 ///- `VK_ERROR_UNKNOWN`
22326 ///- `VK_ERROR_VALIDATION_FAILED`
22327 ///
22328 ///# Safety
22329 ///- `device` (self) must be valid and not destroyed.
22330 ///
22331 ///# Panics
22332 ///Panics if `vkGetDataGraphPipelinePropertiesARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22333 ///
22334 ///# Usage Notes
22335 ///
22336 ///Queries specific property values for a data graph pipeline.
22337 ///First enumerate available properties with
22338 ///`get_data_graph_pipeline_available_properties_arm`, then query
22339 ///the ones you need.
22340 ///
22341 ///Requires `VK_ARM_data_graph`.
22342 pub unsafe fn get_data_graph_pipeline_properties_arm(
22343 &self,
22344 p_pipeline_info: &DataGraphPipelineInfoARM,
22345 properties_count: u32,
22346 p_properties: *mut DataGraphPipelinePropertyQueryResultARM,
22347 ) -> VkResult<()> {
22348 let fp = self
22349 .commands()
22350 .get_data_graph_pipeline_properties_arm
22351 .expect("vkGetDataGraphPipelinePropertiesARM not loaded");
22352 check(unsafe {
22353 fp(
22354 self.handle(),
22355 p_pipeline_info,
22356 properties_count,
22357 p_properties,
22358 )
22359 })
22360 }
22361 ///Wraps [`vkGetNativeBufferPropertiesOHOS`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetNativeBufferPropertiesOHOS.html).
22362 /**
22363 Provided by **VK_OHOS_external_memory**.*/
22364 ///
22365 ///# Errors
22366 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22367 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR`
22368 ///- `VK_ERROR_UNKNOWN`
22369 ///- `VK_ERROR_VALIDATION_FAILED`
22370 ///
22371 ///# Safety
22372 ///- `device` (self) must be valid and not destroyed.
22373 ///
22374 ///# Panics
22375 ///Panics if `vkGetNativeBufferPropertiesOHOS` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22376 ///
22377 ///# Usage Notes
22378 ///
22379 ///Queries Vulkan memory properties (memory type bits, size) for
22380 ///an OHOS native buffer. Use before importing external memory to
22381 ///determine compatible memory types. OHOS only.
22382 ///
22383 ///Requires `VK_OHOS_external_memory`.
22384 pub unsafe fn get_native_buffer_properties_ohos(
22385 &self,
22386 buffer: *const core::ffi::c_void,
22387 p_properties: &mut NativeBufferPropertiesOHOS,
22388 ) -> VkResult<()> {
22389 let fp = self
22390 .commands()
22391 .get_native_buffer_properties_ohos
22392 .expect("vkGetNativeBufferPropertiesOHOS not loaded");
22393 check(unsafe { fp(self.handle(), buffer, p_properties) })
22394 }
22395 ///Wraps [`vkGetMemoryNativeBufferOHOS`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryNativeBufferOHOS.html).
22396 /**
22397 Provided by **VK_OHOS_external_memory**.*/
22398 ///
22399 ///# Errors
22400 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22401 ///- `VK_ERROR_UNKNOWN`
22402 ///- `VK_ERROR_VALIDATION_FAILED`
22403 ///
22404 ///# Safety
22405 ///- `device` (self) must be valid and not destroyed.
22406 ///
22407 ///# Panics
22408 ///Panics if `vkGetMemoryNativeBufferOHOS` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22409 ///
22410 ///# Usage Notes
22411 ///
22412 ///Exports a Vulkan device memory allocation as an OHOS native
22413 ///buffer handle for sharing with other OpenHarmony services.
22414 ///OHOS only.
22415 ///
22416 ///Requires `VK_OHOS_external_memory`.
22417 pub unsafe fn get_memory_native_buffer_ohos(
22418 &self,
22419 p_info: &MemoryGetNativeBufferInfoOHOS,
22420 p_buffer: *mut *mut core::ffi::c_void,
22421 ) -> VkResult<()> {
22422 let fp = self
22423 .commands()
22424 .get_memory_native_buffer_ohos
22425 .expect("vkGetMemoryNativeBufferOHOS not loaded");
22426 check(unsafe { fp(self.handle(), p_info, p_buffer) })
22427 }
22428 ///Wraps [`vkGetSwapchainGrallocUsageOHOS`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSwapchainGrallocUsageOHOS.html).
22429 ///
22430 ///# Errors
22431 ///- `VK_ERROR_INITIALIZATION_FAILED`
22432 ///- `VK_ERROR_UNKNOWN`
22433 ///- `VK_ERROR_VALIDATION_FAILED`
22434 ///
22435 ///# Safety
22436 ///- `device` (self) must be valid and not destroyed.
22437 ///
22438 ///# Panics
22439 ///Panics if `vkGetSwapchainGrallocUsageOHOS` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22440 ///
22441 ///# Usage Notes
22442 ///
22443 ///Queries the OHOS gralloc usage flags needed for swapchain images
22444 ///with the given format and Vulkan image usage. Used internally by
22445 ///the OHOS WSI implementation. OHOS only.
22446 ///
22447 ///Requires `VK_OHOS_native_buffer`.
22448 pub unsafe fn get_swapchain_gralloc_usage_ohos(
22449 &self,
22450 format: Format,
22451 image_usage: ImageUsageFlags,
22452 ) -> VkResult<u64> {
22453 let fp = self
22454 .commands()
22455 .get_swapchain_gralloc_usage_ohos
22456 .expect("vkGetSwapchainGrallocUsageOHOS not loaded");
22457 let mut out = unsafe { core::mem::zeroed() };
22458 check(unsafe { fp(self.handle(), format, image_usage, &mut out) })?;
22459 Ok(out)
22460 }
22461 ///Wraps [`vkAcquireImageOHOS`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAcquireImageOHOS.html).
22462 ///
22463 ///# Errors
22464 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22465 ///- `VK_ERROR_UNKNOWN`
22466 ///- `VK_ERROR_VALIDATION_FAILED`
22467 ///
22468 ///# Safety
22469 ///- `device` (self) must be valid and not destroyed.
22470 ///
22471 ///# Panics
22472 ///Panics if `vkAcquireImageOHOS` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22473 ///
22474 ///# Usage Notes
22475 ///
22476 ///Acquires ownership of a swapchain image on OpenHarmony OS.
22477 ///Takes a native fence file descriptor for synchronisation and
22478 ///can signal a Vulkan semaphore or fence on completion. OHOS only.
22479 ///
22480 ///Requires `VK_OHOS_native_buffer`.
22481 pub unsafe fn acquire_image_ohos(
22482 &self,
22483 image: Image,
22484 native_fence_fd: i32,
22485 semaphore: Semaphore,
22486 fence: Fence,
22487 ) -> VkResult<()> {
22488 let fp = self
22489 .commands()
22490 .acquire_image_ohos
22491 .expect("vkAcquireImageOHOS not loaded");
22492 check(unsafe { fp(self.handle(), image, native_fence_fd, semaphore, fence) })
22493 }
22494 ///Wraps [`vkQueueSignalReleaseImageOHOS`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueSignalReleaseImageOHOS.html).
22495 ///
22496 ///# Errors
22497 ///- `VK_ERROR_INITIALIZATION_FAILED`
22498 ///- `VK_ERROR_UNKNOWN`
22499 ///- `VK_ERROR_VALIDATION_FAILED`
22500 ///
22501 ///# Safety
22502 ///- `queue` (self) must be valid and not destroyed.
22503 ///
22504 ///# Panics
22505 ///Panics if `vkQueueSignalReleaseImageOHOS` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22506 ///
22507 ///# Usage Notes
22508 ///
22509 ///Releases a swapchain image back to the OHOS compositor after
22510 ///rendering. Waits on the given semaphores and returns a native
22511 ///fence FD for external synchronisation. OHOS only.
22512 ///
22513 ///Requires `VK_OHOS_native_buffer`.
22514 pub unsafe fn queue_signal_release_image_ohos(
22515 &self,
22516 queue: Queue,
22517 p_wait_semaphores: &[Semaphore],
22518 image: Image,
22519 ) -> VkResult<i32> {
22520 let fp = self
22521 .commands()
22522 .queue_signal_release_image_ohos
22523 .expect("vkQueueSignalReleaseImageOHOS not loaded");
22524 let mut out = unsafe { core::mem::zeroed() };
22525 check(unsafe {
22526 fp(
22527 queue,
22528 p_wait_semaphores.len() as u32,
22529 p_wait_semaphores.as_ptr(),
22530 image,
22531 &mut out,
22532 )
22533 })?;
22534 Ok(out)
22535 }
22536 ///Wraps [`vkCmdSetComputeOccupancyPriorityNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetComputeOccupancyPriorityNV.html).
22537 /**
22538 Provided by **VK_NV_compute_occupancy_priority**.*/
22539 ///
22540 ///# Safety
22541 ///- `commandBuffer` (self) must be valid and not destroyed.
22542 ///
22543 ///# Panics
22544 ///Panics if `vkCmdSetComputeOccupancyPriorityNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22545 ///
22546 ///# Usage Notes
22547 ///
22548 ///Sets the compute occupancy priority for subsequent dispatch
22549 ///commands. Higher priority may increase the number of warps
22550 ///resident on an SM, trading off per-warp resources for greater
22551 ///parallelism.
22552 ///
22553 ///Requires `VK_NV_compute_occupancy_priority`.
22554 pub unsafe fn cmd_set_compute_occupancy_priority_nv(
22555 &self,
22556 command_buffer: CommandBuffer,
22557 p_parameters: &ComputeOccupancyPriorityParametersNV,
22558 ) {
22559 let fp = self
22560 .commands()
22561 .cmd_set_compute_occupancy_priority_nv
22562 .expect("vkCmdSetComputeOccupancyPriorityNV not loaded");
22563 unsafe { fp(command_buffer, p_parameters) };
22564 }
22565 ///Wraps [`vkWriteSamplerDescriptorsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkWriteSamplerDescriptorsEXT.html).
22566 /**
22567 Provided by **VK_EXT_descriptor_heap**.*/
22568 ///
22569 ///# Errors
22570 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22571 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22572 ///- `VK_ERROR_UNKNOWN`
22573 ///- `VK_ERROR_VALIDATION_FAILED`
22574 ///
22575 ///# Safety
22576 ///- `device` (self) must be valid and not destroyed.
22577 ///
22578 ///# Panics
22579 ///Panics if `vkWriteSamplerDescriptorsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22580 ///
22581 ///# Usage Notes
22582 ///
22583 ///Writes sampler descriptors to host-visible memory. This is the
22584 ///descriptor heap equivalent for sampler descriptors, instead of
22585 ///using descriptor sets, samplers are written directly to heap
22586 ///memory.
22587 ///
22588 ///Provided by `VK_EXT_descriptor_heap`.
22589 pub unsafe fn write_sampler_descriptors_ext(
22590 &self,
22591 p_samplers: &[SamplerCreateInfo],
22592 p_descriptors: &HostAddressRangeEXT,
22593 ) -> VkResult<()> {
22594 let fp = self
22595 .commands()
22596 .write_sampler_descriptors_ext
22597 .expect("vkWriteSamplerDescriptorsEXT not loaded");
22598 check(unsafe {
22599 fp(
22600 self.handle(),
22601 p_samplers.len() as u32,
22602 p_samplers.as_ptr(),
22603 p_descriptors,
22604 )
22605 })
22606 }
22607 ///Wraps [`vkWriteResourceDescriptorsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkWriteResourceDescriptorsEXT.html).
22608 /**
22609 Provided by **VK_EXT_descriptor_heap**.*/
22610 ///
22611 ///# Errors
22612 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22613 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22614 ///- `VK_ERROR_UNKNOWN`
22615 ///- `VK_ERROR_VALIDATION_FAILED`
22616 ///
22617 ///# Safety
22618 ///- `device` (self) must be valid and not destroyed.
22619 ///
22620 ///# Panics
22621 ///Panics if `vkWriteResourceDescriptorsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22622 ///
22623 ///# Usage Notes
22624 ///
22625 ///Writes resource descriptors (buffers, images, acceleration
22626 ///structures) to host-visible memory. This is the descriptor heap
22627 ///equivalent of writing descriptors, instead of using descriptor
22628 ///sets, descriptors are written directly to heap memory.
22629 ///
22630 ///Provided by `VK_EXT_descriptor_heap`.
22631 pub unsafe fn write_resource_descriptors_ext(
22632 &self,
22633 p_resources: &[ResourceDescriptorInfoEXT],
22634 p_descriptors: &HostAddressRangeEXT,
22635 ) -> VkResult<()> {
22636 let fp = self
22637 .commands()
22638 .write_resource_descriptors_ext
22639 .expect("vkWriteResourceDescriptorsEXT not loaded");
22640 check(unsafe {
22641 fp(
22642 self.handle(),
22643 p_resources.len() as u32,
22644 p_resources.as_ptr(),
22645 p_descriptors,
22646 )
22647 })
22648 }
22649 ///Wraps [`vkCmdBindSamplerHeapEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindSamplerHeapEXT.html).
22650 /**
22651 Provided by **VK_EXT_descriptor_heap**.*/
22652 ///
22653 ///# Safety
22654 ///- `commandBuffer` (self) must be valid and not destroyed.
22655 ///- `commandBuffer` must be externally synchronized.
22656 ///
22657 ///# Panics
22658 ///Panics if `vkCmdBindSamplerHeapEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22659 ///
22660 ///# Usage Notes
22661 ///
22662 ///Binds a sampler descriptor heap for use in subsequent draw and
22663 ///dispatch commands. The `BindHeapInfoEXT` specifies the heap to
22664 ///bind.
22665 ///
22666 ///Sampler heaps hold sampler descriptors. Resource descriptors are
22667 ///bound separately with `cmd_bind_resource_heap_ext`.
22668 ///
22669 ///Provided by `VK_EXT_descriptor_heap`.
22670 pub unsafe fn cmd_bind_sampler_heap_ext(
22671 &self,
22672 command_buffer: CommandBuffer,
22673 p_bind_info: &BindHeapInfoEXT,
22674 ) {
22675 let fp = self
22676 .commands()
22677 .cmd_bind_sampler_heap_ext
22678 .expect("vkCmdBindSamplerHeapEXT not loaded");
22679 unsafe { fp(command_buffer, p_bind_info) };
22680 }
22681 ///Wraps [`vkCmdBindResourceHeapEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindResourceHeapEXT.html).
22682 /**
22683 Provided by **VK_EXT_descriptor_heap**.*/
22684 ///
22685 ///# Safety
22686 ///- `commandBuffer` (self) must be valid and not destroyed.
22687 ///- `commandBuffer` must be externally synchronized.
22688 ///
22689 ///# Panics
22690 ///Panics if `vkCmdBindResourceHeapEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22691 ///
22692 ///# Usage Notes
22693 ///
22694 ///Binds a resource descriptor heap for use in subsequent draw and
22695 ///dispatch commands. The `BindHeapInfoEXT` specifies the heap to
22696 ///bind.
22697 ///
22698 ///Resource heaps hold descriptors for buffers, images, and
22699 ///acceleration structures. Samplers are bound separately with
22700 ///`cmd_bind_sampler_heap_ext`.
22701 ///
22702 ///Provided by `VK_EXT_descriptor_heap`.
22703 pub unsafe fn cmd_bind_resource_heap_ext(
22704 &self,
22705 command_buffer: CommandBuffer,
22706 p_bind_info: &BindHeapInfoEXT,
22707 ) {
22708 let fp = self
22709 .commands()
22710 .cmd_bind_resource_heap_ext
22711 .expect("vkCmdBindResourceHeapEXT not loaded");
22712 unsafe { fp(command_buffer, p_bind_info) };
22713 }
22714 ///Wraps [`vkCmdPushDataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPushDataEXT.html).
22715 /**
22716 Provided by **VK_EXT_descriptor_heap**.*/
22717 ///
22718 ///# Safety
22719 ///- `commandBuffer` (self) must be valid and not destroyed.
22720 ///- `commandBuffer` must be externally synchronized.
22721 ///
22722 ///# Panics
22723 ///Panics if `vkCmdPushDataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22724 ///
22725 ///# Usage Notes
22726 ///
22727 ///Pushes inline data to the command buffer for use in shaders. The
22728 ///`PushDataInfoEXT` specifies the pipeline layout, stage flags,
22729 ///offset, and data bytes.
22730 ///
22731 ///Similar to push constants but used with the descriptor heap
22732 ///model. Data is accessible in shaders via the push data mechanism.
22733 ///
22734 ///Provided by `VK_EXT_descriptor_heap`.
22735 pub unsafe fn cmd_push_data_ext(
22736 &self,
22737 command_buffer: CommandBuffer,
22738 p_push_data_info: &PushDataInfoEXT,
22739 ) {
22740 let fp = self
22741 .commands()
22742 .cmd_push_data_ext
22743 .expect("vkCmdPushDataEXT not loaded");
22744 unsafe { fp(command_buffer, p_push_data_info) };
22745 }
22746 ///Wraps [`vkRegisterCustomBorderColorEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkRegisterCustomBorderColorEXT.html).
22747 /**
22748 Provided by **VK_EXT_descriptor_heap**.*/
22749 ///
22750 ///# Errors
22751 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22752 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22753 ///- `VK_ERROR_TOO_MANY_OBJECTS`
22754 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS`
22755 ///- `VK_ERROR_UNKNOWN`
22756 ///- `VK_ERROR_VALIDATION_FAILED`
22757 ///
22758 ///# Safety
22759 ///- `device` (self) must be valid and not destroyed.
22760 ///
22761 ///# Panics
22762 ///Panics if `vkRegisterCustomBorderColorEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22763 ///
22764 ///# Usage Notes
22765 ///
22766 ///Registers a custom border color for use with samplers. Returns a
22767 ///handle that can be referenced when creating samplers with
22768 ///`BORDER_COLOR_CUSTOM` modes.
22769 ///
22770 ///The device has a limited number of custom border color slots
22771 ///(query `maxCustomBorderColors`).
22772 ///
22773 ///Unregister with `unregister_custom_border_color_ext` when no
22774 ///longer needed.
22775 ///
22776 ///Provided by `VK_EXT_descriptor_heap`.
22777 pub unsafe fn register_custom_border_color_ext(
22778 &self,
22779 p_border_color: &SamplerCustomBorderColorCreateInfoEXT,
22780 request_index: bool,
22781 ) -> VkResult<u32> {
22782 let fp = self
22783 .commands()
22784 .register_custom_border_color_ext
22785 .expect("vkRegisterCustomBorderColorEXT not loaded");
22786 let mut out = unsafe { core::mem::zeroed() };
22787 check(unsafe {
22788 fp(
22789 self.handle(),
22790 p_border_color,
22791 request_index as u32,
22792 &mut out,
22793 )
22794 })?;
22795 Ok(out)
22796 }
22797 ///Wraps [`vkUnregisterCustomBorderColorEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkUnregisterCustomBorderColorEXT.html).
22798 /**
22799 Provided by **VK_EXT_descriptor_heap**.*/
22800 ///
22801 ///# Safety
22802 ///- `device` (self) must be valid and not destroyed.
22803 ///
22804 ///# Panics
22805 ///Panics if `vkUnregisterCustomBorderColorEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22806 ///
22807 ///# Usage Notes
22808 ///
22809 ///Unregisters a custom border color previously registered with
22810 ///`register_custom_border_color_ext`, freeing the slot for reuse.
22811 ///
22812 ///Ensure no samplers referencing this border color are in use
22813 ///before unregistering.
22814 ///
22815 ///Provided by `VK_EXT_descriptor_heap`.
22816 pub unsafe fn unregister_custom_border_color_ext(&self, index: u32) {
22817 let fp = self
22818 .commands()
22819 .unregister_custom_border_color_ext
22820 .expect("vkUnregisterCustomBorderColorEXT not loaded");
22821 unsafe { fp(self.handle(), index) };
22822 }
22823 ///Wraps [`vkGetImageOpaqueCaptureDataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageOpaqueCaptureDataEXT.html).
22824 /**
22825 Provided by **VK_EXT_descriptor_heap**.*/
22826 ///
22827 ///# Errors
22828 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22829 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22830 ///- `VK_ERROR_UNKNOWN`
22831 ///- `VK_ERROR_VALIDATION_FAILED`
22832 ///
22833 ///# Safety
22834 ///- `device` (self) must be valid and not destroyed.
22835 ///
22836 ///# Panics
22837 ///Panics if `vkGetImageOpaqueCaptureDataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22838 ///
22839 ///# Usage Notes
22840 ///
22841 ///Retrieves opaque capture data for one or more images. The returned
22842 ///`HostAddressRangeEXT` data can be used to reconstruct image
22843 ///resource bindings during capture/replay.
22844 ///
22845 ///Provided by `VK_EXT_descriptor_heap`.
22846 pub unsafe fn get_image_opaque_capture_data_ext(
22847 &self,
22848 p_images: &[Image],
22849 ) -> VkResult<Vec<HostAddressRangeEXT>> {
22850 let fp = self
22851 .commands()
22852 .get_image_opaque_capture_data_ext
22853 .expect("vkGetImageOpaqueCaptureDataEXT not loaded");
22854 let count = p_images.len();
22855 let mut out = vec![unsafe { core::mem::zeroed() }; count];
22856 check(unsafe {
22857 fp(
22858 self.handle(),
22859 p_images.len() as u32,
22860 p_images.as_ptr(),
22861 out.as_mut_ptr(),
22862 )
22863 })?;
22864 Ok(out)
22865 }
22866 ///Wraps [`vkGetTensorOpaqueCaptureDataARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetTensorOpaqueCaptureDataARM.html).
22867 /**
22868 Provided by **VK_EXT_descriptor_heap**.*/
22869 ///
22870 ///# Errors
22871 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22872 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22873 ///- `VK_ERROR_UNKNOWN`
22874 ///- `VK_ERROR_VALIDATION_FAILED`
22875 ///
22876 ///# Safety
22877 ///- `device` (self) must be valid and not destroyed.
22878 ///
22879 ///# Panics
22880 ///Panics if `vkGetTensorOpaqueCaptureDataARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22881 ///
22882 ///# Usage Notes
22883 ///
22884 ///Retrieves opaque capture data for one or more ARM tensors. The
22885 ///returned data can be used to reconstruct tensor resource bindings
22886 ///during capture/replay.
22887 ///
22888 ///Provided by `VK_ARM_tensors`.
22889 pub unsafe fn get_tensor_opaque_capture_data_arm(
22890 &self,
22891 p_tensors: &[TensorARM],
22892 ) -> VkResult<Vec<HostAddressRangeEXT>> {
22893 let fp = self
22894 .commands()
22895 .get_tensor_opaque_capture_data_arm
22896 .expect("vkGetTensorOpaqueCaptureDataARM not loaded");
22897 let count = p_tensors.len();
22898 let mut out = vec![unsafe { core::mem::zeroed() }; count];
22899 check(unsafe {
22900 fp(
22901 self.handle(),
22902 p_tensors.len() as u32,
22903 p_tensors.as_ptr(),
22904 out.as_mut_ptr(),
22905 )
22906 })?;
22907 Ok(out)
22908 }
22909 ///Wraps [`vkCmdCopyMemoryKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMemoryKHR.html).
22910 /**
22911 Provided by **VK_KHR_device_address_commands**.*/
22912 ///
22913 ///# Safety
22914 ///- `commandBuffer` (self) must be valid and not destroyed.
22915 ///- `commandBuffer` must be externally synchronized.
22916 ///
22917 ///# Panics
22918 ///Panics if `vkCmdCopyMemoryKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22919 ///
22920 ///# Usage Notes
22921 ///
22922 ///Copies data between two device address ranges on the GPU. This is
22923 ///the device-address equivalent of `cmd_copy_buffer`, instead of
22924 ///buffer handles, source and destination are specified as device
22925 ///addresses in `CopyDeviceMemoryInfoKHR`.
22926 ///
22927 ///Useful for copying data between arbitrary device memory locations
22928 ///without needing buffer objects.
22929 ///
22930 ///Requires `VK_KHR_device_address_commands`.
22931 pub unsafe fn cmd_copy_memory_khr(
22932 &self,
22933 command_buffer: CommandBuffer,
22934 p_copy_memory_info: Option<&CopyDeviceMemoryInfoKHR>,
22935 ) {
22936 let fp = self
22937 .commands()
22938 .cmd_copy_memory_khr
22939 .expect("vkCmdCopyMemoryKHR not loaded");
22940 let p_copy_memory_info_ptr =
22941 p_copy_memory_info.map_or(core::ptr::null(), core::ptr::from_ref);
22942 unsafe { fp(command_buffer, p_copy_memory_info_ptr) };
22943 }
22944 ///Wraps [`vkCmdCopyMemoryToImageKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMemoryToImageKHR.html).
22945 /**
22946 Provided by **VK_KHR_device_address_commands**.*/
22947 ///
22948 ///# Safety
22949 ///- `commandBuffer` (self) must be valid and not destroyed.
22950 ///- `commandBuffer` must be externally synchronized.
22951 ///
22952 ///# Panics
22953 ///Panics if `vkCmdCopyMemoryToImageKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22954 ///
22955 ///# Usage Notes
22956 ///
22957 ///Device-address variant of `cmd_copy_buffer_to_image`. Copies data
22958 ///from a device address range into an image, instead of reading from
22959 ///a buffer handle.
22960 ///
22961 ///The `CopyDeviceMemoryImageInfoKHR` struct specifies the source
22962 ///device address, destination image, and region descriptions.
22963 ///
22964 ///This is the device-address counterpart, for the host-side
22965 ///equivalent, see `copy_memory_to_image` (core 1.4).
22966 ///
22967 ///Requires `VK_KHR_device_address_commands`.
22968 pub unsafe fn cmd_copy_memory_to_image_khr(
22969 &self,
22970 command_buffer: CommandBuffer,
22971 p_copy_memory_info: Option<&CopyDeviceMemoryImageInfoKHR>,
22972 ) {
22973 let fp = self
22974 .commands()
22975 .cmd_copy_memory_to_image_khr
22976 .expect("vkCmdCopyMemoryToImageKHR not loaded");
22977 let p_copy_memory_info_ptr =
22978 p_copy_memory_info.map_or(core::ptr::null(), core::ptr::from_ref);
22979 unsafe { fp(command_buffer, p_copy_memory_info_ptr) };
22980 }
22981 ///Wraps [`vkCmdCopyImageToMemoryKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyImageToMemoryKHR.html).
22982 /**
22983 Provided by **VK_KHR_device_address_commands**.*/
22984 ///
22985 ///# Safety
22986 ///- `commandBuffer` (self) must be valid and not destroyed.
22987 ///- `commandBuffer` must be externally synchronized.
22988 ///
22989 ///# Panics
22990 ///Panics if `vkCmdCopyImageToMemoryKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22991 ///
22992 ///# Usage Notes
22993 ///
22994 ///Device-address variant of `cmd_copy_image_to_buffer`. Copies image
22995 ///texel data to a device address range instead of a buffer handle.
22996 ///
22997 ///The `CopyDeviceMemoryImageInfoKHR` struct specifies the source
22998 ///image, destination device address, and region descriptions.
22999 ///
23000 ///This is the device-address counterpart, for the host-side
23001 ///equivalent, see `copy_image_to_memory` (core 1.4).
23002 ///
23003 ///Requires `VK_KHR_device_address_commands`.
23004 pub unsafe fn cmd_copy_image_to_memory_khr(
23005 &self,
23006 command_buffer: CommandBuffer,
23007 p_copy_memory_info: Option<&CopyDeviceMemoryImageInfoKHR>,
23008 ) {
23009 let fp = self
23010 .commands()
23011 .cmd_copy_image_to_memory_khr
23012 .expect("vkCmdCopyImageToMemoryKHR not loaded");
23013 let p_copy_memory_info_ptr =
23014 p_copy_memory_info.map_or(core::ptr::null(), core::ptr::from_ref);
23015 unsafe { fp(command_buffer, p_copy_memory_info_ptr) };
23016 }
23017 ///Wraps [`vkCmdUpdateMemoryKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdUpdateMemoryKHR.html).
23018 /**
23019 Provided by **VK_KHR_device_address_commands**.*/
23020 ///
23021 ///# Safety
23022 ///- `commandBuffer` (self) must be valid and not destroyed.
23023 ///- `commandBuffer` must be externally synchronized.
23024 ///
23025 ///# Panics
23026 ///Panics if `vkCmdUpdateMemoryKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23027 ///
23028 ///# Usage Notes
23029 ///
23030 ///Device-address variant of `cmd_update_buffer`. Writes a small
23031 ///amount of inline data to a device address range, instead of
23032 ///targeting a buffer handle.
23033 ///
23034 ///`data_size` must be ≤ 65536 bytes and a multiple of 4. For
23035 ///larger transfers, use `cmd_copy_memory_khr`.
23036 ///
23037 ///The `DeviceAddressRangeKHR` specifies the destination address.
23038 ///
23039 ///Requires `VK_KHR_device_address_commands`.
23040 pub unsafe fn cmd_update_memory_khr(
23041 &self,
23042 command_buffer: CommandBuffer,
23043 p_dst_range: &DeviceAddressRangeKHR,
23044 dst_flags: AddressCommandFlagsKHR,
23045 data_size: u64,
23046 p_data: *const core::ffi::c_void,
23047 ) {
23048 let fp = self
23049 .commands()
23050 .cmd_update_memory_khr
23051 .expect("vkCmdUpdateMemoryKHR not loaded");
23052 unsafe { fp(command_buffer, p_dst_range, dst_flags, data_size, p_data) };
23053 }
23054 ///Wraps [`vkCmdFillMemoryKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdFillMemoryKHR.html).
23055 /**
23056 Provided by **VK_KHR_device_address_commands**.*/
23057 ///
23058 ///# Safety
23059 ///- `commandBuffer` (self) must be valid and not destroyed.
23060 ///- `commandBuffer` must be externally synchronized.
23061 ///
23062 ///# Panics
23063 ///Panics if `vkCmdFillMemoryKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23064 ///
23065 ///# Usage Notes
23066 ///
23067 ///Device-address variant of `cmd_fill_buffer`. Fills a device
23068 ///address range with a repeating 32-bit `data` value, instead of
23069 ///targeting a buffer handle.
23070 ///
23071 ///The `DeviceAddressRangeKHR` specifies the destination address
23072 ///and size. The fill size must be a multiple of 4 bytes.
23073 ///
23074 ///Requires `VK_KHR_device_address_commands`.
23075 pub unsafe fn cmd_fill_memory_khr(
23076 &self,
23077 command_buffer: CommandBuffer,
23078 p_dst_range: &DeviceAddressRangeKHR,
23079 dst_flags: AddressCommandFlagsKHR,
23080 data: u32,
23081 ) {
23082 let fp = self
23083 .commands()
23084 .cmd_fill_memory_khr
23085 .expect("vkCmdFillMemoryKHR not loaded");
23086 unsafe { fp(command_buffer, p_dst_range, dst_flags, data) };
23087 }
23088 ///Wraps [`vkCmdCopyQueryPoolResultsToMemoryKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyQueryPoolResultsToMemoryKHR.html).
23089 /**
23090 Provided by **VK_KHR_device_address_commands**.*/
23091 ///
23092 ///# Safety
23093 ///- `commandBuffer` (self) must be valid and not destroyed.
23094 ///- `commandBuffer` must be externally synchronized.
23095 ///
23096 ///# Panics
23097 ///Panics if `vkCmdCopyQueryPoolResultsToMemoryKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23098 ///
23099 ///# Usage Notes
23100 ///
23101 ///Device-address variant of `cmd_copy_query_pool_results`. Copies
23102 ///query results directly to a device address range instead of a
23103 ///buffer handle.
23104 ///
23105 ///`first_query` and `query_count` select which queries to copy.
23106 ///`query_result_flags` controls formatting (`_64_BIT`, `WAIT`,
23107 ///`WITH_AVAILABILITY`, `PARTIAL`).
23108 ///
23109 ///The `StridedDeviceAddressRangeKHR` specifies the destination
23110 ///address and stride between results.
23111 ///
23112 ///Requires `VK_KHR_device_address_commands`.
23113 pub unsafe fn cmd_copy_query_pool_results_to_memory_khr(
23114 &self,
23115 command_buffer: CommandBuffer,
23116 query_pool: QueryPool,
23117 first_query: u32,
23118 query_count: u32,
23119 p_dst_range: &StridedDeviceAddressRangeKHR,
23120 dst_flags: AddressCommandFlagsKHR,
23121 query_result_flags: QueryResultFlags,
23122 ) {
23123 let fp = self
23124 .commands()
23125 .cmd_copy_query_pool_results_to_memory_khr
23126 .expect("vkCmdCopyQueryPoolResultsToMemoryKHR not loaded");
23127 unsafe {
23128 fp(
23129 command_buffer,
23130 query_pool,
23131 first_query,
23132 query_count,
23133 p_dst_range,
23134 dst_flags,
23135 query_result_flags,
23136 )
23137 };
23138 }
23139 ///Wraps [`vkCmdBeginConditionalRendering2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginConditionalRendering2EXT.html).
23140 /**
23141 Provided by **VK_KHR_device_address_commands**.*/
23142 ///
23143 ///# Safety
23144 ///- `commandBuffer` (self) must be valid and not destroyed.
23145 ///- `commandBuffer` must be externally synchronized.
23146 ///
23147 ///# Panics
23148 ///Panics if `vkCmdBeginConditionalRendering2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23149 ///
23150 ///# Usage Notes
23151 ///
23152 ///Device-address variant of `cmd_begin_conditional_rendering_ext`.
23153 ///Instead of a buffer handle + offset, the condition is read from a
23154 ///`DeviceAddress` specified in `ConditionalRenderingBeginInfo2EXT`.
23155 ///
23156 ///When the 32-bit value at the address is zero, subsequent rendering
23157 ///and dispatch commands are discarded (or the inverse, if
23158 ///`INVERTED` is set). End the conditional block with
23159 ///`cmd_end_conditional_rendering_ext`.
23160 ///
23161 ///Requires `VK_KHR_device_address_commands` and
23162 ///`VK_EXT_conditional_rendering`.
23163 pub unsafe fn cmd_begin_conditional_rendering2_ext(
23164 &self,
23165 command_buffer: CommandBuffer,
23166 p_conditional_rendering_begin: &ConditionalRenderingBeginInfo2EXT,
23167 ) {
23168 let fp = self
23169 .commands()
23170 .cmd_begin_conditional_rendering2_ext
23171 .expect("vkCmdBeginConditionalRendering2EXT not loaded");
23172 unsafe { fp(command_buffer, p_conditional_rendering_begin) };
23173 }
23174 ///Wraps [`vkCmdBindTransformFeedbackBuffers2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindTransformFeedbackBuffers2EXT.html).
23175 /**
23176 Provided by **VK_KHR_device_address_commands**.*/
23177 ///
23178 ///# Safety
23179 ///- `commandBuffer` (self) must be valid and not destroyed.
23180 ///- `commandBuffer` must be externally synchronized.
23181 ///
23182 ///# Panics
23183 ///Panics if `vkCmdBindTransformFeedbackBuffers2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23184 ///
23185 ///# Usage Notes
23186 ///
23187 ///Device-address variant of `cmd_bind_transform_feedback_buffers_ext`.
23188 ///Binds transform feedback output buffers using device addresses
23189 ///instead of buffer handles.
23190 ///
23191 ///Each `BindTransformFeedbackBuffer2InfoEXT` specifies a device
23192 ///address and size for one binding slot starting at `first_binding`.
23193 ///
23194 ///Requires `VK_KHR_device_address_commands` and
23195 ///`VK_EXT_transform_feedback`.
23196 pub unsafe fn cmd_bind_transform_feedback_buffers2_ext(
23197 &self,
23198 command_buffer: CommandBuffer,
23199 first_binding: u32,
23200 p_binding_infos: &[BindTransformFeedbackBuffer2InfoEXT],
23201 ) {
23202 let fp = self
23203 .commands()
23204 .cmd_bind_transform_feedback_buffers2_ext
23205 .expect("vkCmdBindTransformFeedbackBuffers2EXT not loaded");
23206 unsafe {
23207 fp(
23208 command_buffer,
23209 first_binding,
23210 p_binding_infos.len() as u32,
23211 p_binding_infos.as_ptr(),
23212 )
23213 };
23214 }
23215 ///Wraps [`vkCmdBeginTransformFeedback2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginTransformFeedback2EXT.html).
23216 /**
23217 Provided by **VK_KHR_device_address_commands**.*/
23218 ///
23219 ///# Safety
23220 ///- `commandBuffer` (self) must be valid and not destroyed.
23221 ///- `commandBuffer` must be externally synchronized.
23222 ///
23223 ///# Panics
23224 ///Panics if `vkCmdBeginTransformFeedback2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23225 ///
23226 ///# Usage Notes
23227 ///
23228 ///Device-address variant of `cmd_begin_transform_feedback_ext`.
23229 ///Activates transform feedback using counter buffers specified via
23230 ///device addresses in `BindTransformFeedbackBuffer2InfoEXT` rather
23231 ///than buffer handles.
23232 ///
23233 ///`first_counter_range` and the info array identify which transform
23234 ///feedback counter ranges to resume from. Pass empty counter infos
23235 ///to start from offset zero.
23236 ///
23237 ///End the transform feedback pass with
23238 ///`cmd_end_transform_feedback2_ext`.
23239 ///
23240 ///Requires `VK_KHR_device_address_commands` and
23241 ///`VK_EXT_transform_feedback`.
23242 pub unsafe fn cmd_begin_transform_feedback2_ext(
23243 &self,
23244 command_buffer: CommandBuffer,
23245 first_counter_range: u32,
23246 p_counter_infos: &[BindTransformFeedbackBuffer2InfoEXT],
23247 ) {
23248 let fp = self
23249 .commands()
23250 .cmd_begin_transform_feedback2_ext
23251 .expect("vkCmdBeginTransformFeedback2EXT not loaded");
23252 unsafe {
23253 fp(
23254 command_buffer,
23255 first_counter_range,
23256 p_counter_infos.len() as u32,
23257 p_counter_infos.as_ptr(),
23258 )
23259 };
23260 }
23261 ///Wraps [`vkCmdEndTransformFeedback2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndTransformFeedback2EXT.html).
23262 /**
23263 Provided by **VK_KHR_device_address_commands**.*/
23264 ///
23265 ///# Safety
23266 ///- `commandBuffer` (self) must be valid and not destroyed.
23267 ///- `commandBuffer` must be externally synchronized.
23268 ///
23269 ///# Panics
23270 ///Panics if `vkCmdEndTransformFeedback2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23271 ///
23272 ///# Usage Notes
23273 ///
23274 ///Device-address variant of `cmd_end_transform_feedback_ext`.
23275 ///Stops transform feedback and writes counter values to device
23276 ///addresses specified in `BindTransformFeedbackBuffer2InfoEXT`.
23277 ///
23278 ///These saved counter values can be passed to
23279 ///`cmd_begin_transform_feedback2_ext` to resume feedback in a
23280 ///later render pass.
23281 ///
23282 ///Requires `VK_KHR_device_address_commands` and
23283 ///`VK_EXT_transform_feedback`.
23284 pub unsafe fn cmd_end_transform_feedback2_ext(
23285 &self,
23286 command_buffer: CommandBuffer,
23287 first_counter_range: u32,
23288 p_counter_infos: &[BindTransformFeedbackBuffer2InfoEXT],
23289 ) {
23290 let fp = self
23291 .commands()
23292 .cmd_end_transform_feedback2_ext
23293 .expect("vkCmdEndTransformFeedback2EXT not loaded");
23294 unsafe {
23295 fp(
23296 command_buffer,
23297 first_counter_range,
23298 p_counter_infos.len() as u32,
23299 p_counter_infos.as_ptr(),
23300 )
23301 };
23302 }
23303 ///Wraps [`vkCmdDrawIndirectByteCount2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndirectByteCount2EXT.html).
23304 /**
23305 Provided by **VK_KHR_device_address_commands**.*/
23306 ///
23307 ///# Safety
23308 ///- `commandBuffer` (self) must be valid and not destroyed.
23309 ///- `commandBuffer` must be externally synchronized.
23310 ///
23311 ///# Panics
23312 ///Panics if `vkCmdDrawIndirectByteCount2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23313 ///
23314 ///# Usage Notes
23315 ///
23316 ///Device-address variant of `cmd_draw_indirect_byte_count_ext`.
23317 ///Draws vertices using a byte count from a transform feedback
23318 ///counter, with the counter buffer specified via device address
23319 ///instead of a buffer handle.
23320 ///
23321 ///`counter_offset` is the byte offset within the counter value
23322 ///to account for any header. `vertex_stride` determines how many
23323 ///bytes each vertex consumes.
23324 ///
23325 ///Requires `VK_KHR_device_address_commands` and
23326 ///`VK_EXT_transform_feedback`.
23327 pub unsafe fn cmd_draw_indirect_byte_count2_ext(
23328 &self,
23329 command_buffer: CommandBuffer,
23330 instance_count: u32,
23331 first_instance: u32,
23332 p_counter_info: &BindTransformFeedbackBuffer2InfoEXT,
23333 counter_offset: u32,
23334 vertex_stride: u32,
23335 ) {
23336 let fp = self
23337 .commands()
23338 .cmd_draw_indirect_byte_count2_ext
23339 .expect("vkCmdDrawIndirectByteCount2EXT not loaded");
23340 unsafe {
23341 fp(
23342 command_buffer,
23343 instance_count,
23344 first_instance,
23345 p_counter_info,
23346 counter_offset,
23347 vertex_stride,
23348 )
23349 };
23350 }
23351 ///Wraps [`vkCmdWriteMarkerToMemoryAMD`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWriteMarkerToMemoryAMD.html).
23352 /**
23353 Provided by **VK_KHR_device_address_commands**.*/
23354 ///
23355 ///# Safety
23356 ///- `commandBuffer` (self) must be valid and not destroyed.
23357 ///- `commandBuffer` must be externally synchronized.
23358 ///
23359 ///# Panics
23360 ///Panics if `vkCmdWriteMarkerToMemoryAMD` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23361 ///
23362 ///# Usage Notes
23363 ///
23364 ///Device-address variant of the AMD buffer marker extension. Writes
23365 ///a 32-bit marker value to a device address at a specific pipeline
23366 ///stage.
23367 ///
23368 ///The `MemoryMarkerInfoAMD` specifies the pipeline stage, device
23369 ///address, and marker value. Useful for GPU crash debugging,
23370 ///markers that were written indicate how far the GPU progressed
23371 ///before a fault.
23372 ///
23373 ///Requires `VK_KHR_device_address_commands`. This is the
23374 ///device-address counterpart of `cmd_write_buffer_marker_amd`.
23375 pub unsafe fn cmd_write_marker_to_memory_amd(
23376 &self,
23377 command_buffer: CommandBuffer,
23378 p_info: &MemoryMarkerInfoAMD,
23379 ) {
23380 let fp = self
23381 .commands()
23382 .cmd_write_marker_to_memory_amd
23383 .expect("vkCmdWriteMarkerToMemoryAMD not loaded");
23384 unsafe { fp(command_buffer, p_info) };
23385 }
23386 ///Wraps [`vkCmdBindIndexBuffer3KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindIndexBuffer3KHR.html).
23387 /**
23388 Provided by **VK_KHR_device_address_commands**.*/
23389 ///
23390 ///# Safety
23391 ///- `commandBuffer` (self) must be valid and not destroyed.
23392 ///- `commandBuffer` must be externally synchronized.
23393 ///
23394 ///# Panics
23395 ///Panics if `vkCmdBindIndexBuffer3KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23396 ///
23397 ///# Usage Notes
23398 ///
23399 ///Device-address variant of `cmd_bind_index_buffer`. Binds an index
23400 ///buffer for subsequent indexed draw commands using a device address
23401 ///instead of a buffer handle.
23402 ///
23403 ///The `BindIndexBuffer3InfoKHR` struct specifies the device address,
23404 ///size, and index type (`UINT16`, `UINT32`, or `UINT8` if enabled).
23405 ///
23406 ///Supersedes `cmd_bind_index_buffer` and `cmd_bind_index_buffer2`
23407 ///when using `VK_KHR_device_address_commands`.
23408 pub unsafe fn cmd_bind_index_buffer3_khr(
23409 &self,
23410 command_buffer: CommandBuffer,
23411 p_info: &BindIndexBuffer3InfoKHR,
23412 ) {
23413 let fp = self
23414 .commands()
23415 .cmd_bind_index_buffer3_khr
23416 .expect("vkCmdBindIndexBuffer3KHR not loaded");
23417 unsafe { fp(command_buffer, p_info) };
23418 }
23419 ///Wraps [`vkCmdBindVertexBuffers3KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindVertexBuffers3KHR.html).
23420 /**
23421 Provided by **VK_KHR_device_address_commands**.*/
23422 ///
23423 ///# Safety
23424 ///- `commandBuffer` (self) must be valid and not destroyed.
23425 ///- `commandBuffer` must be externally synchronized.
23426 ///
23427 ///# Panics
23428 ///Panics if `vkCmdBindVertexBuffers3KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23429 ///
23430 ///# Usage Notes
23431 ///
23432 ///Device-address variant of `cmd_bind_vertex_buffers`. Binds vertex
23433 ///buffers for subsequent draw commands using device addresses instead
23434 ///of buffer handles.
23435 ///
23436 ///Each `BindVertexBuffer3InfoKHR` specifies a device address, size,
23437 ///and stride for one binding slot starting at `first_binding`.
23438 ///
23439 ///Supersedes `cmd_bind_vertex_buffers`, `cmd_bind_vertex_buffers2`,
23440 ///and the core 1.4 equivalent when using
23441 ///`VK_KHR_device_address_commands`.
23442 pub unsafe fn cmd_bind_vertex_buffers3_khr(
23443 &self,
23444 command_buffer: CommandBuffer,
23445 first_binding: u32,
23446 p_binding_infos: &[BindVertexBuffer3InfoKHR],
23447 ) {
23448 let fp = self
23449 .commands()
23450 .cmd_bind_vertex_buffers3_khr
23451 .expect("vkCmdBindVertexBuffers3KHR not loaded");
23452 unsafe {
23453 fp(
23454 command_buffer,
23455 first_binding,
23456 p_binding_infos.len() as u32,
23457 p_binding_infos.as_ptr(),
23458 )
23459 };
23460 }
23461 ///Wraps [`vkCmdDrawIndirect2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndirect2KHR.html).
23462 /**
23463 Provided by **VK_KHR_device_address_commands**.*/
23464 ///
23465 ///# Safety
23466 ///- `commandBuffer` (self) must be valid and not destroyed.
23467 ///- `commandBuffer` must be externally synchronized.
23468 ///
23469 ///# Panics
23470 ///Panics if `vkCmdDrawIndirect2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23471 ///
23472 ///# Usage Notes
23473 ///
23474 ///Device-address variant of `cmd_draw_indirect`. Reads non-indexed
23475 ///draw parameters from a device address instead of a buffer handle
23476 ///+ offset.
23477 ///
23478 ///The `DrawIndirect2InfoKHR` specifies the device address, draw
23479 ///count, and stride.
23480 ///
23481 ///Requires `VK_KHR_device_address_commands`.
23482 pub unsafe fn cmd_draw_indirect2_khr(
23483 &self,
23484 command_buffer: CommandBuffer,
23485 p_info: &DrawIndirect2InfoKHR,
23486 ) {
23487 let fp = self
23488 .commands()
23489 .cmd_draw_indirect2_khr
23490 .expect("vkCmdDrawIndirect2KHR not loaded");
23491 unsafe { fp(command_buffer, p_info) };
23492 }
23493 ///Wraps [`vkCmdDrawIndexedIndirect2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndexedIndirect2KHR.html).
23494 /**
23495 Provided by **VK_KHR_device_address_commands**.*/
23496 ///
23497 ///# Safety
23498 ///- `commandBuffer` (self) must be valid and not destroyed.
23499 ///- `commandBuffer` must be externally synchronized.
23500 ///
23501 ///# Panics
23502 ///Panics if `vkCmdDrawIndexedIndirect2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23503 ///
23504 ///# Usage Notes
23505 ///
23506 ///Device-address variant of `cmd_draw_indexed_indirect`. Reads
23507 ///indexed draw parameters from a device address instead of a buffer
23508 ///handle + offset.
23509 ///
23510 ///The `DrawIndirect2InfoKHR` specifies the device address, draw
23511 ///count, and stride.
23512 ///
23513 ///Requires `VK_KHR_device_address_commands`.
23514 pub unsafe fn cmd_draw_indexed_indirect2_khr(
23515 &self,
23516 command_buffer: CommandBuffer,
23517 p_info: &DrawIndirect2InfoKHR,
23518 ) {
23519 let fp = self
23520 .commands()
23521 .cmd_draw_indexed_indirect2_khr
23522 .expect("vkCmdDrawIndexedIndirect2KHR not loaded");
23523 unsafe { fp(command_buffer, p_info) };
23524 }
23525 ///Wraps [`vkCmdDrawIndirectCount2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndirectCount2KHR.html).
23526 /**
23527 Provided by **VK_KHR_device_address_commands**.*/
23528 ///
23529 ///# Safety
23530 ///- `commandBuffer` (self) must be valid and not destroyed.
23531 ///- `commandBuffer` must be externally synchronized.
23532 ///
23533 ///# Panics
23534 ///Panics if `vkCmdDrawIndirectCount2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23535 ///
23536 ///# Usage Notes
23537 ///
23538 ///Device-address variant of `cmd_draw_indirect_count`. Reads
23539 ///non-indexed draw parameters and the draw count from device
23540 ///addresses instead of buffer handles.
23541 ///
23542 ///The `DrawIndirectCount2InfoKHR` specifies both the draw parameter
23543 ///address and the count address, along with `max_draw_count` and
23544 ///stride.
23545 ///
23546 ///Requires `VK_KHR_device_address_commands`.
23547 pub unsafe fn cmd_draw_indirect_count2_khr(
23548 &self,
23549 command_buffer: CommandBuffer,
23550 p_info: &DrawIndirectCount2InfoKHR,
23551 ) {
23552 let fp = self
23553 .commands()
23554 .cmd_draw_indirect_count2_khr
23555 .expect("vkCmdDrawIndirectCount2KHR not loaded");
23556 unsafe { fp(command_buffer, p_info) };
23557 }
23558 ///Wraps [`vkCmdDrawIndexedIndirectCount2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndexedIndirectCount2KHR.html).
23559 /**
23560 Provided by **VK_KHR_device_address_commands**.*/
23561 ///
23562 ///# Safety
23563 ///- `commandBuffer` (self) must be valid and not destroyed.
23564 ///- `commandBuffer` must be externally synchronized.
23565 ///
23566 ///# Panics
23567 ///Panics if `vkCmdDrawIndexedIndirectCount2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23568 ///
23569 ///# Usage Notes
23570 ///
23571 ///Device-address variant of `cmd_draw_indexed_indirect_count`. Reads
23572 ///indexed draw parameters and the draw count from device addresses
23573 ///instead of buffer handles.
23574 ///
23575 ///The `DrawIndirectCount2InfoKHR` specifies both the draw parameter
23576 ///address and the count address, along with `max_draw_count` and
23577 ///stride.
23578 ///
23579 ///Requires `VK_KHR_device_address_commands`.
23580 pub unsafe fn cmd_draw_indexed_indirect_count2_khr(
23581 &self,
23582 command_buffer: CommandBuffer,
23583 p_info: &DrawIndirectCount2InfoKHR,
23584 ) {
23585 let fp = self
23586 .commands()
23587 .cmd_draw_indexed_indirect_count2_khr
23588 .expect("vkCmdDrawIndexedIndirectCount2KHR not loaded");
23589 unsafe { fp(command_buffer, p_info) };
23590 }
23591 ///Wraps [`vkCmdDrawMeshTasksIndirect2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMeshTasksIndirect2EXT.html).
23592 /**
23593 Provided by **VK_KHR_device_address_commands**.*/
23594 ///
23595 ///# Safety
23596 ///- `commandBuffer` (self) must be valid and not destroyed.
23597 ///- `commandBuffer` must be externally synchronized.
23598 ///
23599 ///# Panics
23600 ///Panics if `vkCmdDrawMeshTasksIndirect2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23601 ///
23602 ///# Usage Notes
23603 ///
23604 ///Device-address variant of `cmd_draw_mesh_tasks_indirect_ext`.
23605 ///Reads mesh shader dispatch parameters from a device address
23606 ///instead of a buffer handle.
23607 ///
23608 ///The `DrawIndirect2InfoKHR` specifies the device address, draw
23609 ///count, and stride.
23610 ///
23611 ///Requires `VK_KHR_device_address_commands` and
23612 ///`VK_EXT_mesh_shader`.
23613 pub unsafe fn cmd_draw_mesh_tasks_indirect2_ext(
23614 &self,
23615 command_buffer: CommandBuffer,
23616 p_info: &DrawIndirect2InfoKHR,
23617 ) {
23618 let fp = self
23619 .commands()
23620 .cmd_draw_mesh_tasks_indirect2_ext
23621 .expect("vkCmdDrawMeshTasksIndirect2EXT not loaded");
23622 unsafe { fp(command_buffer, p_info) };
23623 }
23624 ///Wraps [`vkCmdDrawMeshTasksIndirectCount2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMeshTasksIndirectCount2EXT.html).
23625 /**
23626 Provided by **VK_KHR_device_address_commands**.*/
23627 ///
23628 ///# Safety
23629 ///- `commandBuffer` (self) must be valid and not destroyed.
23630 ///- `commandBuffer` must be externally synchronized.
23631 ///
23632 ///# Panics
23633 ///Panics if `vkCmdDrawMeshTasksIndirectCount2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23634 ///
23635 ///# Usage Notes
23636 ///
23637 ///Device-address variant of `cmd_draw_mesh_tasks_indirect_count_ext`.
23638 ///Reads mesh shader dispatch parameters and the draw count from
23639 ///device addresses instead of buffer handles.
23640 ///
23641 ///The `DrawIndirectCount2InfoKHR` specifies both the draw parameter
23642 ///address and the count address, along with `max_draw_count` and
23643 ///stride.
23644 ///
23645 ///Requires `VK_KHR_device_address_commands` and
23646 ///`VK_EXT_mesh_shader`.
23647 pub unsafe fn cmd_draw_mesh_tasks_indirect_count2_ext(
23648 &self,
23649 command_buffer: CommandBuffer,
23650 p_info: &DrawIndirectCount2InfoKHR,
23651 ) {
23652 let fp = self
23653 .commands()
23654 .cmd_draw_mesh_tasks_indirect_count2_ext
23655 .expect("vkCmdDrawMeshTasksIndirectCount2EXT not loaded");
23656 unsafe { fp(command_buffer, p_info) };
23657 }
23658 ///Wraps [`vkCmdDispatchIndirect2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDispatchIndirect2KHR.html).
23659 /**
23660 Provided by **VK_KHR_device_address_commands**.*/
23661 ///
23662 ///# Safety
23663 ///- `commandBuffer` (self) must be valid and not destroyed.
23664 ///- `commandBuffer` must be externally synchronized.
23665 ///
23666 ///# Panics
23667 ///Panics if `vkCmdDispatchIndirect2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23668 ///
23669 ///# Usage Notes
23670 ///
23671 ///Device-address variant of `cmd_dispatch_indirect`. Reads the
23672 ///dispatch parameters (group counts) from a device address instead
23673 ///of a buffer handle + offset.
23674 ///
23675 ///The `DispatchIndirect2InfoKHR` specifies the device address where
23676 ///the `DispatchIndirectCommand` struct resides.
23677 ///
23678 ///Requires `VK_KHR_device_address_commands`.
23679 pub unsafe fn cmd_dispatch_indirect2_khr(
23680 &self,
23681 command_buffer: CommandBuffer,
23682 p_info: &DispatchIndirect2InfoKHR,
23683 ) {
23684 let fp = self
23685 .commands()
23686 .cmd_dispatch_indirect2_khr
23687 .expect("vkCmdDispatchIndirect2KHR not loaded");
23688 unsafe { fp(command_buffer, p_info) };
23689 }
23690 ///Wraps [`vkCreateAccelerationStructure2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateAccelerationStructure2KHR.html).
23691 /**
23692 Provided by **VK_KHR_device_address_commands**.*/
23693 ///
23694 ///# Errors
23695 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
23696 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
23697 ///- `VK_ERROR_VALIDATION_FAILED`
23698 ///- `VK_ERROR_UNKNOWN`
23699 ///
23700 ///# Safety
23701 ///- `device` (self) must be valid and not destroyed.
23702 ///
23703 ///# Panics
23704 ///Panics if `vkCreateAccelerationStructure2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23705 ///
23706 ///# Usage Notes
23707 ///
23708 ///Device-address variant of `create_acceleration_structure_khr`.
23709 ///Creates a ray tracing acceleration structure backed by a device
23710 ///address range instead of a buffer handle.
23711 ///
23712 ///The `AccelerationStructureCreateInfo2KHR` specifies the device
23713 ///address, size, type (top-level or bottom-level), and optional
23714 ///capture/replay address.
23715 ///
23716 ///Destroy with `destroy_acceleration_structure_khr`.
23717 ///
23718 ///Requires `VK_KHR_device_address_commands` and
23719 ///`VK_KHR_acceleration_structure`.
23720 pub unsafe fn create_acceleration_structure2_khr(
23721 &self,
23722 p_create_info: &AccelerationStructureCreateInfo2KHR,
23723 allocator: Option<&AllocationCallbacks>,
23724 ) -> VkResult<AccelerationStructureKHR> {
23725 let fp = self
23726 .commands()
23727 .create_acceleration_structure2_khr
23728 .expect("vkCreateAccelerationStructure2KHR not loaded");
23729 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
23730 let mut out = unsafe { core::mem::zeroed() };
23731 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
23732 Ok(out)
23733 }
23734}