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::*;
5impl crate::Device {
6 ///Wraps [`vkGetDeviceProcAddr`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceProcAddr.html).
7 /**
8 Provided by **VK_BASE_VERSION_1_0**.*/
9 ///
10 ///# Safety
11 ///- `device` (self) must be valid and not destroyed.
12 ///
13 ///# Panics
14 ///Panics if `vkGetDeviceProcAddr` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15 ///
16 ///# Usage Notes
17 ///
18 ///Returns a function pointer for a device-level command. This is the
19 ///device-specific equivalent of `get_instance_proc_addr` and returns
20 ///pointers dispatched directly through the device's driver, bypassing
21 ///the loader trampoline.
22 ///
23 ///In normal usage you do not need to call this yourself, `Device`
24 ///loads all function pointers automatically at creation time. Use this
25 ///only if you need a command that is not yet exposed as a wrapper
26 ///method, or for raw interop scenarios.
27 ///
28 ///The returned pointer is only valid for the device it was queried
29 ///from. Passing a command name that the device does not support
30 ///returns a null pointer.
31 pub unsafe fn get_device_proc_addr(
32 &self,
33 p_name: *const core::ffi::c_char,
34 ) -> PFN_vkVoidFunction {
35 let fp = self
36 .commands()
37 .get_device_proc_addr
38 .expect("vkGetDeviceProcAddr not loaded");
39 unsafe { fp(self.handle(), p_name) }
40 }
41 ///Wraps [`vkDestroyDevice`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyDevice.html).
42 /**
43 Provided by **VK_BASE_VERSION_1_0**.*/
44 ///
45 ///# Safety
46 ///- `device` (self) must be valid and not destroyed.
47 ///- `device` must be externally synchronized.
48 ///
49 ///# Panics
50 ///Panics if `vkDestroyDevice` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
51 ///
52 ///# Usage Notes
53 ///
54 ///Destroys a logical device and frees its resources. All objects
55 ///created from this device (buffers, images, pipelines, command pools,
56 ///etc.) **must** be destroyed before calling this.
57 ///
58 ///A safe teardown order:
59 ///
60 ///1. `device_wait_idle`, ensure no GPU work is in flight.
61 ///2. Destroy all device-child objects (pipelines, buffers, images,
62 /// views, descriptor pools, command pools, fences, semaphores, etc.).
63 ///3. `free_memory` for all device memory allocations.
64 ///4. `destroy_device`.
65 ///
66 ///After this call the `Device` handle is invalid. Do not use it or any
67 ///object created from it.
68 ///
69 ///# Guide
70 ///
71 ///See [The Vulkan Object Model](https://hiddentale.github.io/vulkan_rust/concepts/object-model.html) in the vulkan_rust guide.
72 pub unsafe fn destroy_device(&self, allocator: Option<&AllocationCallbacks>) {
73 let fp = self
74 .commands()
75 .destroy_device
76 .expect("vkDestroyDevice not loaded");
77 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
78 unsafe { fp(self.handle(), alloc_ptr) };
79 }
80 ///Wraps [`vkGetDeviceQueue`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceQueue.html).
81 /**
82 Provided by **VK_BASE_VERSION_1_0**.*/
83 ///
84 ///# Safety
85 ///- `device` (self) must be valid and not destroyed.
86 ///
87 ///# Panics
88 ///Panics if `vkGetDeviceQueue` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
89 ///
90 ///# Usage Notes
91 ///
92 ///Retrieves a queue handle for a queue that was requested at device
93 ///creation time. The `queue_family_index` and `queue_index` must match
94 ///a family and index that was included in the `DeviceCreateInfo`'s
95 ///`queue_create_infos`.
96 ///
97 ///Queue handles are implicitly owned by the device, they do not need
98 ///to be destroyed and become invalid when the device is destroyed.
99 ///
100 ///Queues retrieved this way have no special flags. If you created
101 ///queues with `DeviceQueueCreateFlags` (e.g. protected queues), use
102 ///`get_device_queue2` instead.
103 ///
104 ///It is common to retrieve queues once after device creation and store
105 ///them for the lifetime of the device.
106 ///
107 ///# Guide
108 ///
109 ///See [Hello Triangle, Part 1](https://hiddentale.github.io/vulkan_rust/getting-started/hello-triangle-1.html) in the vulkan_rust guide.
110 pub unsafe fn get_device_queue(&self, queue_family_index: u32, queue_index: u32) -> Queue {
111 let fp = self
112 .commands()
113 .get_device_queue
114 .expect("vkGetDeviceQueue not loaded");
115 let mut out = unsafe { core::mem::zeroed() };
116 unsafe { fp(self.handle(), queue_family_index, queue_index, &mut out) };
117 out
118 }
119 ///Wraps [`vkQueueSubmit`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueSubmit.html).
120 /**
121 Provided by **VK_BASE_VERSION_1_0**.*/
122 ///
123 ///# Errors
124 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
125 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
126 ///- `VK_ERROR_DEVICE_LOST`
127 ///- `VK_ERROR_UNKNOWN`
128 ///- `VK_ERROR_VALIDATION_FAILED`
129 ///
130 ///# Safety
131 ///- `queue` (self) must be valid and not destroyed.
132 ///- `queue` must be externally synchronized.
133 ///- `fence` must be externally synchronized.
134 ///
135 ///# Panics
136 ///Panics if `vkQueueSubmit` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
137 ///
138 ///# Usage Notes
139 ///
140 ///`queue_submit` is the primary way to send recorded command buffers
141 ///to the GPU. Each `SubmitInfo` specifies:
142 ///
143 ///- **Wait semaphores + stage masks**: the submission waits on these
144 /// semaphores at the given pipeline stages before executing.
145 ///- **Command buffers**: executed in array order within the submission.
146 ///- **Signal semaphores**: signalled when all command buffers complete.
147 ///
148 ///**Fence**: pass a fence to know when the *entire batch* of submissions
149 ///completes on the CPU side. Passing `Fence::null()` means there is no
150 ///CPU-visible signal, you must use semaphores or `queue_wait_idle`
151 ///instead.
152 ///
153 ///Minimize `queue_submit` calls. Each call has driver overhead; batching
154 ///multiple `SubmitInfo` entries into one call is cheaper than separate
155 ///calls.
156 ///
157 ///**Thread safety**: a `Queue` must be externally synchronized. If
158 ///multiple threads submit to the same queue, you need a mutex.
159 ///
160 ///# Guide
161 ///
162 ///See [Synchronization](https://hiddentale.github.io/vulkan_rust/concepts/synchronization.html) in the vulkan_rust guide.
163 pub unsafe fn queue_submit(
164 &self,
165 queue: Queue,
166 p_submits: &[SubmitInfo],
167 fence: Fence,
168 ) -> VkResult<()> {
169 let fp = self
170 .commands()
171 .queue_submit
172 .expect("vkQueueSubmit not loaded");
173 check(unsafe { fp(queue, p_submits.len() as u32, p_submits.as_ptr(), fence) })
174 }
175 ///Wraps [`vkQueueWaitIdle`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueWaitIdle.html).
176 /**
177 Provided by **VK_BASE_VERSION_1_0**.*/
178 ///
179 ///# Errors
180 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
181 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
182 ///- `VK_ERROR_DEVICE_LOST`
183 ///- `VK_ERROR_UNKNOWN`
184 ///- `VK_ERROR_VALIDATION_FAILED`
185 ///
186 ///# Safety
187 ///- `queue` (self) must be valid and not destroyed.
188 ///- `queue` must be externally synchronized.
189 ///
190 ///# Panics
191 ///Panics if `vkQueueWaitIdle` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
192 ///
193 ///# Usage Notes
194 ///
195 ///Blocks the calling thread until all commands submitted to this queue
196 ///have completed. Equivalent to submitting a fence and immediately
197 ///waiting on it, but simpler.
198 ///
199 ///Use this for quick synchronization in non-performance-critical paths
200 ///(e.g. during teardown or after a one-shot transfer). In a render
201 ///loop, prefer fences or timeline semaphores for finer-grained
202 ///control, `queue_wait_idle` stalls the CPU and prevents overlap
203 ///between CPU and GPU work.
204 ///
205 ///The queue must be externally synchronized: do not call this while
206 ///another thread is submitting to the same queue.
207 pub unsafe fn queue_wait_idle(&self, queue: Queue) -> VkResult<()> {
208 let fp = self
209 .commands()
210 .queue_wait_idle
211 .expect("vkQueueWaitIdle not loaded");
212 check(unsafe { fp(queue) })
213 }
214 ///Wraps [`vkDeviceWaitIdle`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDeviceWaitIdle.html).
215 /**
216 Provided by **VK_BASE_VERSION_1_0**.*/
217 ///
218 ///# Errors
219 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
220 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
221 ///- `VK_ERROR_DEVICE_LOST`
222 ///- `VK_ERROR_UNKNOWN`
223 ///- `VK_ERROR_VALIDATION_FAILED`
224 ///
225 ///# Safety
226 ///- `device` (self) must be valid and not destroyed.
227 ///
228 ///# Panics
229 ///Panics if `vkDeviceWaitIdle` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
230 ///
231 ///# Usage Notes
232 ///
233 ///Blocks the calling thread until **all** queues on this device are
234 ///idle. This is the nuclear option for synchronization, it drains
235 ///every queue completely.
236 ///
237 ///Typical uses:
238 ///
239 ///- **Before destroying the device**: ensures no GPU work is in flight
240 /// before you start tearing down resources.
241 ///- **Before a swapchain resize**: guarantees all frames are done so
242 /// image views and framebuffers can be safely recreated.
243 ///
244 ///Avoid calling this in a render loop. It forces a full CPU–GPU
245 ///round-trip and prevents any overlap. Use per-frame fences or
246 ///timeline semaphores instead.
247 pub unsafe fn device_wait_idle(&self) -> VkResult<()> {
248 let fp = self
249 .commands()
250 .device_wait_idle
251 .expect("vkDeviceWaitIdle not loaded");
252 check(unsafe { fp(self.handle()) })
253 }
254 ///Wraps [`vkAllocateMemory`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAllocateMemory.html).
255 /**
256 Provided by **VK_BASE_VERSION_1_0**.*/
257 ///
258 ///# Errors
259 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
260 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
261 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
262 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
263 ///- `VK_ERROR_UNKNOWN`
264 ///- `VK_ERROR_VALIDATION_FAILED`
265 ///
266 ///# Safety
267 ///- `device` (self) must be valid and not destroyed.
268 ///
269 ///# Panics
270 ///Panics if `vkAllocateMemory` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
271 ///
272 ///# Usage Notes
273 ///
274 ///Memory allocation in Vulkan is expensive. Prefer sub-allocating from
275 ///large blocks using a memory allocator (e.g., `gpu-allocator`) rather
276 ///than calling this for every buffer or image.
277 ///
278 ///The returned `DeviceMemory` must be freed with `free_memory` when no
279 ///longer needed. Vulkan does not garbage-collect device memory.
280 ///
281 ///# Guide
282 ///
283 ///See [Memory Management](https://hiddentale.github.io/vulkan_rust/concepts/memory.html) in the vulkan_rust guide.
284 pub unsafe fn allocate_memory(
285 &self,
286 p_allocate_info: &MemoryAllocateInfo,
287 allocator: Option<&AllocationCallbacks>,
288 ) -> VkResult<DeviceMemory> {
289 let fp = self
290 .commands()
291 .allocate_memory
292 .expect("vkAllocateMemory not loaded");
293 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
294 let mut out = unsafe { core::mem::zeroed() };
295 check(unsafe { fp(self.handle(), p_allocate_info, alloc_ptr, &mut out) })?;
296 Ok(out)
297 }
298 ///Wraps [`vkFreeMemory`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkFreeMemory.html).
299 /**
300 Provided by **VK_BASE_VERSION_1_0**.*/
301 ///
302 ///# Safety
303 ///- `device` (self) must be valid and not destroyed.
304 ///- `memory` must be externally synchronized.
305 ///
306 ///# Panics
307 ///Panics if `vkFreeMemory` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
308 ///
309 ///# Usage Notes
310 ///
311 ///Frees a device memory allocation. All buffers and images bound to
312 ///this memory must already be destroyed, freeing memory while objects
313 ///are still bound is undefined behaviour.
314 ///
315 ///If the memory is currently mapped, it is implicitly unmapped before
316 ///being freed. You do not need to call `unmap_memory` first, although
317 ///doing so explicitly is a common defensive practice.
318 ///
319 ///Vulkan has a per-device allocation limit
320 ///(`max_memory_allocation_count`, often 4096). Sub-allocating from
321 ///large blocks and freeing them as a group keeps you well within this
322 ///limit.
323 pub unsafe fn free_memory(
324 &self,
325 memory: DeviceMemory,
326 allocator: Option<&AllocationCallbacks>,
327 ) {
328 let fp = self
329 .commands()
330 .free_memory
331 .expect("vkFreeMemory not loaded");
332 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
333 unsafe { fp(self.handle(), memory, alloc_ptr) };
334 }
335 ///Wraps [`vkUnmapMemory`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkUnmapMemory.html).
336 /**
337 Provided by **VK_BASE_VERSION_1_0**.*/
338 ///
339 ///# Safety
340 ///- `device` (self) must be valid and not destroyed.
341 ///- `memory` must be externally synchronized.
342 ///
343 ///# Panics
344 ///Panics if `vkUnmapMemory` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
345 ///
346 ///# Usage Notes
347 ///
348 ///Unmaps a previously mapped device memory region. After this call the
349 ///host pointer returned by `map_memory` is invalid.
350 ///
351 ///Unmapping is only strictly necessary before `free_memory` if you
352 ///want to be explicit. Freeing memory implicitly unmaps it.
353 ///
354 ///For persistently mapped memory (the recommended pattern), you
355 ///typically map once after allocation and unmap only during teardown.
356 ///There is no performance penalty for keeping memory mapped.
357 ///
358 ///If the memory type is not `HOST_COHERENT`, make sure to call
359 ///`flush_mapped_memory_ranges` after your final writes before
360 ///unmapping, to ensure the GPU sees the latest data.
361 pub unsafe fn unmap_memory(&self, memory: DeviceMemory) {
362 let fp = self
363 .commands()
364 .unmap_memory
365 .expect("vkUnmapMemory not loaded");
366 unsafe { fp(self.handle(), memory) };
367 }
368 ///Wraps [`vkFlushMappedMemoryRanges`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkFlushMappedMemoryRanges.html).
369 /**
370 Provided by **VK_BASE_VERSION_1_0**.*/
371 ///
372 ///# Errors
373 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
374 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
375 ///- `VK_ERROR_UNKNOWN`
376 ///- `VK_ERROR_VALIDATION_FAILED`
377 ///
378 ///# Safety
379 ///- `device` (self) must be valid and not destroyed.
380 ///
381 ///# Panics
382 ///Panics if `vkFlushMappedMemoryRanges` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
383 ///
384 ///# Usage Notes
385 ///
386 ///Flushes CPU writes to mapped non-coherent memory so the GPU can see
387 ///them. Only needed when the memory type does **not** include
388 ///`MEMORY_PROPERTY_HOST_COHERENT`.
389 ///
390 ///Call this **after** writing data through the mapped pointer and
391 ///**before** the GPU reads it (i.e. before the relevant
392 ///`queue_submit`).
393 ///
394 ///**Alignment**: the `offset` and `size` of each range must be
395 ///multiples of `non_coherent_atom_size` (from physical device limits),
396 ///or `offset` must be zero and `size` must be `VK_WHOLE_SIZE`. Failing
397 ///to align causes undefined behaviour on some implementations.
398 ///
399 ///Multiple ranges can be flushed in a single call. Batch them when
400 ///updating several sub-allocations within the same memory object.
401 ///
402 ///If you are using host-coherent memory, this call is unnecessary and
403 ///can be skipped entirely.
404 pub unsafe fn flush_mapped_memory_ranges(
405 &self,
406 p_memory_ranges: &[MappedMemoryRange],
407 ) -> VkResult<()> {
408 let fp = self
409 .commands()
410 .flush_mapped_memory_ranges
411 .expect("vkFlushMappedMemoryRanges not loaded");
412 check(unsafe {
413 fp(
414 self.handle(),
415 p_memory_ranges.len() as u32,
416 p_memory_ranges.as_ptr(),
417 )
418 })
419 }
420 ///Wraps [`vkInvalidateMappedMemoryRanges`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkInvalidateMappedMemoryRanges.html).
421 /**
422 Provided by **VK_BASE_VERSION_1_0**.*/
423 ///
424 ///# Errors
425 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
426 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
427 ///- `VK_ERROR_UNKNOWN`
428 ///- `VK_ERROR_VALIDATION_FAILED`
429 ///
430 ///# Safety
431 ///- `device` (self) must be valid and not destroyed.
432 ///
433 ///# Panics
434 ///Panics if `vkInvalidateMappedMemoryRanges` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
435 ///
436 ///# Usage Notes
437 ///
438 ///Invalidates CPU caches for mapped non-coherent memory so the CPU
439 ///can see data written by the GPU. The counterpart to
440 ///`flush_mapped_memory_ranges`.
441 ///
442 ///Call this **after** the GPU has finished writing (e.g. after
443 ///`wait_for_fences` on the relevant submission) and **before** reading
444 ///the data through the mapped pointer.
445 ///
446 ///The same alignment rules apply: `offset` and `size` must be
447 ///multiples of `non_coherent_atom_size`, or use offset zero with
448 ///`VK_WHOLE_SIZE`.
449 ///
450 ///If you are using host-coherent memory, this call is unnecessary,
451 ///GPU writes are automatically visible to the CPU. Most desktop GPUs
452 ///offer host-coherent memory types for host-visible heaps.
453 pub unsafe fn invalidate_mapped_memory_ranges(
454 &self,
455 p_memory_ranges: &[MappedMemoryRange],
456 ) -> VkResult<()> {
457 let fp = self
458 .commands()
459 .invalidate_mapped_memory_ranges
460 .expect("vkInvalidateMappedMemoryRanges not loaded");
461 check(unsafe {
462 fp(
463 self.handle(),
464 p_memory_ranges.len() as u32,
465 p_memory_ranges.as_ptr(),
466 )
467 })
468 }
469 ///Wraps [`vkGetDeviceMemoryCommitment`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceMemoryCommitment.html).
470 /**
471 Provided by **VK_BASE_VERSION_1_0**.*/
472 ///
473 ///# Safety
474 ///- `device` (self) must be valid and not destroyed.
475 ///
476 ///# Panics
477 ///Panics if `vkGetDeviceMemoryCommitment` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
478 ///
479 ///# Usage Notes
480 ///
481 ///Queries how many bytes of a lazily-allocated memory object are
482 ///currently backed by physical storage. Only meaningful for memory
483 ///allocated with `MEMORY_PROPERTY_LAZILY_ALLOCATED`.
484 ///
485 ///Lazily-allocated memory is primarily used for transient framebuffer
486 ///attachments on tile-based GPUs (mobile). The driver may not back the
487 ///full allocation with physical memory until tiles actually need it.
488 ///
489 ///On desktop GPUs this typically returns the full allocation size since
490 ///lazy allocation is rarely supported. Check
491 ///`memory_properties.memory_types` for the `LAZILY_ALLOCATED` flag
492 ///before relying on this.
493 pub unsafe fn get_device_memory_commitment(&self, memory: DeviceMemory) -> u64 {
494 let fp = self
495 .commands()
496 .get_device_memory_commitment
497 .expect("vkGetDeviceMemoryCommitment not loaded");
498 let mut out = unsafe { core::mem::zeroed() };
499 unsafe { fp(self.handle(), memory, &mut out) };
500 out
501 }
502 ///Wraps [`vkGetBufferMemoryRequirements`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetBufferMemoryRequirements.html).
503 /**
504 Provided by **VK_BASE_VERSION_1_0**.*/
505 ///
506 ///# Safety
507 ///- `device` (self) must be valid and not destroyed.
508 ///
509 ///# Panics
510 ///Panics if `vkGetBufferMemoryRequirements` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
511 ///
512 ///# Usage Notes
513 ///
514 ///Returns the memory requirements (size, alignment, compatible memory
515 ///type bits) for a buffer. Must be called before `bind_buffer_memory`.
516 ///
517 ///The returned `memory_type_bits` is a bitmask where bit *i* is set if
518 ///memory type *i* (from `get_physical_device_memory_properties`) is
519 ///compatible. Pick a type that satisfies both this mask and your
520 ///desired properties (`HOST_VISIBLE`, `DEVICE_LOCAL`, etc.).
521 ///
522 ///The `alignment` value must be respected when sub-allocating: the
523 ///offset passed to `bind_buffer_memory` must be a multiple of it.
524 ///
525 ///For Vulkan 1.1+, prefer `get_buffer_memory_requirements2` which
526 ///supports dedicated allocation queries via
527 ///`MemoryDedicatedRequirements`.
528 pub unsafe fn get_buffer_memory_requirements(&self, buffer: Buffer) -> MemoryRequirements {
529 let fp = self
530 .commands()
531 .get_buffer_memory_requirements
532 .expect("vkGetBufferMemoryRequirements not loaded");
533 let mut out = unsafe { core::mem::zeroed() };
534 unsafe { fp(self.handle(), buffer, &mut out) };
535 out
536 }
537 ///Wraps [`vkBindBufferMemory`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBindBufferMemory.html).
538 /**
539 Provided by **VK_BASE_VERSION_1_0**.*/
540 ///
541 ///# Errors
542 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
543 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
544 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
545 ///- `VK_ERROR_UNKNOWN`
546 ///- `VK_ERROR_VALIDATION_FAILED`
547 ///
548 ///# Safety
549 ///- `device` (self) must be valid and not destroyed.
550 ///- `buffer` must be externally synchronized.
551 ///
552 ///# Panics
553 ///Panics if `vkBindBufferMemory` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
554 ///
555 ///# Usage Notes
556 ///
557 ///Binds a `DeviceMemory` allocation (or a region of one) to a buffer.
558 ///Must be called before the buffer is used in any command.
559 ///
560 ///**Requirements**:
561 ///
562 ///1. Call `get_buffer_memory_requirements` first.
563 ///2. The `memory_type_index` used for allocation must have a bit set
564 /// in the returned `memory_type_bits` mask.
565 ///3. `memory_offset` must be a multiple of the returned `alignment`.
566 ///4. `memory_offset + size` must not exceed the allocation size.
567 ///
568 ///**Sub-allocation**: multiple buffers can share one `DeviceMemory`
569 ///allocation at different offsets. This is strongly recommended,
570 ///drivers have a per-allocation limit (`max_memory_allocation_count`,
571 ///often 4096) and each allocation has overhead.
572 ///
573 ///Once bound, the memory binding cannot be changed for the lifetime of
574 ///the buffer. Destroy the buffer before freeing its backing memory.
575 pub unsafe fn bind_buffer_memory(
576 &self,
577 buffer: Buffer,
578 memory: DeviceMemory,
579 memory_offset: u64,
580 ) -> VkResult<()> {
581 let fp = self
582 .commands()
583 .bind_buffer_memory
584 .expect("vkBindBufferMemory not loaded");
585 check(unsafe { fp(self.handle(), buffer, memory, memory_offset) })
586 }
587 ///Wraps [`vkGetImageMemoryRequirements`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageMemoryRequirements.html).
588 /**
589 Provided by **VK_BASE_VERSION_1_0**.*/
590 ///
591 ///# Safety
592 ///- `device` (self) must be valid and not destroyed.
593 ///
594 ///# Panics
595 ///Panics if `vkGetImageMemoryRequirements` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
596 ///
597 ///# Usage Notes
598 ///
599 ///Returns the memory requirements (size, alignment, compatible memory
600 ///type bits) for an image. Must be called before `bind_image_memory`.
601 ///
602 ///Image memory requirements can differ significantly based on tiling,
603 ///format, and usage flags. An `IMAGE_TILING_OPTIMAL` image typically
604 ///requires `DEVICE_LOCAL` memory and has stricter alignment than a
605 ///linear image.
606 ///
607 ///When sub-allocating linear and optimal images from the same memory
608 ///object, the `buffer_image_granularity` device limit applies. You may
609 ///need extra padding between the two to satisfy this constraint.
610 ///
611 ///For Vulkan 1.1+, prefer `get_image_memory_requirements2` which
612 ///supports dedicated allocation queries.
613 pub unsafe fn get_image_memory_requirements(&self, image: Image) -> MemoryRequirements {
614 let fp = self
615 .commands()
616 .get_image_memory_requirements
617 .expect("vkGetImageMemoryRequirements not loaded");
618 let mut out = unsafe { core::mem::zeroed() };
619 unsafe { fp(self.handle(), image, &mut out) };
620 out
621 }
622 ///Wraps [`vkBindImageMemory`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBindImageMemory.html).
623 /**
624 Provided by **VK_BASE_VERSION_1_0**.*/
625 ///
626 ///# Errors
627 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
628 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
629 ///- `VK_ERROR_UNKNOWN`
630 ///- `VK_ERROR_VALIDATION_FAILED`
631 ///
632 ///# Safety
633 ///- `device` (self) must be valid and not destroyed.
634 ///- `image` must be externally synchronized.
635 ///
636 ///# Panics
637 ///Panics if `vkBindImageMemory` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
638 ///
639 ///# Usage Notes
640 ///
641 ///Binds a `DeviceMemory` allocation (or a region of one) to an image.
642 ///Must be called after `create_image` and before the image is used.
643 ///
644 ///**Requirements**:
645 ///
646 ///1. Call `get_image_memory_requirements` first.
647 ///2. The `memory_type_index` used for allocation must have a bit set
648 /// in the returned `memory_type_bits` mask.
649 ///3. `memory_offset` must be a multiple of the returned `alignment`.
650 ///
651 ///**Dedicated allocations**: some drivers perform better when certain
652 ///images (especially swapchain-sized color or depth targets) have their
653 ///own allocation. Query `get_image_memory_requirements2` with
654 ///`MemoryDedicatedRequirements` to check whether the driver prefers or
655 ///requires a dedicated allocation.
656 ///
657 ///**Sub-allocation**: like buffers, multiple images can share one
658 ///allocation at different offsets. Respect alignment from the memory
659 ///requirements, and note that linear and optimal-tiling images may
660 ///need `buffer_image_granularity` spacing between them.
661 ///
662 ///Once bound, the memory binding is permanent. Destroy the image
663 ///before freeing its backing memory.
664 pub unsafe fn bind_image_memory(
665 &self,
666 image: Image,
667 memory: DeviceMemory,
668 memory_offset: u64,
669 ) -> VkResult<()> {
670 let fp = self
671 .commands()
672 .bind_image_memory
673 .expect("vkBindImageMemory not loaded");
674 check(unsafe { fp(self.handle(), image, memory, memory_offset) })
675 }
676 ///Wraps [`vkGetImageSparseMemoryRequirements`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageSparseMemoryRequirements.html).
677 /**
678 Provided by **VK_BASE_VERSION_1_0**.*/
679 ///
680 ///# Safety
681 ///- `device` (self) must be valid and not destroyed.
682 ///
683 ///# Panics
684 ///Panics if `vkGetImageSparseMemoryRequirements` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
685 ///
686 ///# Usage Notes
687 ///
688 ///Queries the sparse memory requirements for an image created with
689 ///one of the `IMAGE_CREATE_SPARSE_*` flags. Returns a list of sparse
690 ///image format properties describing the memory layout for each
691 ///image aspect (color, depth, stencil, metadata).
692 ///
693 ///Sparse resources allow partially-resident textures where only some
694 ///mip levels or regions are backed by physical memory. This is an
695 ///advanced feature primarily used for virtual texturing and terrain
696 ///streaming.
697 ///
698 ///If the image was not created with sparse flags, this returns an
699 ///empty list. Check `physical_device_features.sparse_binding` before
700 ///using sparse resources.
701 pub unsafe fn get_image_sparse_memory_requirements(
702 &self,
703 image: Image,
704 ) -> Vec<SparseImageMemoryRequirements> {
705 let fp = self
706 .commands()
707 .get_image_sparse_memory_requirements
708 .expect("vkGetImageSparseMemoryRequirements not loaded");
709 fill_two_call(|count, data| unsafe { fp(self.handle(), image, count, data) })
710 }
711 ///Wraps [`vkQueueBindSparse`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueBindSparse.html).
712 /**
713 Provided by **VK_BASE_VERSION_1_0**.*/
714 ///
715 ///# Errors
716 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
717 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
718 ///- `VK_ERROR_DEVICE_LOST`
719 ///- `VK_ERROR_UNKNOWN`
720 ///- `VK_ERROR_VALIDATION_FAILED`
721 ///
722 ///# Safety
723 ///- `queue` (self) must be valid and not destroyed.
724 ///- `queue` must be externally synchronized.
725 ///- `fence` must be externally synchronized.
726 ///
727 ///# Panics
728 ///Panics if `vkQueueBindSparse` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
729 ///
730 ///# Usage Notes
731 ///
732 ///Binds sparse memory regions to sparse resources (buffers or images).
733 ///This is the only way to change the memory backing of a sparse
734 ///resource after creation.
735 ///
736 ///Sparse binding supports:
737 ///
738 ///- **Partial residency**: bind memory to individual mip tail regions
739 /// or image tiles, leaving others unbound.
740 ///- **Aliasing**: multiple sparse resources can alias the same memory
741 /// region (with `IMAGE_CREATE_SPARSE_ALIASED`).
742 ///- **Dynamic re-binding**: swap memory pages at runtime for virtual
743 /// texturing or streaming.
744 ///
745 ///The bind operation is asynchronous and can synchronize with
746 ///semaphores, similar to `queue_submit`. The queue must support sparse
747 ///binding (check `QUEUE_SPARSE_BINDING`).
748 ///
749 ///This is an advanced feature. Most applications use fully-bound
750 ///resources with `bind_buffer_memory` / `bind_image_memory` instead.
751 pub unsafe fn queue_bind_sparse(
752 &self,
753 queue: Queue,
754 p_bind_info: &[BindSparseInfo],
755 fence: Fence,
756 ) -> VkResult<()> {
757 let fp = self
758 .commands()
759 .queue_bind_sparse
760 .expect("vkQueueBindSparse not loaded");
761 check(unsafe { fp(queue, p_bind_info.len() as u32, p_bind_info.as_ptr(), fence) })
762 }
763 ///Wraps [`vkCreateFence`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateFence.html).
764 /**
765 Provided by **VK_BASE_VERSION_1_0**.*/
766 ///
767 ///# Errors
768 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
769 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
770 ///- `VK_ERROR_UNKNOWN`
771 ///- `VK_ERROR_VALIDATION_FAILED`
772 ///
773 ///# Safety
774 ///- `device` (self) must be valid and not destroyed.
775 ///
776 ///# Panics
777 ///Panics if `vkCreateFence` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
778 ///
779 ///# Usage Notes
780 ///
781 ///Fences are the primary CPU–GPU synchronization primitive. The CPU
782 ///blocks on `wait_for_fences` until the GPU signals the fence.
783 ///
784 ///**Initial state**: create with `FENCE_CREATE_SIGNALED` when the
785 ///fence is used in a frame loop that waits before the first submit.
786 ///Without this flag the first `wait_for_fences` would block forever.
787 ///
788 ///**Typical frame loop pattern**:
789 ///
790 ///1. `wait_for_fences`, block until the previous frame's GPU work
791 /// completes.
792 ///2. `reset_fences`, reset back to unsignaled.
793 ///3. Record and submit commands, passing the fence to `queue_submit`.
794 ///
795 ///A fence can only be associated with one submission at a time.
796 ///Submitting with a fence that is already pending is an error.
797 ///
798 ///For GPU–GPU synchronization (between queue submissions) use
799 ///semaphores instead. Fences are strictly for CPU-visible signalling.
800 ///
801 ///# Guide
802 ///
803 ///See [Synchronization](https://hiddentale.github.io/vulkan_rust/concepts/synchronization.html) in the vulkan_rust guide.
804 pub unsafe fn create_fence(
805 &self,
806 p_create_info: &FenceCreateInfo,
807 allocator: Option<&AllocationCallbacks>,
808 ) -> VkResult<Fence> {
809 let fp = self
810 .commands()
811 .create_fence
812 .expect("vkCreateFence not loaded");
813 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
814 let mut out = unsafe { core::mem::zeroed() };
815 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
816 Ok(out)
817 }
818 ///Wraps [`vkDestroyFence`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyFence.html).
819 /**
820 Provided by **VK_BASE_VERSION_1_0**.*/
821 ///
822 ///# Safety
823 ///- `device` (self) must be valid and not destroyed.
824 ///- `fence` must be externally synchronized.
825 ///
826 ///# Panics
827 ///Panics if `vkDestroyFence` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
828 ///
829 ///# Usage Notes
830 ///
831 ///Destroys a fence object. The fence must not be in use by any
832 ///pending `queue_submit` call, wait on it or call `device_wait_idle`
833 ///before destroying.
834 ///
835 ///Fences are lightweight objects but are still tracked by the driver.
836 ///Destroy them during teardown or when they are no longer part of your
837 ///synchronization scheme.
838 pub unsafe fn destroy_fence(&self, fence: Fence, allocator: Option<&AllocationCallbacks>) {
839 let fp = self
840 .commands()
841 .destroy_fence
842 .expect("vkDestroyFence not loaded");
843 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
844 unsafe { fp(self.handle(), fence, alloc_ptr) };
845 }
846 ///Wraps [`vkResetFences`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkResetFences.html).
847 /**
848 Provided by **VK_BASE_VERSION_1_0**.*/
849 ///
850 ///# Errors
851 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
852 ///- `VK_ERROR_UNKNOWN`
853 ///- `VK_ERROR_VALIDATION_FAILED`
854 ///
855 ///# Safety
856 ///- `device` (self) must be valid and not destroyed.
857 ///- `pFences` must be externally synchronized.
858 ///
859 ///# Panics
860 ///Panics if `vkResetFences` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
861 ///
862 ///# Usage Notes
863 ///
864 ///Resets one or more fences to the unsignaled state. Must be called
865 ///before reusing a fence in a new `queue_submit` call.
866 ///
867 ///The fence must not be currently waited on by `wait_for_fences` from
868 ///another thread. A common safe pattern:
869 ///
870 ///1. `wait_for_fences`, blocks until signaled.
871 ///2. `reset_fences`, immediately reset after the wait returns.
872 ///3. Submit new work with the fence.
873 ///
874 ///Resetting a fence that is already unsignaled is valid but wasteful.
875 ///Resetting a fence that is pending (submitted but not yet signaled)
876 ///is an error.
877 pub unsafe fn reset_fences(&self, p_fences: &[Fence]) -> VkResult<()> {
878 let fp = self
879 .commands()
880 .reset_fences
881 .expect("vkResetFences not loaded");
882 check(unsafe { fp(self.handle(), p_fences.len() as u32, p_fences.as_ptr()) })
883 }
884 ///Wraps [`vkGetFenceStatus`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetFenceStatus.html).
885 /**
886 Provided by **VK_BASE_VERSION_1_0**.*/
887 ///
888 ///# Errors
889 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
890 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
891 ///- `VK_ERROR_DEVICE_LOST`
892 ///- `VK_ERROR_UNKNOWN`
893 ///- `VK_ERROR_VALIDATION_FAILED`
894 ///
895 ///# Safety
896 ///- `device` (self) must be valid and not destroyed.
897 ///
898 ///# Panics
899 ///Panics if `vkGetFenceStatus` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
900 ///
901 ///# Usage Notes
902 ///
903 ///Non-blocking check of whether a fence is signaled. Returns
904 ///`VK_SUCCESS` if signaled, `VK_NOT_READY` if still pending.
905 ///
906 ///Use this for polling patterns where you want to do other work while
907 ///waiting:
908 ///
909 ///```text
910 ///loop {
911 /// if get_fence_status(fence) == VK_SUCCESS { break; }
912 /// // do other work...
913 ///}
914 ///```
915 ///
916 ///For blocking waits, prefer `wait_for_fences` which is more efficient
917 ///than a spin loop, it lets the CPU sleep until the driver signals.
918 ///
919 ///This call can also return device-lost errors, so check the result
920 ///even in non-error paths.
921 pub unsafe fn get_fence_status(&self, fence: Fence) -> VkResult<()> {
922 let fp = self
923 .commands()
924 .get_fence_status
925 .expect("vkGetFenceStatus not loaded");
926 check(unsafe { fp(self.handle(), fence) })
927 }
928 ///Wraps [`vkWaitForFences`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkWaitForFences.html).
929 /**
930 Provided by **VK_BASE_VERSION_1_0**.*/
931 ///
932 ///# Errors
933 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
934 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
935 ///- `VK_ERROR_DEVICE_LOST`
936 ///- `VK_ERROR_UNKNOWN`
937 ///- `VK_ERROR_VALIDATION_FAILED`
938 ///
939 ///# Safety
940 ///- `device` (self) must be valid and not destroyed.
941 ///
942 ///# Panics
943 ///Panics if `vkWaitForFences` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
944 ///
945 ///# Usage Notes
946 ///
947 ///Blocks the calling thread until one or all of the given fences are
948 ///signaled, or until the timeout expires.
949 ///
950 ///**`wait_all`**: when `true`, the call returns only after *every*
951 ///fence in the list is signaled. When `false`, it returns as soon as
952 ///*any* one fence is signaled.
953 ///
954 ///**Timeout**: specified in nanoseconds. `u64::MAX` means wait
955 ///indefinitely. A timeout of zero performs a non-blocking check
956 ///(equivalent to polling `get_fence_status` on each fence).
957 ///
958 ///Returns `VK_TIMEOUT` if the timeout expires before the condition is
959 ///met. This is not an error, check the return value and handle it
960 ///(e.g. log a warning or retry).
961 ///
962 ///**Typical frame loop**:
963 ///
964 ///```text
965 ///wait_for_fences(&[frame_fence], true, u64::MAX)
966 ///reset_fences(&[frame_fence])
967 #[doc = "// record and submit..."]
968 ///```
969 ///
970 ///After `wait_for_fences` returns successfully, all GPU work
971 ///associated with those fences is complete and the resources are safe
972 ///to reuse.
973 pub unsafe fn wait_for_fences(
974 &self,
975 p_fences: &[Fence],
976 wait_all: bool,
977 timeout: u64,
978 ) -> VkResult<()> {
979 let fp = self
980 .commands()
981 .wait_for_fences
982 .expect("vkWaitForFences not loaded");
983 check(unsafe {
984 fp(
985 self.handle(),
986 p_fences.len() as u32,
987 p_fences.as_ptr(),
988 wait_all as u32,
989 timeout,
990 )
991 })
992 }
993 ///Wraps [`vkCreateSemaphore`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateSemaphore.html).
994 /**
995 Provided by **VK_BASE_VERSION_1_0**.*/
996 ///
997 ///# Errors
998 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
999 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1000 ///- `VK_ERROR_UNKNOWN`
1001 ///- `VK_ERROR_VALIDATION_FAILED`
1002 ///
1003 ///# Safety
1004 ///- `device` (self) must be valid and not destroyed.
1005 ///
1006 ///# Panics
1007 ///Panics if `vkCreateSemaphore` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1008 ///
1009 ///# Usage Notes
1010 ///
1011 ///Creates a semaphore for GPU–GPU synchronization between queue
1012 ///submissions. Unlike fences (CPU–GPU), semaphores are invisible to
1013 ///the CPU, they are signaled and waited on entirely within
1014 ///`queue_submit` or `queue_present_khr`.
1015 ///
1016 ///**Binary semaphores** (the default) have two states: signaled and
1017 ///unsignaled. A submission signals the semaphore, and a later
1018 ///submission waits on it, which also resets it to unsignaled.
1019 ///
1020 ///**Timeline semaphores** (Vulkan 1.2+) have a monotonically
1021 ///increasing 64-bit counter. Create one by chaining
1022 ///`SemaphoreTypeCreateInfo` with `SEMAPHORE_TYPE_TIMELINE`. Timeline
1023 ///semaphores can be waited on and signaled from the CPU as well via
1024 ///`wait_semaphores` and `signal_semaphore`.
1025 ///
1026 ///Common uses:
1027 ///
1028 ///- Synchronize between a graphics queue submit and a present.
1029 ///- Order a transfer upload before a render pass that consumes it.
1030 ///- Coordinate work across different queue families.
1031 ///
1032 ///# Guide
1033 ///
1034 ///See [Synchronization](https://hiddentale.github.io/vulkan_rust/concepts/synchronization.html) in the vulkan_rust guide.
1035 pub unsafe fn create_semaphore(
1036 &self,
1037 p_create_info: &SemaphoreCreateInfo,
1038 allocator: Option<&AllocationCallbacks>,
1039 ) -> VkResult<Semaphore> {
1040 let fp = self
1041 .commands()
1042 .create_semaphore
1043 .expect("vkCreateSemaphore not loaded");
1044 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1045 let mut out = unsafe { core::mem::zeroed() };
1046 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1047 Ok(out)
1048 }
1049 ///Wraps [`vkDestroySemaphore`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroySemaphore.html).
1050 /**
1051 Provided by **VK_BASE_VERSION_1_0**.*/
1052 ///
1053 ///# Safety
1054 ///- `device` (self) must be valid and not destroyed.
1055 ///- `semaphore` must be externally synchronized.
1056 ///
1057 ///# Panics
1058 ///Panics if `vkDestroySemaphore` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1059 ///
1060 ///# Usage Notes
1061 ///
1062 ///Destroys a semaphore. The semaphore must not be referenced by any
1063 ///pending queue submission, either as a wait or signal semaphore.
1064 ///
1065 ///Wait for all submissions that use this semaphore to complete (via
1066 ///fences or `device_wait_idle`) before destroying it.
1067 pub unsafe fn destroy_semaphore(
1068 &self,
1069 semaphore: Semaphore,
1070 allocator: Option<&AllocationCallbacks>,
1071 ) {
1072 let fp = self
1073 .commands()
1074 .destroy_semaphore
1075 .expect("vkDestroySemaphore not loaded");
1076 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1077 unsafe { fp(self.handle(), semaphore, alloc_ptr) };
1078 }
1079 ///Wraps [`vkCreateEvent`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateEvent.html).
1080 /**
1081 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1082 ///
1083 ///# Errors
1084 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1085 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1086 ///- `VK_ERROR_UNKNOWN`
1087 ///- `VK_ERROR_VALIDATION_FAILED`
1088 ///
1089 ///# Safety
1090 ///- `device` (self) must be valid and not destroyed.
1091 ///
1092 ///# Panics
1093 ///Panics if `vkCreateEvent` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1094 ///
1095 ///# Usage Notes
1096 ///
1097 ///Creates an event, a fine-grained synchronisation primitive that
1098 ///can be signaled and waited on from both the host (CPU) and the
1099 ///device (GPU).
1100 ///
1101 ///Events are most useful for split barriers: signal an event at one
1102 ///point in a command buffer, do other work, then wait on it later.
1103 ///This gives the GPU more flexibility to overlap execution compared to
1104 ///a single `cmd_pipeline_barrier`.
1105 ///
1106 ///**Host-side usage**: `set_event` and `reset_event` signal and reset
1107 ///from the CPU. `get_event_status` polls the current state. However,
1108 ///host-signaled events cannot be reliably waited on by the GPU on all
1109 ///implementations, use them primarily for GPU–GPU sync within a
1110 ///queue.
1111 ///
1112 ///Events are lightweight and cheap to create.
1113 pub unsafe fn create_event(
1114 &self,
1115 p_create_info: &EventCreateInfo,
1116 allocator: Option<&AllocationCallbacks>,
1117 ) -> VkResult<Event> {
1118 let fp = self
1119 .commands()
1120 .create_event
1121 .expect("vkCreateEvent not loaded");
1122 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1123 let mut out = unsafe { core::mem::zeroed() };
1124 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1125 Ok(out)
1126 }
1127 ///Wraps [`vkDestroyEvent`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyEvent.html).
1128 /**
1129 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1130 ///
1131 ///# Safety
1132 ///- `device` (self) must be valid and not destroyed.
1133 ///- `event` must be externally synchronized.
1134 ///
1135 ///# Panics
1136 ///Panics if `vkDestroyEvent` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1137 ///
1138 ///# Usage Notes
1139 ///
1140 ///Destroys an event. The event must not be referenced by any pending
1141 ///command buffer. Wait for all relevant submissions to complete before
1142 ///destroying.
1143 pub unsafe fn destroy_event(&self, event: Event, allocator: Option<&AllocationCallbacks>) {
1144 let fp = self
1145 .commands()
1146 .destroy_event
1147 .expect("vkDestroyEvent not loaded");
1148 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1149 unsafe { fp(self.handle(), event, alloc_ptr) };
1150 }
1151 ///Wraps [`vkGetEventStatus`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetEventStatus.html).
1152 /**
1153 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1154 ///
1155 ///# Errors
1156 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1157 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1158 ///- `VK_ERROR_DEVICE_LOST`
1159 ///- `VK_ERROR_UNKNOWN`
1160 ///- `VK_ERROR_VALIDATION_FAILED`
1161 ///
1162 ///# Safety
1163 ///- `device` (self) must be valid and not destroyed.
1164 ///
1165 ///# Panics
1166 ///Panics if `vkGetEventStatus` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1167 ///
1168 ///# Usage Notes
1169 ///
1170 ///Returns whether an event is currently signaled or unsignaled.
1171 ///Returns `VK_EVENT_SET` if signaled, `VK_EVENT_RESET` if not.
1172 ///
1173 ///This is a non-blocking host-side query. Use it to poll for
1174 ///GPU-signaled events when you need to know the result without
1175 ///blocking. For blocking synchronisation, use fences instead.
1176 pub unsafe fn get_event_status(&self, event: Event) -> VkResult<()> {
1177 let fp = self
1178 .commands()
1179 .get_event_status
1180 .expect("vkGetEventStatus not loaded");
1181 check(unsafe { fp(self.handle(), event) })
1182 }
1183 ///Wraps [`vkSetEvent`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetEvent.html).
1184 /**
1185 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1186 ///
1187 ///# Errors
1188 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1189 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1190 ///- `VK_ERROR_UNKNOWN`
1191 ///- `VK_ERROR_VALIDATION_FAILED`
1192 ///
1193 ///# Safety
1194 ///- `device` (self) must be valid and not destroyed.
1195 ///- `event` must be externally synchronized.
1196 ///
1197 ///# Panics
1198 ///Panics if `vkSetEvent` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1199 ///
1200 ///# Usage Notes
1201 ///
1202 ///Signals an event from the host (CPU). After this call,
1203 ///`get_event_status` returns `VK_EVENT_SET`.
1204 ///
1205 ///Host-signaled events are primarily useful for host–host
1206 ///synchronisation or as a manual control mechanism. For GPU–GPU
1207 ///synchronisation, prefer `cmd_set_event` recorded in a command
1208 ///buffer.
1209 pub unsafe fn set_event(&self, event: Event) -> VkResult<()> {
1210 let fp = self.commands().set_event.expect("vkSetEvent not loaded");
1211 check(unsafe { fp(self.handle(), event) })
1212 }
1213 ///Wraps [`vkResetEvent`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkResetEvent.html).
1214 /**
1215 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1216 ///
1217 ///# Errors
1218 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1219 ///- `VK_ERROR_UNKNOWN`
1220 ///- `VK_ERROR_VALIDATION_FAILED`
1221 ///
1222 ///# Safety
1223 ///- `device` (self) must be valid and not destroyed.
1224 ///- `event` must be externally synchronized.
1225 ///
1226 ///# Panics
1227 ///Panics if `vkResetEvent` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1228 ///
1229 ///# Usage Notes
1230 ///
1231 ///Resets an event to the unsignaled state from the host (CPU). The
1232 ///event must not be waited on by any pending `cmd_wait_events` call.
1233 ///
1234 ///After resetting, the event can be signaled again by `set_event` or
1235 ///`cmd_set_event`.
1236 pub unsafe fn reset_event(&self, event: Event) -> VkResult<()> {
1237 let fp = self
1238 .commands()
1239 .reset_event
1240 .expect("vkResetEvent not loaded");
1241 check(unsafe { fp(self.handle(), event) })
1242 }
1243 ///Wraps [`vkCreateQueryPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateQueryPool.html).
1244 /**
1245 Provided by **VK_BASE_VERSION_1_0**.*/
1246 ///
1247 ///# Errors
1248 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1249 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1250 ///- `VK_ERROR_UNKNOWN`
1251 ///- `VK_ERROR_VALIDATION_FAILED`
1252 ///
1253 ///# Safety
1254 ///- `device` (self) must be valid and not destroyed.
1255 ///
1256 ///# Panics
1257 ///Panics if `vkCreateQueryPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1258 ///
1259 ///# Usage Notes
1260 ///
1261 ///Creates a pool of query slots. Queries let you measure GPU
1262 ///performance and gather statistics without stalling the pipeline.
1263 ///
1264 ///**Query types**:
1265 ///
1266 ///- `OCCLUSION`: counts how many samples pass the depth test. Useful
1267 /// for visibility culling, render a bounding box, check the count.
1268 ///- `PIPELINE_STATISTICS`: counts shader invocations, primitives,
1269 /// clipping, etc. Must be enabled via
1270 /// `pipeline_statistics_query` device feature.
1271 ///- `TIMESTAMP`: records a GPU timestamp. Use two timestamps and the
1272 /// `timestamp_period` device property to measure elapsed time.
1273 ///
1274 ///Queries must be reset before use with `cmd_reset_query_pool` (or
1275 ///`reset_query_pool` on Vulkan 1.2+). Results are retrieved with
1276 ///`get_query_pool_results` or copied into a buffer with
1277 ///`cmd_copy_query_pool_results`.
1278 pub unsafe fn create_query_pool(
1279 &self,
1280 p_create_info: &QueryPoolCreateInfo,
1281 allocator: Option<&AllocationCallbacks>,
1282 ) -> VkResult<QueryPool> {
1283 let fp = self
1284 .commands()
1285 .create_query_pool
1286 .expect("vkCreateQueryPool not loaded");
1287 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1288 let mut out = unsafe { core::mem::zeroed() };
1289 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1290 Ok(out)
1291 }
1292 ///Wraps [`vkDestroyQueryPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyQueryPool.html).
1293 /**
1294 Provided by **VK_BASE_VERSION_1_0**.*/
1295 ///
1296 ///# Safety
1297 ///- `device` (self) must be valid and not destroyed.
1298 ///- `queryPool` must be externally synchronized.
1299 ///
1300 ///# Panics
1301 ///Panics if `vkDestroyQueryPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1302 ///
1303 ///# Usage Notes
1304 ///
1305 ///Destroys a query pool and frees its resources. All command buffers
1306 ///that reference this pool must have completed execution before
1307 ///destroying it.
1308 pub unsafe fn destroy_query_pool(
1309 &self,
1310 query_pool: QueryPool,
1311 allocator: Option<&AllocationCallbacks>,
1312 ) {
1313 let fp = self
1314 .commands()
1315 .destroy_query_pool
1316 .expect("vkDestroyQueryPool not loaded");
1317 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1318 unsafe { fp(self.handle(), query_pool, alloc_ptr) };
1319 }
1320 ///Wraps [`vkGetQueryPoolResults`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetQueryPoolResults.html).
1321 /**
1322 Provided by **VK_BASE_VERSION_1_0**.*/
1323 ///
1324 ///# Errors
1325 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1326 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1327 ///- `VK_ERROR_DEVICE_LOST`
1328 ///- `VK_ERROR_UNKNOWN`
1329 ///- `VK_ERROR_VALIDATION_FAILED`
1330 ///
1331 ///# Safety
1332 ///- `device` (self) must be valid and not destroyed.
1333 ///
1334 ///# Panics
1335 ///Panics if `vkGetQueryPoolResults` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1336 ///
1337 ///# Usage Notes
1338 ///
1339 ///Reads query results from a query pool into a host buffer. This is
1340 ///the CPU-side retrieval path, for GPU-side copies into a device
1341 ///buffer, use `cmd_copy_query_pool_results` instead.
1342 ///
1343 ///**Key flags**:
1344 ///
1345 ///- `QUERY_RESULT_64`: return 64-bit results. Always use this for
1346 /// timestamp and pipeline statistics queries to avoid overflow.
1347 ///- `QUERY_RESULT_WAIT`: block until all requested queries are
1348 /// available. Without this flag, unavailable queries return
1349 /// `VK_NOT_READY` and their slots are left untouched.
1350 ///- `QUERY_RESULT_WITH_AVAILABILITY`: append an availability value
1351 /// after each result (non-zero if available). Useful for polling
1352 /// without blocking.
1353 ///- `QUERY_RESULT_PARTIAL`: return whatever data is available even
1354 /// for incomplete queries. Only meaningful for occlusion queries.
1355 ///
1356 ///**Stride**: the `stride` parameter is the byte distance between
1357 ///successive query results in your output buffer. It must be at least
1358 ///large enough to hold the result plus the optional availability value.
1359 ///
1360 ///Queries that have not been started or not yet completed return
1361 ///`VK_NOT_READY` unless `QUERY_RESULT_WAIT` is set.
1362 pub unsafe fn get_query_pool_results(
1363 &self,
1364 query_pool: QueryPool,
1365 first_query: u32,
1366 query_count: u32,
1367 data_size: usize,
1368 p_data: *mut core::ffi::c_void,
1369 stride: u64,
1370 flags: QueryResultFlags,
1371 ) -> VkResult<()> {
1372 let fp = self
1373 .commands()
1374 .get_query_pool_results
1375 .expect("vkGetQueryPoolResults not loaded");
1376 check(unsafe {
1377 fp(
1378 self.handle(),
1379 query_pool,
1380 first_query,
1381 query_count,
1382 data_size,
1383 p_data,
1384 stride,
1385 flags,
1386 )
1387 })
1388 }
1389 ///Wraps [`vkResetQueryPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkResetQueryPool.html).
1390 /**
1391 Provided by **VK_BASE_VERSION_1_2**.*/
1392 ///
1393 ///# Safety
1394 ///- `device` (self) must be valid and not destroyed.
1395 ///
1396 ///# Panics
1397 ///Panics if `vkResetQueryPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1398 ///
1399 ///# Usage Notes
1400 ///
1401 ///Resets a range of queries in a pool from the host (CPU). This is the
1402 ///Vulkan 1.2 host-side alternative to `cmd_reset_query_pool`, which
1403 ///resets queries from a command buffer.
1404 ///
1405 ///Host-side reset is simpler, call it directly without recording a
1406 ///command buffer. Requires the `host_query_reset` feature (core in
1407 ///Vulkan 1.2).
1408 ///
1409 ///Queries must be reset before use. Resetting a query that is in use
1410 ///by a pending command buffer is an error.
1411 pub unsafe fn reset_query_pool(
1412 &self,
1413 query_pool: QueryPool,
1414 first_query: u32,
1415 query_count: u32,
1416 ) {
1417 let fp = self
1418 .commands()
1419 .reset_query_pool
1420 .expect("vkResetQueryPool not loaded");
1421 unsafe { fp(self.handle(), query_pool, first_query, query_count) };
1422 }
1423 ///Wraps [`vkCreateBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateBuffer.html).
1424 /**
1425 Provided by **VK_BASE_VERSION_1_0**.*/
1426 ///
1427 ///# Errors
1428 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1429 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1430 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
1431 ///- `VK_ERROR_UNKNOWN`
1432 ///- `VK_ERROR_VALIDATION_FAILED`
1433 ///
1434 ///# Safety
1435 ///- `device` (self) must be valid and not destroyed.
1436 ///
1437 ///# Panics
1438 ///Panics if `vkCreateBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1439 ///
1440 ///# Examples
1441 ///
1442 ///```no_run
1443 ///# let (_, instance) = vulkan_rust::test_helpers::create_test_instance().expect("test setup");
1444 ///# let phys = unsafe { instance.enumerate_physical_devices() }.expect("no devices");
1445 ///# let p = [1.0f32];
1446 ///# let qi = vulkan_rust::vk::DeviceQueueCreateInfo::builder().queue_priorities(&p);
1447 ///# let qis = [*qi];
1448 ///# let di = vulkan_rust::vk::DeviceCreateInfo::builder().queue_create_infos(&qis);
1449 ///# let device = unsafe { instance.create_device(phys[0], &di, None) }.expect("device creation");
1450 ///use vulkan_rust::vk::*;
1451 ///
1452 ///let info = BufferCreateInfo::builder()
1453 /// .size(1024)
1454 /// .usage(BufferUsageFlagBits::VERTEX_BUFFER)
1455 /// .sharing_mode(vulkan_rust::vk::SharingMode::EXCLUSIVE);
1456 ///let buffer = unsafe { device.create_buffer(&info, None) }
1457 /// .expect("buffer creation failed");
1458 #[doc = "// Use buffer..."]
1459 ///unsafe { device.destroy_buffer(buffer, None) };
1460 ///# unsafe { device.destroy_device(None) };
1461 ///# unsafe { instance.destroy_instance(None) };
1462 ///```
1463 ///
1464 ///# Guide
1465 ///
1466 ///See [Memory Management](https://hiddentale.github.io/vulkan_rust/concepts/memory.html) in the vulkan_rust guide.
1467 pub unsafe fn create_buffer(
1468 &self,
1469 p_create_info: &BufferCreateInfo,
1470 allocator: Option<&AllocationCallbacks>,
1471 ) -> VkResult<Buffer> {
1472 let fp = self
1473 .commands()
1474 .create_buffer
1475 .expect("vkCreateBuffer not loaded");
1476 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1477 let mut out = unsafe { core::mem::zeroed() };
1478 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1479 Ok(out)
1480 }
1481 ///Wraps [`vkDestroyBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyBuffer.html).
1482 /**
1483 Provided by **VK_BASE_VERSION_1_0**.*/
1484 ///
1485 ///# Safety
1486 ///- `device` (self) must be valid and not destroyed.
1487 ///- `buffer` must be externally synchronized.
1488 ///
1489 ///# Panics
1490 ///Panics if `vkDestroyBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1491 ///
1492 ///# Usage Notes
1493 ///
1494 ///Destroys a buffer object. The buffer must not be in use by any
1495 ///pending GPU work, wait on the relevant fences or call
1496 ///`device_wait_idle` before destroying.
1497 ///
1498 ///Destroying a buffer does **not** free its backing memory. Call
1499 ///`free_memory` separately (or let your sub-allocator reclaim the
1500 ///region).
1501 ///
1502 ///Destroy order: destroy the buffer first, then free the memory. Not
1503 ///the reverse, freeing memory while a buffer is still bound to it is
1504 ///undefined behaviour.
1505 pub unsafe fn destroy_buffer(&self, buffer: Buffer, allocator: Option<&AllocationCallbacks>) {
1506 let fp = self
1507 .commands()
1508 .destroy_buffer
1509 .expect("vkDestroyBuffer not loaded");
1510 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1511 unsafe { fp(self.handle(), buffer, alloc_ptr) };
1512 }
1513 ///Wraps [`vkCreateBufferView`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateBufferView.html).
1514 /**
1515 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1516 ///
1517 ///# Errors
1518 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1519 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1520 ///- `VK_ERROR_UNKNOWN`
1521 ///- `VK_ERROR_VALIDATION_FAILED`
1522 ///
1523 ///# Safety
1524 ///- `device` (self) must be valid and not destroyed.
1525 ///
1526 ///# Panics
1527 ///Panics if `vkCreateBufferView` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1528 ///
1529 ///# Usage Notes
1530 ///
1531 ///Creates a view into a buffer that interprets its contents as a
1532 ///typed array of texels. Buffer views are used with:
1533 ///
1534 ///- **Uniform texel buffers** (`BUFFER_USAGE_UNIFORM_TEXEL_BUFFER`):
1535 /// read-only typed access from shaders via `samplerBuffer` /
1536 /// `textureBuffer` in GLSL.
1537 ///- **Storage texel buffers** (`BUFFER_USAGE_STORAGE_TEXEL_BUFFER`):
1538 /// read-write typed access from shaders via `imageBuffer` in GLSL.
1539 ///
1540 ///The format, offset, and range define the view window into the
1541 ///buffer. The format must be supported for the buffer view usage,
1542 ///check `format_properties.buffer_features`.
1543 ///
1544 ///Buffer views are less common than image views. They are mainly used
1545 ///for large, flat data arrays (e.g. particle attributes, lookup
1546 ///tables) that benefit from format conversion on read.
1547 pub unsafe fn create_buffer_view(
1548 &self,
1549 p_create_info: &BufferViewCreateInfo,
1550 allocator: Option<&AllocationCallbacks>,
1551 ) -> VkResult<BufferView> {
1552 let fp = self
1553 .commands()
1554 .create_buffer_view
1555 .expect("vkCreateBufferView not loaded");
1556 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1557 let mut out = unsafe { core::mem::zeroed() };
1558 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1559 Ok(out)
1560 }
1561 ///Wraps [`vkDestroyBufferView`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyBufferView.html).
1562 /**
1563 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1564 ///
1565 ///# Safety
1566 ///- `device` (self) must be valid and not destroyed.
1567 ///- `bufferView` must be externally synchronized.
1568 ///
1569 ///# Panics
1570 ///Panics if `vkDestroyBufferView` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1571 ///
1572 ///# Usage Notes
1573 ///
1574 ///Destroys a buffer view. The view must not be referenced by any
1575 ///descriptor set that is bound in a pending command buffer.
1576 ///
1577 ///Destroy buffer views before the underlying buffer.
1578 pub unsafe fn destroy_buffer_view(
1579 &self,
1580 buffer_view: BufferView,
1581 allocator: Option<&AllocationCallbacks>,
1582 ) {
1583 let fp = self
1584 .commands()
1585 .destroy_buffer_view
1586 .expect("vkDestroyBufferView not loaded");
1587 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1588 unsafe { fp(self.handle(), buffer_view, alloc_ptr) };
1589 }
1590 ///Wraps [`vkCreateImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateImage.html).
1591 /**
1592 Provided by **VK_BASE_VERSION_1_0**.*/
1593 ///
1594 ///# Errors
1595 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1596 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1597 ///- `VK_ERROR_COMPRESSION_EXHAUSTED_EXT`
1598 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
1599 ///- `VK_ERROR_UNKNOWN`
1600 ///- `VK_ERROR_VALIDATION_FAILED`
1601 ///
1602 ///# Safety
1603 ///- `device` (self) must be valid and not destroyed.
1604 ///
1605 ///# Panics
1606 ///Panics if `vkCreateImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1607 ///
1608 ///# Usage Notes
1609 ///
1610 ///After creating an image you must bind memory to it before use:
1611 ///
1612 ///1. Query requirements with `get_image_memory_requirements`.
1613 ///2. Allocate from a compatible memory type with `allocate_memory`.
1614 ///3. Bind with `bind_image_memory`.
1615 ///
1616 ///Choose `IMAGE_TILING_OPTIMAL` for GPU-side textures and render targets.
1617 ///Use `IMAGE_TILING_LINEAR` only when you need direct CPU access to the
1618 ///texel layout (e.g. CPU readback), and check format support first with
1619 ///`get_physical_device_image_format_properties`.
1620 ///
1621 ///The `initial_layout` must be `UNDEFINED` or `PREINITIALIZED`.
1622 ///Most applications use `UNDEFINED` and transition via a pipeline barrier.
1623 ///
1624 ///Destroy with `destroy_image` when no longer needed. Do not destroy an
1625 ///image that is still referenced by a framebuffer or image view.
1626 pub unsafe fn create_image(
1627 &self,
1628 p_create_info: &ImageCreateInfo,
1629 allocator: Option<&AllocationCallbacks>,
1630 ) -> VkResult<Image> {
1631 let fp = self
1632 .commands()
1633 .create_image
1634 .expect("vkCreateImage not loaded");
1635 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1636 let mut out = unsafe { core::mem::zeroed() };
1637 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1638 Ok(out)
1639 }
1640 ///Wraps [`vkDestroyImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyImage.html).
1641 /**
1642 Provided by **VK_BASE_VERSION_1_0**.*/
1643 ///
1644 ///# Safety
1645 ///- `device` (self) must be valid and not destroyed.
1646 ///- `image` must be externally synchronized.
1647 ///
1648 ///# Panics
1649 ///Panics if `vkDestroyImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1650 ///
1651 ///# Usage Notes
1652 ///
1653 ///Destroys an image object. The image must not be in use by any
1654 ///pending GPU work, and all image views referencing this image must
1655 ///already be destroyed.
1656 ///
1657 ///Destroying an image does **not** free its backing memory. Call
1658 ///`free_memory` separately after destroying the image.
1659 ///
1660 ///Safe teardown order for an image:
1661 ///
1662 ///1. Wait for all GPU work using the image to complete.
1663 ///2. Destroy all `ImageView` objects referencing the image.
1664 ///3. Destroy any `Framebuffer` objects that included those views.
1665 ///4. `destroy_image`.
1666 ///5. Free or reclaim the backing memory.
1667 pub unsafe fn destroy_image(&self, image: Image, allocator: Option<&AllocationCallbacks>) {
1668 let fp = self
1669 .commands()
1670 .destroy_image
1671 .expect("vkDestroyImage not loaded");
1672 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1673 unsafe { fp(self.handle(), image, alloc_ptr) };
1674 }
1675 ///Wraps [`vkGetImageSubresourceLayout`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageSubresourceLayout.html).
1676 /**
1677 Provided by **VK_BASE_VERSION_1_0**.*/
1678 ///
1679 ///# Safety
1680 ///- `device` (self) must be valid and not destroyed.
1681 ///
1682 ///# Panics
1683 ///Panics if `vkGetImageSubresourceLayout` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1684 ///
1685 ///# Usage Notes
1686 ///
1687 ///Queries the memory layout (offset, size, row pitch, array pitch,
1688 ///depth pitch) of a specific subresource within a linear-tiling
1689 ///image. Only valid for images created with `IMAGE_TILING_LINEAR`.
1690 ///For optimal-tiling images, use `get_image_subresource_layout2`.
1691 pub unsafe fn get_image_subresource_layout(
1692 &self,
1693 image: Image,
1694 p_subresource: &ImageSubresource,
1695 ) -> SubresourceLayout {
1696 let fp = self
1697 .commands()
1698 .get_image_subresource_layout
1699 .expect("vkGetImageSubresourceLayout not loaded");
1700 let mut out = unsafe { core::mem::zeroed() };
1701 unsafe { fp(self.handle(), image, p_subresource, &mut out) };
1702 out
1703 }
1704 ///Wraps [`vkCreateImageView`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateImageView.html).
1705 /**
1706 Provided by **VK_BASE_VERSION_1_0**.*/
1707 ///
1708 ///# Errors
1709 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1710 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1711 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
1712 ///- `VK_ERROR_UNKNOWN`
1713 ///- `VK_ERROR_VALIDATION_FAILED`
1714 ///
1715 ///# Safety
1716 ///- `device` (self) must be valid and not destroyed.
1717 ///
1718 ///# Panics
1719 ///Panics if `vkCreateImageView` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1720 ///
1721 ///# Usage Notes
1722 ///
1723 ///An image view selects a subset of an image's subresources and
1724 ///reinterprets them for a specific use (sampling, color attachment, etc.).
1725 ///
1726 ///Common pitfalls:
1727 ///
1728 ///- **Aspect mask**: use `COLOR` for color formats, `DEPTH` and/or
1729 /// `STENCIL` for depth/stencil formats. Getting this wrong causes
1730 /// validation errors that are not always obvious.
1731 ///- **Format compatibility**: the view format must be compatible with the
1732 /// image's format. Using `IMAGE_CREATE_MUTABLE_FORMAT` on the image
1733 /// relaxes this to any format in the same size-compatibility class.
1734 ///- **View type vs image type**: a 2D image can back a `VIEW_TYPE_2D` or
1735 /// `VIEW_TYPE_2D_ARRAY`. A 3D image cannot be viewed as 2D without
1736 /// `VK_EXT_image_2d_view_of_3d`.
1737 ///
1738 ///Destroy with `destroy_image_view` when no longer needed. Destroy image
1739 ///views *before* destroying the underlying image.
1740 pub unsafe fn create_image_view(
1741 &self,
1742 p_create_info: &ImageViewCreateInfo,
1743 allocator: Option<&AllocationCallbacks>,
1744 ) -> VkResult<ImageView> {
1745 let fp = self
1746 .commands()
1747 .create_image_view
1748 .expect("vkCreateImageView not loaded");
1749 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1750 let mut out = unsafe { core::mem::zeroed() };
1751 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1752 Ok(out)
1753 }
1754 ///Wraps [`vkDestroyImageView`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyImageView.html).
1755 /**
1756 Provided by **VK_BASE_VERSION_1_0**.*/
1757 ///
1758 ///# Safety
1759 ///- `device` (self) must be valid and not destroyed.
1760 ///- `imageView` must be externally synchronized.
1761 ///
1762 ///# Panics
1763 ///Panics if `vkDestroyImageView` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1764 ///
1765 ///# Usage Notes
1766 ///
1767 ///Destroys an image view. The view must not be referenced by any
1768 ///pending GPU work or by any framebuffer that is still in use.
1769 ///
1770 ///Destroy image views **before** the underlying image. Destroy any
1771 ///framebuffers that reference the view before destroying the view
1772 ///itself.
1773 pub unsafe fn destroy_image_view(
1774 &self,
1775 image_view: ImageView,
1776 allocator: Option<&AllocationCallbacks>,
1777 ) {
1778 let fp = self
1779 .commands()
1780 .destroy_image_view
1781 .expect("vkDestroyImageView not loaded");
1782 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1783 unsafe { fp(self.handle(), image_view, alloc_ptr) };
1784 }
1785 ///Wraps [`vkCreateShaderModule`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateShaderModule.html).
1786 /**
1787 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1788 ///
1789 ///# Errors
1790 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1791 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1792 ///- `VK_ERROR_INVALID_SHADER_NV`
1793 ///- `VK_ERROR_UNKNOWN`
1794 ///- `VK_ERROR_VALIDATION_FAILED`
1795 ///
1796 ///# Safety
1797 ///- `device` (self) must be valid and not destroyed.
1798 ///
1799 ///# Panics
1800 ///Panics if `vkCreateShaderModule` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1801 ///
1802 ///# Usage Notes
1803 ///
1804 ///The input must be valid SPIR-V bytecode. The `code` slice is `&[u32]`
1805 ///and must be aligned to 4 bytes, which Rust's `&[u32]` guarantees.
1806 ///
1807 ///Use the `bytecode::read_spv` helper to load a `.spv` file from disk
1808 ///with correct alignment.
1809 ///
1810 ///Shader modules can be destroyed immediately after pipeline creation;
1811 ///the driver copies what it needs during `create_graphics_pipelines` or
1812 ///`create_compute_pipelines`. Destroying early keeps the handle count
1813 ///low.
1814 ///
1815 ///# Guide
1816 ///
1817 ///See [Pipelines](https://hiddentale.github.io/vulkan_rust/concepts/pipelines.html) in the vulkan_rust guide.
1818 pub unsafe fn create_shader_module(
1819 &self,
1820 p_create_info: &ShaderModuleCreateInfo,
1821 allocator: Option<&AllocationCallbacks>,
1822 ) -> VkResult<ShaderModule> {
1823 let fp = self
1824 .commands()
1825 .create_shader_module
1826 .expect("vkCreateShaderModule not loaded");
1827 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1828 let mut out = unsafe { core::mem::zeroed() };
1829 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1830 Ok(out)
1831 }
1832 ///Wraps [`vkDestroyShaderModule`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyShaderModule.html).
1833 /**
1834 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1835 ///
1836 ///# Safety
1837 ///- `device` (self) must be valid and not destroyed.
1838 ///- `shaderModule` must be externally synchronized.
1839 ///
1840 ///# Panics
1841 ///Panics if `vkDestroyShaderModule` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1842 ///
1843 ///# Usage Notes
1844 ///
1845 ///Destroys a shader module. The module must not be in use by any
1846 ///pipeline. Shader modules can be safely destroyed after pipeline
1847 ///creation since the driver copies the SPIR-V at creation time.
1848 pub unsafe fn destroy_shader_module(
1849 &self,
1850 shader_module: ShaderModule,
1851 allocator: Option<&AllocationCallbacks>,
1852 ) {
1853 let fp = self
1854 .commands()
1855 .destroy_shader_module
1856 .expect("vkDestroyShaderModule not loaded");
1857 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1858 unsafe { fp(self.handle(), shader_module, alloc_ptr) };
1859 }
1860 ///Wraps [`vkCreatePipelineCache`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreatePipelineCache.html).
1861 /**
1862 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1863 ///
1864 ///# Errors
1865 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1866 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1867 ///- `VK_ERROR_UNKNOWN`
1868 ///- `VK_ERROR_VALIDATION_FAILED`
1869 ///
1870 ///# Safety
1871 ///- `device` (self) must be valid and not destroyed.
1872 ///
1873 ///# Panics
1874 ///Panics if `vkCreatePipelineCache` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1875 ///
1876 ///# Usage Notes
1877 ///
1878 ///Creates a pipeline cache that stores compiled pipeline state to
1879 ///speed up future pipeline creation.
1880 ///
1881 ///**Initial data**: pass previously serialized cache data (from
1882 ///`get_pipeline_cache_data`) to warm the cache on startup. The driver
1883 ///validates the header and silently ignores data from incompatible
1884 ///driver versions or hardware, it is always safe to pass stale data.
1885 ///
1886 ///A single cache can be shared across all pipeline creation calls in
1887 ///the application. Multiple threads can use the same cache
1888 ///concurrently, the driver handles internal synchronization.
1889 ///
1890 ///**Recommended workflow**:
1891 ///
1892 ///1. On startup, load cache data from disk and create the cache.
1893 ///2. Pass the cache to every `create_graphics_pipelines` and
1894 /// `create_compute_pipelines` call.
1895 ///3. On shutdown, serialize with `get_pipeline_cache_data` and write
1896 /// to disk.
1897 pub unsafe fn create_pipeline_cache(
1898 &self,
1899 p_create_info: &PipelineCacheCreateInfo,
1900 allocator: Option<&AllocationCallbacks>,
1901 ) -> VkResult<PipelineCache> {
1902 let fp = self
1903 .commands()
1904 .create_pipeline_cache
1905 .expect("vkCreatePipelineCache not loaded");
1906 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1907 let mut out = unsafe { core::mem::zeroed() };
1908 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1909 Ok(out)
1910 }
1911 ///Wraps [`vkDestroyPipelineCache`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyPipelineCache.html).
1912 /**
1913 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1914 ///
1915 ///# Safety
1916 ///- `device` (self) must be valid and not destroyed.
1917 ///- `pipelineCache` must be externally synchronized.
1918 ///
1919 ///# Panics
1920 ///Panics if `vkDestroyPipelineCache` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1921 ///
1922 ///# Usage Notes
1923 ///
1924 ///Destroys a pipeline cache. Pipelines that were created using this
1925 ///cache remain valid, the cache is only needed during creation, not
1926 ///at runtime.
1927 ///
1928 ///Serialize the cache with `get_pipeline_cache_data` before destroying
1929 ///if you want to persist it to disk for the next session.
1930 pub unsafe fn destroy_pipeline_cache(
1931 &self,
1932 pipeline_cache: PipelineCache,
1933 allocator: Option<&AllocationCallbacks>,
1934 ) {
1935 let fp = self
1936 .commands()
1937 .destroy_pipeline_cache
1938 .expect("vkDestroyPipelineCache not loaded");
1939 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1940 unsafe { fp(self.handle(), pipeline_cache, alloc_ptr) };
1941 }
1942 ///Wraps [`vkGetPipelineCacheData`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPipelineCacheData.html).
1943 /**
1944 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1945 ///
1946 ///# Errors
1947 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1948 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1949 ///- `VK_ERROR_UNKNOWN`
1950 ///- `VK_ERROR_VALIDATION_FAILED`
1951 ///
1952 ///# Safety
1953 ///- `device` (self) must be valid and not destroyed.
1954 ///
1955 ///# Panics
1956 ///Panics if `vkGetPipelineCacheData` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1957 ///
1958 ///# Usage Notes
1959 ///
1960 ///Serializes the contents of a pipeline cache into a byte buffer for
1961 ///storage on disk. The data includes a vendor-specific header that the
1962 ///driver uses to validate compatibility on reload.
1963 ///
1964 ///Call this with a null data pointer first to query the required buffer
1965 ///size, then allocate and call again. The wrapper handles this
1966 ///two-call pattern for you.
1967 ///
1968 ///The cache data is **not portable** across different GPU vendors,
1969 ///driver versions, or pipeline cache UUIDs. Always check the header
1970 ///or let the driver reject incompatible data silently on reload via
1971 ///`create_pipeline_cache`.
1972 ///
1973 ///Write the data to a file (e.g. `pipeline_cache.bin`) and load it on
1974 ///the next application start to avoid redundant shader compilation.
1975 pub unsafe fn get_pipeline_cache_data(
1976 &self,
1977 pipeline_cache: PipelineCache,
1978 p_data: *mut core::ffi::c_void,
1979 ) -> VkResult<usize> {
1980 let fp = self
1981 .commands()
1982 .get_pipeline_cache_data
1983 .expect("vkGetPipelineCacheData not loaded");
1984 let mut out = unsafe { core::mem::zeroed() };
1985 check(unsafe { fp(self.handle(), pipeline_cache, &mut out, p_data) })?;
1986 Ok(out)
1987 }
1988 ///Wraps [`vkMergePipelineCaches`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkMergePipelineCaches.html).
1989 /**
1990 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1991 ///
1992 ///# Errors
1993 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1994 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1995 ///- `VK_ERROR_UNKNOWN`
1996 ///- `VK_ERROR_VALIDATION_FAILED`
1997 ///
1998 ///# Safety
1999 ///- `device` (self) must be valid and not destroyed.
2000 ///- `dstCache` must be externally synchronized.
2001 ///
2002 ///# Panics
2003 ///Panics if `vkMergePipelineCaches` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2004 ///
2005 ///# Usage Notes
2006 ///
2007 ///Merges one or more source caches into a destination cache. Useful
2008 ///when multiple threads each use their own cache during parallel
2009 ///pipeline creation, merge them into a single cache before
2010 ///serializing to disk.
2011 ///
2012 ///The source caches are not modified or destroyed by this call. The
2013 ///destination cache receives all entries from the sources that it does
2014 ///not already contain. Duplicate entries are ignored.
2015 ///
2016 ///After merging, you can destroy the source caches if they are no
2017 ///longer needed.
2018 pub unsafe fn merge_pipeline_caches(
2019 &self,
2020 dst_cache: PipelineCache,
2021 p_src_caches: &[PipelineCache],
2022 ) -> VkResult<()> {
2023 let fp = self
2024 .commands()
2025 .merge_pipeline_caches
2026 .expect("vkMergePipelineCaches not loaded");
2027 check(unsafe {
2028 fp(
2029 self.handle(),
2030 dst_cache,
2031 p_src_caches.len() as u32,
2032 p_src_caches.as_ptr(),
2033 )
2034 })
2035 }
2036 ///Wraps [`vkCreatePipelineBinariesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreatePipelineBinariesKHR.html).
2037 /**
2038 Provided by **VK_KHR_pipeline_binary**.*/
2039 ///
2040 ///# Errors
2041 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2042 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2043 ///- `VK_ERROR_INITIALIZATION_FAILED`
2044 ///- `VK_ERROR_UNKNOWN`
2045 ///- `VK_ERROR_VALIDATION_FAILED`
2046 ///
2047 ///# Safety
2048 ///- `device` (self) must be valid and not destroyed.
2049 ///
2050 ///# Panics
2051 ///Panics if `vkCreatePipelineBinariesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2052 ///
2053 ///# Usage Notes
2054 ///
2055 ///Creates pipeline binary objects from either a pipeline create info
2056 ///or previously serialized binary data. Pipeline binaries capture
2057 ///compiled shader code in a device-specific format, enabling fast
2058 ///pipeline recreation without recompilation.
2059 ///
2060 ///Two creation paths via `PipelineBinaryCreateInfoKHR`:
2061 ///
2062 ///- **From pipeline create info + key**: compiles shaders and
2063 /// produces binaries. Use `get_pipeline_key_khr` to obtain the
2064 /// key first.
2065 ///- **From serialized data**: restores binaries saved with
2066 /// `get_pipeline_binary_data_khr` from a prior run. This skips
2067 /// compilation entirely.
2068 ///
2069 ///The output is written to `PipelineBinaryHandlesInfoKHR`. Call
2070 ///once with a null `pipelines` pointer to query the count, then
2071 ///again with an allocated array.
2072 ///
2073 ///Pipeline binaries are more portable than pipeline caches, they
2074 ///can be validated, versioned, and stored in application-managed
2075 ///files rather than opaque blobs.
2076 pub unsafe fn create_pipeline_binaries_khr(
2077 &self,
2078 p_create_info: &PipelineBinaryCreateInfoKHR,
2079 allocator: Option<&AllocationCallbacks>,
2080 p_binaries: &mut PipelineBinaryHandlesInfoKHR,
2081 ) -> VkResult<()> {
2082 let fp = self
2083 .commands()
2084 .create_pipeline_binaries_khr
2085 .expect("vkCreatePipelineBinariesKHR not loaded");
2086 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2087 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, p_binaries) })
2088 }
2089 ///Wraps [`vkDestroyPipelineBinaryKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyPipelineBinaryKHR.html).
2090 /**
2091 Provided by **VK_KHR_pipeline_binary**.*/
2092 ///
2093 ///# Safety
2094 ///- `device` (self) must be valid and not destroyed.
2095 ///- `pipelineBinary` must be externally synchronized.
2096 ///
2097 ///# Panics
2098 ///Panics if `vkDestroyPipelineBinaryKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2099 ///
2100 ///# Usage Notes
2101 ///
2102 ///Destroys a pipeline binary handle. After destruction, the binary
2103 ///cannot be used to create pipelines or retrieve data.
2104 ///
2105 ///Pipeline binaries are independent of the pipelines created from
2106 ///them, destroying a binary does not affect any pipeline that was
2107 ///already created using it.
2108 pub unsafe fn destroy_pipeline_binary_khr(
2109 &self,
2110 pipeline_binary: PipelineBinaryKHR,
2111 allocator: Option<&AllocationCallbacks>,
2112 ) {
2113 let fp = self
2114 .commands()
2115 .destroy_pipeline_binary_khr
2116 .expect("vkDestroyPipelineBinaryKHR not loaded");
2117 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2118 unsafe { fp(self.handle(), pipeline_binary, alloc_ptr) };
2119 }
2120 ///Wraps [`vkGetPipelineKeyKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPipelineKeyKHR.html).
2121 /**
2122 Provided by **VK_KHR_pipeline_binary**.*/
2123 ///
2124 ///# Errors
2125 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2126 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2127 ///- `VK_ERROR_UNKNOWN`
2128 ///- `VK_ERROR_VALIDATION_FAILED`
2129 ///
2130 ///# Safety
2131 ///- `device` (self) must be valid and not destroyed.
2132 ///
2133 ///# Panics
2134 ///Panics if `vkGetPipelineKeyKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2135 ///
2136 ///# Usage Notes
2137 ///
2138 ///Computes a pipeline key that identifies the pipeline configuration
2139 ///for use with pipeline binaries. The key is a hash of the pipeline
2140 ///create info that lets you look up previously cached binaries.
2141 ///
2142 ///Pass a `PipelineCreateInfoKHR` referencing the pipeline create
2143 ///info (graphics, compute, or ray tracing) to get its key. Pass
2144 ///`None` to get an empty key structure for use as an output
2145 ///parameter.
2146 ///
2147 ///Store the key alongside serialized binary data from
2148 ///`get_pipeline_binary_data_khr`. On subsequent runs, compute the
2149 ///key for the current pipeline configuration and check if a matching
2150 ///binary exists before falling back to full compilation.
2151 pub unsafe fn get_pipeline_key_khr(
2152 &self,
2153 p_pipeline_create_info: Option<&PipelineCreateInfoKHR>,
2154 p_pipeline_key: &mut PipelineBinaryKeyKHR,
2155 ) -> VkResult<()> {
2156 let fp = self
2157 .commands()
2158 .get_pipeline_key_khr
2159 .expect("vkGetPipelineKeyKHR not loaded");
2160 let p_pipeline_create_info_ptr =
2161 p_pipeline_create_info.map_or(core::ptr::null(), core::ptr::from_ref);
2162 check(unsafe { fp(self.handle(), p_pipeline_create_info_ptr, p_pipeline_key) })
2163 }
2164 ///Wraps [`vkGetPipelineBinaryDataKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPipelineBinaryDataKHR.html).
2165 /**
2166 Provided by **VK_KHR_pipeline_binary**.*/
2167 ///
2168 ///# Errors
2169 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2170 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2171 ///- `VK_ERROR_NOT_ENOUGH_SPACE_KHR`
2172 ///- `VK_ERROR_UNKNOWN`
2173 ///- `VK_ERROR_VALIDATION_FAILED`
2174 ///
2175 ///# Safety
2176 ///- `device` (self) must be valid and not destroyed.
2177 ///
2178 ///# Panics
2179 ///Panics if `vkGetPipelineBinaryDataKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2180 ///
2181 ///# Usage Notes
2182 ///
2183 ///Serializes a pipeline binary into a byte buffer for offline
2184 ///storage. The data can be saved to disk and later passed to
2185 ///`create_pipeline_binaries_khr` to skip shader compilation on
2186 ///subsequent application launches.
2187 ///
2188 ///Uses the two-call pattern: call with a null `p_pipeline_binary_data`
2189 ///to query the required `data_size`, allocate a buffer, then call
2190 ///again to fill it.
2191 ///
2192 ///The output also includes a `PipelineBinaryKeyKHR` that identifies
2193 ///the binary. Store the key alongside the data, it is required
2194 ///when recreating the binary.
2195 ///
2196 ///Serialized data is device-specific and may become invalid after
2197 ///driver updates. Applications should handle creation failure
2198 ///gracefully by falling back to full recompilation.
2199 pub unsafe fn get_pipeline_binary_data_khr(
2200 &self,
2201 p_info: &PipelineBinaryDataInfoKHR,
2202 p_pipeline_binary_key: &mut PipelineBinaryKeyKHR,
2203 p_pipeline_binary_data: *mut core::ffi::c_void,
2204 ) -> VkResult<usize> {
2205 let fp = self
2206 .commands()
2207 .get_pipeline_binary_data_khr
2208 .expect("vkGetPipelineBinaryDataKHR not loaded");
2209 let mut out = unsafe { core::mem::zeroed() };
2210 check(unsafe {
2211 fp(
2212 self.handle(),
2213 p_info,
2214 p_pipeline_binary_key,
2215 &mut out,
2216 p_pipeline_binary_data,
2217 )
2218 })?;
2219 Ok(out)
2220 }
2221 ///Wraps [`vkReleaseCapturedPipelineDataKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkReleaseCapturedPipelineDataKHR.html).
2222 /**
2223 Provided by **VK_KHR_pipeline_binary**.*/
2224 ///
2225 ///# Errors
2226 ///- `VK_ERROR_UNKNOWN`
2227 ///- `VK_ERROR_VALIDATION_FAILED`
2228 ///
2229 ///# Safety
2230 ///- `device` (self) must be valid and not destroyed.
2231 ///
2232 ///# Panics
2233 ///Panics if `vkReleaseCapturedPipelineDataKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2234 ///
2235 ///# Usage Notes
2236 ///
2237 ///Releases internal data captured during pipeline creation that was
2238 ///retained for binary extraction. Call this after you have finished
2239 ///calling `create_pipeline_binaries_khr` for a pipeline created
2240 ///with `PIPELINE_CREATE_CAPTURE_DATA`.
2241 ///
2242 ///The pipeline itself remains valid after this call, only the
2243 ///captured internal data is freed. This reduces memory usage when
2244 ///you no longer need to extract binaries from the pipeline.
2245 pub unsafe fn release_captured_pipeline_data_khr(
2246 &self,
2247 p_info: &ReleaseCapturedPipelineDataInfoKHR,
2248 allocator: Option<&AllocationCallbacks>,
2249 ) -> VkResult<()> {
2250 let fp = self
2251 .commands()
2252 .release_captured_pipeline_data_khr
2253 .expect("vkReleaseCapturedPipelineDataKHR not loaded");
2254 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2255 check(unsafe { fp(self.handle(), p_info, alloc_ptr) })
2256 }
2257 ///Wraps [`vkCreateGraphicsPipelines`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateGraphicsPipelines.html).
2258 /**
2259 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
2260 ///
2261 ///# Errors
2262 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2263 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2264 ///- `VK_ERROR_INVALID_SHADER_NV`
2265 ///- `VK_ERROR_UNKNOWN`
2266 ///- `VK_ERROR_VALIDATION_FAILED`
2267 ///
2268 ///# Safety
2269 ///- `device` (self) must be valid and not destroyed.
2270 ///- `pipelineCache` must be externally synchronized.
2271 ///
2272 ///# Panics
2273 ///Panics if `vkCreateGraphicsPipelines` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2274 ///
2275 ///# Usage Notes
2276 ///
2277 ///Graphics pipeline creation is the most expensive Vulkan object creation
2278 ///call. Batch multiple pipelines into a single call when possible,the
2279 ///driver can often parallelise compilation internally.
2280 ///
2281 ///**Pipeline cache**: always pass a `PipelineCache`. Even an empty cache
2282 ///helps on the first run; on subsequent runs it avoids redundant shader
2283 ///compilation entirely. Serialize the cache to disk between application
2284 ///sessions with `get_pipeline_cache_data`.
2285 ///
2286 ///**Dynamic state**: mark states like viewport, scissor, and blend
2287 ///constants as dynamic to reduce the number of pipeline permutations.
2288 ///Vulkan 1.3 makes viewport and scissor dynamic by default via
2289 ///`VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT` and
2290 ///`VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT`.
2291 ///
2292 ///If creation fails for one pipeline in a batch, the call returns an
2293 ///error but may still populate some output handles. Check
2294 ///`VK_PIPELINE_COMPILE_REQUIRED` when using
2295 ///`VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT`.
2296 ///
2297 ///# Guide
2298 ///
2299 ///See [Pipelines](https://hiddentale.github.io/vulkan_rust/concepts/pipelines.html) in the vulkan_rust guide.
2300 pub unsafe fn create_graphics_pipelines(
2301 &self,
2302 pipeline_cache: PipelineCache,
2303 p_create_infos: &[GraphicsPipelineCreateInfo],
2304 allocator: Option<&AllocationCallbacks>,
2305 ) -> VkResult<Vec<Pipeline>> {
2306 let fp = self
2307 .commands()
2308 .create_graphics_pipelines
2309 .expect("vkCreateGraphicsPipelines not loaded");
2310 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2311 let count = p_create_infos.len();
2312 let mut out = vec![unsafe { core::mem::zeroed() }; count];
2313 check(unsafe {
2314 fp(
2315 self.handle(),
2316 pipeline_cache,
2317 p_create_infos.len() as u32,
2318 p_create_infos.as_ptr(),
2319 alloc_ptr,
2320 out.as_mut_ptr(),
2321 )
2322 })?;
2323 Ok(out)
2324 }
2325 ///Wraps [`vkCreateComputePipelines`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateComputePipelines.html).
2326 /**
2327 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2328 ///
2329 ///# Errors
2330 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2331 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2332 ///- `VK_ERROR_INVALID_SHADER_NV`
2333 ///- `VK_ERROR_UNKNOWN`
2334 ///- `VK_ERROR_VALIDATION_FAILED`
2335 ///
2336 ///# Safety
2337 ///- `device` (self) must be valid and not destroyed.
2338 ///- `pipelineCache` must be externally synchronized.
2339 ///
2340 ///# Panics
2341 ///Panics if `vkCreateComputePipelines` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2342 ///
2343 ///# Usage Notes
2344 ///
2345 ///Creates one or more compute pipelines. Compute pipelines are simpler
2346 ///than graphics pipelines, they only need a single shader stage and a
2347 ///pipeline layout.
2348 ///
2349 ///**Pipeline cache**: pass a `PipelineCache` to speed up creation, the
2350 ///same way as with graphics pipelines. The cache is shared across both
2351 ///pipeline types.
2352 ///
2353 ///**Specialisation constants**: use `SpecializationInfo` on the shader
2354 ///stage to bake compile-time constants into the shader (e.g. workgroup
2355 ///size, algorithm variant). This produces optimised code without
2356 ///duplicating shader source.
2357 ///
2358 ///Batch multiple compute pipelines in a single call when possible.
2359 ///
2360 ///Compute pipelines can be created at any time and are not tied to a
2361 ///render pass. They are bound with `cmd_bind_pipeline` using
2362 ///`PIPELINE_BIND_POINT_COMPUTE` and dispatched with `cmd_dispatch`.
2363 pub unsafe fn create_compute_pipelines(
2364 &self,
2365 pipeline_cache: PipelineCache,
2366 p_create_infos: &[ComputePipelineCreateInfo],
2367 allocator: Option<&AllocationCallbacks>,
2368 ) -> VkResult<Vec<Pipeline>> {
2369 let fp = self
2370 .commands()
2371 .create_compute_pipelines
2372 .expect("vkCreateComputePipelines not loaded");
2373 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2374 let count = p_create_infos.len();
2375 let mut out = vec![unsafe { core::mem::zeroed() }; count];
2376 check(unsafe {
2377 fp(
2378 self.handle(),
2379 pipeline_cache,
2380 p_create_infos.len() as u32,
2381 p_create_infos.as_ptr(),
2382 alloc_ptr,
2383 out.as_mut_ptr(),
2384 )
2385 })?;
2386 Ok(out)
2387 }
2388 ///Wraps [`vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI.html).
2389 /**
2390 Provided by **VK_HUAWEI_subpass_shading**.*/
2391 ///
2392 ///# Errors
2393 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2394 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2395 ///- `VK_ERROR_SURFACE_LOST_KHR`
2396 ///- `VK_ERROR_UNKNOWN`
2397 ///- `VK_ERROR_VALIDATION_FAILED`
2398 ///
2399 ///# Safety
2400 ///- `device` (self) must be valid and not destroyed.
2401 ///
2402 ///# Panics
2403 ///Panics if `vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2404 ///
2405 ///# Usage Notes
2406 ///
2407 ///Queries the maximum workgroup size supported for subpass shading
2408 ///on the given render pass. Returns an `Extent2D` with the max
2409 ///width and height. Use this to configure subpass shading dispatch
2410 ///parameters.
2411 ///
2412 ///Requires `VK_HUAWEI_subpass_shading`.
2413 pub unsafe fn get_device_subpass_shading_max_workgroup_size_huawei(
2414 &self,
2415 renderpass: RenderPass,
2416 p_max_workgroup_size: *mut Extent2D,
2417 ) -> VkResult<()> {
2418 let fp = self
2419 .commands()
2420 .get_device_subpass_shading_max_workgroup_size_huawei
2421 .expect("vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI not loaded");
2422 check(unsafe { fp(self.handle(), renderpass, p_max_workgroup_size) })
2423 }
2424 ///Wraps [`vkDestroyPipeline`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyPipeline.html).
2425 /**
2426 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2427 ///
2428 ///# Safety
2429 ///- `device` (self) must be valid and not destroyed.
2430 ///- `pipeline` must be externally synchronized.
2431 ///
2432 ///# Panics
2433 ///Panics if `vkDestroyPipeline` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2434 ///
2435 ///# Usage Notes
2436 ///
2437 ///Destroys a graphics, compute, or ray tracing pipeline. The pipeline
2438 ///must not be bound in any command buffer that is still pending
2439 ///execution.
2440 ///
2441 ///Pipelines are expensive to create but cheap to keep around. Only
2442 ///destroy them when you are certain they will not be needed again
2443 ///(e.g. during level transitions or application shutdown).
2444 ///
2445 ///Shader modules used to create the pipeline can be destroyed
2446 ///independently, the pipeline retains its own copy of the compiled
2447 ///state.
2448 pub unsafe fn destroy_pipeline(
2449 &self,
2450 pipeline: Pipeline,
2451 allocator: Option<&AllocationCallbacks>,
2452 ) {
2453 let fp = self
2454 .commands()
2455 .destroy_pipeline
2456 .expect("vkDestroyPipeline not loaded");
2457 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2458 unsafe { fp(self.handle(), pipeline, alloc_ptr) };
2459 }
2460 ///Wraps [`vkCreatePipelineLayout`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreatePipelineLayout.html).
2461 /**
2462 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2463 ///
2464 ///# Errors
2465 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2466 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2467 ///- `VK_ERROR_UNKNOWN`
2468 ///- `VK_ERROR_VALIDATION_FAILED`
2469 ///
2470 ///# Safety
2471 ///- `device` (self) must be valid and not destroyed.
2472 ///
2473 ///# Panics
2474 ///Panics if `vkCreatePipelineLayout` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2475 ///
2476 ///# Usage Notes
2477 ///
2478 ///A pipeline layout defines the interface between shader stages and
2479 ///the descriptor sets and push constants that feed them. It specifies:
2480 ///
2481 ///- **Descriptor set layouts**: which bindings are available at each
2482 /// set index (0, 1, 2, ...).
2483 ///- **Push constant ranges**: byte ranges per shader stage for small,
2484 /// frequently-updated data.
2485 ///
2486 ///**Set layout ordering convention**: a common pattern is:
2487 ///
2488 ///- Set 0: per-frame data (camera, time).
2489 ///- Set 1: per-material data (textures, material params).
2490 ///- Set 2: per-object data (transforms).
2491 ///
2492 ///This lets you bind set 0 once per frame and only rebind sets 1–2
2493 ///as materials and objects change, minimising descriptor set switches.
2494 ///
2495 ///Pipeline layouts are immutable after creation. Two pipelines that
2496 ///share the same layout can share descriptor sets without rebinding.
2497 ///
2498 ///Push constants are limited to `max_push_constants_size` bytes
2499 ///(guaranteed at least 128). Use them for small per-draw data like
2500 ///transform matrices or material indices.
2501 ///
2502 ///# Guide
2503 ///
2504 ///See [Pipelines](https://hiddentale.github.io/vulkan_rust/concepts/pipelines.html) in the vulkan_rust guide.
2505 pub unsafe fn create_pipeline_layout(
2506 &self,
2507 p_create_info: &PipelineLayoutCreateInfo,
2508 allocator: Option<&AllocationCallbacks>,
2509 ) -> VkResult<PipelineLayout> {
2510 let fp = self
2511 .commands()
2512 .create_pipeline_layout
2513 .expect("vkCreatePipelineLayout not loaded");
2514 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2515 let mut out = unsafe { core::mem::zeroed() };
2516 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
2517 Ok(out)
2518 }
2519 ///Wraps [`vkDestroyPipelineLayout`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyPipelineLayout.html).
2520 /**
2521 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2522 ///
2523 ///# Safety
2524 ///- `device` (self) must be valid and not destroyed.
2525 ///- `pipelineLayout` must be externally synchronized.
2526 ///
2527 ///# Panics
2528 ///Panics if `vkDestroyPipelineLayout` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2529 ///
2530 ///# Usage Notes
2531 ///
2532 ///Destroys a pipeline layout. All pipelines and descriptor sets that
2533 ///were created with this layout must no longer be in use.
2534 ///
2535 ///In practice, pipeline layouts are typically created once and live for
2536 ///the duration of the application or a major rendering context. There
2537 ///is little reason to destroy them early.
2538 pub unsafe fn destroy_pipeline_layout(
2539 &self,
2540 pipeline_layout: PipelineLayout,
2541 allocator: Option<&AllocationCallbacks>,
2542 ) {
2543 let fp = self
2544 .commands()
2545 .destroy_pipeline_layout
2546 .expect("vkDestroyPipelineLayout not loaded");
2547 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2548 unsafe { fp(self.handle(), pipeline_layout, alloc_ptr) };
2549 }
2550 ///Wraps [`vkCreateSampler`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateSampler.html).
2551 /**
2552 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2553 ///
2554 ///# Errors
2555 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2556 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2557 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
2558 ///- `VK_ERROR_UNKNOWN`
2559 ///- `VK_ERROR_VALIDATION_FAILED`
2560 ///
2561 ///# Safety
2562 ///- `device` (self) must be valid and not destroyed.
2563 ///
2564 ///# Panics
2565 ///Panics if `vkCreateSampler` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2566 ///
2567 ///# Usage Notes
2568 ///
2569 ///Creates a sampler that controls how shaders read image data:
2570 ///filtering, addressing, mip level selection, and anisotropy.
2571 ///
2572 ///**Common configurations**:
2573 ///
2574 ///- **Nearest/point**: `MIN_FILTER_NEAREST`, `MAG_FILTER_NEAREST`.
2575 /// No interpolation, pixel art, data textures, or shadow map
2576 /// comparison.
2577 ///- **Bilinear**: `MIN_FILTER_LINEAR`, `MAG_FILTER_LINEAR`,
2578 /// `MIPMAP_MODE_NEAREST`. Smooth within a mip level but snaps
2579 /// between levels.
2580 ///- **Trilinear**: same as bilinear but with `MIPMAP_MODE_LINEAR`.
2581 /// Smooth transitions between mip levels. The default choice for
2582 /// most 3D textures.
2583 ///- **Anisotropic**: enable `anisotropy_enable` and set
2584 /// `max_anisotropy` (commonly 4–16). Improves quality at oblique
2585 /// viewing angles at a small GPU cost.
2586 ///
2587 ///**Address modes** (`REPEAT`, `MIRRORED_REPEAT`, `CLAMP_TO_EDGE`,
2588 ///`CLAMP_TO_BORDER`) control what happens when UVs go outside [0, 1].
2589 ///
2590 ///Samplers are immutable after creation and can be shared across any
2591 ///number of descriptor sets. Most applications need only a handful of
2592 ///samplers.
2593 pub unsafe fn create_sampler(
2594 &self,
2595 p_create_info: &SamplerCreateInfo,
2596 allocator: Option<&AllocationCallbacks>,
2597 ) -> VkResult<Sampler> {
2598 let fp = self
2599 .commands()
2600 .create_sampler
2601 .expect("vkCreateSampler not loaded");
2602 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2603 let mut out = unsafe { core::mem::zeroed() };
2604 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
2605 Ok(out)
2606 }
2607 ///Wraps [`vkDestroySampler`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroySampler.html).
2608 /**
2609 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2610 ///
2611 ///# Safety
2612 ///- `device` (self) must be valid and not destroyed.
2613 ///- `sampler` must be externally synchronized.
2614 ///
2615 ///# Panics
2616 ///Panics if `vkDestroySampler` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2617 ///
2618 ///# Usage Notes
2619 ///
2620 ///Destroys a sampler. The sampler must not be referenced by any
2621 ///descriptor set that is bound in a pending command buffer.
2622 ///
2623 ///Since most applications use a small fixed set of samplers, they are
2624 ///typically created once at startup and destroyed only during
2625 ///application shutdown.
2626 pub unsafe fn destroy_sampler(
2627 &self,
2628 sampler: Sampler,
2629 allocator: Option<&AllocationCallbacks>,
2630 ) {
2631 let fp = self
2632 .commands()
2633 .destroy_sampler
2634 .expect("vkDestroySampler not loaded");
2635 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2636 unsafe { fp(self.handle(), sampler, alloc_ptr) };
2637 }
2638 ///Wraps [`vkCreateDescriptorSetLayout`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateDescriptorSetLayout.html).
2639 /**
2640 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2641 ///
2642 ///# Errors
2643 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2644 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2645 ///- `VK_ERROR_UNKNOWN`
2646 ///- `VK_ERROR_VALIDATION_FAILED`
2647 ///
2648 ///# Safety
2649 ///- `device` (self) must be valid and not destroyed.
2650 ///
2651 ///# Panics
2652 ///Panics if `vkCreateDescriptorSetLayout` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2653 ///
2654 ///# Usage Notes
2655 ///
2656 ///A descriptor set layout defines the shape of a descriptor set: which
2657 ///binding numbers exist, what descriptor type each binding holds, and
2658 ///at which shader stages each binding is visible.
2659 ///
2660 ///**Binding tips**:
2661 ///
2662 ///- Keep `stage_flags` as narrow as possible. Declaring a binding
2663 /// visible to all stages when only the fragment shader uses it wastes
2664 /// driver resources on some implementations.
2665 ///- Use `DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER` for simple texture
2666 /// sampling. Separate sampler + sampled image bindings offer more
2667 /// flexibility when you want to reuse samplers across many textures.
2668 ///- Array descriptors (`descriptor_count > 1`) map to GLSL arrays.
2669 /// Useful for bindless or material-table patterns.
2670 ///
2671 ///Layouts are immutable after creation and can be shared across
2672 ///multiple pipeline layouts and descriptor set allocations.
2673 ///
2674 ///Destroy with `destroy_descriptor_set_layout` when no pipeline layout
2675 ///or pending descriptor set allocation still references it.
2676 pub unsafe fn create_descriptor_set_layout(
2677 &self,
2678 p_create_info: &DescriptorSetLayoutCreateInfo,
2679 allocator: Option<&AllocationCallbacks>,
2680 ) -> VkResult<DescriptorSetLayout> {
2681 let fp = self
2682 .commands()
2683 .create_descriptor_set_layout
2684 .expect("vkCreateDescriptorSetLayout not loaded");
2685 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2686 let mut out = unsafe { core::mem::zeroed() };
2687 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
2688 Ok(out)
2689 }
2690 ///Wraps [`vkDestroyDescriptorSetLayout`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyDescriptorSetLayout.html).
2691 /**
2692 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2693 ///
2694 ///# Safety
2695 ///- `device` (self) must be valid and not destroyed.
2696 ///- `descriptorSetLayout` must be externally synchronized.
2697 ///
2698 ///# Panics
2699 ///Panics if `vkDestroyDescriptorSetLayout` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2700 ///
2701 ///# Usage Notes
2702 ///
2703 ///Destroys a descriptor set layout. The layout must not be referenced
2704 ///by any pipeline layout or pending descriptor set allocation that is
2705 ///still in use.
2706 ///
2707 ///Descriptor set layouts are lightweight and typically long-lived.
2708 ///Destroy them during application shutdown after all dependent
2709 ///pipeline layouts and descriptor pools have been destroyed.
2710 pub unsafe fn destroy_descriptor_set_layout(
2711 &self,
2712 descriptor_set_layout: DescriptorSetLayout,
2713 allocator: Option<&AllocationCallbacks>,
2714 ) {
2715 let fp = self
2716 .commands()
2717 .destroy_descriptor_set_layout
2718 .expect("vkDestroyDescriptorSetLayout not loaded");
2719 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2720 unsafe { fp(self.handle(), descriptor_set_layout, alloc_ptr) };
2721 }
2722 ///Wraps [`vkCreateDescriptorPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateDescriptorPool.html).
2723 /**
2724 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2725 ///
2726 ///# Errors
2727 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2728 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2729 ///- `VK_ERROR_FRAGMENTATION_EXT`
2730 ///- `VK_ERROR_UNKNOWN`
2731 ///- `VK_ERROR_VALIDATION_FAILED`
2732 ///
2733 ///# Safety
2734 ///- `device` (self) must be valid and not destroyed.
2735 ///
2736 ///# Panics
2737 ///Panics if `vkCreateDescriptorPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2738 ///
2739 ///# Usage Notes
2740 ///
2741 ///Creates a pool from which descriptor sets are allocated. The pool
2742 ///must be sized to accommodate all the descriptor sets and individual
2743 ///descriptor types your application needs.
2744 ///
2745 ///**Sizing**: specify `max_sets` (total descriptor sets) and a list of
2746 ///`DescriptorPoolSize` entries that declare how many descriptors of
2747 ///each type the pool holds. Under-sizing causes
2748 ///`VK_ERROR_OUT_OF_POOL_MEMORY` at allocation time.
2749 ///
2750 ///**Flags**:
2751 ///
2752 ///- `FREE_DESCRIPTOR_SET`: allows individual sets to be freed with
2753 /// `free_descriptor_sets`. Without this flag, sets can only be
2754 /// reclaimed by resetting the entire pool.
2755 ///- `UPDATE_AFTER_BIND`: required if any allocated set uses
2756 /// update-after-bind bindings.
2757 ///
2758 ///**Common pattern**: create one pool per frame-in-flight. At the
2759 ///start of each frame, `reset_descriptor_pool` reclaims all sets at
2760 ///once, no individual tracking or freeing needed.
2761 pub unsafe fn create_descriptor_pool(
2762 &self,
2763 p_create_info: &DescriptorPoolCreateInfo,
2764 allocator: Option<&AllocationCallbacks>,
2765 ) -> VkResult<DescriptorPool> {
2766 let fp = self
2767 .commands()
2768 .create_descriptor_pool
2769 .expect("vkCreateDescriptorPool not loaded");
2770 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2771 let mut out = unsafe { core::mem::zeroed() };
2772 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
2773 Ok(out)
2774 }
2775 ///Wraps [`vkDestroyDescriptorPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyDescriptorPool.html).
2776 /**
2777 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2778 ///
2779 ///# Safety
2780 ///- `device` (self) must be valid and not destroyed.
2781 ///- `descriptorPool` must be externally synchronized.
2782 ///
2783 ///# Panics
2784 ///Panics if `vkDestroyDescriptorPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2785 ///
2786 ///# Usage Notes
2787 ///
2788 ///Destroys a descriptor pool and implicitly frees all descriptor sets
2789 ///allocated from it. You do not need to free individual sets before
2790 ///destroying the pool.
2791 ///
2792 ///Ensure no command buffer that references any set from this pool is
2793 ///still pending execution.
2794 pub unsafe fn destroy_descriptor_pool(
2795 &self,
2796 descriptor_pool: DescriptorPool,
2797 allocator: Option<&AllocationCallbacks>,
2798 ) {
2799 let fp = self
2800 .commands()
2801 .destroy_descriptor_pool
2802 .expect("vkDestroyDescriptorPool not loaded");
2803 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2804 unsafe { fp(self.handle(), descriptor_pool, alloc_ptr) };
2805 }
2806 ///Wraps [`vkResetDescriptorPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkResetDescriptorPool.html).
2807 /**
2808 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2809 ///
2810 ///# Errors
2811 ///- `VK_ERROR_UNKNOWN`
2812 ///- `VK_ERROR_VALIDATION_FAILED`
2813 ///
2814 ///# Safety
2815 ///- `device` (self) must be valid and not destroyed.
2816 ///- `descriptorPool` must be externally synchronized.
2817 ///
2818 ///# Panics
2819 ///Panics if `vkResetDescriptorPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2820 ///
2821 ///# Usage Notes
2822 ///
2823 ///Recycles all descriptor sets allocated from this pool back to the
2824 ///pool, without destroying the pool itself. After a reset, all
2825 ///previously allocated sets are invalid and must not be used.
2826 ///
2827 ///This is the fastest way to reclaim descriptor sets, much cheaper
2828 ///than freeing them individually. Ideal for the per-frame pool pattern
2829 ///where you allocate fresh sets every frame and reset the pool at the
2830 ///start of the next frame.
2831 ///
2832 ///No command buffer that references any set from this pool may be
2833 ///pending execution when you reset.
2834 pub unsafe fn reset_descriptor_pool(
2835 &self,
2836 descriptor_pool: DescriptorPool,
2837 flags: DescriptorPoolResetFlags,
2838 ) -> VkResult<()> {
2839 let fp = self
2840 .commands()
2841 .reset_descriptor_pool
2842 .expect("vkResetDescriptorPool not loaded");
2843 check(unsafe { fp(self.handle(), descriptor_pool, flags) })
2844 }
2845 ///Wraps [`vkAllocateDescriptorSets`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAllocateDescriptorSets.html).
2846 /**
2847 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2848 ///
2849 ///# Errors
2850 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2851 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2852 ///- `VK_ERROR_FRAGMENTED_POOL`
2853 ///- `VK_ERROR_OUT_OF_POOL_MEMORY`
2854 ///- `VK_ERROR_UNKNOWN`
2855 ///- `VK_ERROR_VALIDATION_FAILED`
2856 ///
2857 ///# Safety
2858 ///- `device` (self) must be valid and not destroyed.
2859 ///
2860 ///# Panics
2861 ///Panics if `vkAllocateDescriptorSets` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2862 ///
2863 ///# Usage Notes
2864 ///
2865 ///Allocates descriptor sets from a descriptor pool. Each set is backed
2866 ///by one of the `set_layouts` in the allocate info.
2867 ///
2868 ///Common failure causes:
2869 ///
2870 ///- **Pool exhaustion**: the pool does not have enough descriptors of
2871 /// the required types, or the maximum set count has been reached.
2872 /// Returns `VK_ERROR_OUT_OF_POOL_MEMORY`. Pre-calculate pool sizes
2873 /// carefully or use `VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT`
2874 /// to allow freeing and reallocation.
2875 ///- **Fragmentation**: even with enough total descriptors, internal
2876 /// fragmentation can cause allocation failure. Resetting the entire
2877 /// pool with `reset_descriptor_pool` defragments it.
2878 ///
2879 ///Descriptor sets become invalid when their parent pool is destroyed
2880 ///or reset. Do not submit command buffers that reference descriptor
2881 ///sets from a pool that has been reset.
2882 ///
2883 ///For frequently-updated descriptors, consider
2884 ///`VK_KHR_push_descriptor` which avoids set allocation entirely.
2885 pub unsafe fn allocate_descriptor_sets(
2886 &self,
2887 p_allocate_info: &DescriptorSetAllocateInfo,
2888 ) -> VkResult<Vec<DescriptorSet>> {
2889 let fp = self
2890 .commands()
2891 .allocate_descriptor_sets
2892 .expect("vkAllocateDescriptorSets not loaded");
2893 let count = p_allocate_info.descriptor_set_count as usize;
2894 let mut out = vec![unsafe { core::mem::zeroed() }; count];
2895 check(unsafe { fp(self.handle(), p_allocate_info, out.as_mut_ptr()) })?;
2896 Ok(out)
2897 }
2898 ///Wraps [`vkFreeDescriptorSets`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkFreeDescriptorSets.html).
2899 /**
2900 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2901 ///
2902 ///# Errors
2903 ///- `VK_ERROR_UNKNOWN`
2904 ///- `VK_ERROR_VALIDATION_FAILED`
2905 ///
2906 ///# Safety
2907 ///- `device` (self) must be valid and not destroyed.
2908 ///- `descriptorPool` must be externally synchronized.
2909 ///- `pDescriptorSets` must be externally synchronized.
2910 ///
2911 ///# Panics
2912 ///Panics if `vkFreeDescriptorSets` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2913 ///
2914 ///# Usage Notes
2915 ///
2916 ///Returns individual descriptor sets back to their parent pool. The
2917 ///pool must have been created with `FREE_DESCRIPTOR_SET`, without
2918 ///that flag this call is invalid.
2919 ///
2920 ///For most applications, resetting the entire pool with
2921 ///`reset_descriptor_pool` is simpler and faster than tracking and
2922 ///freeing individual sets. Use `free_descriptor_sets` only when you
2923 ///need fine-grained lifetime control over specific sets.
2924 ///
2925 ///Freed sets must not be referenced by any pending command buffer.
2926 pub unsafe fn free_descriptor_sets(
2927 &self,
2928 descriptor_pool: DescriptorPool,
2929 p_descriptor_sets: &[DescriptorSet],
2930 ) -> VkResult<()> {
2931 let fp = self
2932 .commands()
2933 .free_descriptor_sets
2934 .expect("vkFreeDescriptorSets not loaded");
2935 check(unsafe {
2936 fp(
2937 self.handle(),
2938 descriptor_pool,
2939 p_descriptor_sets.len() as u32,
2940 p_descriptor_sets.as_ptr(),
2941 )
2942 })
2943 }
2944 ///Wraps [`vkUpdateDescriptorSets`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkUpdateDescriptorSets.html).
2945 /**
2946 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2947 ///
2948 ///# Safety
2949 ///- `device` (self) must be valid and not destroyed.
2950 ///- `pDescriptorWrites` must be externally synchronized.
2951 ///
2952 ///# Panics
2953 ///Panics if `vkUpdateDescriptorSets` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2954 ///
2955 ///# Usage Notes
2956 ///
2957 ///Writes or copies resource bindings into descriptor sets. This is
2958 ///how you connect actual buffers, images, and samplers to the
2959 ///descriptor slots that shaders read from.
2960 ///
2961 ///**Writes** (`WriteDescriptorSet`): bind concrete resources to a
2962 ///specific set + binding + array element. Each write targets one
2963 ///descriptor type (uniform buffer, combined image sampler, storage
2964 ///buffer, etc.).
2965 ///
2966 ///**Copies** (`CopyDescriptorSet`): duplicate bindings from one set
2967 ///to another. Rarely used, writes cover nearly all cases.
2968 ///
2969 ///Updates take effect immediately and are visible to any command buffer
2970 ///recorded after the update. However, updating a set that is currently
2971 ///bound in a pending command buffer is undefined behaviour unless the
2972 ///set was allocated from a pool with `UPDATE_AFTER_BIND` and the
2973 ///binding is marked as update-after-bind in the layout.
2974 ///
2975 ///Batch multiple writes into a single call when possible, the driver
2976 ///can often process them more efficiently.
2977 pub unsafe fn update_descriptor_sets(
2978 &self,
2979 p_descriptor_writes: &[WriteDescriptorSet],
2980 p_descriptor_copies: &[CopyDescriptorSet],
2981 ) {
2982 let fp = self
2983 .commands()
2984 .update_descriptor_sets
2985 .expect("vkUpdateDescriptorSets not loaded");
2986 unsafe {
2987 fp(
2988 self.handle(),
2989 p_descriptor_writes.len() as u32,
2990 p_descriptor_writes.as_ptr(),
2991 p_descriptor_copies.len() as u32,
2992 p_descriptor_copies.as_ptr(),
2993 )
2994 };
2995 }
2996 ///Wraps [`vkCreateFramebuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateFramebuffer.html).
2997 /**
2998 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
2999 ///
3000 ///# Errors
3001 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3002 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3003 ///- `VK_ERROR_UNKNOWN`
3004 ///- `VK_ERROR_VALIDATION_FAILED`
3005 ///
3006 ///# Safety
3007 ///- `device` (self) must be valid and not destroyed.
3008 ///
3009 ///# Panics
3010 ///Panics if `vkCreateFramebuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3011 ///
3012 ///# Usage Notes
3013 ///
3014 ///A framebuffer binds concrete image views to the attachment slots
3015 ///defined by a render pass. The number and format of attachments must
3016 ///match the render pass exactly, mismatches cause validation errors.
3017 ///
3018 ///**Dimensions**: `width`, `height`, and `layers` must be less than
3019 ///or equal to the corresponding dimensions of every attached image
3020 ///view. They define the renderable area for `cmd_begin_render_pass`.
3021 ///
3022 ///**Lifetime**: the framebuffer must stay alive for the entire
3023 ///duration of any render pass instance that uses it. In practice,
3024 ///framebuffers are typically recreated when the swapchain is resized.
3025 ///
3026 ///**Imageless framebuffers** (Vulkan 1.2+): create the framebuffer
3027 ///with `FRAMEBUFFER_CREATE_IMAGELESS` and no attachments. Concrete
3028 ///image views are then supplied at `cmd_begin_render_pass` time via
3029 ///`RenderPassAttachmentBeginInfo`. This avoids recreating framebuffers
3030 ///on swapchain resize.
3031 ///
3032 ///# Guide
3033 ///
3034 ///See [Render Passes & Framebuffers](https://hiddentale.github.io/vulkan_rust/concepts/render-passes.html) in the vulkan_rust guide.
3035 pub unsafe fn create_framebuffer(
3036 &self,
3037 p_create_info: &FramebufferCreateInfo,
3038 allocator: Option<&AllocationCallbacks>,
3039 ) -> VkResult<Framebuffer> {
3040 let fp = self
3041 .commands()
3042 .create_framebuffer
3043 .expect("vkCreateFramebuffer not loaded");
3044 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
3045 let mut out = unsafe { core::mem::zeroed() };
3046 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
3047 Ok(out)
3048 }
3049 ///Wraps [`vkDestroyFramebuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyFramebuffer.html).
3050 /**
3051 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3052 ///
3053 ///# Safety
3054 ///- `device` (self) must be valid and not destroyed.
3055 ///- `framebuffer` must be externally synchronized.
3056 ///
3057 ///# Panics
3058 ///Panics if `vkDestroyFramebuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3059 ///
3060 ///# Usage Notes
3061 ///
3062 ///Destroys a framebuffer. No render pass instance using this
3063 ///framebuffer may be pending execution.
3064 ///
3065 ///Framebuffers are typically recreated whenever the swapchain is
3066 ///resized, so they tend to have shorter lifetimes than most Vulkan
3067 ///objects. With imageless framebuffers (Vulkan 1.2+) you can avoid
3068 ///this churn entirely.
3069 pub unsafe fn destroy_framebuffer(
3070 &self,
3071 framebuffer: Framebuffer,
3072 allocator: Option<&AllocationCallbacks>,
3073 ) {
3074 let fp = self
3075 .commands()
3076 .destroy_framebuffer
3077 .expect("vkDestroyFramebuffer not loaded");
3078 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
3079 unsafe { fp(self.handle(), framebuffer, alloc_ptr) };
3080 }
3081 ///Wraps [`vkCreateRenderPass`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateRenderPass.html).
3082 /**
3083 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3084 ///
3085 ///# Errors
3086 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3087 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3088 ///- `VK_ERROR_UNKNOWN`
3089 ///- `VK_ERROR_VALIDATION_FAILED`
3090 ///
3091 ///# Safety
3092 ///- `device` (self) must be valid and not destroyed.
3093 ///
3094 ///# Panics
3095 ///Panics if `vkCreateRenderPass` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3096 ///
3097 ///# Usage Notes
3098 ///
3099 ///A render pass describes the attachments, subpasses, and dependencies
3100 ///used during rendering. It does not reference actual images, those
3101 ///are bound later via a framebuffer.
3102 ///
3103 ///Key design points:
3104 ///
3105 ///- **`load_op` / `store_op`**: use `DONT_CARE` for attachments whose
3106 /// prior contents are irrelevant (e.g. a transient depth buffer). This
3107 /// lets tile-based GPUs skip loads/stores, which is significant on
3108 /// mobile.
3109 ///- **`initial_layout` / `final_layout`**: Vulkan inserts implicit layout
3110 /// transitions at render pass boundaries. Set these to match your actual
3111 /// usage to avoid unnecessary transitions. `UNDEFINED` for `initial_layout`
3112 /// is fine when `load_op` is `CLEAR` or `DONT_CARE`.
3113 ///- **Subpass dependencies**: the implicit external dependencies
3114 /// (`VK_SUBPASS_EXTERNAL`) are often insufficient. Add explicit
3115 /// dependencies when subsequent passes read the output.
3116 ///
3117 ///For dynamic rendering (Vulkan 1.3+), consider `cmd_begin_rendering`
3118 ///instead, which avoids the need for render pass and framebuffer objects.
3119 ///
3120 ///# Guide
3121 ///
3122 ///See [Render Passes & Framebuffers](https://hiddentale.github.io/vulkan_rust/concepts/render-passes.html) in the vulkan_rust guide.
3123 pub unsafe fn create_render_pass(
3124 &self,
3125 p_create_info: &RenderPassCreateInfo,
3126 allocator: Option<&AllocationCallbacks>,
3127 ) -> VkResult<RenderPass> {
3128 let fp = self
3129 .commands()
3130 .create_render_pass
3131 .expect("vkCreateRenderPass not loaded");
3132 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
3133 let mut out = unsafe { core::mem::zeroed() };
3134 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
3135 Ok(out)
3136 }
3137 ///Wraps [`vkDestroyRenderPass`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyRenderPass.html).
3138 /**
3139 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3140 ///
3141 ///# Safety
3142 ///- `device` (self) must be valid and not destroyed.
3143 ///- `renderPass` must be externally synchronized.
3144 ///
3145 ///# Panics
3146 ///Panics if `vkDestroyRenderPass` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3147 ///
3148 ///# Usage Notes
3149 ///
3150 ///Destroys a render pass. All framebuffers and pipelines created with
3151 ///this render pass must no longer be in use.
3152 ///
3153 ///Render passes are typically long-lived, created once at startup
3154 ///and destroyed during shutdown. Destroying a render pass does not
3155 ///affect pipelines that were created with a compatible render pass
3156 ///(same attachment count, formats, and sample counts).
3157 pub unsafe fn destroy_render_pass(
3158 &self,
3159 render_pass: RenderPass,
3160 allocator: Option<&AllocationCallbacks>,
3161 ) {
3162 let fp = self
3163 .commands()
3164 .destroy_render_pass
3165 .expect("vkDestroyRenderPass not loaded");
3166 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
3167 unsafe { fp(self.handle(), render_pass, alloc_ptr) };
3168 }
3169 ///Wraps [`vkGetRenderAreaGranularity`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetRenderAreaGranularity.html).
3170 /**
3171 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3172 ///
3173 ///# Safety
3174 ///- `device` (self) must be valid and not destroyed.
3175 ///
3176 ///# Panics
3177 ///Panics if `vkGetRenderAreaGranularity` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3178 ///
3179 ///# Usage Notes
3180 ///
3181 ///Returns the granularity (in pixels) at which the render area should
3182 ///be aligned for optimal performance with this render pass.
3183 ///
3184 ///The render area passed to `cmd_begin_render_pass` should have its
3185 ///`offset` be a multiple of this granularity and its `extent` should
3186 ///either cover the full framebuffer or be rounded up to a multiple.
3187 ///
3188 ///On most desktop GPUs this returns (1, 1), meaning any alignment is
3189 ///fine. On tile-based GPUs this may return the tile size (e.g. 32×32),
3190 ///and misalignment can cause partial-tile overhead.
3191 ///
3192 ///In practice, most applications render to the full framebuffer extent
3193 ///and never need to worry about this.
3194 pub unsafe fn get_render_area_granularity(&self, render_pass: RenderPass) -> Extent2D {
3195 let fp = self
3196 .commands()
3197 .get_render_area_granularity
3198 .expect("vkGetRenderAreaGranularity not loaded");
3199 let mut out = unsafe { core::mem::zeroed() };
3200 unsafe { fp(self.handle(), render_pass, &mut out) };
3201 out
3202 }
3203 ///Wraps [`vkGetRenderingAreaGranularity`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetRenderingAreaGranularity.html).
3204 /**
3205 Provided by **VK_GRAPHICS_VERSION_1_4**.*/
3206 ///
3207 ///# Safety
3208 ///- `device` (self) must be valid and not destroyed.
3209 ///
3210 ///# Panics
3211 ///Panics if `vkGetRenderingAreaGranularity` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3212 ///
3213 ///# Usage Notes
3214 ///
3215 ///Vulkan 1.4 command that queries the optimal render area granularity
3216 ///for a given dynamic rendering configuration, without needing a
3217 ///render pass object.
3218 ///
3219 ///This is the dynamic rendering equivalent of
3220 ///`get_render_area_granularity`. Pass a `RenderingAreaInfo` describing
3221 ///the attachment formats and sample count, and receive the granularity
3222 ///(in pixels) at which the render area should be aligned.
3223 ///
3224 ///On most desktop GPUs this returns (1, 1). On tile-based GPUs the
3225 ///granularity may match the tile size.
3226 pub unsafe fn get_rendering_area_granularity(
3227 &self,
3228 p_rendering_area_info: &RenderingAreaInfo,
3229 ) -> Extent2D {
3230 let fp = self
3231 .commands()
3232 .get_rendering_area_granularity
3233 .expect("vkGetRenderingAreaGranularity not loaded");
3234 let mut out = unsafe { core::mem::zeroed() };
3235 unsafe { fp(self.handle(), p_rendering_area_info, &mut out) };
3236 out
3237 }
3238 ///Wraps [`vkCreateCommandPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateCommandPool.html).
3239 /**
3240 Provided by **VK_BASE_VERSION_1_0**.*/
3241 ///
3242 ///# Errors
3243 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3244 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3245 ///- `VK_ERROR_UNKNOWN`
3246 ///- `VK_ERROR_VALIDATION_FAILED`
3247 ///
3248 ///# Safety
3249 ///- `device` (self) must be valid and not destroyed.
3250 ///
3251 ///# Panics
3252 ///Panics if `vkCreateCommandPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3253 ///
3254 ///# Usage Notes
3255 ///
3256 ///A command pool provides the memory backing for command buffers
3257 ///allocated from it. Pools are tied to a single queue family, command
3258 ///buffers allocated from the pool can only be submitted to queues of
3259 ///that family.
3260 ///
3261 ///**Flags**:
3262 ///
3263 ///- `TRANSIENT`: hint that command buffers are short-lived and reset or
3264 /// freed frequently. Lets the driver use a faster allocation strategy.
3265 ///- `RESET_COMMAND_BUFFER`: allows individual command buffers to be
3266 /// reset via `reset_command_buffer`. Without this flag you must reset
3267 /// the entire pool with `reset_command_pool`.
3268 ///
3269 ///A common pattern is one pool per frame-in-flight per thread: reset the
3270 ///whole pool at the start of each frame instead of managing individual
3271 ///command buffer lifetimes.
3272 ///
3273 ///Command pools are **not thread-safe**. If multiple threads record
3274 ///commands concurrently, each thread needs its own pool.
3275 ///
3276 ///# Guide
3277 ///
3278 ///See [Command Buffers](https://hiddentale.github.io/vulkan_rust/concepts/command-buffers.html) in the vulkan_rust guide.
3279 pub unsafe fn create_command_pool(
3280 &self,
3281 p_create_info: &CommandPoolCreateInfo,
3282 allocator: Option<&AllocationCallbacks>,
3283 ) -> VkResult<CommandPool> {
3284 let fp = self
3285 .commands()
3286 .create_command_pool
3287 .expect("vkCreateCommandPool not loaded");
3288 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
3289 let mut out = unsafe { core::mem::zeroed() };
3290 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
3291 Ok(out)
3292 }
3293 ///Wraps [`vkDestroyCommandPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyCommandPool.html).
3294 /**
3295 Provided by **VK_BASE_VERSION_1_0**.*/
3296 ///
3297 ///# Safety
3298 ///- `device` (self) must be valid and not destroyed.
3299 ///- `commandPool` must be externally synchronized.
3300 ///
3301 ///# Panics
3302 ///Panics if `vkDestroyCommandPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3303 ///
3304 ///# Usage Notes
3305 ///
3306 ///Destroys a command pool and implicitly frees all command buffers
3307 ///allocated from it. You do not need to free individual command buffers
3308 ///before destroying the pool.
3309 ///
3310 ///All command buffers allocated from this pool must have completed
3311 ///execution before the pool is destroyed. Call `device_wait_idle` or
3312 ///wait on the relevant fences first.
3313 pub unsafe fn destroy_command_pool(
3314 &self,
3315 command_pool: CommandPool,
3316 allocator: Option<&AllocationCallbacks>,
3317 ) {
3318 let fp = self
3319 .commands()
3320 .destroy_command_pool
3321 .expect("vkDestroyCommandPool not loaded");
3322 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
3323 unsafe { fp(self.handle(), command_pool, alloc_ptr) };
3324 }
3325 ///Wraps [`vkResetCommandPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkResetCommandPool.html).
3326 /**
3327 Provided by **VK_BASE_VERSION_1_0**.*/
3328 ///
3329 ///# Errors
3330 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3331 ///- `VK_ERROR_UNKNOWN`
3332 ///- `VK_ERROR_VALIDATION_FAILED`
3333 ///
3334 ///# Safety
3335 ///- `device` (self) must be valid and not destroyed.
3336 ///- `commandPool` must be externally synchronized.
3337 ///
3338 ///# Panics
3339 ///Panics if `vkResetCommandPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3340 ///
3341 ///# Usage Notes
3342 ///
3343 ///Resets a command pool, recycling all command buffers allocated from
3344 ///it back to the initial state. This is faster than resetting
3345 ///individual command buffers.
3346 ///
3347 ///**Flags**:
3348 ///
3349 ///- `RELEASE_RESOURCES`: return memory to the system. Without this
3350 /// flag, the pool keeps its internal memory for reuse by future
3351 /// allocations, usually what you want in a frame loop.
3352 ///
3353 ///**Per-frame pattern**: reset the pool at the start of each frame
3354 ///(without `RELEASE_RESOURCES`), then re-record command buffers from
3355 ///the same pool. Memory is reused without reallocation overhead.
3356 ///
3357 ///All command buffers from this pool must have completed execution
3358 ///before resetting.
3359 pub unsafe fn reset_command_pool(
3360 &self,
3361 command_pool: CommandPool,
3362 flags: CommandPoolResetFlags,
3363 ) -> VkResult<()> {
3364 let fp = self
3365 .commands()
3366 .reset_command_pool
3367 .expect("vkResetCommandPool not loaded");
3368 check(unsafe { fp(self.handle(), command_pool, flags) })
3369 }
3370 ///Wraps [`vkAllocateCommandBuffers`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAllocateCommandBuffers.html).
3371 /**
3372 Provided by **VK_BASE_VERSION_1_0**.*/
3373 ///
3374 ///# Errors
3375 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3376 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3377 ///- `VK_ERROR_UNKNOWN`
3378 ///- `VK_ERROR_VALIDATION_FAILED`
3379 ///
3380 ///# Safety
3381 ///- `device` (self) must be valid and not destroyed.
3382 ///
3383 ///# Panics
3384 ///Panics if `vkAllocateCommandBuffers` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3385 ///
3386 ///# Usage Notes
3387 ///
3388 ///Allocates one or more command buffers from a command pool. The
3389 ///`command_buffer_count` and output slice length must match.
3390 ///
3391 ///**Level**:
3392 ///
3393 ///- `PRIMARY`: submitted directly to a queue via `queue_submit`.
3394 ///- `SECONDARY`: recorded separately and executed inside a primary
3395 /// buffer via `cmd_execute_commands`. Useful for pre-recording
3396 /// draw calls that are reused across frames.
3397 ///
3398 ///All allocated command buffers start in the *initial* state and must
3399 ///be recorded with `begin_command_buffer` before submission.
3400 ///
3401 ///Command buffers are freed either individually with
3402 ///`free_command_buffers` or implicitly when the parent pool is
3403 ///destroyed or reset.
3404 ///
3405 ///# Guide
3406 ///
3407 ///See [Command Buffers](https://hiddentale.github.io/vulkan_rust/concepts/command-buffers.html) in the vulkan_rust guide.
3408 pub unsafe fn allocate_command_buffers(
3409 &self,
3410 p_allocate_info: &CommandBufferAllocateInfo,
3411 ) -> VkResult<Vec<CommandBuffer>> {
3412 let fp = self
3413 .commands()
3414 .allocate_command_buffers
3415 .expect("vkAllocateCommandBuffers not loaded");
3416 let count = p_allocate_info.command_buffer_count as usize;
3417 let mut out = vec![unsafe { core::mem::zeroed() }; count];
3418 check(unsafe { fp(self.handle(), p_allocate_info, out.as_mut_ptr()) })?;
3419 Ok(out)
3420 }
3421 ///Wraps [`vkFreeCommandBuffers`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkFreeCommandBuffers.html).
3422 /**
3423 Provided by **VK_BASE_VERSION_1_0**.*/
3424 ///
3425 ///# Safety
3426 ///- `device` (self) must be valid and not destroyed.
3427 ///- `commandPool` must be externally synchronized.
3428 ///- `pCommandBuffers` must be externally synchronized.
3429 ///
3430 ///# Panics
3431 ///Panics if `vkFreeCommandBuffers` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3432 ///
3433 ///# Usage Notes
3434 ///
3435 ///Returns individual command buffers to their parent pool. The command
3436 ///buffers must not be pending execution.
3437 ///
3438 ///For most applications, resetting the entire pool with
3439 ///`reset_command_pool` is simpler. Use `free_command_buffers` only
3440 ///when you need fine-grained lifetime control, for example, freeing
3441 ///a one-shot transfer command buffer immediately after use while
3442 ///keeping other buffers from the same pool alive.
3443 ///
3444 ///Freed command buffer handles become invalid. Do not resubmit them.
3445 pub unsafe fn free_command_buffers(
3446 &self,
3447 command_pool: CommandPool,
3448 p_command_buffers: &[CommandBuffer],
3449 ) {
3450 let fp = self
3451 .commands()
3452 .free_command_buffers
3453 .expect("vkFreeCommandBuffers not loaded");
3454 unsafe {
3455 fp(
3456 self.handle(),
3457 command_pool,
3458 p_command_buffers.len() as u32,
3459 p_command_buffers.as_ptr(),
3460 )
3461 };
3462 }
3463 ///Wraps [`vkBeginCommandBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBeginCommandBuffer.html).
3464 /**
3465 Provided by **VK_BASE_VERSION_1_0**.*/
3466 ///
3467 ///# Errors
3468 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3469 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3470 ///- `VK_ERROR_UNKNOWN`
3471 ///- `VK_ERROR_VALIDATION_FAILED`
3472 ///
3473 ///# Safety
3474 ///- `commandBuffer` (self) must be valid and not destroyed.
3475 ///- `commandBuffer` must be externally synchronized.
3476 ///
3477 ///# Panics
3478 ///Panics if `vkBeginCommandBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3479 ///
3480 ///# Usage Notes
3481 ///
3482 ///Begins recording commands into a command buffer. The command buffer
3483 ///must be in the *initial* state, either freshly allocated, or reset
3484 ///via `reset_command_buffer` / `reset_command_pool`.
3485 ///
3486 ///**Flags**:
3487 ///
3488 ///- `ONE_TIME_SUBMIT`: the command buffer will be submitted once and
3489 /// then reset or freed. Lets the driver skip internal tracking it
3490 /// would otherwise need for resubmission.
3491 ///- `SIMULTANEOUS_USE`: the command buffer can be pending execution on
3492 /// multiple queues simultaneously. Required for secondary command
3493 /// buffers reused across multiple primary buffers.
3494 ///
3495 ///**Inheritance info**: only required for secondary command buffers.
3496 ///When recording a secondary buffer that will execute inside a render
3497 ///pass, set `render_pass`, `subpass`, and optionally `framebuffer` in
3498 ///the `CommandBufferInheritanceInfo`. For primary buffers the
3499 ///inheritance info is ignored.
3500 ///
3501 ///Calling `begin_command_buffer` on a buffer that is already recording
3502 ///is an error. Calling it on a buffer in the *executable* state
3503 ///implicitly resets it first (if the pool allows it).
3504 ///
3505 ///# Guide
3506 ///
3507 ///See [Command Buffers](https://hiddentale.github.io/vulkan_rust/concepts/command-buffers.html) in the vulkan_rust guide.
3508 pub unsafe fn begin_command_buffer(
3509 &self,
3510 command_buffer: CommandBuffer,
3511 p_begin_info: &CommandBufferBeginInfo,
3512 ) -> VkResult<()> {
3513 let fp = self
3514 .commands()
3515 .begin_command_buffer
3516 .expect("vkBeginCommandBuffer not loaded");
3517 check(unsafe { fp(command_buffer, p_begin_info) })
3518 }
3519 ///Wraps [`vkEndCommandBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkEndCommandBuffer.html).
3520 /**
3521 Provided by **VK_BASE_VERSION_1_0**.*/
3522 ///
3523 ///# Errors
3524 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3525 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3526 ///- `VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR`
3527 ///- `VK_ERROR_UNKNOWN`
3528 ///- `VK_ERROR_VALIDATION_FAILED`
3529 ///
3530 ///# Safety
3531 ///- `commandBuffer` (self) must be valid and not destroyed.
3532 ///- `commandBuffer` must be externally synchronized.
3533 ///
3534 ///# Panics
3535 ///Panics if `vkEndCommandBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3536 ///
3537 ///# Usage Notes
3538 ///
3539 ///Finishes recording a command buffer. After this call the command
3540 ///buffer moves from the *recording* state to the *executable* state
3541 ///and can be submitted via `queue_submit`.
3542 ///
3543 ///If an error occurred during recording (e.g. out of memory), this
3544 ///call returns the error. Always check the return value, a failed
3545 ///`end_command_buffer` means the command buffer is in an invalid state
3546 ///and must be reset before reuse.
3547 ///
3548 ///A command buffer that is inside a render pass must end the render
3549 ///pass with `cmd_end_render_pass` before calling `end_command_buffer`.
3550 ///
3551 ///# Guide
3552 ///
3553 ///See [Command Buffers](https://hiddentale.github.io/vulkan_rust/concepts/command-buffers.html) in the vulkan_rust guide.
3554 pub unsafe fn end_command_buffer(&self, command_buffer: CommandBuffer) -> VkResult<()> {
3555 let fp = self
3556 .commands()
3557 .end_command_buffer
3558 .expect("vkEndCommandBuffer not loaded");
3559 check(unsafe { fp(command_buffer) })
3560 }
3561 ///Wraps [`vkResetCommandBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkResetCommandBuffer.html).
3562 /**
3563 Provided by **VK_BASE_VERSION_1_0**.*/
3564 ///
3565 ///# Errors
3566 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3567 ///- `VK_ERROR_UNKNOWN`
3568 ///- `VK_ERROR_VALIDATION_FAILED`
3569 ///
3570 ///# Safety
3571 ///- `commandBuffer` (self) must be valid and not destroyed.
3572 ///- `commandBuffer` must be externally synchronized.
3573 ///
3574 ///# Panics
3575 ///Panics if `vkResetCommandBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3576 ///
3577 ///# Usage Notes
3578 ///
3579 ///Resets a single command buffer back to the initial state so it can
3580 ///be re-recorded. The command pool must have been created with
3581 ///`RESET_COMMAND_BUFFER` for this to be valid.
3582 ///
3583 ///**Flags**:
3584 ///
3585 ///- `RELEASE_RESOURCES`: return the command buffer's memory to the
3586 /// pool. Without this flag, memory is retained for reuse during the
3587 /// next recording, usually preferred in a frame loop.
3588 ///
3589 ///For bulk resets, `reset_command_pool` is more efficient than
3590 ///resetting buffers individually.
3591 ///
3592 ///The command buffer must not be pending execution when reset.
3593 pub unsafe fn reset_command_buffer(
3594 &self,
3595 command_buffer: CommandBuffer,
3596 flags: CommandBufferResetFlags,
3597 ) -> VkResult<()> {
3598 let fp = self
3599 .commands()
3600 .reset_command_buffer
3601 .expect("vkResetCommandBuffer not loaded");
3602 check(unsafe { fp(command_buffer, flags) })
3603 }
3604 ///Wraps [`vkCmdBindPipeline`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindPipeline.html).
3605 /**
3606 Provided by **VK_COMPUTE_VERSION_1_0**.*/
3607 ///
3608 ///# Safety
3609 ///- `commandBuffer` (self) must be valid and not destroyed.
3610 ///- `commandBuffer` must be externally synchronized.
3611 ///
3612 ///# Panics
3613 ///Panics if `vkCmdBindPipeline` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3614 ///
3615 ///# Usage Notes
3616 ///
3617 ///Binds a pipeline to a command buffer for subsequent draw or dispatch
3618 ///calls. The `pipeline_bind_point` must match the pipeline type:
3619 ///
3620 ///- `PIPELINE_BIND_POINT_GRAPHICS` for graphics pipelines.
3621 ///- `PIPELINE_BIND_POINT_COMPUTE` for compute pipelines.
3622 ///- `PIPELINE_BIND_POINT_RAY_TRACING_KHR` for ray tracing pipelines.
3623 ///
3624 ///Binding a pipeline invalidates any incompatible dynamic state. For
3625 ///example, binding a new graphics pipeline that uses dynamic viewport
3626 ///requires you to call `cmd_set_viewport` again before drawing.
3627 ///
3628 ///Pipeline binds are relatively cheap, the driver patches command
3629 ///state internally. Minimise binds by sorting draw calls by pipeline
3630 ///when possible, but do not over-optimise at the expense of code
3631 ///clarity.
3632 ///
3633 ///Graphics pipelines can only be bound inside a render pass (or
3634 ///dynamic rendering). Compute pipelines can be bound anywhere.
3635 ///
3636 ///# Guide
3637 ///
3638 ///See [Pipelines](https://hiddentale.github.io/vulkan_rust/concepts/pipelines.html) in the vulkan_rust guide.
3639 pub unsafe fn cmd_bind_pipeline(
3640 &self,
3641 command_buffer: CommandBuffer,
3642 pipeline_bind_point: PipelineBindPoint,
3643 pipeline: Pipeline,
3644 ) {
3645 let fp = self
3646 .commands()
3647 .cmd_bind_pipeline
3648 .expect("vkCmdBindPipeline not loaded");
3649 unsafe { fp(command_buffer, pipeline_bind_point, pipeline) };
3650 }
3651 ///Wraps [`vkCmdSetAttachmentFeedbackLoopEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetAttachmentFeedbackLoopEnableEXT.html).
3652 /**
3653 Provided by **VK_EXT_attachment_feedback_loop_dynamic_state**.*/
3654 ///
3655 ///# Safety
3656 ///- `commandBuffer` (self) must be valid and not destroyed.
3657 ///- `commandBuffer` must be externally synchronized.
3658 ///
3659 ///# Panics
3660 ///Panics if `vkCmdSetAttachmentFeedbackLoopEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3661 ///
3662 ///# Usage Notes
3663 ///
3664 ///Dynamically enables or disables attachment feedback loops for
3665 ///specific image aspects (color, depth, stencil). When enabled,
3666 ///shaders can both read from and write to the same attachment
3667 ///within a render pass.
3668 ///
3669 ///Use with care, feedback loops create read-after-write hazards.
3670 ///The implementation handles coherency when this flag is set.
3671 ///
3672 ///Requires `VK_EXT_attachment_feedback_loop_dynamic_state`.
3673 pub unsafe fn cmd_set_attachment_feedback_loop_enable_ext(
3674 &self,
3675 command_buffer: CommandBuffer,
3676 aspect_mask: ImageAspectFlags,
3677 ) {
3678 let fp = self
3679 .commands()
3680 .cmd_set_attachment_feedback_loop_enable_ext
3681 .expect("vkCmdSetAttachmentFeedbackLoopEnableEXT not loaded");
3682 unsafe { fp(command_buffer, aspect_mask) };
3683 }
3684 ///Wraps [`vkCmdSetViewport`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetViewport.html).
3685 /**
3686 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3687 ///
3688 ///# Safety
3689 ///- `commandBuffer` (self) must be valid and not destroyed.
3690 ///- `commandBuffer` must be externally synchronized.
3691 ///
3692 ///# Panics
3693 ///Panics if `vkCmdSetViewport` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3694 ///
3695 ///# Usage Notes
3696 ///
3697 ///Sets the viewport transform dynamically. Only takes effect if the
3698 ///pipeline was created with `DYNAMIC_STATE_VIEWPORT`.
3699 ///
3700 ///The viewport defines the mapping from normalised device coordinates
3701 ///to framebuffer coordinates. Most applications use a single viewport
3702 ///covering the full render target:
3703 ///
3704 ///```text
3705 ///Viewport { x: 0.0, y: 0.0, width: w, height: h, min_depth: 0.0, max_depth: 1.0 }
3706 ///```
3707 ///
3708 ///**Flipped Y**: Vulkan's clip space has Y pointing downward (unlike
3709 ///OpenGL). To match OpenGL conventions, use a negative height and
3710 ///offset Y by the framebuffer height:
3711 ///`Viewport { y: h, height: -h, ... }`. This requires Vulkan 1.1 or
3712 ///`VK_KHR_maintenance1`.
3713 ///
3714 ///Multiple viewports are supported for multi-view rendering (e.g.
3715 ///VR). The `first_viewport` parameter selects which viewport index to
3716 ///start writing at.
3717 pub unsafe fn cmd_set_viewport(
3718 &self,
3719 command_buffer: CommandBuffer,
3720 first_viewport: u32,
3721 p_viewports: &[Viewport],
3722 ) {
3723 let fp = self
3724 .commands()
3725 .cmd_set_viewport
3726 .expect("vkCmdSetViewport not loaded");
3727 unsafe {
3728 fp(
3729 command_buffer,
3730 first_viewport,
3731 p_viewports.len() as u32,
3732 p_viewports.as_ptr(),
3733 )
3734 };
3735 }
3736 ///Wraps [`vkCmdSetScissor`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetScissor.html).
3737 /**
3738 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3739 ///
3740 ///# Safety
3741 ///- `commandBuffer` (self) must be valid and not destroyed.
3742 ///- `commandBuffer` must be externally synchronized.
3743 ///
3744 ///# Panics
3745 ///Panics if `vkCmdSetScissor` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3746 ///
3747 ///# Usage Notes
3748 ///
3749 ///Sets the scissor rectangle dynamically. Only takes effect if the
3750 ///pipeline was created with `DYNAMIC_STATE_SCISSOR`.
3751 ///
3752 ///The scissor test discards fragments outside the rectangle. Unlike
3753 ///the viewport (which transforms coordinates), the scissor is a
3754 ///hard clip in framebuffer pixel coordinates.
3755 ///
3756 ///A common default is a scissor covering the full framebuffer:
3757 ///
3758 ///```text
3759 ///Rect2D { offset: { x: 0, y: 0 }, extent: { width: w, height: h } }
3760 ///```
3761 ///
3762 ///Scissor rectangles are useful for UI rendering, split-screen, or
3763 ///any case where you want to restrict rendering to a sub-region
3764 ///without changing the viewport transform.
3765 ///
3766 ///The scissor must be set before any draw call when using dynamic
3767 ///scissor state, even if it covers the full framebuffer.
3768 pub unsafe fn cmd_set_scissor(
3769 &self,
3770 command_buffer: CommandBuffer,
3771 first_scissor: u32,
3772 p_scissors: &[Rect2D],
3773 ) {
3774 let fp = self
3775 .commands()
3776 .cmd_set_scissor
3777 .expect("vkCmdSetScissor not loaded");
3778 unsafe {
3779 fp(
3780 command_buffer,
3781 first_scissor,
3782 p_scissors.len() as u32,
3783 p_scissors.as_ptr(),
3784 )
3785 };
3786 }
3787 ///Wraps [`vkCmdSetLineWidth`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetLineWidth.html).
3788 /**
3789 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3790 ///
3791 ///# Safety
3792 ///- `commandBuffer` (self) must be valid and not destroyed.
3793 ///- `commandBuffer` must be externally synchronized.
3794 ///
3795 ///# Panics
3796 ///Panics if `vkCmdSetLineWidth` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3797 ///
3798 ///# Usage Notes
3799 ///
3800 ///Sets the width of rasterised line primitives dynamically. Only takes
3801 ///effect if the pipeline was created with `DYNAMIC_STATE_LINE_WIDTH`.
3802 ///
3803 ///The default line width is 1.0. Wide lines (width > 1.0) require the
3804 ///`wide_lines` device feature, check
3805 ///`physical_device_features.wide_lines` before using.
3806 ///
3807 ///The supported range is device-dependent (query
3808 ///`physical_device_limits.line_width_range`). If `wide_lines` is not
3809 ///supported, only 1.0 is valid.
3810 ///
3811 ///Line width is specified in framebuffer pixels. Anti-aliased lines
3812 ///may be rendered slightly wider than the specified width due to
3813 ///coverage calculations.
3814 pub unsafe fn cmd_set_line_width(&self, command_buffer: CommandBuffer, line_width: f32) {
3815 let fp = self
3816 .commands()
3817 .cmd_set_line_width
3818 .expect("vkCmdSetLineWidth not loaded");
3819 unsafe { fp(command_buffer, line_width) };
3820 }
3821 ///Wraps [`vkCmdSetDepthBias`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthBias.html).
3822 /**
3823 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3824 ///
3825 ///# Safety
3826 ///- `commandBuffer` (self) must be valid and not destroyed.
3827 ///- `commandBuffer` must be externally synchronized.
3828 ///
3829 ///# Panics
3830 ///Panics if `vkCmdSetDepthBias` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3831 ///
3832 ///# Usage Notes
3833 ///
3834 ///Sets depth bias parameters dynamically. Only takes effect if the
3835 ///pipeline was created with `DYNAMIC_STATE_DEPTH_BIAS` and depth bias
3836 ///is enabled in the rasterisation state.
3837 ///
3838 ///Depth bias adds a computed offset to each fragment's depth value
3839 ///before the depth test. The primary use case is **shadow mapping**,
3840 ///biasing shadow caster geometry slightly away from the light prevents
3841 ///self-shadowing artifacts (shadow acne).
3842 ///
3843 ///The final bias is computed as:
3844 ///
3845 ///```text
3846 ///bias = constant_factor * r + slope_factor * max_slope
3847 ///```
3848 ///
3849 ///where `r` is the minimum resolvable depth difference and `max_slope`
3850 ///is the maximum depth slope of the triangle.
3851 ///
3852 ///**`depth_bias_clamp`** limits the maximum bias value. Requires the
3853 ///`depth_bias_clamp` device feature. A clamp of 0.0 disables clamping.
3854 ///
3855 ///Typical shadow map values: `constant_factor` = 1.25,
3856 ///`slope_factor` = 1.75, `clamp` = 0.0. Tune per scene.
3857 pub unsafe fn cmd_set_depth_bias(
3858 &self,
3859 command_buffer: CommandBuffer,
3860 depth_bias_constant_factor: f32,
3861 depth_bias_clamp: f32,
3862 depth_bias_slope_factor: f32,
3863 ) {
3864 let fp = self
3865 .commands()
3866 .cmd_set_depth_bias
3867 .expect("vkCmdSetDepthBias not loaded");
3868 unsafe {
3869 fp(
3870 command_buffer,
3871 depth_bias_constant_factor,
3872 depth_bias_clamp,
3873 depth_bias_slope_factor,
3874 )
3875 };
3876 }
3877 ///Wraps [`vkCmdSetBlendConstants`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetBlendConstants.html).
3878 /**
3879 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3880 ///
3881 ///# Safety
3882 ///- `commandBuffer` (self) must be valid and not destroyed.
3883 ///- `commandBuffer` must be externally synchronized.
3884 ///
3885 ///# Panics
3886 ///Panics if `vkCmdSetBlendConstants` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3887 ///
3888 ///# Usage Notes
3889 ///
3890 ///Sets the constant blend colour used when a blend factor references
3891 ///`BLEND_FACTOR_CONSTANT_COLOR`, `BLEND_FACTOR_CONSTANT_ALPHA`, or
3892 ///their one-minus variants. Only takes effect if the pipeline was
3893 ///created with `DYNAMIC_STATE_BLEND_CONSTANTS`.
3894 ///
3895 ///The four values are RGBA in [0.0, 1.0]. A common use is fading
3896 ///geometry by setting a constant alpha and blending with
3897 ///`BLEND_FACTOR_CONSTANT_ALPHA`.
3898 ///
3899 ///If your pipeline does not use any constant blend factors, you do not
3900 ///need to set this state. The values are ignored for blend modes that
3901 ///do not reference them.
3902 pub unsafe fn cmd_set_blend_constants(
3903 &self,
3904 command_buffer: CommandBuffer,
3905 blend_constants: f32,
3906 ) {
3907 let fp = self
3908 .commands()
3909 .cmd_set_blend_constants
3910 .expect("vkCmdSetBlendConstants not loaded");
3911 unsafe { fp(command_buffer, blend_constants) };
3912 }
3913 ///Wraps [`vkCmdSetDepthBounds`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthBounds.html).
3914 /**
3915 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3916 ///
3917 ///# Safety
3918 ///- `commandBuffer` (self) must be valid and not destroyed.
3919 ///- `commandBuffer` must be externally synchronized.
3920 ///
3921 ///# Panics
3922 ///Panics if `vkCmdSetDepthBounds` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3923 ///
3924 ///# Usage Notes
3925 ///
3926 ///Sets the depth bounds test range dynamically. Only takes effect if
3927 ///the pipeline was created with `DYNAMIC_STATE_DEPTH_BOUNDS` and
3928 ///depth bounds testing is enabled in the depth-stencil state.
3929 ///
3930 ///The depth bounds test discards fragments whose depth buffer value
3931 ///falls outside [`min_depth_bounds`, `max_depth_bounds`]. Note that
3932 ///this tests the **existing** depth buffer value, not the fragment's
3933 ///incoming depth.
3934 ///
3935 ///Use cases are niche:
3936 ///
3937 ///- **Stencil shadow volumes**: reject fragments that are clearly
3938 /// outside the shadow volume's depth range.
3939 ///- **Deferred shading light volumes**: skip fragments outside the
3940 /// light's depth range.
3941 ///
3942 ///Requires the `depth_bounds` device feature. Not supported on all
3943 ///hardware, check `physical_device_features.depth_bounds` before
3944 ///enabling.
3945 pub unsafe fn cmd_set_depth_bounds(
3946 &self,
3947 command_buffer: CommandBuffer,
3948 min_depth_bounds: f32,
3949 max_depth_bounds: f32,
3950 ) {
3951 let fp = self
3952 .commands()
3953 .cmd_set_depth_bounds
3954 .expect("vkCmdSetDepthBounds not loaded");
3955 unsafe { fp(command_buffer, min_depth_bounds, max_depth_bounds) };
3956 }
3957 ///Wraps [`vkCmdSetStencilCompareMask`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetStencilCompareMask.html).
3958 /**
3959 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3960 ///
3961 ///# Safety
3962 ///- `commandBuffer` (self) must be valid and not destroyed.
3963 ///- `commandBuffer` must be externally synchronized.
3964 ///
3965 ///# Panics
3966 ///Panics if `vkCmdSetStencilCompareMask` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3967 ///
3968 ///# Usage Notes
3969 ///
3970 ///Sets the stencil compare mask dynamically for front-facing,
3971 ///back-facing, or both face sets. Only takes effect if the pipeline
3972 ///was created with `DYNAMIC_STATE_STENCIL_COMPARE_MASK`.
3973 ///
3974 ///The compare mask is ANDed with both the reference value and the
3975 ///stencil buffer value before the stencil comparison. This lets you
3976 ///use individual bits of the stencil buffer for different purposes
3977 ///(e.g. bit 0 for portals, bits 1–3 for decal layers).
3978 ///
3979 ///A mask of `0xFF` (the default) uses all 8 bits of the stencil
3980 ///buffer. Narrower masks isolate specific bit planes for multi-purpose
3981 ///stencil schemes.
3982 pub unsafe fn cmd_set_stencil_compare_mask(
3983 &self,
3984 command_buffer: CommandBuffer,
3985 face_mask: StencilFaceFlags,
3986 compare_mask: u32,
3987 ) {
3988 let fp = self
3989 .commands()
3990 .cmd_set_stencil_compare_mask
3991 .expect("vkCmdSetStencilCompareMask not loaded");
3992 unsafe { fp(command_buffer, face_mask, compare_mask) };
3993 }
3994 ///Wraps [`vkCmdSetStencilWriteMask`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetStencilWriteMask.html).
3995 /**
3996 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3997 ///
3998 ///# Safety
3999 ///- `commandBuffer` (self) must be valid and not destroyed.
4000 ///- `commandBuffer` must be externally synchronized.
4001 ///
4002 ///# Panics
4003 ///Panics if `vkCmdSetStencilWriteMask` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4004 ///
4005 ///# Usage Notes
4006 ///
4007 ///Sets the stencil write mask dynamically for front-facing,
4008 ///back-facing, or both face sets. Only takes effect if the pipeline
4009 ///was created with `DYNAMIC_STATE_STENCIL_WRITE_MASK`.
4010 ///
4011 ///The write mask controls which bits of the stencil buffer are updated
4012 ///by stencil operations (`KEEP`, `REPLACE`, `INCREMENT`, etc.). Bits
4013 ///that are zero in the mask are left unchanged.
4014 ///
4015 ///A mask of `0xFF` writes all 8 bits. Use narrower masks when
4016 ///different rendering passes own different stencil bit planes.
4017 pub unsafe fn cmd_set_stencil_write_mask(
4018 &self,
4019 command_buffer: CommandBuffer,
4020 face_mask: StencilFaceFlags,
4021 write_mask: u32,
4022 ) {
4023 let fp = self
4024 .commands()
4025 .cmd_set_stencil_write_mask
4026 .expect("vkCmdSetStencilWriteMask not loaded");
4027 unsafe { fp(command_buffer, face_mask, write_mask) };
4028 }
4029 ///Wraps [`vkCmdSetStencilReference`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetStencilReference.html).
4030 /**
4031 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
4032 ///
4033 ///# Safety
4034 ///- `commandBuffer` (self) must be valid and not destroyed.
4035 ///- `commandBuffer` must be externally synchronized.
4036 ///
4037 ///# Panics
4038 ///Panics if `vkCmdSetStencilReference` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4039 ///
4040 ///# Usage Notes
4041 ///
4042 ///Sets the stencil reference value dynamically for front-facing,
4043 ///back-facing, or both face sets. Only takes effect if the pipeline
4044 ///was created with `DYNAMIC_STATE_STENCIL_REFERENCE`.
4045 ///
4046 ///The reference value is used in stencil comparison operations (e.g.
4047 ///`COMPARE_OP_EQUAL` compares the masked buffer value against the
4048 ///masked reference) and as the source value for `STENCIL_OP_REPLACE`.
4049 ///
4050 ///Common patterns:
4051 ///
4052 ///- **Portal/mirror rendering**: set reference to a unique ID per
4053 /// portal, write it with `STENCIL_OP_REPLACE`, then test with
4054 /// `COMPARE_OP_EQUAL` to mask subsequent draws to that portal's
4055 /// region.
4056 ///- **Decal layering**: increment the reference per layer.
4057 pub unsafe fn cmd_set_stencil_reference(
4058 &self,
4059 command_buffer: CommandBuffer,
4060 face_mask: StencilFaceFlags,
4061 reference: u32,
4062 ) {
4063 let fp = self
4064 .commands()
4065 .cmd_set_stencil_reference
4066 .expect("vkCmdSetStencilReference not loaded");
4067 unsafe { fp(command_buffer, face_mask, reference) };
4068 }
4069 ///Wraps [`vkCmdBindDescriptorSets`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindDescriptorSets.html).
4070 /**
4071 Provided by **VK_COMPUTE_VERSION_1_0**.*/
4072 ///
4073 ///# Safety
4074 ///- `commandBuffer` (self) must be valid and not destroyed.
4075 ///- `commandBuffer` must be externally synchronized.
4076 ///
4077 ///# Panics
4078 ///Panics if `vkCmdBindDescriptorSets` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4079 ///
4080 ///# Usage Notes
4081 ///
4082 ///Binds one or more descriptor sets to a command buffer at specified
4083 ///set indices. Subsequent draw or dispatch calls read resources from
4084 ///these bound sets.
4085 ///
4086 ///**`first_set`**: the set index at which binding starts. Sets at
4087 ///lower indices are not disturbed. This lets you bind per-frame data
4088 ///at set 0 once and rebind only per-material or per-object sets at
4089 ///higher indices.
4090 ///
4091 ///**Dynamic offsets**: for descriptors of type
4092 ///`UNIFORM_BUFFER_DYNAMIC` or `STORAGE_BUFFER_DYNAMIC`, the
4093 ///`dynamic_offsets` slice provides byte offsets applied at bind time.
4094 ///This lets multiple draw calls share a single large buffer with
4095 ///different sub-regions without updating the descriptor set.
4096 ///
4097 ///The bound pipeline layout and the descriptor set layouts must be
4098 ///compatible, same binding layout at each set index. Binding a set
4099 ///with an incompatible layout is undefined behaviour.
4100 pub unsafe fn cmd_bind_descriptor_sets(
4101 &self,
4102 command_buffer: CommandBuffer,
4103 pipeline_bind_point: PipelineBindPoint,
4104 layout: PipelineLayout,
4105 first_set: u32,
4106 p_descriptor_sets: &[DescriptorSet],
4107 p_dynamic_offsets: &[u32],
4108 ) {
4109 let fp = self
4110 .commands()
4111 .cmd_bind_descriptor_sets
4112 .expect("vkCmdBindDescriptorSets not loaded");
4113 unsafe {
4114 fp(
4115 command_buffer,
4116 pipeline_bind_point,
4117 layout,
4118 first_set,
4119 p_descriptor_sets.len() as u32,
4120 p_descriptor_sets.as_ptr(),
4121 p_dynamic_offsets.len() as u32,
4122 p_dynamic_offsets.as_ptr(),
4123 )
4124 };
4125 }
4126 ///Wraps [`vkCmdBindIndexBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindIndexBuffer.html).
4127 /**
4128 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
4129 ///
4130 ///# Safety
4131 ///- `commandBuffer` (self) must be valid and not destroyed.
4132 ///- `commandBuffer` must be externally synchronized.
4133 ///
4134 ///# Panics
4135 ///Panics if `vkCmdBindIndexBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4136 ///
4137 ///# Usage Notes
4138 ///
4139 ///Binds an index buffer for subsequent indexed draw calls
4140 ///(`cmd_draw_indexed`, `cmd_draw_indexed_indirect`).
4141 ///
4142 ///**Index type**:
4143 ///
4144 ///- `INDEX_TYPE_UINT16`: 2 bytes per index. Good for meshes with
4145 /// fewer than 65536 vertices, saves memory bandwidth.
4146 ///- `INDEX_TYPE_UINT32`: 4 bytes per index. Required for large meshes.
4147 ///- `INDEX_TYPE_UINT8_KHR` (extension): 1 byte per index for very
4148 /// small meshes.
4149 ///
4150 ///The buffer must have been created with `BUFFER_USAGE_INDEX_BUFFER`.
4151 ///The `offset` must be a multiple of the index type size (2 for
4152 ///UINT16, 4 for UINT32).
4153 ///
4154 ///Only one index buffer can be bound at a time, binding a new one
4155 ///replaces the previous binding.
4156 pub unsafe fn cmd_bind_index_buffer(
4157 &self,
4158 command_buffer: CommandBuffer,
4159 buffer: Buffer,
4160 offset: u64,
4161 index_type: IndexType,
4162 ) {
4163 let fp = self
4164 .commands()
4165 .cmd_bind_index_buffer
4166 .expect("vkCmdBindIndexBuffer not loaded");
4167 unsafe { fp(command_buffer, buffer, offset, index_type) };
4168 }
4169 ///Wraps [`vkCmdBindVertexBuffers`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindVertexBuffers.html).
4170 /**
4171 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
4172 ///
4173 ///# Safety
4174 ///- `commandBuffer` (self) must be valid and not destroyed.
4175 ///- `commandBuffer` must be externally synchronized.
4176 ///
4177 ///# Panics
4178 ///Panics if `vkCmdBindVertexBuffers` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4179 ///
4180 ///# Usage Notes
4181 ///
4182 ///Binds one or more vertex buffers to input binding slots for
4183 ///subsequent draw calls.
4184 ///
4185 ///**`first_binding`**: the binding slot index to start at. Binding
4186 ///slots are defined in the pipeline's vertex input state. Multiple
4187 ///buffers can be bound to consecutive slots in a single call.
4188 ///
4189 ///**Interleaved vs separate**: a single buffer with interleaved
4190 ///attributes (position + normal + UV) uses one binding slot. Separate
4191 ///attribute streams (one buffer per attribute) use multiple slots.
4192 ///Interleaved is generally more cache-friendly.
4193 ///
4194 ///Buffers must have been created with `BUFFER_USAGE_VERTEX_BUFFER`.
4195 ///The `offsets` array specifies the byte offset within each buffer
4196 ///where vertex data starts.
4197 ///
4198 ///For Vulkan 1.3+, `cmd_bind_vertex_buffers2` also lets you set
4199 ///buffer sizes and strides dynamically.
4200 pub unsafe fn cmd_bind_vertex_buffers(
4201 &self,
4202 command_buffer: CommandBuffer,
4203 first_binding: u32,
4204 p_buffers: &[Buffer],
4205 p_offsets: &[u64],
4206 ) {
4207 let fp = self
4208 .commands()
4209 .cmd_bind_vertex_buffers
4210 .expect("vkCmdBindVertexBuffers not loaded");
4211 unsafe {
4212 fp(
4213 command_buffer,
4214 first_binding,
4215 p_buffers.len() as u32,
4216 p_buffers.as_ptr(),
4217 p_offsets.as_ptr(),
4218 )
4219 };
4220 }
4221 ///Wraps [`vkCmdDraw`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDraw.html).
4222 /**
4223 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
4224 ///
4225 ///# Safety
4226 ///- `commandBuffer` (self) must be valid and not destroyed.
4227 ///- `commandBuffer` must be externally synchronized.
4228 ///
4229 ///# Panics
4230 ///Panics if `vkCmdDraw` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4231 ///
4232 ///# Usage Notes
4233 ///
4234 ///Records a non-indexed draw call. Vertices are generated sequentially
4235 ///from `first_vertex` to `first_vertex + vertex_count - 1`.
4236 ///
4237 ///**Parameters**:
4238 ///
4239 ///- `vertex_count`: number of vertices to draw.
4240 ///- `instance_count`: number of instances. Use 1 for non-instanced
4241 /// drawing.
4242 ///- `first_vertex`: offset into the vertex buffer (added to
4243 /// `gl_VertexIndex` in the shader).
4244 ///- `first_instance`: offset into instance data (added to
4245 /// `gl_InstanceIndex`). Requires the `first_instance` feature if
4246 /// non-zero.
4247 ///
4248 ///For indexed geometry (the common case for meshes), use
4249 ///`cmd_draw_indexed` instead. `cmd_draw` is typically used for
4250 ///full-screen quads, procedural geometry, or particle systems where
4251 ///vertices are generated in the shader.
4252 ///
4253 ///# Guide
4254 ///
4255 ///See [Command Buffers](https://hiddentale.github.io/vulkan_rust/concepts/command-buffers.html) in the vulkan_rust guide.
4256 pub unsafe fn cmd_draw(
4257 &self,
4258 command_buffer: CommandBuffer,
4259 vertex_count: u32,
4260 instance_count: u32,
4261 first_vertex: u32,
4262 first_instance: u32,
4263 ) {
4264 let fp = self.commands().cmd_draw.expect("vkCmdDraw not loaded");
4265 unsafe {
4266 fp(
4267 command_buffer,
4268 vertex_count,
4269 instance_count,
4270 first_vertex,
4271 first_instance,
4272 )
4273 };
4274 }
4275 ///Wraps [`vkCmdDrawIndexed`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndexed.html).
4276 /**
4277 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
4278 ///
4279 ///# Safety
4280 ///- `commandBuffer` (self) must be valid and not destroyed.
4281 ///- `commandBuffer` must be externally synchronized.
4282 ///
4283 ///# Panics
4284 ///Panics if `vkCmdDrawIndexed` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4285 ///
4286 ///# Usage Notes
4287 ///
4288 ///Records an indexed draw call, the standard way to draw meshes.
4289 ///Indices are read from the bound index buffer, and each index is used
4290 ///to fetch vertex attributes from the bound vertex buffers.
4291 ///
4292 ///**Parameters**:
4293 ///
4294 ///- `index_count`: number of indices to read.
4295 ///- `instance_count`: number of instances. Use 1 for non-instanced.
4296 ///- `first_index`: offset into the index buffer (in units of indices,
4297 /// not bytes).
4298 ///- `vertex_offset`: added to each index value before fetching the
4299 /// vertex. Useful for packing multiple meshes into a single vertex
4300 /// buffer at different offsets.
4301 ///- `first_instance`: offset into instance data.
4302 ///
4303 ///Indexed drawing reuses vertices via the index buffer, saving memory
4304 ///and bandwidth compared to non-indexed draws for any mesh with shared
4305 ///vertices (which is nearly all of them).
4306 pub unsafe fn cmd_draw_indexed(
4307 &self,
4308 command_buffer: CommandBuffer,
4309 index_count: u32,
4310 instance_count: u32,
4311 first_index: u32,
4312 vertex_offset: i32,
4313 first_instance: u32,
4314 ) {
4315 let fp = self
4316 .commands()
4317 .cmd_draw_indexed
4318 .expect("vkCmdDrawIndexed not loaded");
4319 unsafe {
4320 fp(
4321 command_buffer,
4322 index_count,
4323 instance_count,
4324 first_index,
4325 vertex_offset,
4326 first_instance,
4327 )
4328 };
4329 }
4330 ///Wraps [`vkCmdDrawMultiEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMultiEXT.html).
4331 /**
4332 Provided by **VK_EXT_multi_draw**.*/
4333 ///
4334 ///# Safety
4335 ///- `commandBuffer` (self) must be valid and not destroyed.
4336 ///- `commandBuffer` must be externally synchronized.
4337 ///
4338 ///# Panics
4339 ///Panics if `vkCmdDrawMultiEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4340 ///
4341 ///# Usage Notes
4342 ///
4343 ///Draws multiple non-indexed draw calls from an array of
4344 ///`MultiDrawInfoEXT` (first_vertex, vertex_count pairs). More
4345 ///efficient than issuing separate `cmd_draw` calls because the
4346 ///driver can batch them.
4347 ///
4348 ///Requires `VK_EXT_multi_draw` and the `multiDraw` feature.
4349 pub unsafe fn cmd_draw_multi_ext(
4350 &self,
4351 command_buffer: CommandBuffer,
4352 p_vertex_info: &[MultiDrawInfoEXT],
4353 instance_count: u32,
4354 first_instance: u32,
4355 stride: u32,
4356 ) {
4357 let fp = self
4358 .commands()
4359 .cmd_draw_multi_ext
4360 .expect("vkCmdDrawMultiEXT not loaded");
4361 unsafe {
4362 fp(
4363 command_buffer,
4364 p_vertex_info.len() as u32,
4365 p_vertex_info.as_ptr(),
4366 instance_count,
4367 first_instance,
4368 stride,
4369 )
4370 };
4371 }
4372 ///Wraps [`vkCmdDrawMultiIndexedEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMultiIndexedEXT.html).
4373 /**
4374 Provided by **VK_EXT_multi_draw**.*/
4375 ///
4376 ///# Safety
4377 ///- `commandBuffer` (self) must be valid and not destroyed.
4378 ///- `commandBuffer` must be externally synchronized.
4379 ///
4380 ///# Panics
4381 ///Panics if `vkCmdDrawMultiIndexedEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4382 ///
4383 ///# Usage Notes
4384 ///
4385 ///Draws multiple indexed draw calls from an array of
4386 ///`MultiDrawIndexedInfoEXT` (first_index, index_count,
4387 ///vertex_offset triples). More efficient than separate
4388 ///`cmd_draw_indexed` calls.
4389 ///
4390 ///An optional `p_vertex_offset` overrides all per-draw vertex
4391 ///offsets with a single value.
4392 ///
4393 ///Requires `VK_EXT_multi_draw` and the `multiDraw` feature.
4394 pub unsafe fn cmd_draw_multi_indexed_ext(
4395 &self,
4396 command_buffer: CommandBuffer,
4397 p_index_info: &[MultiDrawIndexedInfoEXT],
4398 instance_count: u32,
4399 first_instance: u32,
4400 stride: u32,
4401 p_vertex_offset: *const i32,
4402 ) {
4403 let fp = self
4404 .commands()
4405 .cmd_draw_multi_indexed_ext
4406 .expect("vkCmdDrawMultiIndexedEXT not loaded");
4407 unsafe {
4408 fp(
4409 command_buffer,
4410 p_index_info.len() as u32,
4411 p_index_info.as_ptr(),
4412 instance_count,
4413 first_instance,
4414 stride,
4415 p_vertex_offset,
4416 )
4417 };
4418 }
4419 ///Wraps [`vkCmdDrawIndirect`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndirect.html).
4420 /**
4421 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
4422 ///
4423 ///# Safety
4424 ///- `commandBuffer` (self) must be valid and not destroyed.
4425 ///- `commandBuffer` must be externally synchronized.
4426 ///
4427 ///# Panics
4428 ///Panics if `vkCmdDrawIndirect` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4429 ///
4430 ///# Usage Notes
4431 ///
4432 ///Records one or more non-indexed draw calls whose parameters are read
4433 ///from a GPU buffer at execution time rather than baked into the
4434 ///command buffer.
4435 ///
4436 ///Each `DrawIndirectCommand` in the buffer contains `vertex_count`,
4437 ///`instance_count`, `first_vertex`, and `first_instance`, the same
4438 ///parameters as `cmd_draw`.
4439 ///
4440 ///**Use cases**:
4441 ///
4442 ///- **GPU-driven rendering**: a compute shader fills the indirect
4443 /// buffer with draw parameters (e.g. after culling), and the GPU
4444 /// draws without CPU round-trips.
4445 ///- **Conditional draw counts**: pair with
4446 /// `cmd_draw_indirect_count` (Vulkan 1.2) to have the GPU also
4447 /// determine how many draws to execute.
4448 ///
4449 ///The buffer must have been created with
4450 ///`BUFFER_USAGE_INDIRECT_BUFFER`. The `stride` between commands must
4451 ///be at least `sizeof(DrawIndirectCommand)` (16 bytes) and a
4452 ///multiple of 4.
4453 pub unsafe fn cmd_draw_indirect(
4454 &self,
4455 command_buffer: CommandBuffer,
4456 buffer: Buffer,
4457 offset: u64,
4458 draw_count: u32,
4459 stride: u32,
4460 ) {
4461 let fp = self
4462 .commands()
4463 .cmd_draw_indirect
4464 .expect("vkCmdDrawIndirect not loaded");
4465 unsafe { fp(command_buffer, buffer, offset, draw_count, stride) };
4466 }
4467 ///Wraps [`vkCmdDrawIndexedIndirect`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndexedIndirect.html).
4468 /**
4469 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
4470 ///
4471 ///# Safety
4472 ///- `commandBuffer` (self) must be valid and not destroyed.
4473 ///- `commandBuffer` must be externally synchronized.
4474 ///
4475 ///# Panics
4476 ///Panics if `vkCmdDrawIndexedIndirect` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4477 ///
4478 ///# Usage Notes
4479 ///
4480 ///Records one or more indexed draw calls whose parameters are read
4481 ///from a GPU buffer. Each `DrawIndexedIndirectCommand` contains
4482 ///`index_count`, `instance_count`, `first_index`, `vertex_offset`,
4483 ///and `first_instance`.
4484 ///
4485 ///This is the indexed counterpart to `cmd_draw_indirect` and the most
4486 ///common indirect draw call for GPU-driven rendering pipelines. A
4487 ///compute shader performs culling and writes surviving draw commands
4488 ///into the buffer; the GPU then draws them without CPU involvement.
4489 ///
4490 ///The buffer must have `BUFFER_USAGE_INDIRECT_BUFFER`. The `stride`
4491 ///must be at least `sizeof(DrawIndexedIndirectCommand)` (20 bytes)
4492 ///and a multiple of 4.
4493 ///
4494 ///For dynamic draw counts, use `cmd_draw_indexed_indirect_count`
4495 ///(Vulkan 1.2).
4496 pub unsafe fn cmd_draw_indexed_indirect(
4497 &self,
4498 command_buffer: CommandBuffer,
4499 buffer: Buffer,
4500 offset: u64,
4501 draw_count: u32,
4502 stride: u32,
4503 ) {
4504 let fp = self
4505 .commands()
4506 .cmd_draw_indexed_indirect
4507 .expect("vkCmdDrawIndexedIndirect not loaded");
4508 unsafe { fp(command_buffer, buffer, offset, draw_count, stride) };
4509 }
4510 ///Wraps [`vkCmdDispatch`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDispatch.html).
4511 /**
4512 Provided by **VK_COMPUTE_VERSION_1_0**.*/
4513 ///
4514 ///# Safety
4515 ///- `commandBuffer` (self) must be valid and not destroyed.
4516 ///- `commandBuffer` must be externally synchronized.
4517 ///
4518 ///# Panics
4519 ///Panics if `vkCmdDispatch` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4520 ///
4521 ///# Usage Notes
4522 ///
4523 ///Launches a compute shader with the given number of workgroups in
4524 ///X, Y, and Z dimensions. The total number of invocations is
4525 ///`group_count * local_size` (defined in the shader's `local_size_x`,
4526 ///`local_size_y`, `local_size_z`).
4527 ///
4528 ///A compute pipeline must be bound before calling this. Compute
4529 ///dispatches can be recorded outside a render pass.
4530 ///
4531 ///**Sizing**: to process an image of `width × height` pixels with a
4532 ///local size of 16×16, dispatch
4533 ///`ceil(width / 16) × ceil(height / 16) × 1` workgroups.
4534 ///
4535 ///**Limits**: each dimension is capped by
4536 ///`max_compute_work_group_count` (at least 65535 per axis). The total
4537 ///invocations per workgroup are capped by
4538 ///`max_compute_work_group_invocations` (at least 128).
4539 ///
4540 ///For GPU-driven dispatch counts, use `cmd_dispatch_indirect`.
4541 pub unsafe fn cmd_dispatch(
4542 &self,
4543 command_buffer: CommandBuffer,
4544 group_count_x: u32,
4545 group_count_y: u32,
4546 group_count_z: u32,
4547 ) {
4548 let fp = self
4549 .commands()
4550 .cmd_dispatch
4551 .expect("vkCmdDispatch not loaded");
4552 unsafe { fp(command_buffer, group_count_x, group_count_y, group_count_z) };
4553 }
4554 ///Wraps [`vkCmdDispatchIndirect`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDispatchIndirect.html).
4555 /**
4556 Provided by **VK_COMPUTE_VERSION_1_0**.*/
4557 ///
4558 ///# Safety
4559 ///- `commandBuffer` (self) must be valid and not destroyed.
4560 ///- `commandBuffer` must be externally synchronized.
4561 ///
4562 ///# Panics
4563 ///Panics if `vkCmdDispatchIndirect` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4564 ///
4565 ///# Usage Notes
4566 ///
4567 ///Launches a compute shader with workgroup counts read from a GPU
4568 ///buffer. The buffer contains a `DispatchIndirectCommand` with
4569 ///`group_count_x`, `group_count_y`, `group_count_z`.
4570 ///
4571 ///Use this when a prior compute pass determines how much work to do,
4572 ///for example, a culling pass writes the surviving workgroup count
4573 ///for a subsequent processing pass.
4574 ///
4575 ///The buffer must have `BUFFER_USAGE_INDIRECT_BUFFER`. The offset must
4576 ///be a multiple of 4.
4577 ///
4578 ///The same workgroup count limits apply as for `cmd_dispatch`.
4579 pub unsafe fn cmd_dispatch_indirect(
4580 &self,
4581 command_buffer: CommandBuffer,
4582 buffer: Buffer,
4583 offset: u64,
4584 ) {
4585 let fp = self
4586 .commands()
4587 .cmd_dispatch_indirect
4588 .expect("vkCmdDispatchIndirect not loaded");
4589 unsafe { fp(command_buffer, buffer, offset) };
4590 }
4591 ///Wraps [`vkCmdSubpassShadingHUAWEI`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSubpassShadingHUAWEI.html).
4592 /**
4593 Provided by **VK_HUAWEI_subpass_shading**.*/
4594 ///
4595 ///# Safety
4596 ///- `commandBuffer` (self) must be valid and not destroyed.
4597 ///- `commandBuffer` must be externally synchronized.
4598 ///
4599 ///# Panics
4600 ///Panics if `vkCmdSubpassShadingHUAWEI` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4601 ///
4602 ///# Usage Notes
4603 ///
4604 ///Dispatches subpass shading work within the current subpass.
4605 ///Subpass shading runs compute-like shaders that have access to
4606 ///input attachments at the fragment's location, combining the
4607 ///efficiency of compute with the data locality of subpasses.
4608 ///
4609 ///Requires `VK_HUAWEI_subpass_shading`.
4610 pub unsafe fn cmd_subpass_shading_huawei(&self, command_buffer: CommandBuffer) {
4611 let fp = self
4612 .commands()
4613 .cmd_subpass_shading_huawei
4614 .expect("vkCmdSubpassShadingHUAWEI not loaded");
4615 unsafe { fp(command_buffer) };
4616 }
4617 ///Wraps [`vkCmdDrawClusterHUAWEI`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawClusterHUAWEI.html).
4618 /**
4619 Provided by **VK_HUAWEI_cluster_culling_shader**.*/
4620 ///
4621 ///# Safety
4622 ///- `commandBuffer` (self) must be valid and not destroyed.
4623 ///- `commandBuffer` must be externally synchronized.
4624 ///
4625 ///# Panics
4626 ///Panics if `vkCmdDrawClusterHUAWEI` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4627 ///
4628 ///# Usage Notes
4629 ///
4630 ///Dispatches cluster culling shader workgroups using the Huawei
4631 ///cluster culling shader pipeline. The group counts specify the
4632 ///3D dispatch dimensions, similar to `cmd_dispatch`.
4633 ///
4634 ///Requires `VK_HUAWEI_cluster_culling_shader`.
4635 pub unsafe fn cmd_draw_cluster_huawei(
4636 &self,
4637 command_buffer: CommandBuffer,
4638 group_count_x: u32,
4639 group_count_y: u32,
4640 group_count_z: u32,
4641 ) {
4642 let fp = self
4643 .commands()
4644 .cmd_draw_cluster_huawei
4645 .expect("vkCmdDrawClusterHUAWEI not loaded");
4646 unsafe { fp(command_buffer, group_count_x, group_count_y, group_count_z) };
4647 }
4648 ///Wraps [`vkCmdDrawClusterIndirectHUAWEI`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawClusterIndirectHUAWEI.html).
4649 /**
4650 Provided by **VK_HUAWEI_cluster_culling_shader**.*/
4651 ///
4652 ///# Safety
4653 ///- `commandBuffer` (self) must be valid and not destroyed.
4654 ///- `commandBuffer` must be externally synchronized.
4655 ///
4656 ///# Panics
4657 ///Panics if `vkCmdDrawClusterIndirectHUAWEI` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4658 ///
4659 ///# Usage Notes
4660 ///
4661 ///Indirect variant of `cmd_draw_cluster_huawei`. Reads the cluster
4662 ///dispatch parameters from a buffer at the given offset, allowing
4663 ///GPU-driven cluster culling without CPU readback.
4664 ///
4665 ///Requires `VK_HUAWEI_cluster_culling_shader`.
4666 pub unsafe fn cmd_draw_cluster_indirect_huawei(
4667 &self,
4668 command_buffer: CommandBuffer,
4669 buffer: Buffer,
4670 offset: u64,
4671 ) {
4672 let fp = self
4673 .commands()
4674 .cmd_draw_cluster_indirect_huawei
4675 .expect("vkCmdDrawClusterIndirectHUAWEI not loaded");
4676 unsafe { fp(command_buffer, buffer, offset) };
4677 }
4678 ///Wraps [`vkCmdUpdatePipelineIndirectBufferNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdUpdatePipelineIndirectBufferNV.html).
4679 /**
4680 Provided by **VK_NV_device_generated_commands_compute**.*/
4681 ///
4682 ///# Safety
4683 ///- `commandBuffer` (self) must be valid and not destroyed.
4684 ///- `commandBuffer` must be externally synchronized.
4685 ///
4686 ///# Panics
4687 ///Panics if `vkCmdUpdatePipelineIndirectBufferNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4688 ///
4689 ///# Usage Notes
4690 ///
4691 ///Updates the indirect dispatch parameters for a compute pipeline
4692 ///in a GPU buffer. Used with device-generated compute commands so
4693 ///the GPU can dispatch compute pipelines indirectly.
4694 ///
4695 ///Requires `VK_NV_device_generated_commands_compute`.
4696 pub unsafe fn cmd_update_pipeline_indirect_buffer_nv(
4697 &self,
4698 command_buffer: CommandBuffer,
4699 pipeline_bind_point: PipelineBindPoint,
4700 pipeline: Pipeline,
4701 ) {
4702 let fp = self
4703 .commands()
4704 .cmd_update_pipeline_indirect_buffer_nv
4705 .expect("vkCmdUpdatePipelineIndirectBufferNV not loaded");
4706 unsafe { fp(command_buffer, pipeline_bind_point, pipeline) };
4707 }
4708 ///Wraps [`vkCmdCopyBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyBuffer.html).
4709 /**
4710 Provided by **VK_BASE_VERSION_1_0**.*/
4711 ///
4712 ///# Safety
4713 ///- `commandBuffer` (self) must be valid and not destroyed.
4714 ///- `commandBuffer` must be externally synchronized.
4715 ///
4716 ///# Panics
4717 ///Panics if `vkCmdCopyBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4718 ///
4719 ///# Usage Notes
4720 ///
4721 ///Copies data between two buffers. Multiple regions can be copied in
4722 ///a single call. Must be recorded outside a render pass.
4723 ///
4724 ///Common patterns:
4725 ///
4726 ///- **Staging upload**: copy from a host-visible staging buffer to a
4727 /// device-local buffer. This is the standard way to get vertex,
4728 /// index, and uniform data onto the GPU.
4729 ///- **Buffer-to-buffer transfers**: defragment or reorganise GPU data.
4730 ///
4731 ///Source and destination regions must not overlap within the same
4732 ///buffer. Use a temporary staging buffer if you need to shift data
4733 ///within a single buffer.
4734 ///
4735 ///For Vulkan 1.3+, prefer `cmd_copy_buffer2` which uses an extensible
4736 ///`CopyBufferInfo2` struct.
4737 pub unsafe fn cmd_copy_buffer(
4738 &self,
4739 command_buffer: CommandBuffer,
4740 src_buffer: Buffer,
4741 dst_buffer: Buffer,
4742 p_regions: &[BufferCopy],
4743 ) {
4744 let fp = self
4745 .commands()
4746 .cmd_copy_buffer
4747 .expect("vkCmdCopyBuffer not loaded");
4748 unsafe {
4749 fp(
4750 command_buffer,
4751 src_buffer,
4752 dst_buffer,
4753 p_regions.len() as u32,
4754 p_regions.as_ptr(),
4755 )
4756 };
4757 }
4758 ///Wraps [`vkCmdCopyImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyImage.html).
4759 /**
4760 Provided by **VK_BASE_VERSION_1_0**.*/
4761 ///
4762 ///# Safety
4763 ///- `commandBuffer` (self) must be valid and not destroyed.
4764 ///- `commandBuffer` must be externally synchronized.
4765 ///
4766 ///# Panics
4767 ///Panics if `vkCmdCopyImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4768 ///
4769 ///# Usage Notes
4770 ///
4771 ///Copies texel data between two images. Both images must have been
4772 ///created with `TRANSFER_SRC` and `TRANSFER_DST` usage respectively,
4773 ///and must be in compatible layouts (`TRANSFER_SRC_OPTIMAL` /
4774 ///`TRANSFER_DST_OPTIMAL` or `GENERAL`).
4775 ///
4776 ///The source and destination formats must be identical, or both must
4777 ///be in the same size-compatibility class. For format conversion, use
4778 ///`cmd_blit_image` instead.
4779 ///
4780 ///Copy operates on raw texel blocks, no filtering or scaling. The
4781 ///extent must be aligned to the texel block size for compressed
4782 ///formats.
4783 ///
4784 ///Must be recorded outside a render pass. For Vulkan 1.3+, prefer
4785 ///`cmd_copy_image2`.
4786 pub unsafe fn cmd_copy_image(
4787 &self,
4788 command_buffer: CommandBuffer,
4789 src_image: Image,
4790 src_image_layout: ImageLayout,
4791 dst_image: Image,
4792 dst_image_layout: ImageLayout,
4793 p_regions: &[ImageCopy],
4794 ) {
4795 let fp = self
4796 .commands()
4797 .cmd_copy_image
4798 .expect("vkCmdCopyImage not loaded");
4799 unsafe {
4800 fp(
4801 command_buffer,
4802 src_image,
4803 src_image_layout,
4804 dst_image,
4805 dst_image_layout,
4806 p_regions.len() as u32,
4807 p_regions.as_ptr(),
4808 )
4809 };
4810 }
4811 ///Wraps [`vkCmdBlitImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBlitImage.html).
4812 /**
4813 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
4814 ///
4815 ///# Safety
4816 ///- `commandBuffer` (self) must be valid and not destroyed.
4817 ///- `commandBuffer` must be externally synchronized.
4818 ///
4819 ///# Panics
4820 ///Panics if `vkCmdBlitImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4821 ///
4822 ///# Usage Notes
4823 ///
4824 ///Copies a region between two images with optional scaling and format
4825 ///conversion. Unlike `cmd_copy_image`, blit supports different source
4826 ///and destination extents (scaling) and applies a filter.
4827 ///
4828 ///**Filters**:
4829 ///
4830 ///- `FILTER_NEAREST`: no interpolation. Fast, but produces blocky
4831 /// results when scaling.
4832 ///- `FILTER_LINEAR`: bilinear interpolation. Smooth scaling. Requires
4833 /// the format to support `FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR`.
4834 ///
4835 ///Common uses:
4836 ///
4837 ///- **Mipmap generation**: blit each mip level from the previous one,
4838 /// halving dimensions each step.
4839 ///- **Resolve or downscale**: blit a high-resolution offscreen image
4840 /// to a smaller swapchain image.
4841 ///
4842 ///Both images must be in appropriate transfer layouts. Must be recorded
4843 ///outside a render pass. For Vulkan 1.3+, prefer `cmd_blit_image2`.
4844 ///
4845 ///Not supported for depth/stencil or compressed formats. Use
4846 ///`cmd_copy_image` or `cmd_resolve_image` for those.
4847 pub unsafe fn cmd_blit_image(
4848 &self,
4849 command_buffer: CommandBuffer,
4850 src_image: Image,
4851 src_image_layout: ImageLayout,
4852 dst_image: Image,
4853 dst_image_layout: ImageLayout,
4854 p_regions: &[ImageBlit],
4855 filter: Filter,
4856 ) {
4857 let fp = self
4858 .commands()
4859 .cmd_blit_image
4860 .expect("vkCmdBlitImage not loaded");
4861 unsafe {
4862 fp(
4863 command_buffer,
4864 src_image,
4865 src_image_layout,
4866 dst_image,
4867 dst_image_layout,
4868 p_regions.len() as u32,
4869 p_regions.as_ptr(),
4870 filter,
4871 )
4872 };
4873 }
4874 ///Wraps [`vkCmdCopyBufferToImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyBufferToImage.html).
4875 /**
4876 Provided by **VK_BASE_VERSION_1_0**.*/
4877 ///
4878 ///# Safety
4879 ///- `commandBuffer` (self) must be valid and not destroyed.
4880 ///- `commandBuffer` must be externally synchronized.
4881 ///
4882 ///# Panics
4883 ///Panics if `vkCmdCopyBufferToImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4884 ///
4885 ///# Usage Notes
4886 ///
4887 ///Copies data from a buffer to an image, the primary way to upload
4888 ///texture data from CPU to GPU.
4889 ///
4890 ///**Typical upload workflow**:
4891 ///
4892 ///1. Write pixel data into a host-visible staging buffer.
4893 ///2. Transition the target image to `TRANSFER_DST_OPTIMAL`.
4894 ///3. `cmd_copy_buffer_to_image` with the appropriate
4895 /// `BufferImageCopy` regions.
4896 ///4. Transition the image to `SHADER_READ_ONLY_OPTIMAL` for sampling.
4897 ///
4898 ///**Buffer layout**: `buffer_row_length` and `buffer_image_height`
4899 ///control the row and slice pitch of the source data in the buffer.
4900 ///Set both to zero to use a tightly packed layout matching the image
4901 ///extent.
4902 ///
4903 ///Multiple regions can be copied in a single call (e.g. all mip
4904 ///levels of a texture). Must be recorded outside a render pass.
4905 ///
4906 ///For Vulkan 1.3+, prefer `cmd_copy_buffer_to_image2`.
4907 pub unsafe fn cmd_copy_buffer_to_image(
4908 &self,
4909 command_buffer: CommandBuffer,
4910 src_buffer: Buffer,
4911 dst_image: Image,
4912 dst_image_layout: ImageLayout,
4913 p_regions: &[BufferImageCopy],
4914 ) {
4915 let fp = self
4916 .commands()
4917 .cmd_copy_buffer_to_image
4918 .expect("vkCmdCopyBufferToImage not loaded");
4919 unsafe {
4920 fp(
4921 command_buffer,
4922 src_buffer,
4923 dst_image,
4924 dst_image_layout,
4925 p_regions.len() as u32,
4926 p_regions.as_ptr(),
4927 )
4928 };
4929 }
4930 ///Wraps [`vkCmdCopyImageToBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyImageToBuffer.html).
4931 /**
4932 Provided by **VK_BASE_VERSION_1_0**.*/
4933 ///
4934 ///# Safety
4935 ///- `commandBuffer` (self) must be valid and not destroyed.
4936 ///- `commandBuffer` must be externally synchronized.
4937 ///
4938 ///# Panics
4939 ///Panics if `vkCmdCopyImageToBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4940 ///
4941 ///# Usage Notes
4942 ///
4943 ///Copies data from an image to a buffer, used for GPU readback of
4944 ///rendered images, screenshots, or compute shader output.
4945 ///
4946 ///**Typical readback workflow**:
4947 ///
4948 ///1. Transition the source image to `TRANSFER_SRC_OPTIMAL`.
4949 ///2. `cmd_copy_image_to_buffer` into a host-visible buffer.
4950 ///3. Submit and wait for the fence.
4951 ///4. Map the buffer and read the pixel data on the CPU.
4952 ///
4953 ///The `buffer_row_length` and `buffer_image_height` fields in
4954 ///`BufferImageCopy` control the destination layout. Set both to zero
4955 ///for tightly packed output.
4956 ///
4957 ///Be aware that readback is not instantaneous, it requires a full
4958 ///GPU round-trip. Avoid reading back in the render loop unless you
4959 ///are double- or triple-buffering the readback to hide latency.
4960 ///
4961 ///Must be recorded outside a render pass. For Vulkan 1.3+, prefer
4962 ///`cmd_copy_image_to_buffer2`.
4963 pub unsafe fn cmd_copy_image_to_buffer(
4964 &self,
4965 command_buffer: CommandBuffer,
4966 src_image: Image,
4967 src_image_layout: ImageLayout,
4968 dst_buffer: Buffer,
4969 p_regions: &[BufferImageCopy],
4970 ) {
4971 let fp = self
4972 .commands()
4973 .cmd_copy_image_to_buffer
4974 .expect("vkCmdCopyImageToBuffer not loaded");
4975 unsafe {
4976 fp(
4977 command_buffer,
4978 src_image,
4979 src_image_layout,
4980 dst_buffer,
4981 p_regions.len() as u32,
4982 p_regions.as_ptr(),
4983 )
4984 };
4985 }
4986 ///Wraps [`vkCmdCopyMemoryIndirectNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMemoryIndirectNV.html).
4987 /**
4988 Provided by **VK_NV_copy_memory_indirect**.*/
4989 ///
4990 ///# Safety
4991 ///- `commandBuffer` (self) must be valid and not destroyed.
4992 ///- `commandBuffer` must be externally synchronized.
4993 ///
4994 ///# Panics
4995 ///Panics if `vkCmdCopyMemoryIndirectNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4996 ///
4997 ///# Usage Notes
4998 ///
4999 ///Copies memory regions using indirect parameters stored in a GPU
5000 ///buffer at the given device address. Enables GPU-driven memory
5001 ///copy workflows where the copy descriptors are generated on the
5002 ///device.
5003 ///
5004 ///Requires `VK_NV_copy_memory_indirect`.
5005 pub unsafe fn cmd_copy_memory_indirect_nv(
5006 &self,
5007 command_buffer: CommandBuffer,
5008 copy_buffer_address: u64,
5009 copy_count: u32,
5010 stride: u32,
5011 ) {
5012 let fp = self
5013 .commands()
5014 .cmd_copy_memory_indirect_nv
5015 .expect("vkCmdCopyMemoryIndirectNV not loaded");
5016 unsafe { fp(command_buffer, copy_buffer_address, copy_count, stride) };
5017 }
5018 ///Wraps [`vkCmdCopyMemoryIndirectKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMemoryIndirectKHR.html).
5019 /**
5020 Provided by **VK_KHR_copy_memory_indirect**.*/
5021 ///
5022 ///# Safety
5023 ///- `commandBuffer` (self) must be valid and not destroyed.
5024 ///- `commandBuffer` must be externally synchronized.
5025 ///
5026 ///# Panics
5027 ///Panics if `vkCmdCopyMemoryIndirectKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5028 ///
5029 ///# Usage Notes
5030 ///
5031 ///Copies memory regions using parameters read from a device-side
5032 ///info structure. Enables GPU-driven memory copies without CPU
5033 ///involvement in specifying source/destination addresses.
5034 ///
5035 ///Requires `VK_KHR_copy_memory_indirect`.
5036 pub unsafe fn cmd_copy_memory_indirect_khr(
5037 &self,
5038 command_buffer: CommandBuffer,
5039 p_copy_memory_indirect_info: &CopyMemoryIndirectInfoKHR,
5040 ) {
5041 let fp = self
5042 .commands()
5043 .cmd_copy_memory_indirect_khr
5044 .expect("vkCmdCopyMemoryIndirectKHR not loaded");
5045 unsafe { fp(command_buffer, p_copy_memory_indirect_info) };
5046 }
5047 ///Wraps [`vkCmdCopyMemoryToImageIndirectNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMemoryToImageIndirectNV.html).
5048 /**
5049 Provided by **VK_NV_copy_memory_indirect**.*/
5050 ///
5051 ///# Safety
5052 ///- `commandBuffer` (self) must be valid and not destroyed.
5053 ///- `commandBuffer` must be externally synchronized.
5054 ///
5055 ///# Panics
5056 ///Panics if `vkCmdCopyMemoryToImageIndirectNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5057 ///
5058 ///# Usage Notes
5059 ///
5060 ///Copies data from memory to an image using indirect parameters
5061 ///stored at a device address. Enables GPU-driven texture uploads
5062 ///where the copy regions are generated on the device.
5063 ///
5064 ///Requires `VK_NV_copy_memory_indirect`.
5065 pub unsafe fn cmd_copy_memory_to_image_indirect_nv(
5066 &self,
5067 command_buffer: CommandBuffer,
5068 copy_buffer_address: u64,
5069 stride: u32,
5070 dst_image: Image,
5071 dst_image_layout: ImageLayout,
5072 p_image_subresources: &[ImageSubresourceLayers],
5073 ) {
5074 let fp = self
5075 .commands()
5076 .cmd_copy_memory_to_image_indirect_nv
5077 .expect("vkCmdCopyMemoryToImageIndirectNV not loaded");
5078 unsafe {
5079 fp(
5080 command_buffer,
5081 copy_buffer_address,
5082 p_image_subresources.len() as u32,
5083 stride,
5084 dst_image,
5085 dst_image_layout,
5086 p_image_subresources.as_ptr(),
5087 )
5088 };
5089 }
5090 ///Wraps [`vkCmdCopyMemoryToImageIndirectKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMemoryToImageIndirectKHR.html).
5091 /**
5092 Provided by **VK_KHR_copy_memory_indirect**.*/
5093 ///
5094 ///# Safety
5095 ///- `commandBuffer` (self) must be valid and not destroyed.
5096 ///- `commandBuffer` must be externally synchronized.
5097 ///
5098 ///# Panics
5099 ///Panics if `vkCmdCopyMemoryToImageIndirectKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5100 ///
5101 ///# Usage Notes
5102 ///
5103 ///Copies data from memory to an image using parameters read from a
5104 ///device-side info structure. Enables GPU-driven memory-to-image
5105 ///transfers without CPU readback of copy parameters.
5106 ///
5107 ///Requires `VK_KHR_copy_memory_indirect`.
5108 pub unsafe fn cmd_copy_memory_to_image_indirect_khr(
5109 &self,
5110 command_buffer: CommandBuffer,
5111 p_copy_memory_to_image_indirect_info: &CopyMemoryToImageIndirectInfoKHR,
5112 ) {
5113 let fp = self
5114 .commands()
5115 .cmd_copy_memory_to_image_indirect_khr
5116 .expect("vkCmdCopyMemoryToImageIndirectKHR not loaded");
5117 unsafe { fp(command_buffer, p_copy_memory_to_image_indirect_info) };
5118 }
5119 ///Wraps [`vkCmdUpdateBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdUpdateBuffer.html).
5120 /**
5121 Provided by **VK_BASE_VERSION_1_0**.*/
5122 ///
5123 ///# Safety
5124 ///- `commandBuffer` (self) must be valid and not destroyed.
5125 ///- `commandBuffer` must be externally synchronized.
5126 ///
5127 ///# Panics
5128 ///Panics if `vkCmdUpdateBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5129 ///
5130 ///# Usage Notes
5131 ///
5132 ///Writes a small amount of data inline into a buffer from the command
5133 ///stream. The data is embedded directly in the command buffer, no
5134 ///staging buffer needed.
5135 ///
5136 ///**Size limit**: the data size must be ≤ 65536 bytes and a multiple
5137 ///of 4. For larger uploads, use `cmd_copy_buffer` with a staging
5138 ///buffer instead.
5139 ///
5140 ///This is convenient for small per-frame updates (e.g. a uniform
5141 ///buffer with a single matrix) but should not be used for bulk data,
5142 ///it inflates command buffer size and the data is uploaded through the
5143 ///command stream, which is slower than a DMA transfer.
5144 ///
5145 ///Must be recorded outside a render pass. The destination buffer must
5146 ///have `BUFFER_USAGE_TRANSFER_DST`.
5147 pub unsafe fn cmd_update_buffer(
5148 &self,
5149 command_buffer: CommandBuffer,
5150 dst_buffer: Buffer,
5151 dst_offset: u64,
5152 data_size: u64,
5153 p_data: *const core::ffi::c_void,
5154 ) {
5155 let fp = self
5156 .commands()
5157 .cmd_update_buffer
5158 .expect("vkCmdUpdateBuffer not loaded");
5159 unsafe { fp(command_buffer, dst_buffer, dst_offset, data_size, p_data) };
5160 }
5161 ///Wraps [`vkCmdFillBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdFillBuffer.html).
5162 /**
5163 Provided by **VK_BASE_VERSION_1_0**.*/
5164 ///
5165 ///# Safety
5166 ///- `commandBuffer` (self) must be valid and not destroyed.
5167 ///- `commandBuffer` must be externally synchronized.
5168 ///
5169 ///# Panics
5170 ///Panics if `vkCmdFillBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5171 ///
5172 ///# Usage Notes
5173 ///
5174 ///Fills a region of a buffer with a repeating 4-byte value. Useful
5175 ///for clearing GPU buffers to zero (or any uniform value) without a
5176 ///staging upload.
5177 ///
5178 ///Common uses:
5179 ///
5180 ///- **Zero-initialise** an indirect draw count buffer before a compute
5181 /// culling pass.
5182 ///- **Clear** a storage buffer used as a histogram or counter.
5183 ///
5184 ///The `offset` and `size` must be multiples of 4. Use `VK_WHOLE_SIZE`
5185 ///to fill from the offset to the end of the buffer.
5186 ///
5187 ///Must be recorded outside a render pass. The buffer must have
5188 ///`BUFFER_USAGE_TRANSFER_DST`.
5189 pub unsafe fn cmd_fill_buffer(
5190 &self,
5191 command_buffer: CommandBuffer,
5192 dst_buffer: Buffer,
5193 dst_offset: u64,
5194 size: u64,
5195 data: u32,
5196 ) {
5197 let fp = self
5198 .commands()
5199 .cmd_fill_buffer
5200 .expect("vkCmdFillBuffer not loaded");
5201 unsafe { fp(command_buffer, dst_buffer, dst_offset, size, data) };
5202 }
5203 ///Wraps [`vkCmdClearColorImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdClearColorImage.html).
5204 /**
5205 Provided by **VK_COMPUTE_VERSION_1_0**.*/
5206 ///
5207 ///# Safety
5208 ///- `commandBuffer` (self) must be valid and not destroyed.
5209 ///- `commandBuffer` must be externally synchronized.
5210 ///
5211 ///# Panics
5212 ///Panics if `vkCmdClearColorImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5213 ///
5214 ///# Usage Notes
5215 ///
5216 ///Clears one or more regions of a colour image to a specified value.
5217 ///The image must be in `TRANSFER_DST_OPTIMAL` or `GENERAL` layout.
5218 ///
5219 ///This is an explicit clear outside a render pass. For clears inside
5220 ///a render pass, use `load_op = CLEAR` in the attachment description
5221 ///or `cmd_clear_attachments`, both are typically faster because the
5222 ///driver can integrate them with tile-based rendering.
5223 ///
5224 ///The clear value is a `ClearColorValue` union: either four `float32`,
5225 ///`int32`, or `uint32` values depending on the image format.
5226 ///
5227 ///Must be recorded outside a render pass.
5228 pub unsafe fn cmd_clear_color_image(
5229 &self,
5230 command_buffer: CommandBuffer,
5231 image: Image,
5232 image_layout: ImageLayout,
5233 p_color: &ClearColorValue,
5234 p_ranges: &[ImageSubresourceRange],
5235 ) {
5236 let fp = self
5237 .commands()
5238 .cmd_clear_color_image
5239 .expect("vkCmdClearColorImage not loaded");
5240 unsafe {
5241 fp(
5242 command_buffer,
5243 image,
5244 image_layout,
5245 p_color,
5246 p_ranges.len() as u32,
5247 p_ranges.as_ptr(),
5248 )
5249 };
5250 }
5251 ///Wraps [`vkCmdClearDepthStencilImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdClearDepthStencilImage.html).
5252 /**
5253 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
5254 ///
5255 ///# Safety
5256 ///- `commandBuffer` (self) must be valid and not destroyed.
5257 ///- `commandBuffer` must be externally synchronized.
5258 ///
5259 ///# Panics
5260 ///Panics if `vkCmdClearDepthStencilImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5261 ///
5262 ///# Usage Notes
5263 ///
5264 ///Clears one or more regions of a depth/stencil image to a specified
5265 ///depth and stencil value. The image must be in
5266 ///`TRANSFER_DST_OPTIMAL` or `GENERAL` layout.
5267 ///
5268 ///For most rendering, clearing via `load_op = CLEAR` on the
5269 ///depth/stencil attachment is preferred, it lets tile-based GPUs
5270 ///avoid a separate clear pass. Use this command only when you need to
5271 ///clear a depth/stencil image outside a render pass.
5272 ///
5273 ///The `image_subresource_range` must reference the appropriate aspect
5274 ///flags (`DEPTH`, `STENCIL`, or both).
5275 ///
5276 ///Must be recorded outside a render pass.
5277 pub unsafe fn cmd_clear_depth_stencil_image(
5278 &self,
5279 command_buffer: CommandBuffer,
5280 image: Image,
5281 image_layout: ImageLayout,
5282 p_depth_stencil: &ClearDepthStencilValue,
5283 p_ranges: &[ImageSubresourceRange],
5284 ) {
5285 let fp = self
5286 .commands()
5287 .cmd_clear_depth_stencil_image
5288 .expect("vkCmdClearDepthStencilImage not loaded");
5289 unsafe {
5290 fp(
5291 command_buffer,
5292 image,
5293 image_layout,
5294 p_depth_stencil,
5295 p_ranges.len() as u32,
5296 p_ranges.as_ptr(),
5297 )
5298 };
5299 }
5300 ///Wraps [`vkCmdClearAttachments`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdClearAttachments.html).
5301 /**
5302 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
5303 ///
5304 ///# Safety
5305 ///- `commandBuffer` (self) must be valid and not destroyed.
5306 ///- `commandBuffer` must be externally synchronized.
5307 ///
5308 ///# Panics
5309 ///Panics if `vkCmdClearAttachments` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5310 ///
5311 ///# Usage Notes
5312 ///
5313 ///Clears one or more attachment regions **inside** an active render
5314 ///pass. Unlike `load_op = CLEAR` (which clears the entire attachment
5315 ///at render pass begin), this clears arbitrary rectangular regions
5316 ///mid-render-pass.
5317 ///
5318 ///Use cases:
5319 ///
5320 ///- Clear a sub-region of a colour attachment (e.g. a UI panel
5321 /// background).
5322 ///- Clear the stencil buffer for a specific screen region.
5323 ///
5324 ///Each `ClearAttachment` specifies which attachment to clear (colour
5325 ///index, depth, or stencil) and the clear value. Each `ClearRect`
5326 ///defines the pixel rectangle and layer range.
5327 ///
5328 ///For whole-attachment clears, prefer `load_op = CLEAR`, it is
5329 ///always at least as fast and often faster on tile-based hardware.
5330 pub unsafe fn cmd_clear_attachments(
5331 &self,
5332 command_buffer: CommandBuffer,
5333 p_attachments: &[ClearAttachment],
5334 p_rects: &[ClearRect],
5335 ) {
5336 let fp = self
5337 .commands()
5338 .cmd_clear_attachments
5339 .expect("vkCmdClearAttachments not loaded");
5340 unsafe {
5341 fp(
5342 command_buffer,
5343 p_attachments.len() as u32,
5344 p_attachments.as_ptr(),
5345 p_rects.len() as u32,
5346 p_rects.as_ptr(),
5347 )
5348 };
5349 }
5350 ///Wraps [`vkCmdResolveImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdResolveImage.html).
5351 /**
5352 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
5353 ///
5354 ///# Safety
5355 ///- `commandBuffer` (self) must be valid and not destroyed.
5356 ///- `commandBuffer` must be externally synchronized.
5357 ///
5358 ///# Panics
5359 ///Panics if `vkCmdResolveImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5360 ///
5361 ///# Usage Notes
5362 ///
5363 ///Resolves (downsamples) a multisample image into a single-sample
5364 ///image. Typically used to produce the final single-sample result from
5365 ///a multisampled colour attachment.
5366 ///
5367 ///Both images must be in appropriate transfer layouts
5368 ///(`TRANSFER_SRC_OPTIMAL` and `TRANSFER_DST_OPTIMAL` respectively).
5369 ///The source must be multisampled; the destination must be
5370 ///single-sample. Formats must be identical.
5371 ///
5372 ///For resolving inside a render pass, use `resolve_attachment` in the
5373 ///subpass description instead, it is more efficient on tile-based
5374 ///GPUs because the resolve happens in-tile.
5375 ///
5376 ///Must be recorded outside a render pass. For Vulkan 1.3+, prefer
5377 ///`cmd_resolve_image2`.
5378 pub unsafe fn cmd_resolve_image(
5379 &self,
5380 command_buffer: CommandBuffer,
5381 src_image: Image,
5382 src_image_layout: ImageLayout,
5383 dst_image: Image,
5384 dst_image_layout: ImageLayout,
5385 p_regions: &[ImageResolve],
5386 ) {
5387 let fp = self
5388 .commands()
5389 .cmd_resolve_image
5390 .expect("vkCmdResolveImage not loaded");
5391 unsafe {
5392 fp(
5393 command_buffer,
5394 src_image,
5395 src_image_layout,
5396 dst_image,
5397 dst_image_layout,
5398 p_regions.len() as u32,
5399 p_regions.as_ptr(),
5400 )
5401 };
5402 }
5403 ///Wraps [`vkCmdSetEvent`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetEvent.html).
5404 /**
5405 Provided by **VK_COMPUTE_VERSION_1_0**.*/
5406 ///
5407 ///# Safety
5408 ///- `commandBuffer` (self) must be valid and not destroyed.
5409 ///- `commandBuffer` must be externally synchronized.
5410 ///
5411 ///# Panics
5412 ///Panics if `vkCmdSetEvent` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5413 ///
5414 ///# Usage Notes
5415 ///
5416 ///Signals an event from the GPU at a specific pipeline stage. A later
5417 ///`cmd_wait_events` call can wait for this signal to synchronise work
5418 ///within the same queue.
5419 ///
5420 ///Events provide finer-grained synchronisation than pipeline barriers
5421 ///when you want to split a dependency into a "signal" point and a
5422 ///"wait" point separated by other commands. This lets the GPU execute
5423 ///interleaving work between the signal and wait.
5424 ///
5425 ///The `stage_mask` specifies at which pipeline stage the event is
5426 ///signaled. The event becomes signaled once all commands prior to this
5427 ///call have completed that stage.
5428 ///
5429 ///Events must only be used within a single queue. For cross-queue
5430 ///synchronisation, use semaphores.
5431 ///
5432 ///For Vulkan 1.3+, prefer `cmd_set_event2` which supports more
5433 ///precise stage and access masks.
5434 pub unsafe fn cmd_set_event(
5435 &self,
5436 command_buffer: CommandBuffer,
5437 event: Event,
5438 stage_mask: PipelineStageFlags,
5439 ) {
5440 let fp = self
5441 .commands()
5442 .cmd_set_event
5443 .expect("vkCmdSetEvent not loaded");
5444 unsafe { fp(command_buffer, event, stage_mask) };
5445 }
5446 ///Wraps [`vkCmdResetEvent`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdResetEvent.html).
5447 /**
5448 Provided by **VK_COMPUTE_VERSION_1_0**.*/
5449 ///
5450 ///# Safety
5451 ///- `commandBuffer` (self) must be valid and not destroyed.
5452 ///- `commandBuffer` must be externally synchronized.
5453 ///
5454 ///# Panics
5455 ///Panics if `vkCmdResetEvent` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5456 ///
5457 ///# Usage Notes
5458 ///
5459 ///Resets an event to the unsignaled state from the GPU at a specific
5460 ///pipeline stage. The event can then be signaled again by a
5461 ///subsequent `cmd_set_event`.
5462 ///
5463 ///Must not be called while a `cmd_wait_events` that waits on this
5464 ///event is between its wait and the completion of the dependent work.
5465 ///
5466 ///For Vulkan 1.3+, prefer `cmd_reset_event2`.
5467 pub unsafe fn cmd_reset_event(
5468 &self,
5469 command_buffer: CommandBuffer,
5470 event: Event,
5471 stage_mask: PipelineStageFlags,
5472 ) {
5473 let fp = self
5474 .commands()
5475 .cmd_reset_event
5476 .expect("vkCmdResetEvent not loaded");
5477 unsafe { fp(command_buffer, event, stage_mask) };
5478 }
5479 ///Wraps [`vkCmdWaitEvents`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWaitEvents.html).
5480 /**
5481 Provided by **VK_COMPUTE_VERSION_1_0**.*/
5482 ///
5483 ///# Safety
5484 ///- `commandBuffer` (self) must be valid and not destroyed.
5485 ///- `commandBuffer` must be externally synchronized.
5486 ///
5487 ///# Panics
5488 ///Panics if `vkCmdWaitEvents` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5489 ///
5490 ///# Usage Notes
5491 ///
5492 ///Waits for one or more events to be signaled and then inserts memory
5493 ///and execution dependencies. This is the "wait" half of the
5494 ///signal/wait pattern started by `cmd_set_event`.
5495 ///
5496 ///The wait blocks execution at the specified destination pipeline
5497 ///stages until all events are signaled. Memory barriers provided in
5498 ///this call make the specified source writes visible to the
5499 ///destination stages.
5500 ///
5501 ///**Split barriers**: the main advantage over `cmd_pipeline_barrier`
5502 ///is that you can interleave unrelated commands between the signal and
5503 ///wait, giving the GPU more opportunity for parallel execution.
5504 ///
5505 ///Events must not be waited on across different queues. For
5506 ///cross-queue synchronisation, use semaphores.
5507 ///
5508 ///For Vulkan 1.3+, prefer `cmd_wait_events2`.
5509 pub unsafe fn cmd_wait_events(
5510 &self,
5511 command_buffer: CommandBuffer,
5512 p_events: &[Event],
5513 src_stage_mask: PipelineStageFlags,
5514 dst_stage_mask: PipelineStageFlags,
5515 p_memory_barriers: &[MemoryBarrier],
5516 p_buffer_memory_barriers: &[BufferMemoryBarrier],
5517 p_image_memory_barriers: &[ImageMemoryBarrier],
5518 ) {
5519 let fp = self
5520 .commands()
5521 .cmd_wait_events
5522 .expect("vkCmdWaitEvents not loaded");
5523 unsafe {
5524 fp(
5525 command_buffer,
5526 p_events.len() as u32,
5527 p_events.as_ptr(),
5528 src_stage_mask,
5529 dst_stage_mask,
5530 p_memory_barriers.len() as u32,
5531 p_memory_barriers.as_ptr(),
5532 p_buffer_memory_barriers.len() as u32,
5533 p_buffer_memory_barriers.as_ptr(),
5534 p_image_memory_barriers.len() as u32,
5535 p_image_memory_barriers.as_ptr(),
5536 )
5537 };
5538 }
5539 ///Wraps [`vkCmdPipelineBarrier`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPipelineBarrier.html).
5540 /**
5541 Provided by **VK_BASE_VERSION_1_0**.*/
5542 ///
5543 ///# Safety
5544 ///- `commandBuffer` (self) must be valid and not destroyed.
5545 ///- `commandBuffer` must be externally synchronized.
5546 ///
5547 ///# Panics
5548 ///Panics if `vkCmdPipelineBarrier` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5549 ///
5550 ///# Usage Notes
5551 ///
5552 ///Inserts an execution and memory dependency between commands recorded
5553 ///before and after the barrier. This is the primary synchronisation
5554 ///tool inside a command buffer.
5555 ///
5556 ///**Three types of barrier**:
5557 ///
5558 ///- **Memory barriers** (`MemoryBarrier`): global, affects all
5559 /// resources. Rarely needed, prefer the more specific variants.
5560 ///- **Buffer memory barriers** (`BufferMemoryBarrier`): targets a
5561 /// specific buffer region. Use for storage buffer read-after-write.
5562 ///- **Image memory barriers** (`ImageMemoryBarrier`): targets a
5563 /// specific image subresource range. Also performs layout transitions.
5564 ///
5565 ///**Layout transitions**: image memory barriers are the primary way to
5566 ///transition images between layouts (e.g.
5567 ///`TRANSFER_DST_OPTIMAL` → `SHADER_READ_ONLY_OPTIMAL`). The old and
5568 ///new layouts in the barrier define the transition.
5569 ///
5570 ///**Stage masks**: `src_stage_mask` is the set of stages that must
5571 ///complete before the barrier. `dst_stage_mask` is the set of stages
5572 ///that must wait for the barrier. Choose the narrowest stages possible
5573 ///to minimise stalls.
5574 ///
5575 ///Inside a render pass, only self-dependencies are allowed (barriers
5576 ///within a single subpass). Outside a render pass, there are no
5577 ///restrictions.
5578 ///
5579 ///For Vulkan 1.3+, prefer `cmd_pipeline_barrier2` which uses
5580 ///extensible structs.
5581 pub unsafe fn cmd_pipeline_barrier(
5582 &self,
5583 command_buffer: CommandBuffer,
5584 src_stage_mask: PipelineStageFlags,
5585 dst_stage_mask: PipelineStageFlags,
5586 dependency_flags: DependencyFlags,
5587 p_memory_barriers: &[MemoryBarrier],
5588 p_buffer_memory_barriers: &[BufferMemoryBarrier],
5589 p_image_memory_barriers: &[ImageMemoryBarrier],
5590 ) {
5591 let fp = self
5592 .commands()
5593 .cmd_pipeline_barrier
5594 .expect("vkCmdPipelineBarrier not loaded");
5595 unsafe {
5596 fp(
5597 command_buffer,
5598 src_stage_mask,
5599 dst_stage_mask,
5600 dependency_flags,
5601 p_memory_barriers.len() as u32,
5602 p_memory_barriers.as_ptr(),
5603 p_buffer_memory_barriers.len() as u32,
5604 p_buffer_memory_barriers.as_ptr(),
5605 p_image_memory_barriers.len() as u32,
5606 p_image_memory_barriers.as_ptr(),
5607 )
5608 };
5609 }
5610 ///Wraps [`vkCmdBeginQuery`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginQuery.html).
5611 /**
5612 Provided by **VK_BASE_VERSION_1_0**.*/
5613 ///
5614 ///# Safety
5615 ///- `commandBuffer` (self) must be valid and not destroyed.
5616 ///- `commandBuffer` must be externally synchronized.
5617 ///
5618 ///# Panics
5619 ///Panics if `vkCmdBeginQuery` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5620 ///
5621 ///# Usage Notes
5622 ///
5623 ///Begins a query at the specified index in a query pool. All
5624 ///rendering or compute commands recorded between `cmd_begin_query` and
5625 ///`cmd_end_query` are measured by the query.
5626 ///
5627 ///**Flags**:
5628 ///
5629 ///- `QUERY_CONTROL_PRECISE`: for occlusion queries, return an exact
5630 /// sample count instead of a boolean. More expensive on some
5631 /// hardware. Requires the `occlusion_query_precise` device feature.
5632 ///
5633 ///The query slot must have been reset with `cmd_reset_query_pool` (or
5634 ///`reset_query_pool` on Vulkan 1.2+) before beginning.
5635 ///
5636 ///Pipeline statistics queries must be begun and ended outside a render
5637 ///pass. Occlusion queries can span draw calls within a render pass.
5638 pub unsafe fn cmd_begin_query(
5639 &self,
5640 command_buffer: CommandBuffer,
5641 query_pool: QueryPool,
5642 query: u32,
5643 flags: QueryControlFlags,
5644 ) {
5645 let fp = self
5646 .commands()
5647 .cmd_begin_query
5648 .expect("vkCmdBeginQuery not loaded");
5649 unsafe { fp(command_buffer, query_pool, query, flags) };
5650 }
5651 ///Wraps [`vkCmdEndQuery`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndQuery.html).
5652 /**
5653 Provided by **VK_BASE_VERSION_1_0**.*/
5654 ///
5655 ///# Safety
5656 ///- `commandBuffer` (self) must be valid and not destroyed.
5657 ///- `commandBuffer` must be externally synchronized.
5658 ///
5659 ///# Panics
5660 ///Panics if `vkCmdEndQuery` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5661 ///
5662 ///# Usage Notes
5663 ///
5664 ///Ends an active query at the specified index. The query results
5665 ///become available for retrieval via `get_query_pool_results` or
5666 ///`cmd_copy_query_pool_results` once the command buffer has completed
5667 ///execution.
5668 ///
5669 ///Must be paired with a preceding `cmd_begin_query` on the same
5670 ///query index. Beginning a query without ending it, or ending one
5671 ///that was not begun, is an error.
5672 pub unsafe fn cmd_end_query(
5673 &self,
5674 command_buffer: CommandBuffer,
5675 query_pool: QueryPool,
5676 query: u32,
5677 ) {
5678 let fp = self
5679 .commands()
5680 .cmd_end_query
5681 .expect("vkCmdEndQuery not loaded");
5682 unsafe { fp(command_buffer, query_pool, query) };
5683 }
5684 ///Wraps [`vkCmdBeginConditionalRenderingEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginConditionalRenderingEXT.html).
5685 /**
5686 Provided by **VK_EXT_conditional_rendering**.*/
5687 ///
5688 ///# Safety
5689 ///- `commandBuffer` (self) must be valid and not destroyed.
5690 ///- `commandBuffer` must be externally synchronized.
5691 ///
5692 ///# Panics
5693 ///Panics if `vkCmdBeginConditionalRenderingEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5694 ///
5695 ///# Usage Notes
5696 ///
5697 ///Begins a conditional rendering block. Subsequent rendering and
5698 ///dispatch commands are discarded if the 32-bit value at the
5699 ///specified buffer offset is zero (or non-zero if `INVERTED` is
5700 ///set).
5701 ///
5702 ///End with `cmd_end_conditional_rendering_ext`.
5703 ///
5704 ///Useful for GPU-driven occlusion culling, write visibility
5705 ///results to a buffer, then conditionally skip draw calls.
5706 ///
5707 ///Requires `VK_EXT_conditional_rendering`.
5708 pub unsafe fn cmd_begin_conditional_rendering_ext(
5709 &self,
5710 command_buffer: CommandBuffer,
5711 p_conditional_rendering_begin: &ConditionalRenderingBeginInfoEXT,
5712 ) {
5713 let fp = self
5714 .commands()
5715 .cmd_begin_conditional_rendering_ext
5716 .expect("vkCmdBeginConditionalRenderingEXT not loaded");
5717 unsafe { fp(command_buffer, p_conditional_rendering_begin) };
5718 }
5719 ///Wraps [`vkCmdEndConditionalRenderingEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndConditionalRenderingEXT.html).
5720 /**
5721 Provided by **VK_EXT_conditional_rendering**.*/
5722 ///
5723 ///# Safety
5724 ///- `commandBuffer` (self) must be valid and not destroyed.
5725 ///- `commandBuffer` must be externally synchronized.
5726 ///
5727 ///# Panics
5728 ///Panics if `vkCmdEndConditionalRenderingEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5729 ///
5730 ///# Usage Notes
5731 ///
5732 ///Ends a conditional rendering block started with
5733 ///`cmd_begin_conditional_rendering_ext`. Commands after this call
5734 ///execute unconditionally.
5735 ///
5736 ///Requires `VK_EXT_conditional_rendering`.
5737 pub unsafe fn cmd_end_conditional_rendering_ext(&self, command_buffer: CommandBuffer) {
5738 let fp = self
5739 .commands()
5740 .cmd_end_conditional_rendering_ext
5741 .expect("vkCmdEndConditionalRenderingEXT not loaded");
5742 unsafe { fp(command_buffer) };
5743 }
5744 ///Wraps [`vkCmdBeginCustomResolveEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginCustomResolveEXT.html).
5745 /**
5746 Provided by **VK_EXT_custom_resolve**.*/
5747 ///
5748 ///# Safety
5749 ///- `commandBuffer` (self) must be valid and not destroyed.
5750 ///- `commandBuffer` must be externally synchronized.
5751 ///
5752 ///# Panics
5753 ///Panics if `vkCmdBeginCustomResolveEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5754 ///
5755 ///# Usage Notes
5756 ///
5757 ///Begins a custom resolve region, allowing the application to use
5758 ///its own fragment shader for MSAA resolve instead of the fixed-
5759 ///function resolve. End with `cmd_end_custom_resolve_ext`.
5760 ///
5761 ///Useful for tone-mapped or weighted resolves that the built-in
5762 ///resolve operations cannot express.
5763 ///
5764 ///Requires `VK_EXT_custom_resolve`.
5765 pub unsafe fn cmd_begin_custom_resolve_ext(
5766 &self,
5767 command_buffer: CommandBuffer,
5768 p_begin_custom_resolve_info: Option<&BeginCustomResolveInfoEXT>,
5769 ) {
5770 let fp = self
5771 .commands()
5772 .cmd_begin_custom_resolve_ext
5773 .expect("vkCmdBeginCustomResolveEXT not loaded");
5774 let p_begin_custom_resolve_info_ptr =
5775 p_begin_custom_resolve_info.map_or(core::ptr::null(), core::ptr::from_ref);
5776 unsafe { fp(command_buffer, p_begin_custom_resolve_info_ptr) };
5777 }
5778 ///Wraps [`vkCmdResetQueryPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdResetQueryPool.html).
5779 /**
5780 Provided by **VK_BASE_VERSION_1_0**.*/
5781 ///
5782 ///# Safety
5783 ///- `commandBuffer` (self) must be valid and not destroyed.
5784 ///- `commandBuffer` must be externally synchronized.
5785 ///
5786 ///# Panics
5787 ///Panics if `vkCmdResetQueryPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5788 ///
5789 ///# Usage Notes
5790 ///
5791 ///Resets a range of queries in a pool from the GPU command stream.
5792 ///Queries must be reset before they can be used in `cmd_begin_query`
5793 ///or `cmd_write_timestamp`.
5794 ///
5795 ///This is the pre-1.2 way to reset queries. For Vulkan 1.2+,
5796 ///`reset_query_pool` (host-side) is often more convenient and avoids
5797 ///adding the reset to the command buffer.
5798 ///
5799 ///Must be recorded outside a render pass.
5800 pub unsafe fn cmd_reset_query_pool(
5801 &self,
5802 command_buffer: CommandBuffer,
5803 query_pool: QueryPool,
5804 first_query: u32,
5805 query_count: u32,
5806 ) {
5807 let fp = self
5808 .commands()
5809 .cmd_reset_query_pool
5810 .expect("vkCmdResetQueryPool not loaded");
5811 unsafe { fp(command_buffer, query_pool, first_query, query_count) };
5812 }
5813 ///Wraps [`vkCmdWriteTimestamp`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWriteTimestamp.html).
5814 /**
5815 Provided by **VK_BASE_VERSION_1_0**.*/
5816 ///
5817 ///# Safety
5818 ///- `commandBuffer` (self) must be valid and not destroyed.
5819 ///- `commandBuffer` must be externally synchronized.
5820 ///
5821 ///# Panics
5822 ///Panics if `vkCmdWriteTimestamp` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5823 ///
5824 ///# Usage Notes
5825 ///
5826 ///Writes the current GPU timestamp into a query pool slot when the
5827 ///specified pipeline stage completes. Use two timestamps to measure
5828 ///elapsed GPU time:
5829 ///
5830 ///```text
5831 ///cmd_write_timestamp(PIPELINE_STAGE_TOP_OF_PIPE, pool, 0);
5832 #[doc = "// ... commands to measure ..."]
5833 ///cmd_write_timestamp(PIPELINE_STAGE_BOTTOM_OF_PIPE, pool, 1);
5834 ///```
5835 ///
5836 ///After the command buffer completes, read the values with
5837 ///`get_query_pool_results` (with `QUERY_RESULT_64`) and compute:
5838 ///
5839 ///```text
5840 ///elapsed_ns = (timestamp[1] - timestamp[0]) * timestamp_period
5841 ///```
5842 ///
5843 ///`timestamp_period` is in nanoseconds per tick, available from
5844 ///`physical_device_limits`.
5845 ///
5846 ///Not all queue families support timestamps, check
5847 ///`timestamp_valid_bits` in the queue family properties. A value of 0
5848 ///means timestamps are not supported on that queue.
5849 ///
5850 ///For Vulkan 1.3+, prefer `cmd_write_timestamp2`.
5851 pub unsafe fn cmd_write_timestamp(
5852 &self,
5853 command_buffer: CommandBuffer,
5854 pipeline_stage: PipelineStageFlagBits,
5855 query_pool: QueryPool,
5856 query: u32,
5857 ) {
5858 let fp = self
5859 .commands()
5860 .cmd_write_timestamp
5861 .expect("vkCmdWriteTimestamp not loaded");
5862 unsafe { fp(command_buffer, pipeline_stage, query_pool, query) };
5863 }
5864 ///Wraps [`vkCmdCopyQueryPoolResults`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyQueryPoolResults.html).
5865 /**
5866 Provided by **VK_BASE_VERSION_1_0**.*/
5867 ///
5868 ///# Safety
5869 ///- `commandBuffer` (self) must be valid and not destroyed.
5870 ///- `commandBuffer` must be externally synchronized.
5871 ///
5872 ///# Panics
5873 ///Panics if `vkCmdCopyQueryPoolResults` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5874 ///
5875 ///# Usage Notes
5876 ///
5877 ///Copies query results directly into a GPU buffer. This is the
5878 ///GPU-side counterpart to `get_query_pool_results` and avoids a CPU
5879 ///round-trip when the results are consumed by subsequent GPU work
5880 ///(e.g. conditional rendering or indirect dispatch).
5881 ///
5882 ///The same flags apply as for `get_query_pool_results`:
5883 ///`QUERY_RESULT_64`, `QUERY_RESULT_WAIT`,
5884 ///`QUERY_RESULT_WITH_AVAILABILITY`, and `QUERY_RESULT_PARTIAL`.
5885 ///
5886 ///The destination buffer must have `BUFFER_USAGE_TRANSFER_DST`. The
5887 ///stride must be large enough to hold the result (and availability
5888 ///value, if requested).
5889 ///
5890 ///Must be recorded outside a render pass.
5891 pub unsafe fn cmd_copy_query_pool_results(
5892 &self,
5893 command_buffer: CommandBuffer,
5894 query_pool: QueryPool,
5895 first_query: u32,
5896 query_count: u32,
5897 dst_buffer: Buffer,
5898 dst_offset: u64,
5899 stride: u64,
5900 flags: QueryResultFlags,
5901 ) {
5902 let fp = self
5903 .commands()
5904 .cmd_copy_query_pool_results
5905 .expect("vkCmdCopyQueryPoolResults not loaded");
5906 unsafe {
5907 fp(
5908 command_buffer,
5909 query_pool,
5910 first_query,
5911 query_count,
5912 dst_buffer,
5913 dst_offset,
5914 stride,
5915 flags,
5916 )
5917 };
5918 }
5919 ///Wraps [`vkCmdPushConstants`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPushConstants.html).
5920 /**
5921 Provided by **VK_COMPUTE_VERSION_1_0**.*/
5922 ///
5923 ///# Safety
5924 ///- `commandBuffer` (self) must be valid and not destroyed.
5925 ///- `commandBuffer` must be externally synchronized.
5926 ///
5927 ///# Panics
5928 ///Panics if `vkCmdPushConstants` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5929 ///
5930 ///# Usage Notes
5931 ///
5932 ///Updates push constant values for the bound pipeline layout. Push
5933 ///constants are a fast path for small, frequently-changing data that
5934 ///avoids descriptor set updates entirely.
5935 ///
5936 ///**Size limit**: the total push constant range is at least 128 bytes
5937 ///(device limit `max_push_constants_size`). Use push constants for
5938 ///per-draw data like transform matrices, material indices, or time
5939 ///values.
5940 ///
5941 ///**Stage flags**: the `stage_flags` parameter must match the stages
5942 ///declared in the pipeline layout's push constant range. You can
5943 ///update different stage ranges separately (e.g. update the vertex
5944 ///shader's range without touching the fragment shader's range).
5945 ///
5946 ///Push constant data persists across draw/dispatch calls until the
5947 ///pipeline layout is changed or the values are overwritten.
5948 ///
5949 ///For Vulkan 1.4+, `cmd_push_constants2` uses an extensible struct.
5950 pub unsafe fn cmd_push_constants(
5951 &self,
5952 command_buffer: CommandBuffer,
5953 layout: PipelineLayout,
5954 stage_flags: ShaderStageFlags,
5955 offset: u32,
5956 p_values: &[u8],
5957 ) {
5958 let fp = self
5959 .commands()
5960 .cmd_push_constants
5961 .expect("vkCmdPushConstants not loaded");
5962 unsafe {
5963 fp(
5964 command_buffer,
5965 layout,
5966 stage_flags,
5967 offset,
5968 p_values.len() as u32,
5969 p_values.as_ptr().cast(),
5970 )
5971 };
5972 }
5973 ///Wraps [`vkCmdBeginRenderPass`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginRenderPass.html).
5974 /**
5975 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
5976 ///
5977 ///# Safety
5978 ///- `commandBuffer` (self) must be valid and not destroyed.
5979 ///- `commandBuffer` must be externally synchronized.
5980 ///
5981 ///# Panics
5982 ///Panics if `vkCmdBeginRenderPass` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5983 ///
5984 ///# Usage Notes
5985 ///
5986 ///Begins a render pass instance. All subsequent drawing commands are
5987 ///recorded within this render pass until `cmd_end_render_pass`.
5988 ///
5989 ///**`render_pass_begin_info`** specifies:
5990 ///
5991 ///- **Render pass and framebuffer**: which render pass to use and
5992 /// which concrete image views are bound.
5993 ///- **Render area**: the pixel region to render. Should match the
5994 /// framebuffer extent for best performance. Misalignment with the
5995 /// render area granularity can cause overhead on tile-based GPUs.
5996 ///- **Clear values**: one per attachment with `load_op = CLEAR`. The
5997 /// array must include entries for all attachments (use a dummy value
5998 /// for non-cleared attachments).
5999 ///
6000 ///**`contents`**:
6001 ///
6002 ///- `SUBPASS_CONTENTS_INLINE`: draw commands are recorded directly
6003 /// in this command buffer.
6004 ///- `SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS`: draw commands come
6005 /// from secondary command buffers via `cmd_execute_commands`.
6006 ///
6007 ///For Vulkan 1.2+, `cmd_begin_render_pass2` accepts a `SubpassBeginInfo`.
6008 ///For Vulkan 1.3+, consider dynamic rendering (`cmd_begin_rendering`)
6009 ///which avoids render pass and framebuffer objects entirely.
6010 ///
6011 ///# Guide
6012 ///
6013 ///See [Render Passes & Framebuffers](https://hiddentale.github.io/vulkan_rust/concepts/render-passes.html) in the vulkan_rust guide.
6014 pub unsafe fn cmd_begin_render_pass(
6015 &self,
6016 command_buffer: CommandBuffer,
6017 p_render_pass_begin: &RenderPassBeginInfo,
6018 contents: SubpassContents,
6019 ) {
6020 let fp = self
6021 .commands()
6022 .cmd_begin_render_pass
6023 .expect("vkCmdBeginRenderPass not loaded");
6024 unsafe { fp(command_buffer, p_render_pass_begin, contents) };
6025 }
6026 ///Wraps [`vkCmdNextSubpass`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdNextSubpass.html).
6027 /**
6028 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
6029 ///
6030 ///# Safety
6031 ///- `commandBuffer` (self) must be valid and not destroyed.
6032 ///- `commandBuffer` must be externally synchronized.
6033 ///
6034 ///# Panics
6035 ///Panics if `vkCmdNextSubpass` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6036 ///
6037 ///# Usage Notes
6038 ///
6039 ///Advances to the next subpass within a render pass. Subpass
6040 ///transitions allow the driver to resolve dependencies between
6041 ///subpasses, for example, reading a colour attachment written in
6042 ///the previous subpass as an input attachment.
6043 ///
6044 ///The `contents` parameter has the same meaning as in
6045 ///`cmd_begin_render_pass`: `INLINE` or `SECONDARY_COMMAND_BUFFERS`.
6046 ///
6047 ///Multi-subpass render passes are an optimisation for tile-based GPUs
6048 ///where they can keep data on-chip between subpasses. On desktop GPUs
6049 ///the benefit is smaller. Many applications use a single subpass and
6050 ///handle inter-pass dependencies with explicit pipeline barriers.
6051 ///
6052 ///For Vulkan 1.2+, prefer `cmd_next_subpass2`.
6053 pub unsafe fn cmd_next_subpass(
6054 &self,
6055 command_buffer: CommandBuffer,
6056 contents: SubpassContents,
6057 ) {
6058 let fp = self
6059 .commands()
6060 .cmd_next_subpass
6061 .expect("vkCmdNextSubpass not loaded");
6062 unsafe { fp(command_buffer, contents) };
6063 }
6064 ///Wraps [`vkCmdEndRenderPass`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndRenderPass.html).
6065 /**
6066 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
6067 ///
6068 ///# Safety
6069 ///- `commandBuffer` (self) must be valid and not destroyed.
6070 ///- `commandBuffer` must be externally synchronized.
6071 ///
6072 ///# Panics
6073 ///Panics if `vkCmdEndRenderPass` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6074 ///
6075 ///# Usage Notes
6076 ///
6077 ///Ends the current render pass instance. After this call, the
6078 ///implicit layout transitions specified by each attachment's
6079 ///`final_layout` are applied.
6080 ///
6081 ///No draw commands may be recorded after this until a new render pass
6082 ///is begun (or dynamic rendering is started).
6083 ///
6084 ///For Vulkan 1.2+, prefer `cmd_end_render_pass2`.
6085 pub unsafe fn cmd_end_render_pass(&self, command_buffer: CommandBuffer) {
6086 let fp = self
6087 .commands()
6088 .cmd_end_render_pass
6089 .expect("vkCmdEndRenderPass not loaded");
6090 unsafe { fp(command_buffer) };
6091 }
6092 ///Wraps [`vkCmdExecuteCommands`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdExecuteCommands.html).
6093 /**
6094 Provided by **VK_BASE_VERSION_1_0**.*/
6095 ///
6096 ///# Safety
6097 ///- `commandBuffer` (self) must be valid and not destroyed.
6098 ///- `commandBuffer` must be externally synchronized.
6099 ///
6100 ///# Panics
6101 ///Panics if `vkCmdExecuteCommands` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6102 ///
6103 ///# Usage Notes
6104 ///
6105 ///Executes one or more secondary command buffers from a primary
6106 ///command buffer. The secondary buffers are inlined into the primary
6107 ///buffer's execution stream in array order.
6108 ///
6109 ///**Use cases**:
6110 ///
6111 ///- **Multi-threaded recording**: each thread records a secondary
6112 /// command buffer, and the main thread assembles them with a single
6113 /// `cmd_execute_commands` call. This is the primary scaling strategy
6114 /// for CPU-bound recording.
6115 ///- **Reusable draw sequences**: record a secondary buffer once and
6116 /// execute it in multiple frames or from multiple primary buffers
6117 /// (requires `SIMULTANEOUS_USE` on the secondary buffer).
6118 ///
6119 ///Secondary command buffers inherit certain state from the primary
6120 ///buffer (viewport, scissor, etc.) only if declared in the
6121 ///`CommandBufferInheritanceInfo`. The render pass and subpass must
6122 ///match what the primary buffer is currently in.
6123 ///
6124 ///This command can only be called from a primary command buffer.
6125 pub unsafe fn cmd_execute_commands(
6126 &self,
6127 command_buffer: CommandBuffer,
6128 p_command_buffers: &[CommandBuffer],
6129 ) {
6130 let fp = self
6131 .commands()
6132 .cmd_execute_commands
6133 .expect("vkCmdExecuteCommands not loaded");
6134 unsafe {
6135 fp(
6136 command_buffer,
6137 p_command_buffers.len() as u32,
6138 p_command_buffers.as_ptr(),
6139 )
6140 };
6141 }
6142 ///Wraps [`vkCreateSharedSwapchainsKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateSharedSwapchainsKHR.html).
6143 /**
6144 Provided by **VK_KHR_display_swapchain**.*/
6145 ///
6146 ///# Errors
6147 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6148 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
6149 ///- `VK_ERROR_INCOMPATIBLE_DISPLAY_KHR`
6150 ///- `VK_ERROR_DEVICE_LOST`
6151 ///- `VK_ERROR_SURFACE_LOST_KHR`
6152 ///- `VK_ERROR_UNKNOWN`
6153 ///- `VK_ERROR_VALIDATION_FAILED`
6154 ///
6155 ///# Safety
6156 ///- `device` (self) must be valid and not destroyed.
6157 ///
6158 ///# Panics
6159 ///Panics if `vkCreateSharedSwapchainsKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6160 ///
6161 ///# Usage Notes
6162 ///
6163 ///Creates one or more swapchains that share presentable images with
6164 ///their `old_swapchain`. Provided by `VK_KHR_display_swapchain`.
6165 ///
6166 ///This is primarily used for direct-to-display rendering where
6167 ///multiple swapchains share the same display plane. For window-based
6168 ///rendering, use `create_swapchain_khr` instead.
6169 pub unsafe fn create_shared_swapchains_khr(
6170 &self,
6171 p_create_infos: &[SwapchainCreateInfoKHR],
6172 allocator: Option<&AllocationCallbacks>,
6173 ) -> VkResult<Vec<SwapchainKHR>> {
6174 let fp = self
6175 .commands()
6176 .create_shared_swapchains_khr
6177 .expect("vkCreateSharedSwapchainsKHR not loaded");
6178 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
6179 let count = p_create_infos.len();
6180 let mut out = vec![unsafe { core::mem::zeroed() }; count];
6181 check(unsafe {
6182 fp(
6183 self.handle(),
6184 p_create_infos.len() as u32,
6185 p_create_infos.as_ptr(),
6186 alloc_ptr,
6187 out.as_mut_ptr(),
6188 )
6189 })?;
6190 Ok(out)
6191 }
6192 ///Wraps [`vkCreateSwapchainKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateSwapchainKHR.html).
6193 /**
6194 Provided by **VK_KHR_swapchain**.*/
6195 ///
6196 ///# Errors
6197 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6198 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
6199 ///- `VK_ERROR_DEVICE_LOST`
6200 ///- `VK_ERROR_SURFACE_LOST_KHR`
6201 ///- `VK_ERROR_NATIVE_WINDOW_IN_USE_KHR`
6202 ///- `VK_ERROR_INITIALIZATION_FAILED`
6203 ///- `VK_ERROR_COMPRESSION_EXHAUSTED_EXT`
6204 ///- `VK_ERROR_UNKNOWN`
6205 ///- `VK_ERROR_VALIDATION_FAILED`
6206 ///
6207 ///# Safety
6208 ///- `device` (self) must be valid and not destroyed.
6209 ///
6210 ///# Panics
6211 ///Panics if `vkCreateSwapchainKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6212 ///
6213 ///# Usage Notes
6214 ///
6215 ///Creates a swapchain, a queue of presentable images tied to a
6216 ///surface (window). The swapchain is the bridge between rendering and
6217 ///display.
6218 ///
6219 ///**Key parameters**:
6220 ///
6221 ///- **`min_image_count`**: request at least this many images. For
6222 /// double buffering use 2, for triple buffering use 3. Query
6223 /// `get_physical_device_surface_capabilities_khr` for the supported
6224 /// range.
6225 ///- **`image_format` / `image_color_space`**: pick a pair from
6226 /// `get_physical_device_surface_formats_khr`. `B8G8R8A8_SRGB` +
6227 /// `SRGB_NONLINEAR` is the most portable.
6228 ///- **`present_mode`**: `FIFO` (vsync, always supported), `MAILBOX`
6229 /// (low-latency triple buffering), `IMMEDIATE` (no vsync, tearing).
6230 ///- **`pre_transform`**: set to `current_transform` from surface
6231 /// capabilities to avoid an extra composition blit.
6232 ///- **`old_swapchain`**: when recreating after a resize, pass the old
6233 /// swapchain here. The driver can reuse internal resources.
6234 ///
6235 ///**Swapchain recreation** is required when the surface size changes
6236 ///(window resize) or when `acquire_next_image_khr` returns
6237 ///`VK_ERROR_OUT_OF_DATE_KHR`. Destroy the old swapchain after
6238 ///creating the new one.
6239 ///
6240 ///# Guide
6241 ///
6242 ///See [Hello Triangle, Part 2](https://hiddentale.github.io/vulkan_rust/getting-started/hello-triangle-2.html) in the vulkan_rust guide.
6243 pub unsafe fn create_swapchain_khr(
6244 &self,
6245 p_create_info: &SwapchainCreateInfoKHR,
6246 allocator: Option<&AllocationCallbacks>,
6247 ) -> VkResult<SwapchainKHR> {
6248 let fp = self
6249 .commands()
6250 .create_swapchain_khr
6251 .expect("vkCreateSwapchainKHR not loaded");
6252 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
6253 let mut out = unsafe { core::mem::zeroed() };
6254 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
6255 Ok(out)
6256 }
6257 ///Wraps [`vkDestroySwapchainKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroySwapchainKHR.html).
6258 /**
6259 Provided by **VK_KHR_swapchain**.*/
6260 ///
6261 ///# Safety
6262 ///- `device` (self) must be valid and not destroyed.
6263 ///- `swapchain` must be externally synchronized.
6264 ///
6265 ///# Panics
6266 ///Panics if `vkDestroySwapchainKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6267 ///
6268 ///# Usage Notes
6269 ///
6270 ///Destroys a swapchain. All images obtained from
6271 ///`get_swapchain_images_khr` become invalid, destroy any image views
6272 ///and framebuffers referencing them first.
6273 ///
6274 ///Wait for all rendering to complete (`device_wait_idle`) before
6275 ///destroying. Do not destroy a swapchain while an acquired image has
6276 ///not been presented.
6277 ///
6278 ///When recreating a swapchain (e.g. on resize), create the new one
6279 ///first (passing the old as `old_swapchain`), then destroy the old
6280 ///one.
6281 ///
6282 ///# Guide
6283 ///
6284 ///See [Hello Triangle, Part 2](https://hiddentale.github.io/vulkan_rust/getting-started/hello-triangle-2.html) in the vulkan_rust guide.
6285 pub unsafe fn destroy_swapchain_khr(
6286 &self,
6287 swapchain: SwapchainKHR,
6288 allocator: Option<&AllocationCallbacks>,
6289 ) {
6290 let fp = self
6291 .commands()
6292 .destroy_swapchain_khr
6293 .expect("vkDestroySwapchainKHR not loaded");
6294 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
6295 unsafe { fp(self.handle(), swapchain, alloc_ptr) };
6296 }
6297 ///Wraps [`vkGetSwapchainImagesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSwapchainImagesKHR.html).
6298 /**
6299 Provided by **VK_KHR_swapchain**.*/
6300 ///
6301 ///# Errors
6302 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6303 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
6304 ///- `VK_ERROR_UNKNOWN`
6305 ///- `VK_ERROR_VALIDATION_FAILED`
6306 ///
6307 ///# Safety
6308 ///- `device` (self) must be valid and not destroyed.
6309 ///
6310 ///# Panics
6311 ///Panics if `vkGetSwapchainImagesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6312 ///
6313 ///# Usage Notes
6314 ///
6315 ///Returns the array of presentable images owned by the swapchain. You
6316 ///do not create or destroy these images, they are managed by the
6317 ///swapchain.
6318 ///
6319 ///The returned image count may be greater than `min_image_count`
6320 ///requested at swapchain creation.
6321 ///
6322 ///Create an `ImageView` for each swapchain image to use them as
6323 ///render targets. These views (and any framebuffers using them) must
6324 ///be destroyed before the swapchain is destroyed.
6325 ///
6326 ///The images start in an undefined layout. Transition them to the
6327 ///appropriate layout (e.g. `COLOR_ATTACHMENT_OPTIMAL`) during the
6328 ///first render pass or via a pipeline barrier.
6329 ///
6330 ///# Guide
6331 ///
6332 ///See [Hello Triangle, Part 2](https://hiddentale.github.io/vulkan_rust/getting-started/hello-triangle-2.html) in the vulkan_rust guide.
6333 pub unsafe fn get_swapchain_images_khr(&self, swapchain: SwapchainKHR) -> VkResult<Vec<Image>> {
6334 let fp = self
6335 .commands()
6336 .get_swapchain_images_khr
6337 .expect("vkGetSwapchainImagesKHR not loaded");
6338 enumerate_two_call(|count, data| unsafe { fp(self.handle(), swapchain, count, data) })
6339 }
6340 ///Wraps [`vkAcquireNextImageKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAcquireNextImageKHR.html).
6341 /**
6342 Provided by **VK_KHR_swapchain**.*/
6343 ///
6344 ///# Errors
6345 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6346 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
6347 ///- `VK_ERROR_DEVICE_LOST`
6348 ///- `VK_ERROR_OUT_OF_DATE_KHR`
6349 ///- `VK_ERROR_SURFACE_LOST_KHR`
6350 ///- `VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT`
6351 ///- `VK_ERROR_UNKNOWN`
6352 ///- `VK_ERROR_VALIDATION_FAILED`
6353 ///
6354 ///# Safety
6355 ///- `device` (self) must be valid and not destroyed.
6356 ///- `swapchain` must be externally synchronized.
6357 ///- `semaphore` must be externally synchronized.
6358 ///- `fence` must be externally synchronized.
6359 ///
6360 ///# Panics
6361 ///Panics if `vkAcquireNextImageKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6362 ///
6363 ///# Usage Notes
6364 ///
6365 ///Acquires the next available image from the swapchain for rendering.
6366 ///Returns the index into the array from `get_swapchain_images_khr`.
6367 ///
6368 ///**Synchronisation**: pass a semaphore, a fence, or both. The
6369 ///semaphore/fence is signaled when the image is ready to be rendered
6370 ///to. Do not start rendering until the semaphore is waited on in
6371 ///`queue_submit`.
6372 ///
6373 ///**Timeout**: in nanoseconds. `u64::MAX` blocks indefinitely.
6374 ///
6375 ///**Special return values**:
6376 ///
6377 ///- `VK_SUBOPTIMAL_KHR`: the swapchain still works but no longer
6378 /// matches the surface perfectly (e.g. after a resize). You can
6379 /// continue rendering but should recreate the swapchain soon.
6380 ///- `VK_ERROR_OUT_OF_DATE_KHR`: the swapchain is incompatible with
6381 /// the surface and must be recreated before rendering. Do not present
6382 /// the acquired image.
6383 ///
6384 ///A common frame loop:
6385 ///
6386 ///```text
6387 ///acquire_next_image_khr(swapchain, u64::MAX, image_available_sem, null)
6388 #[doc = "// wait on image_available_sem in queue_submit"]
6389 #[doc = "// render to swapchain_images[index]"]
6390 #[doc = "// signal render_finished_sem in queue_submit"]
6391 ///queue_present_khr(render_finished_sem, swapchain, index)
6392 ///```
6393 ///
6394 ///# Guide
6395 ///
6396 ///See [Synchronization](https://hiddentale.github.io/vulkan_rust/concepts/synchronization.html) in the vulkan_rust guide.
6397 pub unsafe fn acquire_next_image_khr(
6398 &self,
6399 swapchain: SwapchainKHR,
6400 timeout: u64,
6401 semaphore: Semaphore,
6402 fence: Fence,
6403 ) -> VkResult<u32> {
6404 let fp = self
6405 .commands()
6406 .acquire_next_image_khr
6407 .expect("vkAcquireNextImageKHR not loaded");
6408 let mut out = unsafe { core::mem::zeroed() };
6409 check(unsafe {
6410 fp(
6411 self.handle(),
6412 swapchain,
6413 timeout,
6414 semaphore,
6415 fence,
6416 &mut out,
6417 )
6418 })?;
6419 Ok(out)
6420 }
6421 ///Wraps [`vkQueuePresentKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueuePresentKHR.html).
6422 /**
6423 Provided by **VK_KHR_swapchain**.*/
6424 ///
6425 ///# Errors
6426 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6427 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
6428 ///- `VK_ERROR_DEVICE_LOST`
6429 ///- `VK_ERROR_OUT_OF_DATE_KHR`
6430 ///- `VK_ERROR_SURFACE_LOST_KHR`
6431 ///- `VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT`
6432 ///- `VK_ERROR_UNKNOWN`
6433 ///- `VK_ERROR_VALIDATION_FAILED`
6434 ///- `VK_ERROR_PRESENT_TIMING_QUEUE_FULL_EXT`
6435 ///
6436 ///# Safety
6437 ///- `queue` (self) must be valid and not destroyed.
6438 ///- `queue` must be externally synchronized.
6439 ///
6440 ///# Panics
6441 ///Panics if `vkQueuePresentKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6442 ///
6443 ///# Usage Notes
6444 ///
6445 ///Presents a rendered swapchain image to the display. This is the
6446 ///final step in the frame loop, after rendering is complete, present
6447 ///the image to make it visible.
6448 ///
6449 ///**Wait semaphores**: the present waits on these semaphores before
6450 ///presenting. Pass the semaphore that your render submission signals
6451 ///to ensure the image is fully rendered before it goes to the display.
6452 ///
6453 ///**Multiple swapchains**: a single present call can present to
6454 ///multiple swapchains simultaneously (e.g. for multi-window or
6455 ///multi-monitor rendering).
6456 ///
6457 ///**Return values**:
6458 ///
6459 ///- `VK_SUBOPTIMAL_KHR`: presented successfully but the swapchain
6460 /// should be recreated.
6461 ///- `VK_ERROR_OUT_OF_DATE_KHR`: presentation failed, the swapchain
6462 /// must be recreated.
6463 ///
6464 ///The present queue does not need to be the same as the graphics
6465 ///queue, but the semaphore synchronisation must be correct if they
6466 ///differ.
6467 ///
6468 ///# Guide
6469 ///
6470 ///See [Hello Triangle, Part 4](https://hiddentale.github.io/vulkan_rust/getting-started/hello-triangle-4.html) in the vulkan_rust guide.
6471 pub unsafe fn queue_present_khr(
6472 &self,
6473 queue: Queue,
6474 p_present_info: &PresentInfoKHR,
6475 ) -> VkResult<()> {
6476 let fp = self
6477 .commands()
6478 .queue_present_khr
6479 .expect("vkQueuePresentKHR not loaded");
6480 check(unsafe { fp(queue, p_present_info) })
6481 }
6482 ///Wraps [`vkDebugMarkerSetObjectNameEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDebugMarkerSetObjectNameEXT.html).
6483 /**
6484 Provided by **VK_EXT_debug_marker**.*/
6485 ///
6486 ///# Errors
6487 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6488 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
6489 ///- `VK_ERROR_UNKNOWN`
6490 ///- `VK_ERROR_VALIDATION_FAILED`
6491 ///
6492 ///# Safety
6493 ///- `device` (self) must be valid and not destroyed.
6494 ///
6495 ///# Panics
6496 ///Panics if `vkDebugMarkerSetObjectNameEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6497 ///
6498 ///# Usage Notes
6499 ///
6500 ///Assigns a name to a Vulkan object for debugging. This is the
6501 ///legacy `VK_EXT_debug_marker` equivalent of
6502 ///`set_debug_utils_object_name_ext`.
6503 ///
6504 ///`DebugMarkerObjectNameInfoEXT` uses the old
6505 ///`DebugReportObjectTypeEXT` enum to identify object types.
6506 ///
6507 ///Superseded by `VK_EXT_debug_utils`. Prefer
6508 ///`set_debug_utils_object_name_ext` for new code.
6509 pub unsafe fn debug_marker_set_object_name_ext(
6510 &self,
6511 p_name_info: &DebugMarkerObjectNameInfoEXT,
6512 ) -> VkResult<()> {
6513 let fp = self
6514 .commands()
6515 .debug_marker_set_object_name_ext
6516 .expect("vkDebugMarkerSetObjectNameEXT not loaded");
6517 check(unsafe { fp(self.handle(), p_name_info) })
6518 }
6519 ///Wraps [`vkDebugMarkerSetObjectTagEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDebugMarkerSetObjectTagEXT.html).
6520 /**
6521 Provided by **VK_EXT_debug_marker**.*/
6522 ///
6523 ///# Errors
6524 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6525 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
6526 ///- `VK_ERROR_UNKNOWN`
6527 ///- `VK_ERROR_VALIDATION_FAILED`
6528 ///
6529 ///# Safety
6530 ///- `device` (self) must be valid and not destroyed.
6531 ///
6532 ///# Panics
6533 ///Panics if `vkDebugMarkerSetObjectTagEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6534 ///
6535 ///# Usage Notes
6536 ///
6537 ///Attaches arbitrary binary data to a Vulkan object. This is the
6538 ///legacy `VK_EXT_debug_marker` equivalent of
6539 ///`set_debug_utils_object_tag_ext`.
6540 ///
6541 ///Superseded by `VK_EXT_debug_utils`. Prefer
6542 ///`set_debug_utils_object_tag_ext` for new code.
6543 pub unsafe fn debug_marker_set_object_tag_ext(
6544 &self,
6545 p_tag_info: &DebugMarkerObjectTagInfoEXT,
6546 ) -> VkResult<()> {
6547 let fp = self
6548 .commands()
6549 .debug_marker_set_object_tag_ext
6550 .expect("vkDebugMarkerSetObjectTagEXT not loaded");
6551 check(unsafe { fp(self.handle(), p_tag_info) })
6552 }
6553 ///Wraps [`vkCmdDebugMarkerBeginEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDebugMarkerBeginEXT.html).
6554 /**
6555 Provided by **VK_EXT_debug_marker**.*/
6556 ///
6557 ///# Safety
6558 ///- `commandBuffer` (self) must be valid and not destroyed.
6559 ///- `commandBuffer` must be externally synchronized.
6560 ///
6561 ///# Panics
6562 ///Panics if `vkCmdDebugMarkerBeginEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6563 ///
6564 ///# Usage Notes
6565 ///
6566 ///Opens a debug marker region in a command buffer. This is the
6567 ///legacy `VK_EXT_debug_marker` equivalent of
6568 ///`cmd_begin_debug_utils_label_ext`.
6569 ///
6570 ///`DebugMarkerMarkerInfoEXT` specifies a name and optional RGBA
6571 ///color. Close with `cmd_debug_marker_end_ext`.
6572 ///
6573 ///Superseded by `VK_EXT_debug_utils`. Prefer
6574 ///`cmd_begin_debug_utils_label_ext` for new code.
6575 pub unsafe fn cmd_debug_marker_begin_ext(
6576 &self,
6577 command_buffer: CommandBuffer,
6578 p_marker_info: &DebugMarkerMarkerInfoEXT,
6579 ) {
6580 let fp = self
6581 .commands()
6582 .cmd_debug_marker_begin_ext
6583 .expect("vkCmdDebugMarkerBeginEXT not loaded");
6584 unsafe { fp(command_buffer, p_marker_info) };
6585 }
6586 ///Wraps [`vkCmdDebugMarkerEndEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDebugMarkerEndEXT.html).
6587 /**
6588 Provided by **VK_EXT_debug_marker**.*/
6589 ///
6590 ///# Safety
6591 ///- `commandBuffer` (self) must be valid and not destroyed.
6592 ///- `commandBuffer` must be externally synchronized.
6593 ///
6594 ///# Panics
6595 ///Panics if `vkCmdDebugMarkerEndEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6596 ///
6597 ///# Usage Notes
6598 ///
6599 ///Closes the most recently opened debug marker region in the command
6600 ///buffer. Must be paired with `cmd_debug_marker_begin_ext`.
6601 ///
6602 ///This is the legacy `VK_EXT_debug_marker` equivalent of
6603 ///`cmd_end_debug_utils_label_ext`. Prefer `VK_EXT_debug_utils`
6604 ///for new code.
6605 pub unsafe fn cmd_debug_marker_end_ext(&self, command_buffer: CommandBuffer) {
6606 let fp = self
6607 .commands()
6608 .cmd_debug_marker_end_ext
6609 .expect("vkCmdDebugMarkerEndEXT not loaded");
6610 unsafe { fp(command_buffer) };
6611 }
6612 ///Wraps [`vkCmdDebugMarkerInsertEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDebugMarkerInsertEXT.html).
6613 /**
6614 Provided by **VK_EXT_debug_marker**.*/
6615 ///
6616 ///# Safety
6617 ///- `commandBuffer` (self) must be valid and not destroyed.
6618 ///- `commandBuffer` must be externally synchronized.
6619 ///
6620 ///# Panics
6621 ///Panics if `vkCmdDebugMarkerInsertEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6622 ///
6623 ///# Usage Notes
6624 ///
6625 ///Inserts a single-point debug marker into the command buffer.
6626 ///This is the legacy `VK_EXT_debug_marker` equivalent of
6627 ///`cmd_insert_debug_utils_label_ext`.
6628 ///
6629 ///`DebugMarkerMarkerInfoEXT` specifies a name and optional RGBA
6630 ///color.
6631 ///
6632 ///Superseded by `VK_EXT_debug_utils`. Prefer
6633 ///`cmd_insert_debug_utils_label_ext` for new code.
6634 pub unsafe fn cmd_debug_marker_insert_ext(
6635 &self,
6636 command_buffer: CommandBuffer,
6637 p_marker_info: &DebugMarkerMarkerInfoEXT,
6638 ) {
6639 let fp = self
6640 .commands()
6641 .cmd_debug_marker_insert_ext
6642 .expect("vkCmdDebugMarkerInsertEXT not loaded");
6643 unsafe { fp(command_buffer, p_marker_info) };
6644 }
6645 ///Wraps [`vkGetMemoryWin32HandleNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryWin32HandleNV.html).
6646 /**
6647 Provided by **VK_NV_external_memory_win32**.*/
6648 ///
6649 ///# Errors
6650 ///- `VK_ERROR_TOO_MANY_OBJECTS`
6651 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6652 ///- `VK_ERROR_UNKNOWN`
6653 ///- `VK_ERROR_VALIDATION_FAILED`
6654 ///
6655 ///# Safety
6656 ///- `device` (self) must be valid and not destroyed.
6657 ///
6658 ///# Panics
6659 ///Panics if `vkGetMemoryWin32HandleNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6660 ///
6661 ///# Usage Notes
6662 ///
6663 ///Exports a Vulkan device memory allocation as a Win32 handle
6664 ///(HANDLE) for sharing with other APIs or processes. This is the
6665 ///legacy NV path; prefer `get_memory_win32_handle_khr` for new
6666 ///code.
6667 ///
6668 ///Requires `VK_NV_external_memory_win32`. Windows only.
6669 pub unsafe fn get_memory_win32_handle_nv(
6670 &self,
6671 memory: DeviceMemory,
6672 handle_type: ExternalMemoryHandleTypeFlagsNV,
6673 ) -> VkResult<isize> {
6674 let fp = self
6675 .commands()
6676 .get_memory_win32_handle_nv
6677 .expect("vkGetMemoryWin32HandleNV not loaded");
6678 let mut out = unsafe { core::mem::zeroed() };
6679 check(unsafe { fp(self.handle(), memory, handle_type, &mut out) })?;
6680 Ok(out)
6681 }
6682 ///Wraps [`vkCmdExecuteGeneratedCommandsNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdExecuteGeneratedCommandsNV.html).
6683 /**
6684 Provided by **VK_NV_device_generated_commands**.*/
6685 ///
6686 ///# Safety
6687 ///- `commandBuffer` (self) must be valid and not destroyed.
6688 ///- `commandBuffer` must be externally synchronized.
6689 ///
6690 ///# Panics
6691 ///Panics if `vkCmdExecuteGeneratedCommandsNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6692 ///
6693 ///# Usage Notes
6694 ///
6695 ///Executes commands that were generated on the GPU. If
6696 ///`is_preprocessed` is set, the commands must have been
6697 ///preprocessed with `cmd_preprocess_generated_commands_nv` first.
6698 ///
6699 ///Requires `VK_NV_device_generated_commands`.
6700 pub unsafe fn cmd_execute_generated_commands_nv(
6701 &self,
6702 command_buffer: CommandBuffer,
6703 is_preprocessed: bool,
6704 p_generated_commands_info: &GeneratedCommandsInfoNV,
6705 ) {
6706 let fp = self
6707 .commands()
6708 .cmd_execute_generated_commands_nv
6709 .expect("vkCmdExecuteGeneratedCommandsNV not loaded");
6710 unsafe {
6711 fp(
6712 command_buffer,
6713 is_preprocessed as u32,
6714 p_generated_commands_info,
6715 )
6716 };
6717 }
6718 ///Wraps [`vkCmdPreprocessGeneratedCommandsNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPreprocessGeneratedCommandsNV.html).
6719 /**
6720 Provided by **VK_NV_device_generated_commands**.*/
6721 ///
6722 ///# Safety
6723 ///- `commandBuffer` (self) must be valid and not destroyed.
6724 ///- `commandBuffer` must be externally synchronized.
6725 ///
6726 ///# Panics
6727 ///Panics if `vkCmdPreprocessGeneratedCommandsNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6728 ///
6729 ///# Usage Notes
6730 ///
6731 ///Preprocesses device-generated commands into a form suitable for
6732 ///fast execution. The preprocessing result is stored in a
6733 ///preprocess buffer and later consumed by
6734 ///`cmd_execute_generated_commands_nv` with `is_preprocessed` set.
6735 ///
6736 ///Requires `VK_NV_device_generated_commands`.
6737 pub unsafe fn cmd_preprocess_generated_commands_nv(
6738 &self,
6739 command_buffer: CommandBuffer,
6740 p_generated_commands_info: &GeneratedCommandsInfoNV,
6741 ) {
6742 let fp = self
6743 .commands()
6744 .cmd_preprocess_generated_commands_nv
6745 .expect("vkCmdPreprocessGeneratedCommandsNV not loaded");
6746 unsafe { fp(command_buffer, p_generated_commands_info) };
6747 }
6748 ///Wraps [`vkCmdBindPipelineShaderGroupNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindPipelineShaderGroupNV.html).
6749 /**
6750 Provided by **VK_NV_device_generated_commands**.*/
6751 ///
6752 ///# Safety
6753 ///- `commandBuffer` (self) must be valid and not destroyed.
6754 ///- `commandBuffer` must be externally synchronized.
6755 ///
6756 ///# Panics
6757 ///Panics if `vkCmdBindPipelineShaderGroupNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6758 ///
6759 ///# Usage Notes
6760 ///
6761 ///Binds a shader group from a pipeline that was created with
6762 ///multiple shader groups. Used with device-generated commands to
6763 ///switch between pre-compiled shader variants without rebinding
6764 ///the entire pipeline.
6765 ///
6766 ///Requires `VK_NV_device_generated_commands`.
6767 pub unsafe fn cmd_bind_pipeline_shader_group_nv(
6768 &self,
6769 command_buffer: CommandBuffer,
6770 pipeline_bind_point: PipelineBindPoint,
6771 pipeline: Pipeline,
6772 group_index: u32,
6773 ) {
6774 let fp = self
6775 .commands()
6776 .cmd_bind_pipeline_shader_group_nv
6777 .expect("vkCmdBindPipelineShaderGroupNV not loaded");
6778 unsafe { fp(command_buffer, pipeline_bind_point, pipeline, group_index) };
6779 }
6780 ///Wraps [`vkGetGeneratedCommandsMemoryRequirementsNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetGeneratedCommandsMemoryRequirementsNV.html).
6781 /**
6782 Provided by **VK_NV_device_generated_commands**.*/
6783 ///
6784 ///# Safety
6785 ///- `device` (self) must be valid and not destroyed.
6786 ///
6787 ///# Panics
6788 ///Panics if `vkGetGeneratedCommandsMemoryRequirementsNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6789 ///
6790 ///# Usage Notes
6791 ///
6792 ///Queries the memory requirements for preprocessing device-generated
6793 ///commands. The returned size determines how large the preprocess
6794 ///buffer must be for `cmd_preprocess_generated_commands_nv`.
6795 ///
6796 ///Requires `VK_NV_device_generated_commands`.
6797 pub unsafe fn get_generated_commands_memory_requirements_nv(
6798 &self,
6799 p_info: &GeneratedCommandsMemoryRequirementsInfoNV,
6800 p_memory_requirements: &mut MemoryRequirements2,
6801 ) {
6802 let fp = self
6803 .commands()
6804 .get_generated_commands_memory_requirements_nv
6805 .expect("vkGetGeneratedCommandsMemoryRequirementsNV not loaded");
6806 unsafe { fp(self.handle(), p_info, p_memory_requirements) };
6807 }
6808 ///Wraps [`vkCreateIndirectCommandsLayoutNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateIndirectCommandsLayoutNV.html).
6809 /**
6810 Provided by **VK_NV_device_generated_commands**.*/
6811 ///
6812 ///# Errors
6813 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6814 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
6815 ///- `VK_ERROR_UNKNOWN`
6816 ///- `VK_ERROR_VALIDATION_FAILED`
6817 ///
6818 ///# Safety
6819 ///- `device` (self) must be valid and not destroyed.
6820 ///
6821 ///# Panics
6822 ///Panics if `vkCreateIndirectCommandsLayoutNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6823 ///
6824 ///# Usage Notes
6825 ///
6826 ///Creates a layout that describes the structure of indirect command
6827 ///sequences for device-generated commands. The layout defines which
6828 ///tokens (draw, dispatch, push constants, etc.) appear in the
6829 ///command stream and their order.
6830 ///
6831 ///Destroy with `destroy_indirect_commands_layout_nv`.
6832 ///
6833 ///Requires `VK_NV_device_generated_commands`.
6834 pub unsafe fn create_indirect_commands_layout_nv(
6835 &self,
6836 p_create_info: &IndirectCommandsLayoutCreateInfoNV,
6837 allocator: Option<&AllocationCallbacks>,
6838 ) -> VkResult<IndirectCommandsLayoutNV> {
6839 let fp = self
6840 .commands()
6841 .create_indirect_commands_layout_nv
6842 .expect("vkCreateIndirectCommandsLayoutNV not loaded");
6843 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
6844 let mut out = unsafe { core::mem::zeroed() };
6845 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
6846 Ok(out)
6847 }
6848 ///Wraps [`vkDestroyIndirectCommandsLayoutNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyIndirectCommandsLayoutNV.html).
6849 /**
6850 Provided by **VK_NV_device_generated_commands**.*/
6851 ///
6852 ///# Safety
6853 ///- `device` (self) must be valid and not destroyed.
6854 ///- `indirectCommandsLayout` must be externally synchronized.
6855 ///
6856 ///# Panics
6857 ///Panics if `vkDestroyIndirectCommandsLayoutNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6858 ///
6859 ///# Usage Notes
6860 ///
6861 ///Destroys an indirect commands layout created with
6862 ///`create_indirect_commands_layout_nv`.
6863 ///
6864 ///Requires `VK_NV_device_generated_commands`.
6865 pub unsafe fn destroy_indirect_commands_layout_nv(
6866 &self,
6867 indirect_commands_layout: IndirectCommandsLayoutNV,
6868 allocator: Option<&AllocationCallbacks>,
6869 ) {
6870 let fp = self
6871 .commands()
6872 .destroy_indirect_commands_layout_nv
6873 .expect("vkDestroyIndirectCommandsLayoutNV not loaded");
6874 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
6875 unsafe { fp(self.handle(), indirect_commands_layout, alloc_ptr) };
6876 }
6877 ///Wraps [`vkCmdExecuteGeneratedCommandsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdExecuteGeneratedCommandsEXT.html).
6878 /**
6879 Provided by **VK_EXT_device_generated_commands**.*/
6880 ///
6881 ///# Safety
6882 ///- `commandBuffer` (self) must be valid and not destroyed.
6883 ///- `commandBuffer` must be externally synchronized.
6884 ///
6885 ///# Panics
6886 ///Panics if `vkCmdExecuteGeneratedCommandsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6887 ///
6888 ///# Usage Notes
6889 ///
6890 ///Executes commands generated on the GPU from an indirect commands
6891 ///layout. The `GeneratedCommandsInfoEXT` specifies the indirect
6892 ///commands layout, pipeline/shader objects, and the buffer
6893 ///containing the generated command data.
6894 ///
6895 ///If `is_preprocessed` is true, the command data was prepared by
6896 ///a prior `cmd_preprocess_generated_commands_ext` call. Otherwise,
6897 ///preprocessing and execution happen in one step.
6898 ///
6899 ///Requires `VK_EXT_device_generated_commands`.
6900 pub unsafe fn cmd_execute_generated_commands_ext(
6901 &self,
6902 command_buffer: CommandBuffer,
6903 is_preprocessed: bool,
6904 p_generated_commands_info: &GeneratedCommandsInfoEXT,
6905 ) {
6906 let fp = self
6907 .commands()
6908 .cmd_execute_generated_commands_ext
6909 .expect("vkCmdExecuteGeneratedCommandsEXT not loaded");
6910 unsafe {
6911 fp(
6912 command_buffer,
6913 is_preprocessed as u32,
6914 p_generated_commands_info,
6915 )
6916 };
6917 }
6918 ///Wraps [`vkCmdPreprocessGeneratedCommandsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPreprocessGeneratedCommandsEXT.html).
6919 /**
6920 Provided by **VK_EXT_device_generated_commands**.*/
6921 ///
6922 ///# Safety
6923 ///- `commandBuffer` (self) must be valid and not destroyed.
6924 ///- `commandBuffer` must be externally synchronized.
6925 ///- `stateCommandBuffer` must be externally synchronized.
6926 ///
6927 ///# Panics
6928 ///Panics if `vkCmdPreprocessGeneratedCommandsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6929 ///
6930 ///# Usage Notes
6931 ///
6932 ///Preprocesses device-generated commands into an intermediate
6933 ///format. This can be done in a separate command buffer or pass,
6934 ///then executed later with `cmd_execute_generated_commands_ext`
6935 ///(with `is_preprocessed` = true).
6936 ///
6937 ///Separating preprocessing from execution allows overlapping the
6938 ///preprocessing work with other GPU tasks.
6939 ///
6940 ///Requires `VK_EXT_device_generated_commands`.
6941 pub unsafe fn cmd_preprocess_generated_commands_ext(
6942 &self,
6943 command_buffer: CommandBuffer,
6944 p_generated_commands_info: &GeneratedCommandsInfoEXT,
6945 state_command_buffer: CommandBuffer,
6946 ) {
6947 let fp = self
6948 .commands()
6949 .cmd_preprocess_generated_commands_ext
6950 .expect("vkCmdPreprocessGeneratedCommandsEXT not loaded");
6951 unsafe {
6952 fp(
6953 command_buffer,
6954 p_generated_commands_info,
6955 state_command_buffer,
6956 )
6957 };
6958 }
6959 ///Wraps [`vkGetGeneratedCommandsMemoryRequirementsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetGeneratedCommandsMemoryRequirementsEXT.html).
6960 /**
6961 Provided by **VK_EXT_device_generated_commands**.*/
6962 ///
6963 ///# Safety
6964 ///- `device` (self) must be valid and not destroyed.
6965 ///
6966 ///# Panics
6967 ///Panics if `vkGetGeneratedCommandsMemoryRequirementsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6968 ///
6969 ///# Usage Notes
6970 ///
6971 ///Queries the memory requirements for preprocessing and executing
6972 ///device-generated commands. Returns a `MemoryRequirements2` with
6973 ///the size and alignment needed for the preprocess buffer.
6974 ///
6975 ///Call this before allocating the preprocess buffer used by
6976 ///`cmd_preprocess_generated_commands_ext` and
6977 ///`cmd_execute_generated_commands_ext`.
6978 ///
6979 ///Requires `VK_EXT_device_generated_commands`.
6980 pub unsafe fn get_generated_commands_memory_requirements_ext(
6981 &self,
6982 p_info: &GeneratedCommandsMemoryRequirementsInfoEXT,
6983 p_memory_requirements: &mut MemoryRequirements2,
6984 ) {
6985 let fp = self
6986 .commands()
6987 .get_generated_commands_memory_requirements_ext
6988 .expect("vkGetGeneratedCommandsMemoryRequirementsEXT not loaded");
6989 unsafe { fp(self.handle(), p_info, p_memory_requirements) };
6990 }
6991 ///Wraps [`vkCreateIndirectCommandsLayoutEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateIndirectCommandsLayoutEXT.html).
6992 /**
6993 Provided by **VK_EXT_device_generated_commands**.*/
6994 ///
6995 ///# Errors
6996 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6997 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
6998 ///- `VK_ERROR_UNKNOWN`
6999 ///- `VK_ERROR_VALIDATION_FAILED`
7000 ///
7001 ///# Safety
7002 ///- `device` (self) must be valid and not destroyed.
7003 ///
7004 ///# Panics
7005 ///Panics if `vkCreateIndirectCommandsLayoutEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7006 ///
7007 ///# Usage Notes
7008 ///
7009 ///Creates an indirect commands layout that defines the structure of
7010 ///GPU-generated command sequences. Each token in the layout
7011 ///describes one command element (draw, dispatch, push constant,
7012 ///vertex buffer bind, index buffer bind, etc.).
7013 ///
7014 ///The layout is used with `cmd_execute_generated_commands_ext`.
7015 ///
7016 ///Destroy with `destroy_indirect_commands_layout_ext`.
7017 ///
7018 ///Requires `VK_EXT_device_generated_commands`.
7019 pub unsafe fn create_indirect_commands_layout_ext(
7020 &self,
7021 p_create_info: &IndirectCommandsLayoutCreateInfoEXT,
7022 allocator: Option<&AllocationCallbacks>,
7023 ) -> VkResult<IndirectCommandsLayoutEXT> {
7024 let fp = self
7025 .commands()
7026 .create_indirect_commands_layout_ext
7027 .expect("vkCreateIndirectCommandsLayoutEXT not loaded");
7028 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
7029 let mut out = unsafe { core::mem::zeroed() };
7030 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
7031 Ok(out)
7032 }
7033 ///Wraps [`vkDestroyIndirectCommandsLayoutEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyIndirectCommandsLayoutEXT.html).
7034 /**
7035 Provided by **VK_EXT_device_generated_commands**.*/
7036 ///
7037 ///# Safety
7038 ///- `device` (self) must be valid and not destroyed.
7039 ///- `indirectCommandsLayout` must be externally synchronized.
7040 ///
7041 ///# Panics
7042 ///Panics if `vkDestroyIndirectCommandsLayoutEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7043 ///
7044 ///# Usage Notes
7045 ///
7046 ///Destroys an indirect commands layout created with
7047 ///`create_indirect_commands_layout_ext`.
7048 ///
7049 ///Requires `VK_EXT_device_generated_commands`.
7050 pub unsafe fn destroy_indirect_commands_layout_ext(
7051 &self,
7052 indirect_commands_layout: IndirectCommandsLayoutEXT,
7053 allocator: Option<&AllocationCallbacks>,
7054 ) {
7055 let fp = self
7056 .commands()
7057 .destroy_indirect_commands_layout_ext
7058 .expect("vkDestroyIndirectCommandsLayoutEXT not loaded");
7059 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
7060 unsafe { fp(self.handle(), indirect_commands_layout, alloc_ptr) };
7061 }
7062 ///Wraps [`vkCreateIndirectExecutionSetEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateIndirectExecutionSetEXT.html).
7063 /**
7064 Provided by **VK_EXT_device_generated_commands**.*/
7065 ///
7066 ///# Errors
7067 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7068 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
7069 ///- `VK_ERROR_UNKNOWN`
7070 ///- `VK_ERROR_VALIDATION_FAILED`
7071 ///
7072 ///# Safety
7073 ///- `device` (self) must be valid and not destroyed.
7074 ///
7075 ///# Panics
7076 ///Panics if `vkCreateIndirectExecutionSetEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7077 ///
7078 ///# Usage Notes
7079 ///
7080 ///Creates an indirect execution set, a table of pipelines or
7081 ///shader objects that can be indexed at execution time by
7082 ///device-generated commands.
7083 ///
7084 ///The GPU selects which pipeline/shader to use based on an index
7085 ///in the generated command stream, enabling fully GPU-driven
7086 ///material/shader selection.
7087 ///
7088 ///Destroy with `destroy_indirect_execution_set_ext`.
7089 ///
7090 ///Requires `VK_EXT_device_generated_commands`.
7091 pub unsafe fn create_indirect_execution_set_ext(
7092 &self,
7093 p_create_info: &IndirectExecutionSetCreateInfoEXT,
7094 allocator: Option<&AllocationCallbacks>,
7095 ) -> VkResult<IndirectExecutionSetEXT> {
7096 let fp = self
7097 .commands()
7098 .create_indirect_execution_set_ext
7099 .expect("vkCreateIndirectExecutionSetEXT not loaded");
7100 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
7101 let mut out = unsafe { core::mem::zeroed() };
7102 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
7103 Ok(out)
7104 }
7105 ///Wraps [`vkDestroyIndirectExecutionSetEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyIndirectExecutionSetEXT.html).
7106 /**
7107 Provided by **VK_EXT_device_generated_commands**.*/
7108 ///
7109 ///# Safety
7110 ///- `device` (self) must be valid and not destroyed.
7111 ///- `indirectExecutionSet` must be externally synchronized.
7112 ///
7113 ///# Panics
7114 ///Panics if `vkDestroyIndirectExecutionSetEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7115 ///
7116 ///# Usage Notes
7117 ///
7118 ///Destroys an indirect execution set created with
7119 ///`create_indirect_execution_set_ext`.
7120 ///
7121 ///Requires `VK_EXT_device_generated_commands`.
7122 pub unsafe fn destroy_indirect_execution_set_ext(
7123 &self,
7124 indirect_execution_set: IndirectExecutionSetEXT,
7125 allocator: Option<&AllocationCallbacks>,
7126 ) {
7127 let fp = self
7128 .commands()
7129 .destroy_indirect_execution_set_ext
7130 .expect("vkDestroyIndirectExecutionSetEXT not loaded");
7131 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
7132 unsafe { fp(self.handle(), indirect_execution_set, alloc_ptr) };
7133 }
7134 ///Wraps [`vkUpdateIndirectExecutionSetPipelineEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkUpdateIndirectExecutionSetPipelineEXT.html).
7135 /**
7136 Provided by **VK_EXT_device_generated_commands**.*/
7137 ///
7138 ///# Safety
7139 ///- `device` (self) must be valid and not destroyed.
7140 ///- `indirectExecutionSet` must be externally synchronized.
7141 ///
7142 ///# Panics
7143 ///Panics if `vkUpdateIndirectExecutionSetPipelineEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7144 ///
7145 ///# Usage Notes
7146 ///
7147 ///Updates entries in an indirect execution set that holds pipelines.
7148 ///Each `WriteIndirectExecutionSetPipelineEXT` maps an index to a
7149 ///pipeline handle.
7150 ///
7151 ///The pipelines must be compatible with the initial pipeline used
7152 ///to create the execution set.
7153 ///
7154 ///Requires `VK_EXT_device_generated_commands`.
7155 pub unsafe fn update_indirect_execution_set_pipeline_ext(
7156 &self,
7157 indirect_execution_set: IndirectExecutionSetEXT,
7158 p_execution_set_writes: &[WriteIndirectExecutionSetPipelineEXT],
7159 ) {
7160 let fp = self
7161 .commands()
7162 .update_indirect_execution_set_pipeline_ext
7163 .expect("vkUpdateIndirectExecutionSetPipelineEXT not loaded");
7164 unsafe {
7165 fp(
7166 self.handle(),
7167 indirect_execution_set,
7168 p_execution_set_writes.len() as u32,
7169 p_execution_set_writes.as_ptr(),
7170 )
7171 };
7172 }
7173 ///Wraps [`vkUpdateIndirectExecutionSetShaderEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkUpdateIndirectExecutionSetShaderEXT.html).
7174 /**
7175 Provided by **VK_EXT_device_generated_commands**.*/
7176 ///
7177 ///# Safety
7178 ///- `device` (self) must be valid and not destroyed.
7179 ///- `indirectExecutionSet` must be externally synchronized.
7180 ///
7181 ///# Panics
7182 ///Panics if `vkUpdateIndirectExecutionSetShaderEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7183 ///
7184 ///# Usage Notes
7185 ///
7186 ///Updates entries in an indirect execution set that holds shader
7187 ///objects. Each `WriteIndirectExecutionSetShaderEXT` maps an index
7188 ///to a shader object handle.
7189 ///
7190 ///The shaders must be compatible with the initial shader used to
7191 ///create the execution set.
7192 ///
7193 ///Requires `VK_EXT_device_generated_commands`.
7194 pub unsafe fn update_indirect_execution_set_shader_ext(
7195 &self,
7196 indirect_execution_set: IndirectExecutionSetEXT,
7197 p_execution_set_writes: &[WriteIndirectExecutionSetShaderEXT],
7198 ) {
7199 let fp = self
7200 .commands()
7201 .update_indirect_execution_set_shader_ext
7202 .expect("vkUpdateIndirectExecutionSetShaderEXT not loaded");
7203 unsafe {
7204 fp(
7205 self.handle(),
7206 indirect_execution_set,
7207 p_execution_set_writes.len() as u32,
7208 p_execution_set_writes.as_ptr(),
7209 )
7210 };
7211 }
7212 ///Wraps [`vkCmdPushDescriptorSet`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPushDescriptorSet.html).
7213 /**
7214 Provided by **VK_COMPUTE_VERSION_1_4**.*/
7215 ///
7216 ///# Safety
7217 ///- `commandBuffer` (self) must be valid and not destroyed.
7218 ///- `commandBuffer` must be externally synchronized.
7219 ///
7220 ///# Panics
7221 ///Panics if `vkCmdPushDescriptorSet` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7222 ///
7223 ///# Usage Notes
7224 ///
7225 ///Pushes descriptor updates directly into the command buffer without
7226 ///allocating a descriptor set from a pool. The descriptors are embedded
7227 ///in the command stream and only live for the duration of the current
7228 ///command buffer recording.
7229 ///
7230 ///**Advantages**:
7231 ///
7232 ///- No descriptor pool allocation or management.
7233 ///- No need to track descriptor set lifetimes.
7234 ///- Ideal for per-draw data that changes every frame.
7235 ///
7236 ///**Trade-offs**:
7237 ///
7238 ///- Inflates command buffer size (descriptors are stored inline).
7239 ///- Not suitable for large descriptor sets, use conventional
7240 /// allocated sets for sets with many bindings.
7241 ///
7242 ///The pipeline layout must have been created with
7243 ///`DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR` on the target set
7244 ///index.
7245 ///
7246 ///Core in Vulkan 1.4. Previously available via `VK_KHR_push_descriptor`.
7247 pub unsafe fn cmd_push_descriptor_set(
7248 &self,
7249 command_buffer: CommandBuffer,
7250 pipeline_bind_point: PipelineBindPoint,
7251 layout: PipelineLayout,
7252 set: u32,
7253 p_descriptor_writes: &[WriteDescriptorSet],
7254 ) {
7255 let fp = self
7256 .commands()
7257 .cmd_push_descriptor_set
7258 .expect("vkCmdPushDescriptorSet not loaded");
7259 unsafe {
7260 fp(
7261 command_buffer,
7262 pipeline_bind_point,
7263 layout,
7264 set,
7265 p_descriptor_writes.len() as u32,
7266 p_descriptor_writes.as_ptr(),
7267 )
7268 };
7269 }
7270 ///Wraps [`vkTrimCommandPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkTrimCommandPool.html).
7271 /**
7272 Provided by **VK_BASE_VERSION_1_1**.*/
7273 ///
7274 ///# Safety
7275 ///- `device` (self) must be valid and not destroyed.
7276 ///- `commandPool` must be externally synchronized.
7277 ///
7278 ///# Panics
7279 ///Panics if `vkTrimCommandPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7280 ///
7281 ///# Usage Notes
7282 ///
7283 ///Returns unused memory from a command pool back to the system. This
7284 ///is a hint to the driver, it may or may not actually release memory.
7285 ///
7286 ///Call this after a period of high command buffer allocation followed
7287 ///by a return to lower usage (e.g. after loading screens or level
7288 ///transitions). It does not affect any allocated command buffers.
7289 ///
7290 ///Unlike `reset_command_pool`, trimming does not reset or invalidate
7291 ///command buffers. It only reclaims excess internal memory that the
7292 ///pool pre-allocated.
7293 ///
7294 ///In a steady-state frame loop where you reset the pool every frame,
7295 ///trimming is unnecessary, the pool reuses its memory naturally.
7296 pub unsafe fn trim_command_pool(&self, command_pool: CommandPool, flags: CommandPoolTrimFlags) {
7297 let fp = self
7298 .commands()
7299 .trim_command_pool
7300 .expect("vkTrimCommandPool not loaded");
7301 unsafe { fp(self.handle(), command_pool, flags) };
7302 }
7303 ///Wraps [`vkGetMemoryWin32HandleKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryWin32HandleKHR.html).
7304 /**
7305 Provided by **VK_KHR_external_memory_win32**.*/
7306 ///
7307 ///# Errors
7308 ///- `VK_ERROR_TOO_MANY_OBJECTS`
7309 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7310 ///- `VK_ERROR_UNKNOWN`
7311 ///- `VK_ERROR_VALIDATION_FAILED`
7312 ///
7313 ///# Safety
7314 ///- `device` (self) must be valid and not destroyed.
7315 ///
7316 ///# Panics
7317 ///Panics if `vkGetMemoryWin32HandleKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7318 ///
7319 ///# Usage Notes
7320 ///
7321 ///Exports a device memory allocation as a Windows HANDLE. The
7322 ///handle can be shared with other processes or APIs (D3D12, CUDA)
7323 ///for GPU memory interop.
7324 ///
7325 ///`MemoryGetWin32HandleInfoKHR` specifies the `DeviceMemory` and
7326 ///handle type (`OPAQUE_WIN32` or `OPAQUE_WIN32_KMT`).
7327 ///
7328 ///For `OPAQUE_WIN32`, the handle must be closed with `CloseHandle`
7329 ///when done. `OPAQUE_WIN32_KMT` handles are kernel-managed and do
7330 ///not need explicit cleanup.
7331 ///
7332 ///Windows only. Use `get_memory_fd_khr` on Linux.
7333 pub unsafe fn get_memory_win32_handle_khr(
7334 &self,
7335 p_get_win32_handle_info: &MemoryGetWin32HandleInfoKHR,
7336 ) -> VkResult<isize> {
7337 let fp = self
7338 .commands()
7339 .get_memory_win32_handle_khr
7340 .expect("vkGetMemoryWin32HandleKHR not loaded");
7341 let mut out = unsafe { core::mem::zeroed() };
7342 check(unsafe { fp(self.handle(), p_get_win32_handle_info, &mut out) })?;
7343 Ok(out)
7344 }
7345 ///Wraps [`vkGetMemoryWin32HandlePropertiesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryWin32HandlePropertiesKHR.html).
7346 /**
7347 Provided by **VK_KHR_external_memory_win32**.*/
7348 ///
7349 ///# Errors
7350 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7351 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
7352 ///- `VK_ERROR_UNKNOWN`
7353 ///- `VK_ERROR_VALIDATION_FAILED`
7354 ///
7355 ///# Safety
7356 ///- `device` (self) must be valid and not destroyed.
7357 ///
7358 ///# Panics
7359 ///Panics if `vkGetMemoryWin32HandlePropertiesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7360 ///
7361 ///# Usage Notes
7362 ///
7363 ///Queries which memory types are compatible with an external
7364 ///Windows HANDLE. Use this when importing memory from a handle
7365 ///received from another process or API (e.g., D3D11 shared
7366 ///textures).
7367 ///
7368 ///Returns `MemoryWin32HandlePropertiesKHR` with `memory_type_bits`
7369 ///indicating compatible memory type indices for import.
7370 ///
7371 ///Not valid for `OPAQUE_WIN32` or `OPAQUE_WIN32_KMT` handle types,
7372 ///those have their memory type determined by the exporting
7373 ///allocation.
7374 pub unsafe fn get_memory_win32_handle_properties_khr(
7375 &self,
7376 handle_type: ExternalMemoryHandleTypeFlagBits,
7377 handle: isize,
7378 p_memory_win32_handle_properties: &mut MemoryWin32HandlePropertiesKHR,
7379 ) -> VkResult<()> {
7380 let fp = self
7381 .commands()
7382 .get_memory_win32_handle_properties_khr
7383 .expect("vkGetMemoryWin32HandlePropertiesKHR not loaded");
7384 check(unsafe {
7385 fp(
7386 self.handle(),
7387 handle_type,
7388 handle,
7389 p_memory_win32_handle_properties,
7390 )
7391 })
7392 }
7393 ///Wraps [`vkGetMemoryFdKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryFdKHR.html).
7394 /**
7395 Provided by **VK_KHR_external_memory_fd**.*/
7396 ///
7397 ///# Errors
7398 ///- `VK_ERROR_TOO_MANY_OBJECTS`
7399 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7400 ///- `VK_ERROR_UNKNOWN`
7401 ///- `VK_ERROR_VALIDATION_FAILED`
7402 ///
7403 ///# Safety
7404 ///- `device` (self) must be valid and not destroyed.
7405 ///
7406 ///# Panics
7407 ///Panics if `vkGetMemoryFdKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7408 ///
7409 ///# Usage Notes
7410 ///
7411 ///Exports a device memory allocation as a POSIX file descriptor.
7412 ///The fd can be sent to another process (via Unix domain sockets)
7413 ///or another Vulkan device to share GPU memory.
7414 ///
7415 ///`MemoryGetFdInfoKHR` specifies the `DeviceMemory` and the handle
7416 ///type (`OPAQUE_FD` or `DMA_BUF`). The memory must have been
7417 ///allocated with `ExportMemoryAllocateInfo` requesting the
7418 ///corresponding handle type.
7419 ///
7420 ///The caller owns the returned fd and must close it when done.
7421 ///Each call returns a new fd, duplicates are independent.
7422 ///
7423 ///Linux/Android only. Use `get_memory_win32_handle_khr` on Windows.
7424 pub unsafe fn get_memory_fd_khr(
7425 &self,
7426 p_get_fd_info: &MemoryGetFdInfoKHR,
7427 ) -> VkResult<core::ffi::c_int> {
7428 let fp = self
7429 .commands()
7430 .get_memory_fd_khr
7431 .expect("vkGetMemoryFdKHR not loaded");
7432 let mut out = unsafe { core::mem::zeroed() };
7433 check(unsafe { fp(self.handle(), p_get_fd_info, &mut out) })?;
7434 Ok(out)
7435 }
7436 ///Wraps [`vkGetMemoryFdPropertiesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryFdPropertiesKHR.html).
7437 /**
7438 Provided by **VK_KHR_external_memory_fd**.*/
7439 ///
7440 ///# Errors
7441 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7442 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
7443 ///- `VK_ERROR_UNKNOWN`
7444 ///- `VK_ERROR_VALIDATION_FAILED`
7445 ///
7446 ///# Safety
7447 ///- `device` (self) must be valid and not destroyed.
7448 ///
7449 ///# Panics
7450 ///Panics if `vkGetMemoryFdPropertiesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7451 ///
7452 ///# Usage Notes
7453 ///
7454 ///Queries which memory types are compatible with an external file
7455 ///descriptor. Use this when importing memory from an fd received
7456 ///from another process or API.
7457 ///
7458 ///Returns `MemoryFdPropertiesKHR` with a `memory_type_bits` bitmask
7459 ///indicating which memory type indices can be used when allocating
7460 ///memory to import this fd.
7461 ///
7462 ///Only valid for `DMA_BUF` handle types. `OPAQUE_FD` handles don't
7463 ///need this query, their memory type is determined by the
7464 ///exporting allocation.
7465 pub unsafe fn get_memory_fd_properties_khr(
7466 &self,
7467 handle_type: ExternalMemoryHandleTypeFlagBits,
7468 fd: core::ffi::c_int,
7469 p_memory_fd_properties: &mut MemoryFdPropertiesKHR,
7470 ) -> VkResult<()> {
7471 let fp = self
7472 .commands()
7473 .get_memory_fd_properties_khr
7474 .expect("vkGetMemoryFdPropertiesKHR not loaded");
7475 check(unsafe { fp(self.handle(), handle_type, fd, p_memory_fd_properties) })
7476 }
7477 ///Wraps [`vkGetMemoryZirconHandleFUCHSIA`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryZirconHandleFUCHSIA.html).
7478 /**
7479 Provided by **VK_FUCHSIA_external_memory**.*/
7480 ///
7481 ///# Errors
7482 ///- `VK_ERROR_TOO_MANY_OBJECTS`
7483 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7484 ///- `VK_ERROR_UNKNOWN`
7485 ///- `VK_ERROR_VALIDATION_FAILED`
7486 ///
7487 ///# Safety
7488 ///- `device` (self) must be valid and not destroyed.
7489 ///
7490 ///# Panics
7491 ///Panics if `vkGetMemoryZirconHandleFUCHSIA` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7492 ///
7493 ///# Usage Notes
7494 ///
7495 ///Exports a Vulkan device memory allocation as a Fuchsia Zircon
7496 ///VMO handle. The returned handle can be shared with other Fuchsia
7497 ///processes. Fuchsia OS only.
7498 ///
7499 ///Requires `VK_FUCHSIA_external_memory`.
7500 pub unsafe fn get_memory_zircon_handle_fuchsia(
7501 &self,
7502 p_get_zircon_handle_info: &MemoryGetZirconHandleInfoFUCHSIA,
7503 ) -> VkResult<u32> {
7504 let fp = self
7505 .commands()
7506 .get_memory_zircon_handle_fuchsia
7507 .expect("vkGetMemoryZirconHandleFUCHSIA not loaded");
7508 let mut out = unsafe { core::mem::zeroed() };
7509 check(unsafe { fp(self.handle(), p_get_zircon_handle_info, &mut out) })?;
7510 Ok(out)
7511 }
7512 ///Wraps [`vkGetMemoryZirconHandlePropertiesFUCHSIA`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryZirconHandlePropertiesFUCHSIA.html).
7513 /**
7514 Provided by **VK_FUCHSIA_external_memory**.*/
7515 ///
7516 ///# Errors
7517 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
7518 ///- `VK_ERROR_UNKNOWN`
7519 ///- `VK_ERROR_VALIDATION_FAILED`
7520 ///
7521 ///# Safety
7522 ///- `device` (self) must be valid and not destroyed.
7523 ///
7524 ///# Panics
7525 ///Panics if `vkGetMemoryZirconHandlePropertiesFUCHSIA` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7526 ///
7527 ///# Usage Notes
7528 ///
7529 ///Queries the memory properties (compatible memory type bits) for
7530 ///a Zircon VMO handle. Use before importing external memory to
7531 ///determine which memory type to allocate. Fuchsia OS only.
7532 ///
7533 ///Requires `VK_FUCHSIA_external_memory`.
7534 pub unsafe fn get_memory_zircon_handle_properties_fuchsia(
7535 &self,
7536 handle_type: ExternalMemoryHandleTypeFlagBits,
7537 zircon_handle: u32,
7538 p_memory_zircon_handle_properties: &mut MemoryZirconHandlePropertiesFUCHSIA,
7539 ) -> VkResult<()> {
7540 let fp = self
7541 .commands()
7542 .get_memory_zircon_handle_properties_fuchsia
7543 .expect("vkGetMemoryZirconHandlePropertiesFUCHSIA not loaded");
7544 check(unsafe {
7545 fp(
7546 self.handle(),
7547 handle_type,
7548 zircon_handle,
7549 p_memory_zircon_handle_properties,
7550 )
7551 })
7552 }
7553 ///Wraps [`vkGetMemoryRemoteAddressNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryRemoteAddressNV.html).
7554 /**
7555 Provided by **VK_NV_external_memory_rdma**.*/
7556 ///
7557 ///# Errors
7558 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
7559 ///- `VK_ERROR_UNKNOWN`
7560 ///- `VK_ERROR_VALIDATION_FAILED`
7561 ///
7562 ///# Safety
7563 ///- `device` (self) must be valid and not destroyed.
7564 ///
7565 ///# Panics
7566 ///Panics if `vkGetMemoryRemoteAddressNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7567 ///
7568 ///# Usage Notes
7569 ///
7570 ///Retrieves a remote device address for a Vulkan memory allocation,
7571 ///enabling RDMA (Remote Direct Memory Access) between devices. The
7572 ///returned address can be used by another device to directly access
7573 ///this memory over a high-speed interconnect.
7574 ///
7575 ///Requires `VK_NV_external_memory_rdma`.
7576 pub unsafe fn get_memory_remote_address_nv(
7577 &self,
7578 p_memory_get_remote_address_info: &MemoryGetRemoteAddressInfoNV,
7579 ) -> VkResult<*mut core::ffi::c_void> {
7580 let fp = self
7581 .commands()
7582 .get_memory_remote_address_nv
7583 .expect("vkGetMemoryRemoteAddressNV not loaded");
7584 let mut out = unsafe { core::mem::zeroed() };
7585 check(unsafe { fp(self.handle(), p_memory_get_remote_address_info, &mut out) })?;
7586 Ok(out)
7587 }
7588 ///Wraps [`vkGetMemorySciBufNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemorySciBufNV.html).
7589 ///
7590 ///# Errors
7591 ///- `VK_ERROR_INITIALIZATION_FAILED`
7592 ///- `VK_ERROR_UNKNOWN`
7593 ///- `VK_ERROR_VALIDATION_FAILED`
7594 ///
7595 ///# Safety
7596 ///- `device` (self) must be valid and not destroyed.
7597 ///
7598 ///# Panics
7599 ///Panics if `vkGetMemorySciBufNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7600 ///
7601 ///# Usage Notes
7602 ///
7603 ///Exports a Vulkan device memory allocation as a QNX SCI buffer
7604 ///for cross-process or cross-API sharing on QNX platforms.
7605 ///
7606 ///Requires `VK_NV_external_memory_sci_buf`. QNX only.
7607 pub unsafe fn get_memory_sci_buf_nv(
7608 &self,
7609 p_get_sci_buf_info: &MemoryGetSciBufInfoNV,
7610 ) -> VkResult<core::ffi::c_void> {
7611 let fp = self
7612 .commands()
7613 .get_memory_sci_buf_nv
7614 .expect("vkGetMemorySciBufNV not loaded");
7615 let mut out = unsafe { core::mem::zeroed() };
7616 check(unsafe { fp(self.handle(), p_get_sci_buf_info, &mut out) })?;
7617 Ok(out)
7618 }
7619 ///Wraps [`vkGetSemaphoreWin32HandleKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSemaphoreWin32HandleKHR.html).
7620 /**
7621 Provided by **VK_KHR_external_semaphore_win32**.*/
7622 ///
7623 ///# Errors
7624 ///- `VK_ERROR_TOO_MANY_OBJECTS`
7625 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7626 ///- `VK_ERROR_UNKNOWN`
7627 ///- `VK_ERROR_VALIDATION_FAILED`
7628 ///
7629 ///# Safety
7630 ///- `device` (self) must be valid and not destroyed.
7631 ///
7632 ///# Panics
7633 ///Panics if `vkGetSemaphoreWin32HandleKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7634 ///
7635 ///# Usage Notes
7636 ///
7637 ///Exports a semaphore's synchronization state as a Windows HANDLE.
7638 ///The handle can be shared with other processes or APIs for
7639 ///cross-process GPU synchronization.
7640 ///
7641 ///`SemaphoreGetWin32HandleInfoKHR` specifies the semaphore and
7642 ///handle type (`OPAQUE_WIN32`, `OPAQUE_WIN32_KMT`, or
7643 ///`D3D12_FENCE`).
7644 ///
7645 ///For `OPAQUE_WIN32` and `D3D12_FENCE`, close the handle with
7646 ///`CloseHandle` when done. `OPAQUE_WIN32_KMT` handles are
7647 ///kernel-managed.
7648 ///
7649 ///Windows only. Use `get_semaphore_fd_khr` on Linux.
7650 pub unsafe fn get_semaphore_win32_handle_khr(
7651 &self,
7652 p_get_win32_handle_info: &SemaphoreGetWin32HandleInfoKHR,
7653 ) -> VkResult<isize> {
7654 let fp = self
7655 .commands()
7656 .get_semaphore_win32_handle_khr
7657 .expect("vkGetSemaphoreWin32HandleKHR not loaded");
7658 let mut out = unsafe { core::mem::zeroed() };
7659 check(unsafe { fp(self.handle(), p_get_win32_handle_info, &mut out) })?;
7660 Ok(out)
7661 }
7662 ///Wraps [`vkImportSemaphoreWin32HandleKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkImportSemaphoreWin32HandleKHR.html).
7663 /**
7664 Provided by **VK_KHR_external_semaphore_win32**.*/
7665 ///
7666 ///# Errors
7667 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7668 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
7669 ///- `VK_ERROR_UNKNOWN`
7670 ///- `VK_ERROR_VALIDATION_FAILED`
7671 ///
7672 ///# Safety
7673 ///- `device` (self) must be valid and not destroyed.
7674 ///
7675 ///# Panics
7676 ///Panics if `vkImportSemaphoreWin32HandleKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7677 ///
7678 ///# Usage Notes
7679 ///
7680 ///Imports a synchronization payload from a Windows HANDLE into a
7681 ///semaphore. After import, the semaphore uses the external
7682 ///synchronization state.
7683 ///
7684 ///`ImportSemaphoreWin32HandleInfoKHR` specifies the target
7685 ///semaphore, handle type, handle (or name for named handles), and
7686 ///whether the import is temporary or permanent.
7687 ///
7688 ///The handle is duplicated internally, the caller retains
7689 ///ownership and should close it when no longer needed.
7690 ///
7691 ///Windows only. Use `import_semaphore_fd_khr` on Linux.
7692 pub unsafe fn import_semaphore_win32_handle_khr(
7693 &self,
7694 p_import_semaphore_win32_handle_info: &ImportSemaphoreWin32HandleInfoKHR,
7695 ) -> VkResult<()> {
7696 let fp = self
7697 .commands()
7698 .import_semaphore_win32_handle_khr
7699 .expect("vkImportSemaphoreWin32HandleKHR not loaded");
7700 check(unsafe { fp(self.handle(), p_import_semaphore_win32_handle_info) })
7701 }
7702 ///Wraps [`vkGetSemaphoreFdKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSemaphoreFdKHR.html).
7703 /**
7704 Provided by **VK_KHR_external_semaphore_fd**.*/
7705 ///
7706 ///# Errors
7707 ///- `VK_ERROR_TOO_MANY_OBJECTS`
7708 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7709 ///- `VK_ERROR_UNKNOWN`
7710 ///- `VK_ERROR_VALIDATION_FAILED`
7711 ///
7712 ///# Safety
7713 ///- `device` (self) must be valid and not destroyed.
7714 ///
7715 ///# Panics
7716 ///Panics if `vkGetSemaphoreFdKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7717 ///
7718 ///# Usage Notes
7719 ///
7720 ///Exports a semaphore's synchronization state as a POSIX file
7721 ///descriptor. The fd can be transferred to another process for
7722 ///cross-process GPU synchronization.
7723 ///
7724 ///`SemaphoreGetFdInfoKHR` specifies the semaphore and handle type
7725 ///(`OPAQUE_FD` or `SYNC_FD`). For `SYNC_FD`, the semaphore must
7726 ///be signaled or have a pending signal operation, exporting
7727 ///transfers ownership and resets the semaphore to unsignaled.
7728 ///
7729 ///The caller owns the returned fd. For `OPAQUE_FD`, each export
7730 ///creates a new reference. For `SYNC_FD`, the export is a
7731 ///move, the semaphore payload is transferred.
7732 ///
7733 ///Linux/Android only. Use `get_semaphore_win32_handle_khr` on
7734 ///Windows.
7735 pub unsafe fn get_semaphore_fd_khr(
7736 &self,
7737 p_get_fd_info: &SemaphoreGetFdInfoKHR,
7738 ) -> VkResult<core::ffi::c_int> {
7739 let fp = self
7740 .commands()
7741 .get_semaphore_fd_khr
7742 .expect("vkGetSemaphoreFdKHR not loaded");
7743 let mut out = unsafe { core::mem::zeroed() };
7744 check(unsafe { fp(self.handle(), p_get_fd_info, &mut out) })?;
7745 Ok(out)
7746 }
7747 ///Wraps [`vkImportSemaphoreFdKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkImportSemaphoreFdKHR.html).
7748 /**
7749 Provided by **VK_KHR_external_semaphore_fd**.*/
7750 ///
7751 ///# Errors
7752 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7753 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
7754 ///- `VK_ERROR_UNKNOWN`
7755 ///- `VK_ERROR_VALIDATION_FAILED`
7756 ///
7757 ///# Safety
7758 ///- `device` (self) must be valid and not destroyed.
7759 ///
7760 ///# Panics
7761 ///Panics if `vkImportSemaphoreFdKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7762 ///
7763 ///# Usage Notes
7764 ///
7765 ///Imports a synchronization payload from a POSIX file descriptor
7766 ///into a semaphore. After import, the semaphore uses the external
7767 ///synchronization state.
7768 ///
7769 ///`ImportSemaphoreFdInfoKHR` specifies the target semaphore, handle
7770 ///type, fd, and whether the import is temporary (payload consumed
7771 ///on first wait) or permanent.
7772 ///
7773 ///For `SYNC_FD`, the import takes ownership of the fd, do not
7774 ///close it afterward. For `OPAQUE_FD`, the fd is duplicated
7775 ///internally and can be closed after the call.
7776 ///
7777 ///Linux/Android only. Use `import_semaphore_win32_handle_khr` on
7778 ///Windows.
7779 pub unsafe fn import_semaphore_fd_khr(
7780 &self,
7781 p_import_semaphore_fd_info: &ImportSemaphoreFdInfoKHR,
7782 ) -> VkResult<()> {
7783 let fp = self
7784 .commands()
7785 .import_semaphore_fd_khr
7786 .expect("vkImportSemaphoreFdKHR not loaded");
7787 check(unsafe { fp(self.handle(), p_import_semaphore_fd_info) })
7788 }
7789 ///Wraps [`vkGetSemaphoreZirconHandleFUCHSIA`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSemaphoreZirconHandleFUCHSIA.html).
7790 /**
7791 Provided by **VK_FUCHSIA_external_semaphore**.*/
7792 ///
7793 ///# Errors
7794 ///- `VK_ERROR_TOO_MANY_OBJECTS`
7795 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7796 ///- `VK_ERROR_UNKNOWN`
7797 ///- `VK_ERROR_VALIDATION_FAILED`
7798 ///
7799 ///# Safety
7800 ///- `device` (self) must be valid and not destroyed.
7801 ///
7802 ///# Panics
7803 ///Panics if `vkGetSemaphoreZirconHandleFUCHSIA` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7804 ///
7805 ///# Usage Notes
7806 ///
7807 ///Exports a Vulkan semaphore as a Fuchsia Zircon event handle for
7808 ///cross-process synchronisation. Fuchsia OS only.
7809 ///
7810 ///Requires `VK_FUCHSIA_external_semaphore`.
7811 pub unsafe fn get_semaphore_zircon_handle_fuchsia(
7812 &self,
7813 p_get_zircon_handle_info: &SemaphoreGetZirconHandleInfoFUCHSIA,
7814 ) -> VkResult<u32> {
7815 let fp = self
7816 .commands()
7817 .get_semaphore_zircon_handle_fuchsia
7818 .expect("vkGetSemaphoreZirconHandleFUCHSIA not loaded");
7819 let mut out = unsafe { core::mem::zeroed() };
7820 check(unsafe { fp(self.handle(), p_get_zircon_handle_info, &mut out) })?;
7821 Ok(out)
7822 }
7823 ///Wraps [`vkImportSemaphoreZirconHandleFUCHSIA`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkImportSemaphoreZirconHandleFUCHSIA.html).
7824 /**
7825 Provided by **VK_FUCHSIA_external_semaphore**.*/
7826 ///
7827 ///# Errors
7828 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7829 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
7830 ///- `VK_ERROR_UNKNOWN`
7831 ///- `VK_ERROR_VALIDATION_FAILED`
7832 ///
7833 ///# Safety
7834 ///- `device` (self) must be valid and not destroyed.
7835 ///
7836 ///# Panics
7837 ///Panics if `vkImportSemaphoreZirconHandleFUCHSIA` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7838 ///
7839 ///# Usage Notes
7840 ///
7841 ///Imports a Fuchsia Zircon event handle into an existing Vulkan
7842 ///semaphore for cross-process synchronisation. Fuchsia OS only.
7843 ///
7844 ///Requires `VK_FUCHSIA_external_semaphore`.
7845 pub unsafe fn import_semaphore_zircon_handle_fuchsia(
7846 &self,
7847 p_import_semaphore_zircon_handle_info: &ImportSemaphoreZirconHandleInfoFUCHSIA,
7848 ) -> VkResult<()> {
7849 let fp = self
7850 .commands()
7851 .import_semaphore_zircon_handle_fuchsia
7852 .expect("vkImportSemaphoreZirconHandleFUCHSIA not loaded");
7853 check(unsafe { fp(self.handle(), p_import_semaphore_zircon_handle_info) })
7854 }
7855 ///Wraps [`vkGetFenceWin32HandleKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetFenceWin32HandleKHR.html).
7856 /**
7857 Provided by **VK_KHR_external_fence_win32**.*/
7858 ///
7859 ///# Errors
7860 ///- `VK_ERROR_TOO_MANY_OBJECTS`
7861 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7862 ///- `VK_ERROR_UNKNOWN`
7863 ///- `VK_ERROR_VALIDATION_FAILED`
7864 ///
7865 ///# Safety
7866 ///- `device` (self) must be valid and not destroyed.
7867 ///
7868 ///# Panics
7869 ///Panics if `vkGetFenceWin32HandleKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7870 ///
7871 ///# Usage Notes
7872 ///
7873 ///Exports a fence's synchronization state as a Windows HANDLE
7874 ///for cross-process fence synchronization.
7875 ///
7876 ///`FenceGetWin32HandleInfoKHR` specifies the fence and handle type
7877 ///(`OPAQUE_WIN32` or `OPAQUE_WIN32_KMT`).
7878 ///
7879 ///For `OPAQUE_WIN32`, close the handle with `CloseHandle` when
7880 ///done. `OPAQUE_WIN32_KMT` handles are kernel-managed.
7881 ///
7882 ///Windows only. Use `get_fence_fd_khr` on Linux.
7883 pub unsafe fn get_fence_win32_handle_khr(
7884 &self,
7885 p_get_win32_handle_info: &FenceGetWin32HandleInfoKHR,
7886 ) -> VkResult<isize> {
7887 let fp = self
7888 .commands()
7889 .get_fence_win32_handle_khr
7890 .expect("vkGetFenceWin32HandleKHR not loaded");
7891 let mut out = unsafe { core::mem::zeroed() };
7892 check(unsafe { fp(self.handle(), p_get_win32_handle_info, &mut out) })?;
7893 Ok(out)
7894 }
7895 ///Wraps [`vkImportFenceWin32HandleKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkImportFenceWin32HandleKHR.html).
7896 /**
7897 Provided by **VK_KHR_external_fence_win32**.*/
7898 ///
7899 ///# Errors
7900 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7901 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
7902 ///- `VK_ERROR_UNKNOWN`
7903 ///- `VK_ERROR_VALIDATION_FAILED`
7904 ///
7905 ///# Safety
7906 ///- `device` (self) must be valid and not destroyed.
7907 ///
7908 ///# Panics
7909 ///Panics if `vkImportFenceWin32HandleKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7910 ///
7911 ///# Usage Notes
7912 ///
7913 ///Imports a synchronization payload from a Windows HANDLE into a
7914 ///fence.
7915 ///
7916 ///`ImportFenceWin32HandleInfoKHR` specifies the target fence,
7917 ///handle type, handle (or name), and whether the import is
7918 ///temporary or permanent.
7919 ///
7920 ///The handle is duplicated internally, the caller retains
7921 ///ownership and should close it when no longer needed.
7922 ///
7923 ///Windows only. Use `import_fence_fd_khr` on Linux.
7924 pub unsafe fn import_fence_win32_handle_khr(
7925 &self,
7926 p_import_fence_win32_handle_info: &ImportFenceWin32HandleInfoKHR,
7927 ) -> VkResult<()> {
7928 let fp = self
7929 .commands()
7930 .import_fence_win32_handle_khr
7931 .expect("vkImportFenceWin32HandleKHR not loaded");
7932 check(unsafe { fp(self.handle(), p_import_fence_win32_handle_info) })
7933 }
7934 ///Wraps [`vkGetFenceFdKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetFenceFdKHR.html).
7935 /**
7936 Provided by **VK_KHR_external_fence_fd**.*/
7937 ///
7938 ///# Errors
7939 ///- `VK_ERROR_TOO_MANY_OBJECTS`
7940 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7941 ///- `VK_ERROR_UNKNOWN`
7942 ///- `VK_ERROR_VALIDATION_FAILED`
7943 ///
7944 ///# Safety
7945 ///- `device` (self) must be valid and not destroyed.
7946 ///
7947 ///# Panics
7948 ///Panics if `vkGetFenceFdKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7949 ///
7950 ///# Usage Notes
7951 ///
7952 ///Exports a fence's synchronization state as a POSIX file
7953 ///descriptor. The fd enables cross-process fence synchronization.
7954 ///
7955 ///`FenceGetFdInfoKHR` specifies the fence and handle type
7956 ///(`OPAQUE_FD` or `SYNC_FD`). For `SYNC_FD`, the fence must be
7957 ///signaled or have a pending signal, exporting transfers the
7958 ///payload and resets the fence.
7959 ///
7960 ///The caller owns the returned fd and must close it when done.
7961 ///
7962 ///Linux/Android only. Use `get_fence_win32_handle_khr` on Windows.
7963 pub unsafe fn get_fence_fd_khr(
7964 &self,
7965 p_get_fd_info: &FenceGetFdInfoKHR,
7966 ) -> VkResult<core::ffi::c_int> {
7967 let fp = self
7968 .commands()
7969 .get_fence_fd_khr
7970 .expect("vkGetFenceFdKHR not loaded");
7971 let mut out = unsafe { core::mem::zeroed() };
7972 check(unsafe { fp(self.handle(), p_get_fd_info, &mut out) })?;
7973 Ok(out)
7974 }
7975 ///Wraps [`vkImportFenceFdKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkImportFenceFdKHR.html).
7976 /**
7977 Provided by **VK_KHR_external_fence_fd**.*/
7978 ///
7979 ///# Errors
7980 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7981 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
7982 ///- `VK_ERROR_UNKNOWN`
7983 ///- `VK_ERROR_VALIDATION_FAILED`
7984 ///
7985 ///# Safety
7986 ///- `device` (self) must be valid and not destroyed.
7987 ///
7988 ///# Panics
7989 ///Panics if `vkImportFenceFdKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7990 ///
7991 ///# Usage Notes
7992 ///
7993 ///Imports a synchronization payload from a POSIX file descriptor
7994 ///into a fence.
7995 ///
7996 ///`ImportFenceFdInfoKHR` specifies the target fence, handle type,
7997 ///fd, and whether the import is temporary (payload consumed on
7998 ///first wait/reset) or permanent.
7999 ///
8000 ///For `SYNC_FD`, ownership of the fd transfers to the
8001 ///implementation, do not close it. For `OPAQUE_FD`, the fd is
8002 ///duplicated and can be closed after the call.
8003 ///
8004 ///Linux/Android only. Use `import_fence_win32_handle_khr` on
8005 ///Windows.
8006 pub unsafe fn import_fence_fd_khr(
8007 &self,
8008 p_import_fence_fd_info: &ImportFenceFdInfoKHR,
8009 ) -> VkResult<()> {
8010 let fp = self
8011 .commands()
8012 .import_fence_fd_khr
8013 .expect("vkImportFenceFdKHR not loaded");
8014 check(unsafe { fp(self.handle(), p_import_fence_fd_info) })
8015 }
8016 ///Wraps [`vkGetFenceSciSyncFenceNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetFenceSciSyncFenceNV.html).
8017 ///
8018 ///# Errors
8019 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
8020 ///- `VK_ERROR_NOT_PERMITTED`
8021 ///- `VK_ERROR_UNKNOWN`
8022 ///- `VK_ERROR_VALIDATION_FAILED`
8023 ///
8024 ///# Safety
8025 ///- `device` (self) must be valid and not destroyed.
8026 ///
8027 ///# Panics
8028 ///Panics if `vkGetFenceSciSyncFenceNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8029 ///
8030 ///# Usage Notes
8031 ///
8032 ///Exports a Vulkan fence as a SciSync fence handle for
8033 ///cross-process synchronisation on NV safety-critical platforms.
8034 ///QNX/NVIDIA Safety only.
8035 ///
8036 ///Requires `VK_NV_external_sci_sync`.
8037 pub unsafe fn get_fence_sci_sync_fence_nv(
8038 &self,
8039 p_get_sci_sync_handle_info: &FenceGetSciSyncInfoNV,
8040 ) -> VkResult<core::ffi::c_void> {
8041 let fp = self
8042 .commands()
8043 .get_fence_sci_sync_fence_nv
8044 .expect("vkGetFenceSciSyncFenceNV not loaded");
8045 let mut out = unsafe { core::mem::zeroed() };
8046 check(unsafe { fp(self.handle(), p_get_sci_sync_handle_info, &mut out) })?;
8047 Ok(out)
8048 }
8049 ///Wraps [`vkGetFenceSciSyncObjNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetFenceSciSyncObjNV.html).
8050 ///
8051 ///# Errors
8052 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
8053 ///- `VK_ERROR_NOT_PERMITTED`
8054 ///- `VK_ERROR_UNKNOWN`
8055 ///- `VK_ERROR_VALIDATION_FAILED`
8056 ///
8057 ///# Safety
8058 ///- `device` (self) must be valid and not destroyed.
8059 ///
8060 ///# Panics
8061 ///Panics if `vkGetFenceSciSyncObjNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8062 ///
8063 ///# Usage Notes
8064 ///
8065 ///Exports a Vulkan fence as a SciSync object handle for
8066 ///cross-process synchronisation on NV safety-critical platforms.
8067 ///QNX/NVIDIA Safety only.
8068 ///
8069 ///Requires `VK_NV_external_sci_sync`.
8070 pub unsafe fn get_fence_sci_sync_obj_nv(
8071 &self,
8072 p_get_sci_sync_handle_info: &FenceGetSciSyncInfoNV,
8073 ) -> VkResult<core::ffi::c_void> {
8074 let fp = self
8075 .commands()
8076 .get_fence_sci_sync_obj_nv
8077 .expect("vkGetFenceSciSyncObjNV not loaded");
8078 let mut out = unsafe { core::mem::zeroed() };
8079 check(unsafe { fp(self.handle(), p_get_sci_sync_handle_info, &mut out) })?;
8080 Ok(out)
8081 }
8082 ///Wraps [`vkImportFenceSciSyncFenceNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkImportFenceSciSyncFenceNV.html).
8083 ///
8084 ///# Errors
8085 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
8086 ///- `VK_ERROR_NOT_PERMITTED`
8087 ///- `VK_ERROR_UNKNOWN`
8088 ///- `VK_ERROR_VALIDATION_FAILED`
8089 ///
8090 ///# Safety
8091 ///- `device` (self) must be valid and not destroyed.
8092 ///
8093 ///# Panics
8094 ///Panics if `vkImportFenceSciSyncFenceNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8095 ///
8096 ///# Usage Notes
8097 ///
8098 ///Imports a SciSync fence handle into an existing Vulkan fence for
8099 ///cross-process synchronisation on NV safety-critical platforms.
8100 ///QNX/NVIDIA Safety only.
8101 ///
8102 ///Requires `VK_NV_external_sci_sync`.
8103 pub unsafe fn import_fence_sci_sync_fence_nv(
8104 &self,
8105 p_import_fence_sci_sync_info: &ImportFenceSciSyncInfoNV,
8106 ) -> VkResult<()> {
8107 let fp = self
8108 .commands()
8109 .import_fence_sci_sync_fence_nv
8110 .expect("vkImportFenceSciSyncFenceNV not loaded");
8111 check(unsafe { fp(self.handle(), p_import_fence_sci_sync_info) })
8112 }
8113 ///Wraps [`vkImportFenceSciSyncObjNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkImportFenceSciSyncObjNV.html).
8114 ///
8115 ///# Errors
8116 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
8117 ///- `VK_ERROR_NOT_PERMITTED`
8118 ///- `VK_ERROR_UNKNOWN`
8119 ///- `VK_ERROR_VALIDATION_FAILED`
8120 ///
8121 ///# Safety
8122 ///- `device` (self) must be valid and not destroyed.
8123 ///
8124 ///# Panics
8125 ///Panics if `vkImportFenceSciSyncObjNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8126 ///
8127 ///# Usage Notes
8128 ///
8129 ///Imports a SciSync object handle into an existing Vulkan fence
8130 ///for cross-process synchronisation on NV safety-critical
8131 ///platforms. QNX/NVIDIA Safety only.
8132 ///
8133 ///Requires `VK_NV_external_sci_sync`.
8134 pub unsafe fn import_fence_sci_sync_obj_nv(
8135 &self,
8136 p_import_fence_sci_sync_info: &ImportFenceSciSyncInfoNV,
8137 ) -> VkResult<()> {
8138 let fp = self
8139 .commands()
8140 .import_fence_sci_sync_obj_nv
8141 .expect("vkImportFenceSciSyncObjNV not loaded");
8142 check(unsafe { fp(self.handle(), p_import_fence_sci_sync_info) })
8143 }
8144 ///Wraps [`vkGetSemaphoreSciSyncObjNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSemaphoreSciSyncObjNV.html).
8145 ///
8146 ///# Errors
8147 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
8148 ///- `VK_ERROR_NOT_PERMITTED`
8149 ///- `VK_ERROR_UNKNOWN`
8150 ///- `VK_ERROR_VALIDATION_FAILED`
8151 ///
8152 ///# Safety
8153 ///- `device` (self) must be valid and not destroyed.
8154 ///
8155 ///# Panics
8156 ///Panics if `vkGetSemaphoreSciSyncObjNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8157 ///
8158 ///# Usage Notes
8159 ///
8160 ///Exports a Vulkan semaphore as a SciSync object handle for
8161 ///cross-process synchronisation on NV safety-critical platforms.
8162 ///QNX/NVIDIA Safety only.
8163 ///
8164 ///Requires `VK_NV_external_sci_sync`.
8165 pub unsafe fn get_semaphore_sci_sync_obj_nv(
8166 &self,
8167 p_get_sci_sync_info: &SemaphoreGetSciSyncInfoNV,
8168 ) -> VkResult<core::ffi::c_void> {
8169 let fp = self
8170 .commands()
8171 .get_semaphore_sci_sync_obj_nv
8172 .expect("vkGetSemaphoreSciSyncObjNV not loaded");
8173 let mut out = unsafe { core::mem::zeroed() };
8174 check(unsafe { fp(self.handle(), p_get_sci_sync_info, &mut out) })?;
8175 Ok(out)
8176 }
8177 ///Wraps [`vkImportSemaphoreSciSyncObjNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkImportSemaphoreSciSyncObjNV.html).
8178 ///
8179 ///# Errors
8180 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
8181 ///- `VK_ERROR_NOT_PERMITTED`
8182 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8183 ///- `VK_ERROR_UNKNOWN`
8184 ///- `VK_ERROR_VALIDATION_FAILED`
8185 ///
8186 ///# Safety
8187 ///- `device` (self) must be valid and not destroyed.
8188 ///
8189 ///# Panics
8190 ///Panics if `vkImportSemaphoreSciSyncObjNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8191 ///
8192 ///# Usage Notes
8193 ///
8194 ///Imports a SciSync object handle into an existing Vulkan
8195 ///semaphore for cross-process synchronisation on NV
8196 ///safety-critical platforms. QNX/NVIDIA Safety only.
8197 ///
8198 ///Requires `VK_NV_external_sci_sync`.
8199 pub unsafe fn import_semaphore_sci_sync_obj_nv(
8200 &self,
8201 p_import_semaphore_sci_sync_info: &ImportSemaphoreSciSyncInfoNV,
8202 ) -> VkResult<()> {
8203 let fp = self
8204 .commands()
8205 .import_semaphore_sci_sync_obj_nv
8206 .expect("vkImportSemaphoreSciSyncObjNV not loaded");
8207 check(unsafe { fp(self.handle(), p_import_semaphore_sci_sync_info) })
8208 }
8209 ///Wraps [`vkCreateSemaphoreSciSyncPoolNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateSemaphoreSciSyncPoolNV.html).
8210 ///
8211 ///# Errors
8212 ///- `VK_ERROR_INITIALIZATION_FAILED`
8213 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8214 ///- `VK_ERROR_UNKNOWN`
8215 ///- `VK_ERROR_VALIDATION_FAILED`
8216 ///
8217 ///# Safety
8218 ///- `device` (self) must be valid and not destroyed.
8219 ///
8220 ///# Panics
8221 ///Panics if `vkCreateSemaphoreSciSyncPoolNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8222 ///
8223 ///# Usage Notes
8224 ///
8225 ///Creates a pool of SciSync-backed semaphores for efficient
8226 ///cross-engine synchronisation on NV safety-critical platforms.
8227 ///QNX/NVIDIA Safety only.
8228 ///
8229 ///Requires `VK_NV_external_sci_sync2`.
8230 pub unsafe fn create_semaphore_sci_sync_pool_nv(
8231 &self,
8232 p_create_info: &SemaphoreSciSyncPoolCreateInfoNV,
8233 allocator: Option<&AllocationCallbacks>,
8234 ) -> VkResult<SemaphoreSciSyncPoolNV> {
8235 let fp = self
8236 .commands()
8237 .create_semaphore_sci_sync_pool_nv
8238 .expect("vkCreateSemaphoreSciSyncPoolNV not loaded");
8239 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
8240 let mut out = unsafe { core::mem::zeroed() };
8241 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
8242 Ok(out)
8243 }
8244 ///Wraps [`vkDestroySemaphoreSciSyncPoolNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroySemaphoreSciSyncPoolNV.html).
8245 ///
8246 ///# Safety
8247 ///- `device` (self) must be valid and not destroyed.
8248 ///- `semaphorePool` must be externally synchronized.
8249 ///
8250 ///# Panics
8251 ///Panics if `vkDestroySemaphoreSciSyncPoolNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8252 ///
8253 ///# Usage Notes
8254 ///
8255 ///Destroys a SciSync semaphore pool. The pool must not be in use
8256 ///by any pending operations. QNX/NVIDIA Safety only.
8257 ///
8258 ///Requires `VK_NV_external_sci_sync2`.
8259 pub unsafe fn destroy_semaphore_sci_sync_pool_nv(
8260 &self,
8261 semaphore_pool: SemaphoreSciSyncPoolNV,
8262 allocator: Option<&AllocationCallbacks>,
8263 ) {
8264 let fp = self
8265 .commands()
8266 .destroy_semaphore_sci_sync_pool_nv
8267 .expect("vkDestroySemaphoreSciSyncPoolNV not loaded");
8268 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
8269 unsafe { fp(self.handle(), semaphore_pool, alloc_ptr) };
8270 }
8271 ///Wraps [`vkDisplayPowerControlEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDisplayPowerControlEXT.html).
8272 /**
8273 Provided by **VK_EXT_display_control**.*/
8274 ///
8275 ///# Errors
8276 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8277 ///- `VK_ERROR_UNKNOWN`
8278 ///- `VK_ERROR_VALIDATION_FAILED`
8279 ///
8280 ///# Safety
8281 ///- `device` (self) must be valid and not destroyed.
8282 ///
8283 ///# Panics
8284 ///Panics if `vkDisplayPowerControlEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8285 ///
8286 ///# Usage Notes
8287 ///
8288 ///Controls the power state of a display (e.g., standby, suspend,
8289 ///off, on). `DisplayPowerInfoEXT` specifies the desired power state.
8290 ///
8291 ///Requires `VK_EXT_display_control`.
8292 pub unsafe fn display_power_control_ext(
8293 &self,
8294 display: DisplayKHR,
8295 p_display_power_info: &DisplayPowerInfoEXT,
8296 ) -> VkResult<()> {
8297 let fp = self
8298 .commands()
8299 .display_power_control_ext
8300 .expect("vkDisplayPowerControlEXT not loaded");
8301 check(unsafe { fp(self.handle(), display, p_display_power_info) })
8302 }
8303 ///Wraps [`vkRegisterDeviceEventEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkRegisterDeviceEventEXT.html).
8304 /**
8305 Provided by **VK_EXT_display_control**.*/
8306 ///
8307 ///# Errors
8308 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8309 ///- `VK_ERROR_UNKNOWN`
8310 ///- `VK_ERROR_VALIDATION_FAILED`
8311 ///
8312 ///# Safety
8313 ///- `device` (self) must be valid and not destroyed.
8314 ///
8315 ///# Panics
8316 ///Panics if `vkRegisterDeviceEventEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8317 ///
8318 ///# Usage Notes
8319 ///
8320 ///Registers a fence to be signaled when a device event occurs.
8321 ///`DeviceEventInfoEXT` specifies the event type (e.g.,
8322 ///`DISPLAY_HOTPLUG`).
8323 ///
8324 ///Returns a fence that will be signaled when the event fires.
8325 ///
8326 ///Requires `VK_EXT_display_control`.
8327 pub unsafe fn register_device_event_ext(
8328 &self,
8329 p_device_event_info: &DeviceEventInfoEXT,
8330 allocator: Option<&AllocationCallbacks>,
8331 ) -> VkResult<Fence> {
8332 let fp = self
8333 .commands()
8334 .register_device_event_ext
8335 .expect("vkRegisterDeviceEventEXT not loaded");
8336 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
8337 let mut out = unsafe { core::mem::zeroed() };
8338 check(unsafe { fp(self.handle(), p_device_event_info, alloc_ptr, &mut out) })?;
8339 Ok(out)
8340 }
8341 ///Wraps [`vkRegisterDisplayEventEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkRegisterDisplayEventEXT.html).
8342 /**
8343 Provided by **VK_EXT_display_control**.*/
8344 ///
8345 ///# Errors
8346 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8347 ///- `VK_ERROR_UNKNOWN`
8348 ///- `VK_ERROR_VALIDATION_FAILED`
8349 ///
8350 ///# Safety
8351 ///- `device` (self) must be valid and not destroyed.
8352 ///
8353 ///# Panics
8354 ///Panics if `vkRegisterDisplayEventEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8355 ///
8356 ///# Usage Notes
8357 ///
8358 ///Registers a fence to be signaled when a display event occurs.
8359 ///`DisplayEventInfoEXT` specifies the event type (e.g.,
8360 ///`FIRST_PIXEL_OUT`, signaled at the start of the first scanline
8361 ///after a present).
8362 ///
8363 ///Returns a fence. Useful for frame pacing and display timing.
8364 ///
8365 ///Requires `VK_EXT_display_control`.
8366 pub unsafe fn register_display_event_ext(
8367 &self,
8368 display: DisplayKHR,
8369 p_display_event_info: &DisplayEventInfoEXT,
8370 allocator: Option<&AllocationCallbacks>,
8371 ) -> VkResult<Fence> {
8372 let fp = self
8373 .commands()
8374 .register_display_event_ext
8375 .expect("vkRegisterDisplayEventEXT not loaded");
8376 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
8377 let mut out = unsafe { core::mem::zeroed() };
8378 check(unsafe {
8379 fp(
8380 self.handle(),
8381 display,
8382 p_display_event_info,
8383 alloc_ptr,
8384 &mut out,
8385 )
8386 })?;
8387 Ok(out)
8388 }
8389 ///Wraps [`vkGetSwapchainCounterEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSwapchainCounterEXT.html).
8390 /**
8391 Provided by **VK_EXT_display_control**.*/
8392 ///
8393 ///# Errors
8394 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8395 ///- `VK_ERROR_DEVICE_LOST`
8396 ///- `VK_ERROR_OUT_OF_DATE_KHR`
8397 ///- `VK_ERROR_UNKNOWN`
8398 ///- `VK_ERROR_VALIDATION_FAILED`
8399 ///
8400 ///# Safety
8401 ///- `device` (self) must be valid and not destroyed.
8402 ///
8403 ///# Panics
8404 ///Panics if `vkGetSwapchainCounterEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8405 ///
8406 ///# Usage Notes
8407 ///
8408 ///Queries a performance counter associated with a swapchain (e.g.,
8409 ///vertical blanks). Returns the counter value as a `u64`.
8410 ///
8411 ///The counter type is specified as a `SurfaceCounterFlagBitsEXT`
8412 ///(typically `VBLANK`).
8413 ///
8414 ///Requires `VK_EXT_display_control`.
8415 pub unsafe fn get_swapchain_counter_ext(
8416 &self,
8417 swapchain: SwapchainKHR,
8418 counter: SurfaceCounterFlagBitsEXT,
8419 ) -> VkResult<u64> {
8420 let fp = self
8421 .commands()
8422 .get_swapchain_counter_ext
8423 .expect("vkGetSwapchainCounterEXT not loaded");
8424 let mut out = unsafe { core::mem::zeroed() };
8425 check(unsafe { fp(self.handle(), swapchain, counter, &mut out) })?;
8426 Ok(out)
8427 }
8428 ///Wraps [`vkGetDeviceGroupPeerMemoryFeatures`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceGroupPeerMemoryFeatures.html).
8429 /**
8430 Provided by **VK_BASE_VERSION_1_1**.*/
8431 ///
8432 ///# Safety
8433 ///- `device` (self) must be valid and not destroyed.
8434 ///
8435 ///# Panics
8436 ///Panics if `vkGetDeviceGroupPeerMemoryFeatures` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8437 ///
8438 ///# Usage Notes
8439 ///
8440 ///Queries the memory access capabilities between two physical devices
8441 ///in a device group. Returns flags indicating whether memory allocated
8442 ///on one device can be copied to, accessed generically, or accessed
8443 ///natively from the other device.
8444 ///
8445 ///Only relevant for multi-GPU device groups. On single-GPU systems
8446 ///this is not needed.
8447 ///
8448 ///Use the returned flags to decide how to share resources across
8449 ///devices, for example, whether a texture on GPU 0 can be sampled
8450 ///directly by GPU 1, or whether it must be copied.
8451 pub unsafe fn get_device_group_peer_memory_features(
8452 &self,
8453 heap_index: u32,
8454 local_device_index: u32,
8455 remote_device_index: u32,
8456 ) -> PeerMemoryFeatureFlags {
8457 let fp = self
8458 .commands()
8459 .get_device_group_peer_memory_features
8460 .expect("vkGetDeviceGroupPeerMemoryFeatures not loaded");
8461 let mut out = unsafe { core::mem::zeroed() };
8462 unsafe {
8463 fp(
8464 self.handle(),
8465 heap_index,
8466 local_device_index,
8467 remote_device_index,
8468 &mut out,
8469 )
8470 };
8471 out
8472 }
8473 ///Wraps [`vkBindBufferMemory2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBindBufferMemory2.html).
8474 /**
8475 Provided by **VK_BASE_VERSION_1_1**.*/
8476 ///
8477 ///# Errors
8478 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8479 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
8480 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
8481 ///- `VK_ERROR_UNKNOWN`
8482 ///- `VK_ERROR_VALIDATION_FAILED`
8483 ///
8484 ///# Safety
8485 ///- `device` (self) must be valid and not destroyed.
8486 ///
8487 ///# Panics
8488 ///Panics if `vkBindBufferMemory2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8489 ///
8490 ///# Usage Notes
8491 ///
8492 ///Binds memory to one or more buffers in a single call. This is the
8493 ///Vulkan 1.1 batch version of `bind_buffer_memory`.
8494 ///
8495 ///Each `BindBufferMemoryInfo` specifies a buffer, memory object, and
8496 ///offset, the same parameters as `bind_buffer_memory`, but batched.
8497 ///
8498 ///Use `BindBufferMemoryDeviceGroupInfo` in the pNext chain to bind
8499 ///memory for specific devices in a device group (multi-GPU). For
8500 ///single-GPU usage, `bind_buffer_memory` and `bind_buffer_memory2`
8501 ///are equivalent.
8502 pub unsafe fn bind_buffer_memory2(
8503 &self,
8504 p_bind_infos: &[BindBufferMemoryInfo],
8505 ) -> VkResult<()> {
8506 let fp = self
8507 .commands()
8508 .bind_buffer_memory2
8509 .expect("vkBindBufferMemory2 not loaded");
8510 check(unsafe {
8511 fp(
8512 self.handle(),
8513 p_bind_infos.len() as u32,
8514 p_bind_infos.as_ptr(),
8515 )
8516 })
8517 }
8518 ///Wraps [`vkBindImageMemory2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBindImageMemory2.html).
8519 /**
8520 Provided by **VK_BASE_VERSION_1_1**.*/
8521 ///
8522 ///# Errors
8523 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8524 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
8525 ///- `VK_ERROR_UNKNOWN`
8526 ///- `VK_ERROR_VALIDATION_FAILED`
8527 ///
8528 ///# Safety
8529 ///- `device` (self) must be valid and not destroyed.
8530 ///
8531 ///# Panics
8532 ///Panics if `vkBindImageMemory2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8533 ///
8534 ///# Usage Notes
8535 ///
8536 ///Binds memory to one or more images in a single call. This is the
8537 ///Vulkan 1.1 batch version of `bind_image_memory`.
8538 ///
8539 ///Also required when binding memory to images created with
8540 ///disjoint multi-planar formats, each plane is bound separately via
8541 ///`BindImagePlaneMemoryInfo` in the pNext chain.
8542 ///
8543 ///For device groups (multi-GPU), chain
8544 ///`BindImageMemoryDeviceGroupInfo` to assign memory per device and
8545 ///specify split-instance bind regions.
8546 pub unsafe fn bind_image_memory2(&self, p_bind_infos: &[BindImageMemoryInfo]) -> VkResult<()> {
8547 let fp = self
8548 .commands()
8549 .bind_image_memory2
8550 .expect("vkBindImageMemory2 not loaded");
8551 check(unsafe {
8552 fp(
8553 self.handle(),
8554 p_bind_infos.len() as u32,
8555 p_bind_infos.as_ptr(),
8556 )
8557 })
8558 }
8559 ///Wraps [`vkCmdSetDeviceMask`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDeviceMask.html).
8560 /**
8561 Provided by **VK_BASE_VERSION_1_1**.*/
8562 ///
8563 ///# Safety
8564 ///- `commandBuffer` (self) must be valid and not destroyed.
8565 ///- `commandBuffer` must be externally synchronized.
8566 ///
8567 ///# Panics
8568 ///Panics if `vkCmdSetDeviceMask` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8569 ///
8570 ///# Usage Notes
8571 ///
8572 ///Sets the device mask for subsequent commands in a command buffer
8573 ///when using device groups (multi-GPU with
8574 ///`VK_KHR_device_group` / Vulkan 1.1).
8575 ///
8576 ///The device mask is a bitmask where bit *i* indicates that subsequent
8577 ///commands execute on physical device *i* in the device group.
8578 ///
8579 ///For single-GPU systems (the common case), the device mask is always
8580 ///`0x1` and this command is not needed.
8581 ///
8582 ///Must only be called outside a render pass, or inside a render pass
8583 ///that was begun with `DEVICE_GROUP_BEGIN_INFO` and has the
8584 ///`DEVICE_GROUP` flag set.
8585 pub unsafe fn cmd_set_device_mask(&self, command_buffer: CommandBuffer, device_mask: u32) {
8586 let fp = self
8587 .commands()
8588 .cmd_set_device_mask
8589 .expect("vkCmdSetDeviceMask not loaded");
8590 unsafe { fp(command_buffer, device_mask) };
8591 }
8592 ///Wraps [`vkGetDeviceGroupPresentCapabilitiesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceGroupPresentCapabilitiesKHR.html).
8593 /**
8594 Provided by **VK_KHR_swapchain**.*/
8595 ///
8596 ///# Errors
8597 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8598 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
8599 ///- `VK_ERROR_UNKNOWN`
8600 ///- `VK_ERROR_VALIDATION_FAILED`
8601 ///
8602 ///# Safety
8603 ///- `device` (self) must be valid and not destroyed.
8604 ///
8605 ///# Panics
8606 ///Panics if `vkGetDeviceGroupPresentCapabilitiesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8607 ///
8608 ///# Usage Notes
8609 ///
8610 ///Queries the present capabilities of a device group, which physical
8611 ///devices can present to which surfaces, and what presentation modes
8612 ///are supported.
8613 ///
8614 ///Only relevant for multi-GPU device groups. On single-GPU systems,
8615 ///only `DEVICE_GROUP_PRESENT_MODE_LOCAL` is supported (each device
8616 ///presents its own images).
8617 pub unsafe fn get_device_group_present_capabilities_khr(
8618 &self,
8619 p_device_group_present_capabilities: &mut DeviceGroupPresentCapabilitiesKHR,
8620 ) -> VkResult<()> {
8621 let fp = self
8622 .commands()
8623 .get_device_group_present_capabilities_khr
8624 .expect("vkGetDeviceGroupPresentCapabilitiesKHR not loaded");
8625 check(unsafe { fp(self.handle(), p_device_group_present_capabilities) })
8626 }
8627 ///Wraps [`vkGetDeviceGroupSurfacePresentModesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceGroupSurfacePresentModesKHR.html).
8628 /**
8629 Provided by **VK_KHR_swapchain**.*/
8630 ///
8631 ///# Errors
8632 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8633 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
8634 ///- `VK_ERROR_SURFACE_LOST_KHR`
8635 ///- `VK_ERROR_UNKNOWN`
8636 ///- `VK_ERROR_VALIDATION_FAILED`
8637 ///
8638 ///# Safety
8639 ///- `device` (self) must be valid and not destroyed.
8640 ///- `surface` must be externally synchronized.
8641 ///
8642 ///# Panics
8643 ///Panics if `vkGetDeviceGroupSurfacePresentModesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8644 ///
8645 ///# Usage Notes
8646 ///
8647 ///Queries which device group present modes a surface supports. The
8648 ///returned bitmask indicates whether `LOCAL`, `REMOTE`, `SUM`, or
8649 ///`LOCAL_MULTI_DEVICE` modes are available.
8650 ///
8651 ///Only relevant for multi-GPU device groups. On single-GPU systems,
8652 ///only `LOCAL` is supported.
8653 pub unsafe fn get_device_group_surface_present_modes_khr(
8654 &self,
8655 surface: SurfaceKHR,
8656 ) -> VkResult<DeviceGroupPresentModeFlagsKHR> {
8657 let fp = self
8658 .commands()
8659 .get_device_group_surface_present_modes_khr
8660 .expect("vkGetDeviceGroupSurfacePresentModesKHR not loaded");
8661 let mut out = unsafe { core::mem::zeroed() };
8662 check(unsafe { fp(self.handle(), surface, &mut out) })?;
8663 Ok(out)
8664 }
8665 ///Wraps [`vkAcquireNextImage2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAcquireNextImage2KHR.html).
8666 /**
8667 Provided by **VK_KHR_swapchain**.*/
8668 ///
8669 ///# Errors
8670 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8671 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
8672 ///- `VK_ERROR_DEVICE_LOST`
8673 ///- `VK_ERROR_OUT_OF_DATE_KHR`
8674 ///- `VK_ERROR_SURFACE_LOST_KHR`
8675 ///- `VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT`
8676 ///- `VK_ERROR_UNKNOWN`
8677 ///- `VK_ERROR_VALIDATION_FAILED`
8678 ///
8679 ///# Safety
8680 ///- `device` (self) must be valid and not destroyed.
8681 ///
8682 ///# Panics
8683 ///Panics if `vkAcquireNextImage2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8684 ///
8685 ///# Usage Notes
8686 ///
8687 ///Extended version of `acquire_next_image_khr` that takes an
8688 ///`AcquireNextImageInfoKHR` struct with pNext support.
8689 ///
8690 ///The key addition is `device_mask` for device groups (multi-GPU),
8691 ///specifying which physical devices the acquired image will be used
8692 ///on.
8693 ///
8694 ///For single-GPU usage, this is functionally identical to
8695 ///`acquire_next_image_khr`.
8696 pub unsafe fn acquire_next_image2_khr(
8697 &self,
8698 p_acquire_info: &AcquireNextImageInfoKHR,
8699 ) -> VkResult<u32> {
8700 let fp = self
8701 .commands()
8702 .acquire_next_image2_khr
8703 .expect("vkAcquireNextImage2KHR not loaded");
8704 let mut out = unsafe { core::mem::zeroed() };
8705 check(unsafe { fp(self.handle(), p_acquire_info, &mut out) })?;
8706 Ok(out)
8707 }
8708 ///Wraps [`vkCmdDispatchBase`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDispatchBase.html).
8709 /**
8710 Provided by **VK_COMPUTE_VERSION_1_1**.*/
8711 ///
8712 ///# Safety
8713 ///- `commandBuffer` (self) must be valid and not destroyed.
8714 ///- `commandBuffer` must be externally synchronized.
8715 ///
8716 ///# Panics
8717 ///Panics if `vkCmdDispatchBase` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8718 ///
8719 ///# Usage Notes
8720 ///
8721 ///Dispatches a compute shader with a non-zero base workgroup offset.
8722 ///The shader's `gl_WorkGroupID` starts at (`base_group_x`,
8723 ///`base_group_y`, `base_group_z`) instead of (0, 0, 0).
8724 ///
8725 ///This is useful for splitting a large dispatch across multiple
8726 ///submissions or for device groups where different physical devices
8727 ///handle different regions of the workgroup space.
8728 ///
8729 ///`gl_NumWorkGroups` reflects the `group_count` parameters, not the
8730 ///total. The shader sees workgroup IDs in the range
8731 ///[`base`, `base + count`).
8732 ///
8733 ///For single-GPU, zero-base dispatches, use `cmd_dispatch` instead.
8734 pub unsafe fn cmd_dispatch_base(
8735 &self,
8736 command_buffer: CommandBuffer,
8737 base_group_x: u32,
8738 base_group_y: u32,
8739 base_group_z: u32,
8740 group_count_x: u32,
8741 group_count_y: u32,
8742 group_count_z: u32,
8743 ) {
8744 let fp = self
8745 .commands()
8746 .cmd_dispatch_base
8747 .expect("vkCmdDispatchBase not loaded");
8748 unsafe {
8749 fp(
8750 command_buffer,
8751 base_group_x,
8752 base_group_y,
8753 base_group_z,
8754 group_count_x,
8755 group_count_y,
8756 group_count_z,
8757 )
8758 };
8759 }
8760 ///Wraps [`vkCreateDescriptorUpdateTemplate`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateDescriptorUpdateTemplate.html).
8761 /**
8762 Provided by **VK_COMPUTE_VERSION_1_1**.*/
8763 ///
8764 ///# Errors
8765 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8766 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
8767 ///- `VK_ERROR_UNKNOWN`
8768 ///- `VK_ERROR_VALIDATION_FAILED`
8769 ///
8770 ///# Safety
8771 ///- `device` (self) must be valid and not destroyed.
8772 ///
8773 ///# Panics
8774 ///Panics if `vkCreateDescriptorUpdateTemplate` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8775 ///
8776 ///# Usage Notes
8777 ///
8778 ///Creates a template that describes how to update a descriptor set
8779 ///from a compact block of host memory. Instead of building an array
8780 ///of `WriteDescriptorSet` structs, you define the layout once in the
8781 ///template and then call `update_descriptor_set_with_template` with
8782 ///a raw pointer to your data.
8783 ///
8784 ///**Benefits**:
8785 ///
8786 ///- Reduces CPU overhead for frequent descriptor updates.
8787 ///- Avoids allocating `WriteDescriptorSet` arrays every frame.
8788 ///- Pairs well with `cmd_push_descriptor_set_with_template` for
8789 /// push descriptors.
8790 ///
8791 ///Each entry in the template maps an offset in your host data block to
8792 ///a descriptor binding, array element, and type. The driver compiles
8793 ///this into an optimised update path.
8794 ///
8795 ///Templates are immutable after creation and can be reused across
8796 ///frames.
8797 pub unsafe fn create_descriptor_update_template(
8798 &self,
8799 p_create_info: &DescriptorUpdateTemplateCreateInfo,
8800 allocator: Option<&AllocationCallbacks>,
8801 ) -> VkResult<DescriptorUpdateTemplate> {
8802 let fp = self
8803 .commands()
8804 .create_descriptor_update_template
8805 .expect("vkCreateDescriptorUpdateTemplate not loaded");
8806 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
8807 let mut out = unsafe { core::mem::zeroed() };
8808 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
8809 Ok(out)
8810 }
8811 ///Wraps [`vkDestroyDescriptorUpdateTemplate`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyDescriptorUpdateTemplate.html).
8812 /**
8813 Provided by **VK_COMPUTE_VERSION_1_1**.*/
8814 ///
8815 ///# Safety
8816 ///- `device` (self) must be valid and not destroyed.
8817 ///- `descriptorUpdateTemplate` must be externally synchronized.
8818 ///
8819 ///# Panics
8820 ///Panics if `vkDestroyDescriptorUpdateTemplate` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8821 ///
8822 ///# Usage Notes
8823 ///
8824 ///Destroys a descriptor update template. The template must not be in
8825 ///use by any pending `update_descriptor_set_with_template` or
8826 ///`cmd_push_descriptor_set_with_template` call.
8827 pub unsafe fn destroy_descriptor_update_template(
8828 &self,
8829 descriptor_update_template: DescriptorUpdateTemplate,
8830 allocator: Option<&AllocationCallbacks>,
8831 ) {
8832 let fp = self
8833 .commands()
8834 .destroy_descriptor_update_template
8835 .expect("vkDestroyDescriptorUpdateTemplate not loaded");
8836 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
8837 unsafe { fp(self.handle(), descriptor_update_template, alloc_ptr) };
8838 }
8839 ///Wraps [`vkUpdateDescriptorSetWithTemplate`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkUpdateDescriptorSetWithTemplate.html).
8840 /**
8841 Provided by **VK_COMPUTE_VERSION_1_1**.*/
8842 ///
8843 ///# Safety
8844 ///- `device` (self) must be valid and not destroyed.
8845 ///- `descriptorSet` must be externally synchronized.
8846 ///
8847 ///# Panics
8848 ///Panics if `vkUpdateDescriptorSetWithTemplate` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8849 ///
8850 ///# Usage Notes
8851 ///
8852 ///Updates a descriptor set using a descriptor update template and a
8853 ///raw pointer to a block of host data. The template defines the mapping
8854 ///from the data block to descriptor bindings.
8855 ///
8856 ///This is faster than `update_descriptor_sets` for repeated updates
8857 ///with the same layout, the driver has pre-compiled the update path.
8858 ///
8859 ///The `data` pointer must point to a block of memory laid out according
8860 ///to the template's entry offsets and strides. The data is consumed
8861 ///immediately; the pointer does not need to remain valid after the
8862 ///call returns.
8863 pub unsafe fn update_descriptor_set_with_template(
8864 &self,
8865 descriptor_set: DescriptorSet,
8866 descriptor_update_template: DescriptorUpdateTemplate,
8867 p_data: *const core::ffi::c_void,
8868 ) {
8869 let fp = self
8870 .commands()
8871 .update_descriptor_set_with_template
8872 .expect("vkUpdateDescriptorSetWithTemplate not loaded");
8873 unsafe {
8874 fp(
8875 self.handle(),
8876 descriptor_set,
8877 descriptor_update_template,
8878 p_data,
8879 )
8880 };
8881 }
8882 ///Wraps [`vkCmdPushDescriptorSetWithTemplate`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPushDescriptorSetWithTemplate.html).
8883 /**
8884 Provided by **VK_COMPUTE_VERSION_1_4**.*/
8885 ///
8886 ///# Safety
8887 ///- `commandBuffer` (self) must be valid and not destroyed.
8888 ///- `commandBuffer` must be externally synchronized.
8889 ///
8890 ///# Panics
8891 ///Panics if `vkCmdPushDescriptorSetWithTemplate` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8892 ///
8893 ///# Usage Notes
8894 ///
8895 ///Combines push descriptors with descriptor update templates for
8896 ///maximum efficiency. Updates are pushed directly into the command
8897 ///buffer using the compact host data format defined by the template.
8898 ///
8899 ///This is the fastest path for per-draw descriptor updates: no pool
8900 ///allocation, no `WriteDescriptorSet` array construction, and the
8901 ///driver has a pre-compiled update path from the template.
8902 ///
8903 ///The template must have been created with
8904 ///`DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS`.
8905 ///
8906 ///Core in Vulkan 1.4. Previously via `VK_KHR_push_descriptor` +
8907 ///`VK_KHR_descriptor_update_template`.
8908 pub unsafe fn cmd_push_descriptor_set_with_template(
8909 &self,
8910 command_buffer: CommandBuffer,
8911 descriptor_update_template: DescriptorUpdateTemplate,
8912 layout: PipelineLayout,
8913 set: u32,
8914 p_data: *const core::ffi::c_void,
8915 ) {
8916 let fp = self
8917 .commands()
8918 .cmd_push_descriptor_set_with_template
8919 .expect("vkCmdPushDescriptorSetWithTemplate not loaded");
8920 unsafe {
8921 fp(
8922 command_buffer,
8923 descriptor_update_template,
8924 layout,
8925 set,
8926 p_data,
8927 )
8928 };
8929 }
8930 ///Wraps [`vkSetHdrMetadataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetHdrMetadataEXT.html).
8931 /**
8932 Provided by **VK_EXT_hdr_metadata**.*/
8933 ///
8934 ///# Safety
8935 ///- `device` (self) must be valid and not destroyed.
8936 ///
8937 ///# Panics
8938 ///Panics if `vkSetHdrMetadataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8939 ///
8940 ///# Usage Notes
8941 ///
8942 ///Sets HDR metadata (mastering display color volume, content light
8943 ///levels) for one or more swapchains. The compositor uses this to
8944 ///tone-map content appropriately for the connected display.
8945 ///
8946 ///Call whenever the content characteristics change (e.g., switching
8947 ///between SDR UI and HDR scene rendering).
8948 ///
8949 ///Requires `VK_EXT_hdr_metadata`.
8950 pub unsafe fn set_hdr_metadata_ext(
8951 &self,
8952 p_swapchains: &[SwapchainKHR],
8953 p_metadata: &[HdrMetadataEXT],
8954 ) {
8955 let fp = self
8956 .commands()
8957 .set_hdr_metadata_ext
8958 .expect("vkSetHdrMetadataEXT not loaded");
8959 unsafe {
8960 fp(
8961 self.handle(),
8962 p_swapchains.len() as u32,
8963 p_swapchains.as_ptr(),
8964 p_metadata.as_ptr(),
8965 )
8966 };
8967 }
8968 ///Wraps [`vkGetSwapchainStatusKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSwapchainStatusKHR.html).
8969 /**
8970 Provided by **VK_KHR_shared_presentable_image**.*/
8971 ///
8972 ///# Errors
8973 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8974 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
8975 ///- `VK_ERROR_DEVICE_LOST`
8976 ///- `VK_ERROR_OUT_OF_DATE_KHR`
8977 ///- `VK_ERROR_SURFACE_LOST_KHR`
8978 ///- `VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT`
8979 ///- `VK_ERROR_UNKNOWN`
8980 ///- `VK_ERROR_VALIDATION_FAILED`
8981 ///
8982 ///# Safety
8983 ///- `device` (self) must be valid and not destroyed.
8984 ///- `swapchain` must be externally synchronized.
8985 ///
8986 ///# Panics
8987 ///Panics if `vkGetSwapchainStatusKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8988 ///
8989 ///# Usage Notes
8990 ///
8991 ///Queries the current status of a shared presentable swapchain
8992 ///(created with `PRESENT_MODE_SHARED_DEMAND_REFRESH` or
8993 ///`PRESENT_MODE_SHARED_CONTINUOUS_REFRESH`).
8994 ///
8995 ///Returns `VK_SUCCESS` if the swapchain is usable, or
8996 ///`VK_SUBOPTIMAL_KHR` / `VK_ERROR_OUT_OF_DATE_KHR` / surface-lost
8997 ///errors if the swapchain needs recreation.
8998 ///
8999 ///Only relevant for shared presentable images
9000 ///(`VK_KHR_shared_presentable_image`). For regular swapchains, status
9001 ///is communicated through `acquire_next_image_khr` and
9002 ///`queue_present_khr` return values.
9003 pub unsafe fn get_swapchain_status_khr(&self, swapchain: SwapchainKHR) -> VkResult<()> {
9004 let fp = self
9005 .commands()
9006 .get_swapchain_status_khr
9007 .expect("vkGetSwapchainStatusKHR not loaded");
9008 check(unsafe { fp(self.handle(), swapchain) })
9009 }
9010 ///Wraps [`vkGetRefreshCycleDurationGOOGLE`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetRefreshCycleDurationGOOGLE.html).
9011 /**
9012 Provided by **VK_GOOGLE_display_timing**.*/
9013 ///
9014 ///# Errors
9015 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
9016 ///- `VK_ERROR_DEVICE_LOST`
9017 ///- `VK_ERROR_SURFACE_LOST_KHR`
9018 ///- `VK_ERROR_UNKNOWN`
9019 ///- `VK_ERROR_VALIDATION_FAILED`
9020 ///
9021 ///# Safety
9022 ///- `device` (self) must be valid and not destroyed.
9023 ///- `swapchain` must be externally synchronized.
9024 ///
9025 ///# Panics
9026 ///Panics if `vkGetRefreshCycleDurationGOOGLE` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9027 ///
9028 ///# Usage Notes
9029 ///
9030 ///Queries the duration of a single refresh cycle (vsync interval)
9031 ///for the display associated with the given swapchain. Returns
9032 ///the period in nanoseconds. Essential for accurate frame pacing.
9033 ///
9034 ///Requires `VK_GOOGLE_display_timing`.
9035 pub unsafe fn get_refresh_cycle_duration_google(
9036 &self,
9037 swapchain: SwapchainKHR,
9038 ) -> VkResult<RefreshCycleDurationGOOGLE> {
9039 let fp = self
9040 .commands()
9041 .get_refresh_cycle_duration_google
9042 .expect("vkGetRefreshCycleDurationGOOGLE not loaded");
9043 let mut out = unsafe { core::mem::zeroed() };
9044 check(unsafe { fp(self.handle(), swapchain, &mut out) })?;
9045 Ok(out)
9046 }
9047 ///Wraps [`vkGetPastPresentationTimingGOOGLE`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPastPresentationTimingGOOGLE.html).
9048 /**
9049 Provided by **VK_GOOGLE_display_timing**.*/
9050 ///
9051 ///# Errors
9052 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
9053 ///- `VK_ERROR_DEVICE_LOST`
9054 ///- `VK_ERROR_OUT_OF_DATE_KHR`
9055 ///- `VK_ERROR_SURFACE_LOST_KHR`
9056 ///- `VK_ERROR_UNKNOWN`
9057 ///- `VK_ERROR_VALIDATION_FAILED`
9058 ///
9059 ///# Safety
9060 ///- `device` (self) must be valid and not destroyed.
9061 ///- `swapchain` must be externally synchronized.
9062 ///
9063 ///# Panics
9064 ///Panics if `vkGetPastPresentationTimingGOOGLE` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9065 ///
9066 ///# Usage Notes
9067 ///
9068 ///Returns timing data for past presentations on a swapchain,
9069 ///including actual present time, earliest possible present time,
9070 ///and finish time. Uses the two-call idiom (call once to get the
9071 ///count, again to fill the buffer). Useful for frame pacing and
9072 ///latency analysis.
9073 ///
9074 ///Requires `VK_GOOGLE_display_timing`.
9075 pub unsafe fn get_past_presentation_timing_google(
9076 &self,
9077 swapchain: SwapchainKHR,
9078 ) -> VkResult<Vec<PastPresentationTimingGOOGLE>> {
9079 let fp = self
9080 .commands()
9081 .get_past_presentation_timing_google
9082 .expect("vkGetPastPresentationTimingGOOGLE not loaded");
9083 enumerate_two_call(|count, data| unsafe { fp(self.handle(), swapchain, count, data) })
9084 }
9085 ///Wraps [`vkCmdSetViewportWScalingNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetViewportWScalingNV.html).
9086 /**
9087 Provided by **VK_NV_clip_space_w_scaling**.*/
9088 ///
9089 ///# Safety
9090 ///- `commandBuffer` (self) must be valid and not destroyed.
9091 ///- `commandBuffer` must be externally synchronized.
9092 ///
9093 ///# Panics
9094 ///Panics if `vkCmdSetViewportWScalingNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9095 ///
9096 ///# Usage Notes
9097 ///
9098 ///Sets per-viewport W scaling factors for lens-matched shading.
9099 ///The W scaling modifies the clip-space W coordinate to account
9100 ///for lens distortion in VR headsets, enabling more efficient
9101 ///shading by varying pixel density across the viewport.
9102 ///
9103 ///Requires `VK_NV_clip_space_w_scaling`.
9104 pub unsafe fn cmd_set_viewport_w_scaling_nv(
9105 &self,
9106 command_buffer: CommandBuffer,
9107 first_viewport: u32,
9108 p_viewport_w_scalings: &[ViewportWScalingNV],
9109 ) {
9110 let fp = self
9111 .commands()
9112 .cmd_set_viewport_w_scaling_nv
9113 .expect("vkCmdSetViewportWScalingNV not loaded");
9114 unsafe {
9115 fp(
9116 command_buffer,
9117 first_viewport,
9118 p_viewport_w_scalings.len() as u32,
9119 p_viewport_w_scalings.as_ptr(),
9120 )
9121 };
9122 }
9123 ///Wraps [`vkCmdSetDiscardRectangleEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDiscardRectangleEXT.html).
9124 /**
9125 Provided by **VK_EXT_discard_rectangles**.*/
9126 ///
9127 ///# Safety
9128 ///- `commandBuffer` (self) must be valid and not destroyed.
9129 ///- `commandBuffer` must be externally synchronized.
9130 ///
9131 ///# Panics
9132 ///Panics if `vkCmdSetDiscardRectangleEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9133 ///
9134 ///# Usage Notes
9135 ///
9136 ///Dynamically sets the discard rectangles for the current command
9137 ///buffer. Fragments inside (or outside, depending on mode) these
9138 ///rectangles are discarded before the fragment shader runs.
9139 ///
9140 ///Useful for multi-view or split-screen rendering to cheaply cull
9141 ///fragments that belong to a different viewport.
9142 ///
9143 ///Requires `VK_EXT_discard_rectangles`.
9144 pub unsafe fn cmd_set_discard_rectangle_ext(
9145 &self,
9146 command_buffer: CommandBuffer,
9147 first_discard_rectangle: u32,
9148 p_discard_rectangles: &[Rect2D],
9149 ) {
9150 let fp = self
9151 .commands()
9152 .cmd_set_discard_rectangle_ext
9153 .expect("vkCmdSetDiscardRectangleEXT not loaded");
9154 unsafe {
9155 fp(
9156 command_buffer,
9157 first_discard_rectangle,
9158 p_discard_rectangles.len() as u32,
9159 p_discard_rectangles.as_ptr(),
9160 )
9161 };
9162 }
9163 ///Wraps [`vkCmdSetDiscardRectangleEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDiscardRectangleEnableEXT.html).
9164 /**
9165 Provided by **VK_EXT_discard_rectangles**.*/
9166 ///
9167 ///# Safety
9168 ///- `commandBuffer` (self) must be valid and not destroyed.
9169 ///- `commandBuffer` must be externally synchronized.
9170 ///
9171 ///# Panics
9172 ///Panics if `vkCmdSetDiscardRectangleEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9173 ///
9174 ///# Usage Notes
9175 ///
9176 ///Dynamically enables or disables discard rectangles for subsequent
9177 ///draw commands. When disabled, no fragments are discarded regardless
9178 ///of the configured rectangles.
9179 ///
9180 ///Requires `VK_EXT_discard_rectangles`.
9181 pub unsafe fn cmd_set_discard_rectangle_enable_ext(
9182 &self,
9183 command_buffer: CommandBuffer,
9184 discard_rectangle_enable: bool,
9185 ) {
9186 let fp = self
9187 .commands()
9188 .cmd_set_discard_rectangle_enable_ext
9189 .expect("vkCmdSetDiscardRectangleEnableEXT not loaded");
9190 unsafe { fp(command_buffer, discard_rectangle_enable as u32) };
9191 }
9192 ///Wraps [`vkCmdSetDiscardRectangleModeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDiscardRectangleModeEXT.html).
9193 /**
9194 Provided by **VK_EXT_discard_rectangles**.*/
9195 ///
9196 ///# Safety
9197 ///- `commandBuffer` (self) must be valid and not destroyed.
9198 ///- `commandBuffer` must be externally synchronized.
9199 ///
9200 ///# Panics
9201 ///Panics if `vkCmdSetDiscardRectangleModeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9202 ///
9203 ///# Usage Notes
9204 ///
9205 ///Dynamically sets whether fragments inside or outside the discard
9206 ///rectangles are discarded. `INCLUSIVE` discards fragments inside
9207 ///the rectangles; `EXCLUSIVE` discards fragments outside.
9208 ///
9209 ///Requires `VK_EXT_discard_rectangles`.
9210 pub unsafe fn cmd_set_discard_rectangle_mode_ext(
9211 &self,
9212 command_buffer: CommandBuffer,
9213 discard_rectangle_mode: DiscardRectangleModeEXT,
9214 ) {
9215 let fp = self
9216 .commands()
9217 .cmd_set_discard_rectangle_mode_ext
9218 .expect("vkCmdSetDiscardRectangleModeEXT not loaded");
9219 unsafe { fp(command_buffer, discard_rectangle_mode) };
9220 }
9221 ///Wraps [`vkCmdSetSampleLocationsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetSampleLocationsEXT.html).
9222 /**
9223 Provided by **VK_EXT_sample_locations**.*/
9224 ///
9225 ///# Safety
9226 ///- `commandBuffer` (self) must be valid and not destroyed.
9227 ///- `commandBuffer` must be externally synchronized.
9228 ///
9229 ///# Panics
9230 ///Panics if `vkCmdSetSampleLocationsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9231 ///
9232 ///# Usage Notes
9233 ///
9234 ///Sets custom sample locations for multisampled rasterization.
9235 ///`SampleLocationsInfoEXT` specifies the grid size, sample count,
9236 ///and per-sample (x, y) positions within each pixel.
9237 ///
9238 ///Custom sample locations enable techniques like temporal AA
9239 ///jittering and programmable MSAA patterns.
9240 ///
9241 ///Must be called when custom sample locations are enabled (via
9242 ///`cmd_set_sample_locations_enable_ext` or pipeline state).
9243 ///
9244 ///Requires `VK_EXT_sample_locations`.
9245 pub unsafe fn cmd_set_sample_locations_ext(
9246 &self,
9247 command_buffer: CommandBuffer,
9248 p_sample_locations_info: &SampleLocationsInfoEXT,
9249 ) {
9250 let fp = self
9251 .commands()
9252 .cmd_set_sample_locations_ext
9253 .expect("vkCmdSetSampleLocationsEXT not loaded");
9254 unsafe { fp(command_buffer, p_sample_locations_info) };
9255 }
9256 ///Wraps [`vkGetBufferMemoryRequirements2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetBufferMemoryRequirements2.html).
9257 /**
9258 Provided by **VK_BASE_VERSION_1_1**.*/
9259 ///
9260 ///# Safety
9261 ///- `device` (self) must be valid and not destroyed.
9262 ///
9263 ///# Panics
9264 ///Panics if `vkGetBufferMemoryRequirements2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9265 ///
9266 ///# Usage Notes
9267 ///
9268 ///Vulkan 1.1 version of `get_buffer_memory_requirements` that supports
9269 ///extensible output structs via pNext.
9270 ///
9271 ///Chain `MemoryDedicatedRequirements` to query whether the driver
9272 ///prefers or requires a dedicated allocation for this buffer. If
9273 ///`prefers_dedicated_allocation` is true, allocating a dedicated
9274 ///`DeviceMemory` for this buffer may improve performance.
9275 ///
9276 ///The base `MemoryRequirements` (size, alignment, memory type bits) is
9277 ///identical to what `get_buffer_memory_requirements` returns.
9278 pub unsafe fn get_buffer_memory_requirements2(
9279 &self,
9280 p_info: &BufferMemoryRequirementsInfo2,
9281 p_memory_requirements: &mut MemoryRequirements2,
9282 ) {
9283 let fp = self
9284 .commands()
9285 .get_buffer_memory_requirements2
9286 .expect("vkGetBufferMemoryRequirements2 not loaded");
9287 unsafe { fp(self.handle(), p_info, p_memory_requirements) };
9288 }
9289 ///Wraps [`vkGetImageMemoryRequirements2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageMemoryRequirements2.html).
9290 /**
9291 Provided by **VK_BASE_VERSION_1_1**.*/
9292 ///
9293 ///# Safety
9294 ///- `device` (self) must be valid and not destroyed.
9295 ///
9296 ///# Panics
9297 ///Panics if `vkGetImageMemoryRequirements2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9298 ///
9299 ///# Usage Notes
9300 ///
9301 ///Vulkan 1.1 version of `get_image_memory_requirements` that supports
9302 ///extensible output structs via pNext.
9303 ///
9304 ///Chain `MemoryDedicatedRequirements` to query whether the driver
9305 ///prefers or requires a dedicated allocation for this image. Dedicated
9306 ///allocations are common for large render targets and swapchain-sized
9307 ///images, some drivers require them.
9308 ///
9309 ///For multi-planar images, chain `ImagePlaneMemoryRequirementsInfo` in
9310 ///the input to query requirements for a specific plane.
9311 ///
9312 ///The base `MemoryRequirements` is identical to what
9313 ///`get_image_memory_requirements` returns.
9314 pub unsafe fn get_image_memory_requirements2(
9315 &self,
9316 p_info: &ImageMemoryRequirementsInfo2,
9317 p_memory_requirements: &mut MemoryRequirements2,
9318 ) {
9319 let fp = self
9320 .commands()
9321 .get_image_memory_requirements2
9322 .expect("vkGetImageMemoryRequirements2 not loaded");
9323 unsafe { fp(self.handle(), p_info, p_memory_requirements) };
9324 }
9325 ///Wraps [`vkGetImageSparseMemoryRequirements2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageSparseMemoryRequirements2.html).
9326 /**
9327 Provided by **VK_BASE_VERSION_1_1**.*/
9328 ///
9329 ///# Safety
9330 ///- `device` (self) must be valid and not destroyed.
9331 ///
9332 ///# Panics
9333 ///Panics if `vkGetImageSparseMemoryRequirements2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9334 ///
9335 ///# Usage Notes
9336 ///
9337 ///Vulkan 1.1 version of `get_image_sparse_memory_requirements` that
9338 ///supports extensible output structs via pNext. Returns the sparse
9339 ///memory requirements for an image created with sparse flags.
9340 ///
9341 ///For non-sparse images, returns an empty list. Only relevant if you
9342 ///are using sparse resources.
9343 pub unsafe fn get_image_sparse_memory_requirements2(
9344 &self,
9345 p_info: &ImageSparseMemoryRequirementsInfo2,
9346 ) -> Vec<SparseImageMemoryRequirements2> {
9347 let fp = self
9348 .commands()
9349 .get_image_sparse_memory_requirements2
9350 .expect("vkGetImageSparseMemoryRequirements2 not loaded");
9351 fill_two_call(|count, data| unsafe { fp(self.handle(), p_info, count, data) })
9352 }
9353 ///Wraps [`vkGetDeviceBufferMemoryRequirements`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceBufferMemoryRequirements.html).
9354 /**
9355 Provided by **VK_BASE_VERSION_1_3**.*/
9356 ///
9357 ///# Safety
9358 ///- `device` (self) must be valid and not destroyed.
9359 ///
9360 ///# Panics
9361 ///Panics if `vkGetDeviceBufferMemoryRequirements` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9362 ///
9363 ///# Usage Notes
9364 ///
9365 ///Vulkan 1.3 command that queries memory requirements for a buffer
9366 ///**without creating it first**. Pass a `DeviceBufferMemoryRequirements`
9367 ///containing the hypothetical `BufferCreateInfo`.
9368 ///
9369 ///This lets you pre-plan memory allocations before creating any
9370 ///objects, useful for memory allocation strategies that need to know
9371 ///sizes and alignments up front.
9372 ///
9373 ///The returned requirements are identical to what
9374 ///`get_buffer_memory_requirements2` would return for an actual buffer
9375 ///created with the same parameters.
9376 pub unsafe fn get_device_buffer_memory_requirements(
9377 &self,
9378 p_info: &DeviceBufferMemoryRequirements,
9379 p_memory_requirements: &mut MemoryRequirements2,
9380 ) {
9381 let fp = self
9382 .commands()
9383 .get_device_buffer_memory_requirements
9384 .expect("vkGetDeviceBufferMemoryRequirements not loaded");
9385 unsafe { fp(self.handle(), p_info, p_memory_requirements) };
9386 }
9387 ///Wraps [`vkGetDeviceImageMemoryRequirements`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceImageMemoryRequirements.html).
9388 /**
9389 Provided by **VK_BASE_VERSION_1_3**.*/
9390 ///
9391 ///# Safety
9392 ///- `device` (self) must be valid and not destroyed.
9393 ///
9394 ///# Panics
9395 ///Panics if `vkGetDeviceImageMemoryRequirements` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9396 ///
9397 ///# Usage Notes
9398 ///
9399 ///Vulkan 1.3 command that queries memory requirements for an image
9400 ///**without creating it first**. Pass a `DeviceImageMemoryRequirements`
9401 ///containing the hypothetical `ImageCreateInfo`.
9402 ///
9403 ///Useful for pre-planning memory allocations or estimating VRAM usage
9404 ///before committing to image creation.
9405 ///
9406 ///For multi-planar images, set `plane_aspect` to query requirements
9407 ///for a specific plane.
9408 ///
9409 ///The returned requirements are identical to what
9410 ///`get_image_memory_requirements2` would return for an actual image
9411 ///created with the same parameters.
9412 pub unsafe fn get_device_image_memory_requirements(
9413 &self,
9414 p_info: &DeviceImageMemoryRequirements,
9415 p_memory_requirements: &mut MemoryRequirements2,
9416 ) {
9417 let fp = self
9418 .commands()
9419 .get_device_image_memory_requirements
9420 .expect("vkGetDeviceImageMemoryRequirements not loaded");
9421 unsafe { fp(self.handle(), p_info, p_memory_requirements) };
9422 }
9423 ///Wraps [`vkGetDeviceImageSparseMemoryRequirements`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceImageSparseMemoryRequirements.html).
9424 /**
9425 Provided by **VK_BASE_VERSION_1_3**.*/
9426 ///
9427 ///# Safety
9428 ///- `device` (self) must be valid and not destroyed.
9429 ///
9430 ///# Panics
9431 ///Panics if `vkGetDeviceImageSparseMemoryRequirements` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9432 ///
9433 ///# Usage Notes
9434 ///
9435 ///Vulkan 1.3 command that queries sparse memory requirements for an
9436 ///image **without creating it first**. The counterpart to
9437 ///`get_device_image_memory_requirements` for sparse images.
9438 ///
9439 ///Only relevant if you are using sparse resources with the hypothetical
9440 ///image creation parameters.
9441 pub unsafe fn get_device_image_sparse_memory_requirements(
9442 &self,
9443 p_info: &DeviceImageMemoryRequirements,
9444 ) -> Vec<SparseImageMemoryRequirements2> {
9445 let fp = self
9446 .commands()
9447 .get_device_image_sparse_memory_requirements
9448 .expect("vkGetDeviceImageSparseMemoryRequirements not loaded");
9449 fill_two_call(|count, data| unsafe { fp(self.handle(), p_info, count, data) })
9450 }
9451 ///Wraps [`vkCreateSamplerYcbcrConversion`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateSamplerYcbcrConversion.html).
9452 /**
9453 Provided by **VK_COMPUTE_VERSION_1_1**.*/
9454 ///
9455 ///# Errors
9456 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
9457 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
9458 ///- `VK_ERROR_UNKNOWN`
9459 ///- `VK_ERROR_VALIDATION_FAILED`
9460 ///
9461 ///# Safety
9462 ///- `device` (self) must be valid and not destroyed.
9463 ///
9464 ///# Panics
9465 ///Panics if `vkCreateSamplerYcbcrConversion` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9466 ///
9467 ///# Usage Notes
9468 ///
9469 ///Creates a sampler YCBCR conversion object that describes how to
9470 ///convert YCBCR-encoded image data to RGB during sampling. Required
9471 ///for multi-planar formats like `G8_B8_R8_3PLANE_420_UNORM` commonly
9472 ///used in video decoding and camera capture.
9473 ///
9474 ///The conversion parameters specify:
9475 ///
9476 ///- **Format**: the multi-planar format being converted.
9477 ///- **YCBCR model**: `RGB_IDENTITY`, `YCBCR_IDENTITY`,
9478 /// `YCBCR_709`, `YCBCR_601`, `YCBCR_2020`.
9479 ///- **Range**: `ITU_FULL` or `ITU_NARROW`.
9480 ///- **Chroma location**: where subsampled chroma samples are located
9481 /// relative to luma samples.
9482 ///- **Chroma filter**: `NEAREST` or `LINEAR` for chroma upsampling.
9483 ///
9484 ///The conversion object is attached to a sampler via
9485 ///`SamplerYcbcrConversionInfo` in the pNext chain, and that sampler
9486 ///must be used as an immutable sampler in the descriptor set layout.
9487 pub unsafe fn create_sampler_ycbcr_conversion(
9488 &self,
9489 p_create_info: &SamplerYcbcrConversionCreateInfo,
9490 allocator: Option<&AllocationCallbacks>,
9491 ) -> VkResult<SamplerYcbcrConversion> {
9492 let fp = self
9493 .commands()
9494 .create_sampler_ycbcr_conversion
9495 .expect("vkCreateSamplerYcbcrConversion not loaded");
9496 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
9497 let mut out = unsafe { core::mem::zeroed() };
9498 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
9499 Ok(out)
9500 }
9501 ///Wraps [`vkDestroySamplerYcbcrConversion`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroySamplerYcbcrConversion.html).
9502 /**
9503 Provided by **VK_COMPUTE_VERSION_1_1**.*/
9504 ///
9505 ///# Safety
9506 ///- `device` (self) must be valid and not destroyed.
9507 ///- `ycbcrConversion` must be externally synchronized.
9508 ///
9509 ///# Panics
9510 ///Panics if `vkDestroySamplerYcbcrConversion` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9511 ///
9512 ///# Usage Notes
9513 ///
9514 ///Destroys a sampler YCBCR conversion object. Any sampler that was
9515 ///created with this conversion must already be destroyed.
9516 ///
9517 ///After destruction, any descriptor set layout that used the associated
9518 ///sampler as an immutable sampler remains valid but cannot be used to
9519 ///allocate new descriptor sets.
9520 pub unsafe fn destroy_sampler_ycbcr_conversion(
9521 &self,
9522 ycbcr_conversion: SamplerYcbcrConversion,
9523 allocator: Option<&AllocationCallbacks>,
9524 ) {
9525 let fp = self
9526 .commands()
9527 .destroy_sampler_ycbcr_conversion
9528 .expect("vkDestroySamplerYcbcrConversion not loaded");
9529 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
9530 unsafe { fp(self.handle(), ycbcr_conversion, alloc_ptr) };
9531 }
9532 ///Wraps [`vkGetDeviceQueue2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceQueue2.html).
9533 /**
9534 Provided by **VK_BASE_VERSION_1_1**.*/
9535 ///
9536 ///# Safety
9537 ///- `device` (self) must be valid and not destroyed.
9538 ///
9539 ///# Panics
9540 ///Panics if `vkGetDeviceQueue2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9541 ///
9542 ///# Usage Notes
9543 ///
9544 ///Retrieves a queue handle for a queue created with specific flags.
9545 ///This is the Vulkan 1.1 version of `get_device_queue` that supports
9546 ///`DeviceQueueInfo2` with queue creation flags.
9547 ///
9548 ///Use this instead of `get_device_queue` when you created queues with
9549 ///non-zero `DeviceQueueCreateFlags` (e.g. `PROTECTED` for protected
9550 ///content processing). For queues created without flags, both
9551 ///`get_device_queue` and `get_device_queue2` work.
9552 pub unsafe fn get_device_queue2(&self, p_queue_info: &DeviceQueueInfo2) -> Queue {
9553 let fp = self
9554 .commands()
9555 .get_device_queue2
9556 .expect("vkGetDeviceQueue2 not loaded");
9557 let mut out = unsafe { core::mem::zeroed() };
9558 unsafe { fp(self.handle(), p_queue_info, &mut out) };
9559 out
9560 }
9561 ///Wraps [`vkCreateValidationCacheEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateValidationCacheEXT.html).
9562 /**
9563 Provided by **VK_EXT_validation_cache**.*/
9564 ///
9565 ///# Errors
9566 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
9567 ///- `VK_ERROR_UNKNOWN`
9568 ///- `VK_ERROR_VALIDATION_FAILED`
9569 ///
9570 ///# Safety
9571 ///- `device` (self) must be valid and not destroyed.
9572 ///
9573 ///# Panics
9574 ///Panics if `vkCreateValidationCacheEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9575 ///
9576 ///# Usage Notes
9577 ///
9578 ///Creates a validation cache that stores the results of validation
9579 ///layer checks. Subsequent pipeline creations with the same shaders
9580 ///can skip redundant validation, improving pipeline creation time.
9581 ///
9582 ///Provide previously saved cache data to warm-start the cache.
9583 ///Retrieve data with `get_validation_cache_data_ext`.
9584 ///
9585 ///Destroy with `destroy_validation_cache_ext`.
9586 ///
9587 ///Requires `VK_EXT_validation_cache`.
9588 pub unsafe fn create_validation_cache_ext(
9589 &self,
9590 p_create_info: &ValidationCacheCreateInfoEXT,
9591 allocator: Option<&AllocationCallbacks>,
9592 ) -> VkResult<ValidationCacheEXT> {
9593 let fp = self
9594 .commands()
9595 .create_validation_cache_ext
9596 .expect("vkCreateValidationCacheEXT not loaded");
9597 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
9598 let mut out = unsafe { core::mem::zeroed() };
9599 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
9600 Ok(out)
9601 }
9602 ///Wraps [`vkDestroyValidationCacheEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyValidationCacheEXT.html).
9603 /**
9604 Provided by **VK_EXT_validation_cache**.*/
9605 ///
9606 ///# Safety
9607 ///- `device` (self) must be valid and not destroyed.
9608 ///- `validationCache` must be externally synchronized.
9609 ///
9610 ///# Panics
9611 ///Panics if `vkDestroyValidationCacheEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9612 ///
9613 ///# Usage Notes
9614 ///
9615 ///Destroys a validation cache created with
9616 ///`create_validation_cache_ext`.
9617 ///
9618 ///Requires `VK_EXT_validation_cache`.
9619 pub unsafe fn destroy_validation_cache_ext(
9620 &self,
9621 validation_cache: ValidationCacheEXT,
9622 allocator: Option<&AllocationCallbacks>,
9623 ) {
9624 let fp = self
9625 .commands()
9626 .destroy_validation_cache_ext
9627 .expect("vkDestroyValidationCacheEXT not loaded");
9628 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
9629 unsafe { fp(self.handle(), validation_cache, alloc_ptr) };
9630 }
9631 ///Wraps [`vkGetValidationCacheDataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetValidationCacheDataEXT.html).
9632 /**
9633 Provided by **VK_EXT_validation_cache**.*/
9634 ///
9635 ///# Errors
9636 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
9637 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
9638 ///- `VK_ERROR_UNKNOWN`
9639 ///- `VK_ERROR_VALIDATION_FAILED`
9640 ///
9641 ///# Safety
9642 ///- `device` (self) must be valid and not destroyed.
9643 ///
9644 ///# Panics
9645 ///Panics if `vkGetValidationCacheDataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9646 ///
9647 ///# Usage Notes
9648 ///
9649 ///Retrieves the data from a validation cache for serialization to
9650 ///disk. Call once with a null buffer to query the size, then again
9651 ///with an appropriately sized buffer.
9652 ///
9653 ///Feed the saved data back into `create_validation_cache_ext` on
9654 ///the next run to avoid redundant validation.
9655 ///
9656 ///Requires `VK_EXT_validation_cache`.
9657 pub unsafe fn get_validation_cache_data_ext(
9658 &self,
9659 validation_cache: ValidationCacheEXT,
9660 p_data: *mut core::ffi::c_void,
9661 ) -> VkResult<usize> {
9662 let fp = self
9663 .commands()
9664 .get_validation_cache_data_ext
9665 .expect("vkGetValidationCacheDataEXT not loaded");
9666 let mut out = unsafe { core::mem::zeroed() };
9667 check(unsafe { fp(self.handle(), validation_cache, &mut out, p_data) })?;
9668 Ok(out)
9669 }
9670 ///Wraps [`vkMergeValidationCachesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkMergeValidationCachesEXT.html).
9671 /**
9672 Provided by **VK_EXT_validation_cache**.*/
9673 ///
9674 ///# Errors
9675 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
9676 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
9677 ///- `VK_ERROR_UNKNOWN`
9678 ///- `VK_ERROR_VALIDATION_FAILED`
9679 ///
9680 ///# Safety
9681 ///- `device` (self) must be valid and not destroyed.
9682 ///- `dstCache` must be externally synchronized.
9683 ///
9684 ///# Panics
9685 ///Panics if `vkMergeValidationCachesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9686 ///
9687 ///# Usage Notes
9688 ///
9689 ///Merges one or more source validation caches into a destination
9690 ///cache. Useful for combining caches from parallel pipeline creation
9691 ///threads.
9692 ///
9693 ///Requires `VK_EXT_validation_cache`.
9694 pub unsafe fn merge_validation_caches_ext(
9695 &self,
9696 dst_cache: ValidationCacheEXT,
9697 p_src_caches: &[ValidationCacheEXT],
9698 ) -> VkResult<()> {
9699 let fp = self
9700 .commands()
9701 .merge_validation_caches_ext
9702 .expect("vkMergeValidationCachesEXT not loaded");
9703 check(unsafe {
9704 fp(
9705 self.handle(),
9706 dst_cache,
9707 p_src_caches.len() as u32,
9708 p_src_caches.as_ptr(),
9709 )
9710 })
9711 }
9712 ///Wraps [`vkGetDescriptorSetLayoutSupport`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDescriptorSetLayoutSupport.html).
9713 /**
9714 Provided by **VK_COMPUTE_VERSION_1_1**.*/
9715 ///
9716 ///# Safety
9717 ///- `device` (self) must be valid and not destroyed.
9718 ///
9719 ///# Panics
9720 ///Panics if `vkGetDescriptorSetLayoutSupport` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9721 ///
9722 ///# Usage Notes
9723 ///
9724 ///Queries whether a descriptor set layout with the given bindings can
9725 ///be created on this device, and returns information about the
9726 ///variable descriptor count limit if applicable.
9727 ///
9728 ///Use this before creating layouts with very large descriptor counts
9729 ///or update-after-bind bindings to verify they are within device
9730 ///limits. The call is lightweight and does not allocate anything.
9731 ///
9732 ///Chain `DescriptorSetVariableDescriptorCountLayoutSupport` in the
9733 ///output to query the maximum variable descriptor count for layouts
9734 ///that use `DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT`.
9735 pub unsafe fn get_descriptor_set_layout_support(
9736 &self,
9737 p_create_info: &DescriptorSetLayoutCreateInfo,
9738 p_support: &mut DescriptorSetLayoutSupport,
9739 ) {
9740 let fp = self
9741 .commands()
9742 .get_descriptor_set_layout_support
9743 .expect("vkGetDescriptorSetLayoutSupport not loaded");
9744 unsafe { fp(self.handle(), p_create_info, p_support) };
9745 }
9746 ///Wraps [`vkGetSwapchainGrallocUsageANDROID`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSwapchainGrallocUsageANDROID.html).
9747 ///
9748 ///# Safety
9749 ///- `device` (self) must be valid and not destroyed.
9750 ///
9751 ///# Panics
9752 ///Panics if `vkGetSwapchainGrallocUsageANDROID` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9753 ///
9754 ///# Usage Notes
9755 ///
9756 ///Queries the Android gralloc usage flags needed for swapchain
9757 ///images with the given format and Vulkan image usage. Used
9758 ///internally by the Android WSI implementation. Android only.
9759 ///
9760 ///Requires `VK_ANDROID_native_buffer`.
9761 pub unsafe fn get_swapchain_gralloc_usage_android(
9762 &self,
9763 format: Format,
9764 image_usage: ImageUsageFlags,
9765 ) -> VkResult<core::ffi::c_int> {
9766 let fp = self
9767 .commands()
9768 .get_swapchain_gralloc_usage_android
9769 .expect("vkGetSwapchainGrallocUsageANDROID not loaded");
9770 let mut out = unsafe { core::mem::zeroed() };
9771 check(unsafe { fp(self.handle(), format, image_usage, &mut out) })?;
9772 Ok(out)
9773 }
9774 ///Wraps [`vkGetSwapchainGrallocUsage2ANDROID`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSwapchainGrallocUsage2ANDROID.html).
9775 ///
9776 ///# Safety
9777 ///- `device` (self) must be valid and not destroyed.
9778 ///
9779 ///# Panics
9780 ///Panics if `vkGetSwapchainGrallocUsage2ANDROID` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9781 ///
9782 ///# Usage Notes
9783 ///
9784 ///Extended version of `get_swapchain_gralloc_usage_android` that
9785 ///additionally accepts swapchain-specific image usage flags and
9786 ///returns both producer and consumer gralloc usage. Android only.
9787 ///
9788 ///Requires `VK_ANDROID_native_buffer`.
9789 pub unsafe fn get_swapchain_gralloc_usage2_android(
9790 &self,
9791 format: Format,
9792 image_usage: ImageUsageFlags,
9793 swapchain_image_usage: SwapchainImageUsageFlagsANDROID,
9794 gralloc_consumer_usage: *mut u64,
9795 ) -> VkResult<u64> {
9796 let fp = self
9797 .commands()
9798 .get_swapchain_gralloc_usage2_android
9799 .expect("vkGetSwapchainGrallocUsage2ANDROID not loaded");
9800 let mut out = unsafe { core::mem::zeroed() };
9801 check(unsafe {
9802 fp(
9803 self.handle(),
9804 format,
9805 image_usage,
9806 swapchain_image_usage,
9807 gralloc_consumer_usage,
9808 &mut out,
9809 )
9810 })?;
9811 Ok(out)
9812 }
9813 ///Wraps [`vkAcquireImageANDROID`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAcquireImageANDROID.html).
9814 ///
9815 ///# Safety
9816 ///- `device` (self) must be valid and not destroyed.
9817 ///
9818 ///# Panics
9819 ///Panics if `vkAcquireImageANDROID` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9820 ///
9821 ///# Usage Notes
9822 ///
9823 ///Acquires ownership of a swapchain image on Android. Takes a
9824 ///native fence FD for synchronisation and can signal a Vulkan
9825 ///semaphore or fence on completion. Android only.
9826 ///
9827 ///Requires `VK_ANDROID_native_buffer`.
9828 pub unsafe fn acquire_image_android(
9829 &self,
9830 image: Image,
9831 native_fence_fd: core::ffi::c_int,
9832 semaphore: Semaphore,
9833 fence: Fence,
9834 ) -> VkResult<()> {
9835 let fp = self
9836 .commands()
9837 .acquire_image_android
9838 .expect("vkAcquireImageANDROID not loaded");
9839 check(unsafe { fp(self.handle(), image, native_fence_fd, semaphore, fence) })
9840 }
9841 ///Wraps [`vkQueueSignalReleaseImageANDROID`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueSignalReleaseImageANDROID.html).
9842 ///
9843 ///# Safety
9844 ///- `queue` (self) must be valid and not destroyed.
9845 ///
9846 ///# Panics
9847 ///Panics if `vkQueueSignalReleaseImageANDROID` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9848 ///
9849 ///# Usage Notes
9850 ///
9851 ///Releases a swapchain image back to the Android compositor after
9852 ///rendering. Waits on the given semaphores and returns a native
9853 ///fence FD for external synchronisation. Android only.
9854 ///
9855 ///Requires `VK_ANDROID_native_buffer`.
9856 pub unsafe fn queue_signal_release_image_android(
9857 &self,
9858 queue: Queue,
9859 p_wait_semaphores: &[Semaphore],
9860 image: Image,
9861 ) -> VkResult<core::ffi::c_int> {
9862 let fp = self
9863 .commands()
9864 .queue_signal_release_image_android
9865 .expect("vkQueueSignalReleaseImageANDROID not loaded");
9866 let mut out = unsafe { core::mem::zeroed() };
9867 check(unsafe {
9868 fp(
9869 queue,
9870 p_wait_semaphores.len() as u32,
9871 p_wait_semaphores.as_ptr(),
9872 image,
9873 &mut out,
9874 )
9875 })?;
9876 Ok(out)
9877 }
9878 ///Wraps [`vkGetShaderInfoAMD`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetShaderInfoAMD.html).
9879 /**
9880 Provided by **VK_AMD_shader_info**.*/
9881 ///
9882 ///# Errors
9883 ///- `VK_ERROR_FEATURE_NOT_PRESENT`
9884 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
9885 ///- `VK_ERROR_UNKNOWN`
9886 ///- `VK_ERROR_VALIDATION_FAILED`
9887 ///
9888 ///# Safety
9889 ///- `device` (self) must be valid and not destroyed.
9890 ///
9891 ///# Panics
9892 ///Panics if `vkGetShaderInfoAMD` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9893 ///
9894 ///# Usage Notes
9895 ///
9896 ///Queries AMD-specific shader information such as compiled binary
9897 ///statistics, disassembly, or resource usage. Call once with a null
9898 ///buffer to query the size, then again with an appropriately sized
9899 ///buffer.
9900 ///
9901 ///Requires `VK_AMD_shader_info`.
9902 pub unsafe fn get_shader_info_amd(
9903 &self,
9904 pipeline: Pipeline,
9905 shader_stage: ShaderStageFlagBits,
9906 info_type: ShaderInfoTypeAMD,
9907 p_info: *mut core::ffi::c_void,
9908 ) -> VkResult<usize> {
9909 let fp = self
9910 .commands()
9911 .get_shader_info_amd
9912 .expect("vkGetShaderInfoAMD not loaded");
9913 let mut out = unsafe { core::mem::zeroed() };
9914 check(unsafe {
9915 fp(
9916 self.handle(),
9917 pipeline,
9918 shader_stage,
9919 info_type,
9920 &mut out,
9921 p_info,
9922 )
9923 })?;
9924 Ok(out)
9925 }
9926 ///Wraps [`vkSetLocalDimmingAMD`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetLocalDimmingAMD.html).
9927 /**
9928 Provided by **VK_AMD_display_native_hdr**.*/
9929 ///
9930 ///# Safety
9931 ///- `device` (self) must be valid and not destroyed.
9932 ///
9933 ///# Panics
9934 ///Panics if `vkSetLocalDimmingAMD` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9935 ///
9936 ///# Usage Notes
9937 ///
9938 ///Enables or disables local dimming on an AMD display with native
9939 ///HDR support. Local dimming improves HDR contrast by adjusting
9940 ///backlight zones independently.
9941 ///
9942 ///Requires `VK_AMD_display_native_hdr`.
9943 pub unsafe fn set_local_dimming_amd(
9944 &self,
9945 swap_chain: SwapchainKHR,
9946 local_dimming_enable: bool,
9947 ) {
9948 let fp = self
9949 .commands()
9950 .set_local_dimming_amd
9951 .expect("vkSetLocalDimmingAMD not loaded");
9952 unsafe { fp(self.handle(), swap_chain, local_dimming_enable as u32) };
9953 }
9954 ///Wraps [`vkGetCalibratedTimestampsKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetCalibratedTimestampsKHR.html).
9955 /**
9956 Provided by **VK_KHR_calibrated_timestamps**.*/
9957 ///
9958 ///# Errors
9959 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
9960 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
9961 ///- `VK_ERROR_UNKNOWN`
9962 ///- `VK_ERROR_VALIDATION_FAILED`
9963 ///
9964 ///# Safety
9965 ///- `device` (self) must be valid and not destroyed.
9966 ///
9967 ///# Panics
9968 ///Panics if `vkGetCalibratedTimestampsKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9969 ///
9970 ///# Usage Notes
9971 ///
9972 ///Samples multiple time domains simultaneously and returns
9973 ///calibrated timestamps. This allows correlating GPU timestamps
9974 ///(from `cmd_write_timestamp2`) with CPU time.
9975 ///
9976 ///Each `CalibratedTimestampInfoKHR` specifies a time domain
9977 ///(e.g., `DEVICE`, `CLOCK_MONOTONIC`, `CLOCK_MONOTONIC_RAW`,
9978 ///`QUERY_PERFORMANCE_COUNTER`). All requested timestamps are
9979 ///sampled as close together as possible.
9980 ///
9981 ///The returned `max_deviation` (in nanoseconds) bounds how far
9982 ///apart the samples could be, smaller is better. If deviation
9983 ///is too large, retry the call.
9984 ///
9985 ///Query available time domains first with
9986 ///`get_physical_device_calibrateable_time_domains_khr`.
9987 pub unsafe fn get_calibrated_timestamps_khr(
9988 &self,
9989 p_timestamp_infos: &[CalibratedTimestampInfoKHR],
9990 p_max_deviation: *mut u64,
9991 ) -> VkResult<Vec<u64>> {
9992 let fp = self
9993 .commands()
9994 .get_calibrated_timestamps_khr
9995 .expect("vkGetCalibratedTimestampsKHR not loaded");
9996 let count = p_timestamp_infos.len();
9997 let mut out = vec![unsafe { core::mem::zeroed() }; count];
9998 check(unsafe {
9999 fp(
10000 self.handle(),
10001 p_timestamp_infos.len() as u32,
10002 p_timestamp_infos.as_ptr(),
10003 out.as_mut_ptr(),
10004 p_max_deviation,
10005 )
10006 })?;
10007 Ok(out)
10008 }
10009 ///Wraps [`vkSetDebugUtilsObjectNameEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetDebugUtilsObjectNameEXT.html).
10010 /**
10011 Provided by **VK_EXT_debug_utils**.*/
10012 ///
10013 ///# Errors
10014 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
10015 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
10016 ///- `VK_ERROR_UNKNOWN`
10017 ///- `VK_ERROR_VALIDATION_FAILED`
10018 ///
10019 ///# Safety
10020 ///- `device` (self) must be valid and not destroyed.
10021 ///- `pNameInfo` must be externally synchronized.
10022 ///
10023 ///# Panics
10024 ///Panics if `vkSetDebugUtilsObjectNameEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10025 ///
10026 ///# Usage Notes
10027 ///
10028 ///Assigns a human-readable name to any Vulkan object. The name
10029 ///appears in validation layer messages, GPU debuggers (RenderDoc,
10030 ///Nsight), and crash reports.
10031 ///
10032 ///`DebugUtilsObjectNameInfoEXT` specifies the object type, handle,
10033 ///and a null-terminated UTF-8 name string.
10034 ///
10035 ///Set the name to null to remove a previously assigned name.
10036 ///
10037 ///This is the most impactful debugging tool in Vulkan, name
10038 ///every object you create.
10039 ///
10040 ///Requires `VK_EXT_debug_utils`.
10041 pub unsafe fn set_debug_utils_object_name_ext(
10042 &self,
10043 p_name_info: &DebugUtilsObjectNameInfoEXT,
10044 ) -> VkResult<()> {
10045 let fp = self
10046 .commands()
10047 .set_debug_utils_object_name_ext
10048 .expect("vkSetDebugUtilsObjectNameEXT not loaded");
10049 check(unsafe { fp(self.handle(), p_name_info) })
10050 }
10051 ///Wraps [`vkSetDebugUtilsObjectTagEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetDebugUtilsObjectTagEXT.html).
10052 /**
10053 Provided by **VK_EXT_debug_utils**.*/
10054 ///
10055 ///# Errors
10056 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
10057 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
10058 ///- `VK_ERROR_UNKNOWN`
10059 ///- `VK_ERROR_VALIDATION_FAILED`
10060 ///
10061 ///# Safety
10062 ///- `device` (self) must be valid and not destroyed.
10063 ///
10064 ///# Panics
10065 ///Panics if `vkSetDebugUtilsObjectTagEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10066 ///
10067 ///# Usage Notes
10068 ///
10069 ///Attaches arbitrary binary data to a Vulkan object. Unlike
10070 ///`set_debug_utils_object_name_ext` (which sets a string),
10071 ///tags carry opaque byte data identified by a `tag_name` (u64).
10072 ///
10073 ///Tags are consumed by debugging tools and layers that understand
10074 ///the specific `tag_name` value. Most applications only need
10075 ///`set_debug_utils_object_name_ext`, use tags for tool-specific
10076 ///metadata.
10077 ///
10078 ///Requires `VK_EXT_debug_utils`.
10079 pub unsafe fn set_debug_utils_object_tag_ext(
10080 &self,
10081 p_tag_info: &DebugUtilsObjectTagInfoEXT,
10082 ) -> VkResult<()> {
10083 let fp = self
10084 .commands()
10085 .set_debug_utils_object_tag_ext
10086 .expect("vkSetDebugUtilsObjectTagEXT not loaded");
10087 check(unsafe { fp(self.handle(), p_tag_info) })
10088 }
10089 ///Wraps [`vkQueueBeginDebugUtilsLabelEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueBeginDebugUtilsLabelEXT.html).
10090 /**
10091 Provided by **VK_EXT_debug_utils**.*/
10092 ///
10093 ///# Safety
10094 ///- `queue` (self) must be valid and not destroyed.
10095 ///- `queue` must be externally synchronized.
10096 ///
10097 ///# Panics
10098 ///Panics if `vkQueueBeginDebugUtilsLabelEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10099 ///
10100 ///# Usage Notes
10101 ///
10102 ///Opens a debug label region on a queue. All submissions between
10103 ///this call and the matching `queue_end_debug_utils_label_ext` are
10104 ///grouped under the label in GPU debuggers.
10105 ///
10106 ///Unlike `cmd_begin_debug_utils_label_ext` (which operates inside
10107 ///a command buffer), this groups entire queue submissions.
10108 ///
10109 ///Requires `VK_EXT_debug_utils`.
10110 pub unsafe fn queue_begin_debug_utils_label_ext(
10111 &self,
10112 queue: Queue,
10113 p_label_info: &DebugUtilsLabelEXT,
10114 ) {
10115 let fp = self
10116 .commands()
10117 .queue_begin_debug_utils_label_ext
10118 .expect("vkQueueBeginDebugUtilsLabelEXT not loaded");
10119 unsafe { fp(queue, p_label_info) };
10120 }
10121 ///Wraps [`vkQueueEndDebugUtilsLabelEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueEndDebugUtilsLabelEXT.html).
10122 /**
10123 Provided by **VK_EXT_debug_utils**.*/
10124 ///
10125 ///# Safety
10126 ///- `queue` (self) must be valid and not destroyed.
10127 ///- `queue` must be externally synchronized.
10128 ///
10129 ///# Panics
10130 ///Panics if `vkQueueEndDebugUtilsLabelEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10131 ///
10132 ///# Usage Notes
10133 ///
10134 ///Closes the most recently opened debug label region on the queue.
10135 ///Must be paired with a prior `queue_begin_debug_utils_label_ext`
10136 ///on the same queue.
10137 ///
10138 ///Requires `VK_EXT_debug_utils`.
10139 pub unsafe fn queue_end_debug_utils_label_ext(&self, queue: Queue) {
10140 let fp = self
10141 .commands()
10142 .queue_end_debug_utils_label_ext
10143 .expect("vkQueueEndDebugUtilsLabelEXT not loaded");
10144 unsafe { fp(queue) };
10145 }
10146 ///Wraps [`vkQueueInsertDebugUtilsLabelEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueInsertDebugUtilsLabelEXT.html).
10147 /**
10148 Provided by **VK_EXT_debug_utils**.*/
10149 ///
10150 ///# Safety
10151 ///- `queue` (self) must be valid and not destroyed.
10152 ///- `queue` must be externally synchronized.
10153 ///
10154 ///# Panics
10155 ///Panics if `vkQueueInsertDebugUtilsLabelEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10156 ///
10157 ///# Usage Notes
10158 ///
10159 ///Inserts a single-point debug label on a queue. Marks a specific
10160 ///moment in the queue's submission timeline without opening a
10161 ///begin/end region.
10162 ///
10163 ///Requires `VK_EXT_debug_utils`.
10164 pub unsafe fn queue_insert_debug_utils_label_ext(
10165 &self,
10166 queue: Queue,
10167 p_label_info: &DebugUtilsLabelEXT,
10168 ) {
10169 let fp = self
10170 .commands()
10171 .queue_insert_debug_utils_label_ext
10172 .expect("vkQueueInsertDebugUtilsLabelEXT not loaded");
10173 unsafe { fp(queue, p_label_info) };
10174 }
10175 ///Wraps [`vkCmdBeginDebugUtilsLabelEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginDebugUtilsLabelEXT.html).
10176 /**
10177 Provided by **VK_EXT_debug_utils**.*/
10178 ///
10179 ///# Safety
10180 ///- `commandBuffer` (self) must be valid and not destroyed.
10181 ///- `commandBuffer` must be externally synchronized.
10182 ///
10183 ///# Panics
10184 ///Panics if `vkCmdBeginDebugUtilsLabelEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10185 ///
10186 ///# Usage Notes
10187 ///
10188 ///Opens a debug label region in a command buffer. All commands
10189 ///recorded between this call and the matching
10190 ///`cmd_end_debug_utils_label_ext` are grouped under the label in
10191 ///GPU debuggers (RenderDoc, Nsight).
10192 ///
10193 ///`DebugUtilsLabelEXT` specifies a name and optional RGBA color
10194 ///for the region.
10195 ///
10196 ///Labels can nest. Every begin must have a matching end within the
10197 ///same command buffer.
10198 ///
10199 ///Requires `VK_EXT_debug_utils`.
10200 pub unsafe fn cmd_begin_debug_utils_label_ext(
10201 &self,
10202 command_buffer: CommandBuffer,
10203 p_label_info: &DebugUtilsLabelEXT,
10204 ) {
10205 let fp = self
10206 .commands()
10207 .cmd_begin_debug_utils_label_ext
10208 .expect("vkCmdBeginDebugUtilsLabelEXT not loaded");
10209 unsafe { fp(command_buffer, p_label_info) };
10210 }
10211 ///Wraps [`vkCmdEndDebugUtilsLabelEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndDebugUtilsLabelEXT.html).
10212 /**
10213 Provided by **VK_EXT_debug_utils**.*/
10214 ///
10215 ///# Safety
10216 ///- `commandBuffer` (self) must be valid and not destroyed.
10217 ///- `commandBuffer` must be externally synchronized.
10218 ///
10219 ///# Panics
10220 ///Panics if `vkCmdEndDebugUtilsLabelEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10221 ///
10222 ///# Usage Notes
10223 ///
10224 ///Closes the most recently opened debug label region in the command
10225 ///buffer. Must be paired with a prior `cmd_begin_debug_utils_label_ext`
10226 ///in the same command buffer.
10227 ///
10228 ///Requires `VK_EXT_debug_utils`.
10229 pub unsafe fn cmd_end_debug_utils_label_ext(&self, command_buffer: CommandBuffer) {
10230 let fp = self
10231 .commands()
10232 .cmd_end_debug_utils_label_ext
10233 .expect("vkCmdEndDebugUtilsLabelEXT not loaded");
10234 unsafe { fp(command_buffer) };
10235 }
10236 ///Wraps [`vkCmdInsertDebugUtilsLabelEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdInsertDebugUtilsLabelEXT.html).
10237 /**
10238 Provided by **VK_EXT_debug_utils**.*/
10239 ///
10240 ///# Safety
10241 ///- `commandBuffer` (self) must be valid and not destroyed.
10242 ///- `commandBuffer` must be externally synchronized.
10243 ///
10244 ///# Panics
10245 ///Panics if `vkCmdInsertDebugUtilsLabelEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10246 ///
10247 ///# Usage Notes
10248 ///
10249 ///Inserts a single-point debug label into the command buffer
10250 ///(as opposed to a begin/end region). Useful for marking specific
10251 ///events like "shadow pass complete" or "post-process start" that
10252 ///don't span a range of commands.
10253 ///
10254 ///Appears as a marker in GPU debuggers (RenderDoc, Nsight).
10255 ///
10256 ///Requires `VK_EXT_debug_utils`.
10257 pub unsafe fn cmd_insert_debug_utils_label_ext(
10258 &self,
10259 command_buffer: CommandBuffer,
10260 p_label_info: &DebugUtilsLabelEXT,
10261 ) {
10262 let fp = self
10263 .commands()
10264 .cmd_insert_debug_utils_label_ext
10265 .expect("vkCmdInsertDebugUtilsLabelEXT not loaded");
10266 unsafe { fp(command_buffer, p_label_info) };
10267 }
10268 ///Wraps [`vkGetMemoryHostPointerPropertiesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryHostPointerPropertiesEXT.html).
10269 /**
10270 Provided by **VK_EXT_external_memory_host**.*/
10271 ///
10272 ///# Errors
10273 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
10274 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
10275 ///- `VK_ERROR_UNKNOWN`
10276 ///- `VK_ERROR_VALIDATION_FAILED`
10277 ///
10278 ///# Safety
10279 ///- `device` (self) must be valid and not destroyed.
10280 ///
10281 ///# Panics
10282 ///Panics if `vkGetMemoryHostPointerPropertiesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10283 ///
10284 ///# Usage Notes
10285 ///
10286 ///Queries which memory types are compatible with importing a host
10287 ///pointer as external memory. Use this before allocating device
10288 ///memory backed by a host-allocated buffer to determine valid
10289 ///memory type bits.
10290 ///
10291 ///Requires `VK_EXT_external_memory_host`.
10292 pub unsafe fn get_memory_host_pointer_properties_ext(
10293 &self,
10294 handle_type: ExternalMemoryHandleTypeFlagBits,
10295 p_host_pointer: *const core::ffi::c_void,
10296 p_memory_host_pointer_properties: &mut MemoryHostPointerPropertiesEXT,
10297 ) -> VkResult<()> {
10298 let fp = self
10299 .commands()
10300 .get_memory_host_pointer_properties_ext
10301 .expect("vkGetMemoryHostPointerPropertiesEXT not loaded");
10302 check(unsafe {
10303 fp(
10304 self.handle(),
10305 handle_type,
10306 p_host_pointer,
10307 p_memory_host_pointer_properties,
10308 )
10309 })
10310 }
10311 ///Wraps [`vkCmdWriteBufferMarkerAMD`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWriteBufferMarkerAMD.html).
10312 /**
10313 Provided by **VK_AMD_buffer_marker**.*/
10314 ///
10315 ///# Safety
10316 ///- `commandBuffer` (self) must be valid and not destroyed.
10317 ///- `commandBuffer` must be externally synchronized.
10318 ///
10319 ///# Panics
10320 ///Panics if `vkCmdWriteBufferMarkerAMD` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10321 ///
10322 ///# Usage Notes
10323 ///
10324 ///Writes a 32-bit marker value into a buffer after a specified
10325 ///pipeline stage completes. Useful for fine-grained GPU progress
10326 ///tracking and debugging GPU hangs by identifying the last
10327 ///completed stage.
10328 ///
10329 ///Requires `VK_AMD_buffer_marker`.
10330 pub unsafe fn cmd_write_buffer_marker_amd(
10331 &self,
10332 command_buffer: CommandBuffer,
10333 pipeline_stage: PipelineStageFlagBits,
10334 dst_buffer: Buffer,
10335 dst_offset: u64,
10336 marker: u32,
10337 ) {
10338 let fp = self
10339 .commands()
10340 .cmd_write_buffer_marker_amd
10341 .expect("vkCmdWriteBufferMarkerAMD not loaded");
10342 unsafe {
10343 fp(
10344 command_buffer,
10345 pipeline_stage,
10346 dst_buffer,
10347 dst_offset,
10348 marker,
10349 )
10350 };
10351 }
10352 ///Wraps [`vkCreateRenderPass2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateRenderPass2.html).
10353 /**
10354 Provided by **VK_GRAPHICS_VERSION_1_2**.*/
10355 ///
10356 ///# Errors
10357 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
10358 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
10359 ///- `VK_ERROR_UNKNOWN`
10360 ///- `VK_ERROR_VALIDATION_FAILED`
10361 ///
10362 ///# Safety
10363 ///- `device` (self) must be valid and not destroyed.
10364 ///
10365 ///# Panics
10366 ///Panics if `vkCreateRenderPass2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10367 ///
10368 ///# Usage Notes
10369 ///
10370 ///Vulkan 1.2 version of `create_render_pass` that uses extensible
10371 ///`RenderPassCreateInfo2`, `AttachmentDescription2`,
10372 ///`SubpassDescription2`, and `SubpassDependency2` structs.
10373 ///
10374 ///Key additions over the 1.0 version:
10375 ///
10376 ///- **View masks**: `SubpassDescription2::view_mask` enables multiview
10377 /// rendering where a single draw call renders to multiple layers
10378 /// simultaneously (e.g. VR left/right eyes).
10379 ///- **Fragment density map**: chain
10380 /// `RenderPassFragmentDensityMapCreateInfoEXT` for variable-rate
10381 /// shading via density maps.
10382 ///- **Depth/stencil resolve**: `SubpassDescriptionDepthStencilResolve`
10383 /// enables automatic depth/stencil resolve at the end of a subpass.
10384 ///
10385 ///Prefer this over `create_render_pass` when targeting Vulkan 1.2+.
10386 ///For Vulkan 1.3+, consider dynamic rendering (`cmd_begin_rendering`)
10387 ///which avoids render pass objects entirely.
10388 pub unsafe fn create_render_pass2(
10389 &self,
10390 p_create_info: &RenderPassCreateInfo2,
10391 allocator: Option<&AllocationCallbacks>,
10392 ) -> VkResult<RenderPass> {
10393 let fp = self
10394 .commands()
10395 .create_render_pass2
10396 .expect("vkCreateRenderPass2 not loaded");
10397 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
10398 let mut out = unsafe { core::mem::zeroed() };
10399 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
10400 Ok(out)
10401 }
10402 ///Wraps [`vkCmdBeginRenderPass2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginRenderPass2.html).
10403 /**
10404 Provided by **VK_GRAPHICS_VERSION_1_2**.*/
10405 ///
10406 ///# Safety
10407 ///- `commandBuffer` (self) must be valid and not destroyed.
10408 ///- `commandBuffer` must be externally synchronized.
10409 ///
10410 ///# Panics
10411 ///Panics if `vkCmdBeginRenderPass2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10412 ///
10413 ///# Usage Notes
10414 ///
10415 ///Vulkan 1.2 version of `cmd_begin_render_pass` that takes an
10416 ///additional `SubpassBeginInfo` parameter specifying the subpass
10417 ///contents mode.
10418 ///
10419 ///The extensible structs allow chaining `RenderPassAttachmentBeginInfo`
10420 ///for imageless framebuffers, concrete image views are supplied at
10421 ///begin time rather than at framebuffer creation time.
10422 ///
10423 ///Prefer this over `cmd_begin_render_pass` when targeting Vulkan 1.2+.
10424 ///For Vulkan 1.3+, consider `cmd_begin_rendering` (dynamic rendering)
10425 ///which eliminates render pass and framebuffer objects entirely.
10426 pub unsafe fn cmd_begin_render_pass2(
10427 &self,
10428 command_buffer: CommandBuffer,
10429 p_render_pass_begin: &RenderPassBeginInfo,
10430 p_subpass_begin_info: &SubpassBeginInfo,
10431 ) {
10432 let fp = self
10433 .commands()
10434 .cmd_begin_render_pass2
10435 .expect("vkCmdBeginRenderPass2 not loaded");
10436 unsafe { fp(command_buffer, p_render_pass_begin, p_subpass_begin_info) };
10437 }
10438 ///Wraps [`vkCmdNextSubpass2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdNextSubpass2.html).
10439 /**
10440 Provided by **VK_GRAPHICS_VERSION_1_2**.*/
10441 ///
10442 ///# Safety
10443 ///- `commandBuffer` (self) must be valid and not destroyed.
10444 ///- `commandBuffer` must be externally synchronized.
10445 ///
10446 ///# Panics
10447 ///Panics if `vkCmdNextSubpass2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10448 ///
10449 ///# Usage Notes
10450 ///
10451 ///Vulkan 1.2 version of `cmd_next_subpass` that takes extensible
10452 ///`SubpassBeginInfo` and `SubpassEndInfo` structs.
10453 ///
10454 ///Functionally identical to `cmd_next_subpass`. Prefer this when
10455 ///targeting Vulkan 1.2+.
10456 pub unsafe fn cmd_next_subpass2(
10457 &self,
10458 command_buffer: CommandBuffer,
10459 p_subpass_begin_info: &SubpassBeginInfo,
10460 p_subpass_end_info: &SubpassEndInfo,
10461 ) {
10462 let fp = self
10463 .commands()
10464 .cmd_next_subpass2
10465 .expect("vkCmdNextSubpass2 not loaded");
10466 unsafe { fp(command_buffer, p_subpass_begin_info, p_subpass_end_info) };
10467 }
10468 ///Wraps [`vkCmdEndRenderPass2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndRenderPass2.html).
10469 /**
10470 Provided by **VK_GRAPHICS_VERSION_1_2**.*/
10471 ///
10472 ///# Safety
10473 ///- `commandBuffer` (self) must be valid and not destroyed.
10474 ///- `commandBuffer` must be externally synchronized.
10475 ///
10476 ///# Panics
10477 ///Panics if `vkCmdEndRenderPass2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10478 ///
10479 ///# Usage Notes
10480 ///
10481 ///Vulkan 1.2 version of `cmd_end_render_pass` that takes an extensible
10482 ///`SubpassEndInfo` struct.
10483 ///
10484 ///Functionally identical to `cmd_end_render_pass`. Prefer this when
10485 ///targeting Vulkan 1.2+.
10486 pub unsafe fn cmd_end_render_pass2(
10487 &self,
10488 command_buffer: CommandBuffer,
10489 p_subpass_end_info: &SubpassEndInfo,
10490 ) {
10491 let fp = self
10492 .commands()
10493 .cmd_end_render_pass2
10494 .expect("vkCmdEndRenderPass2 not loaded");
10495 unsafe { fp(command_buffer, p_subpass_end_info) };
10496 }
10497 ///Wraps [`vkGetSemaphoreCounterValue`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSemaphoreCounterValue.html).
10498 /**
10499 Provided by **VK_BASE_VERSION_1_2**.*/
10500 ///
10501 ///# Errors
10502 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
10503 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
10504 ///- `VK_ERROR_DEVICE_LOST`
10505 ///- `VK_ERROR_UNKNOWN`
10506 ///- `VK_ERROR_VALIDATION_FAILED`
10507 ///
10508 ///# Safety
10509 ///- `device` (self) must be valid and not destroyed.
10510 ///
10511 ///# Panics
10512 ///Panics if `vkGetSemaphoreCounterValue` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10513 ///
10514 ///# Usage Notes
10515 ///
10516 ///Returns the current counter value of a timeline semaphore. Timeline
10517 ///semaphores (Vulkan 1.2) use a monotonically increasing 64-bit
10518 ///counter instead of binary signaled/unsignaled state.
10519 ///
10520 ///Use this for non-blocking progress checks:
10521 ///
10522 ///```text
10523 ///let value = get_semaphore_counter_value(semaphore);
10524 ///if value >= expected_frame {
10525 /// // GPU has finished frame N, safe to reuse resources
10526 ///}
10527 ///```
10528 ///
10529 ///For blocking waits, use `wait_semaphores`. For signaling from the
10530 ///CPU, use `signal_semaphore`.
10531 ///
10532 ///Only valid for semaphores created with `SEMAPHORE_TYPE_TIMELINE`.
10533 ///Calling this on a binary semaphore is an error.
10534 pub unsafe fn get_semaphore_counter_value(&self, semaphore: Semaphore) -> VkResult<u64> {
10535 let fp = self
10536 .commands()
10537 .get_semaphore_counter_value
10538 .expect("vkGetSemaphoreCounterValue not loaded");
10539 let mut out = unsafe { core::mem::zeroed() };
10540 check(unsafe { fp(self.handle(), semaphore, &mut out) })?;
10541 Ok(out)
10542 }
10543 ///Wraps [`vkWaitSemaphores`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkWaitSemaphores.html).
10544 /**
10545 Provided by **VK_BASE_VERSION_1_2**.*/
10546 ///
10547 ///# Errors
10548 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
10549 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
10550 ///- `VK_ERROR_DEVICE_LOST`
10551 ///- `VK_ERROR_UNKNOWN`
10552 ///- `VK_ERROR_VALIDATION_FAILED`
10553 ///
10554 ///# Safety
10555 ///- `device` (self) must be valid and not destroyed.
10556 ///
10557 ///# Panics
10558 ///Panics if `vkWaitSemaphores` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10559 ///
10560 ///# Usage Notes
10561 ///
10562 ///Blocks the calling thread until one or all of the specified timeline
10563 ///semaphores reach their target values, or until the timeout expires.
10564 ///
10565 ///**`SemaphoreWaitInfo` flags**:
10566 ///
10567 ///- `SEMAPHORE_WAIT_ANY`: return when *any* semaphore reaches its
10568 /// target. Without this flag, waits for *all* semaphores.
10569 ///
10570 ///**Timeout**: in nanoseconds. `u64::MAX` for indefinite. Zero for a
10571 ///non-blocking poll.
10572 ///
10573 ///Timeline semaphore waits are the CPU-side counterpart to
10574 ///`queue_submit` timeline waits. They replace many fence-based
10575 ///synchronisation patterns with a single, more flexible primitive.
10576 ///
10577 ///```text
10578 #[doc = "// Wait for frame N to complete on the GPU"]
10579 ///let info = SemaphoreWaitInfo::builder()
10580 /// .semaphores(&[timeline_sem])
10581 /// .values(&[frame_number]);
10582 ///wait_semaphores(&info, u64::MAX);
10583 ///```
10584 ///
10585 ///Only valid for semaphores created with `SEMAPHORE_TYPE_TIMELINE`.
10586 pub unsafe fn wait_semaphores(
10587 &self,
10588 p_wait_info: &SemaphoreWaitInfo,
10589 timeout: u64,
10590 ) -> VkResult<()> {
10591 let fp = self
10592 .commands()
10593 .wait_semaphores
10594 .expect("vkWaitSemaphores not loaded");
10595 check(unsafe { fp(self.handle(), p_wait_info, timeout) })
10596 }
10597 ///Wraps [`vkSignalSemaphore`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSignalSemaphore.html).
10598 /**
10599 Provided by **VK_BASE_VERSION_1_2**.*/
10600 ///
10601 ///# Errors
10602 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
10603 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
10604 ///- `VK_ERROR_UNKNOWN`
10605 ///- `VK_ERROR_VALIDATION_FAILED`
10606 ///
10607 ///# Safety
10608 ///- `device` (self) must be valid and not destroyed.
10609 ///
10610 ///# Panics
10611 ///Panics if `vkSignalSemaphore` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10612 ///
10613 ///# Usage Notes
10614 ///
10615 ///Signals a timeline semaphore from the host (CPU), advancing its
10616 ///counter to the specified value. The value must be greater than the
10617 ///current counter value.
10618 ///
10619 ///Use this to unblock GPU work that is waiting on the semaphore via
10620 ///`queue_submit`. For example, a CPU-side data preparation step can
10621 ///signal a timeline semaphore when data is ready, and the GPU waits on
10622 ///it before processing.
10623 ///
10624 ///Only valid for semaphores created with `SEMAPHORE_TYPE_TIMELINE`.
10625 ///
10626 ///Timeline semaphores replace many use cases that previously required
10627 ///fences, they can be waited on from both the CPU (`wait_semaphores`)
10628 ///and the GPU (`queue_submit`).
10629 pub unsafe fn signal_semaphore(&self, p_signal_info: &SemaphoreSignalInfo) -> VkResult<()> {
10630 let fp = self
10631 .commands()
10632 .signal_semaphore
10633 .expect("vkSignalSemaphore not loaded");
10634 check(unsafe { fp(self.handle(), p_signal_info) })
10635 }
10636 ///Wraps [`vkGetAndroidHardwareBufferPropertiesANDROID`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetAndroidHardwareBufferPropertiesANDROID.html).
10637 /**
10638 Provided by **VK_ANDROID_external_memory_android_hardware_buffer**.*/
10639 ///
10640 ///# Errors
10641 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
10642 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR`
10643 ///- `VK_ERROR_UNKNOWN`
10644 ///- `VK_ERROR_VALIDATION_FAILED`
10645 ///
10646 ///# Safety
10647 ///- `device` (self) must be valid and not destroyed.
10648 ///
10649 ///# Panics
10650 ///Panics if `vkGetAndroidHardwareBufferPropertiesANDROID` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10651 ///
10652 ///# Usage Notes
10653 ///
10654 ///Queries the Vulkan memory properties (memory type bits, size)
10655 ///for an Android `AHardwareBuffer`. Use before importing the
10656 ///buffer as Vulkan memory. Android only.
10657 ///
10658 ///Requires `VK_ANDROID_external_memory_android_hardware_buffer`.
10659 pub unsafe fn get_android_hardware_buffer_properties_android(
10660 &self,
10661 buffer: *const core::ffi::c_void,
10662 p_properties: &mut AndroidHardwareBufferPropertiesANDROID,
10663 ) -> VkResult<()> {
10664 let fp = self
10665 .commands()
10666 .get_android_hardware_buffer_properties_android
10667 .expect("vkGetAndroidHardwareBufferPropertiesANDROID not loaded");
10668 check(unsafe { fp(self.handle(), buffer, p_properties) })
10669 }
10670 ///Wraps [`vkGetMemoryAndroidHardwareBufferANDROID`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryAndroidHardwareBufferANDROID.html).
10671 /**
10672 Provided by **VK_ANDROID_external_memory_android_hardware_buffer**.*/
10673 ///
10674 ///# Errors
10675 ///- `VK_ERROR_TOO_MANY_OBJECTS`
10676 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
10677 ///- `VK_ERROR_UNKNOWN`
10678 ///- `VK_ERROR_VALIDATION_FAILED`
10679 ///
10680 ///# Safety
10681 ///- `device` (self) must be valid and not destroyed.
10682 ///
10683 ///# Panics
10684 ///Panics if `vkGetMemoryAndroidHardwareBufferANDROID` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10685 ///
10686 ///# Usage Notes
10687 ///
10688 ///Exports a Vulkan device memory allocation as an Android
10689 ///`AHardwareBuffer` for sharing with other Android APIs (camera,
10690 ///media codec, SurfaceFlinger). Android only.
10691 ///
10692 ///Requires `VK_ANDROID_external_memory_android_hardware_buffer`.
10693 pub unsafe fn get_memory_android_hardware_buffer_android(
10694 &self,
10695 p_info: &MemoryGetAndroidHardwareBufferInfoANDROID,
10696 p_buffer: *mut *mut core::ffi::c_void,
10697 ) -> VkResult<()> {
10698 let fp = self
10699 .commands()
10700 .get_memory_android_hardware_buffer_android
10701 .expect("vkGetMemoryAndroidHardwareBufferANDROID not loaded");
10702 check(unsafe { fp(self.handle(), p_info, p_buffer) })
10703 }
10704 ///Wraps [`vkCmdDrawIndirectCount`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndirectCount.html).
10705 /**
10706 Provided by **VK_GRAPHICS_VERSION_1_2**.*/
10707 ///
10708 ///# Safety
10709 ///- `commandBuffer` (self) must be valid and not destroyed.
10710 ///- `commandBuffer` must be externally synchronized.
10711 ///
10712 ///# Panics
10713 ///Panics if `vkCmdDrawIndirectCount` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10714 ///
10715 ///# Usage Notes
10716 ///
10717 ///Draws non-indexed geometry with both the draw parameters and the
10718 ///draw **count** read from GPU buffers. The non-indexed counterpart to
10719 ///`cmd_draw_indexed_indirect_count`.
10720 ///
10721 ///See `cmd_draw_indexed_indirect_count` for a full explanation of the
10722 ///GPU-driven rendering pattern. The only difference is that this
10723 ///command reads `DrawIndirectCommand` entries instead of
10724 ///`DrawIndexedIndirectCommand`.
10725 ///
10726 ///Core in Vulkan 1.2. Previously available via
10727 ///`VK_KHR_draw_indirect_count`.
10728 pub unsafe fn cmd_draw_indirect_count(
10729 &self,
10730 command_buffer: CommandBuffer,
10731 buffer: Buffer,
10732 offset: u64,
10733 count_buffer: Buffer,
10734 count_buffer_offset: u64,
10735 max_draw_count: u32,
10736 stride: u32,
10737 ) {
10738 let fp = self
10739 .commands()
10740 .cmd_draw_indirect_count
10741 .expect("vkCmdDrawIndirectCount not loaded");
10742 unsafe {
10743 fp(
10744 command_buffer,
10745 buffer,
10746 offset,
10747 count_buffer,
10748 count_buffer_offset,
10749 max_draw_count,
10750 stride,
10751 )
10752 };
10753 }
10754 ///Wraps [`vkCmdDrawIndexedIndirectCount`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndexedIndirectCount.html).
10755 /**
10756 Provided by **VK_GRAPHICS_VERSION_1_2**.*/
10757 ///
10758 ///# Safety
10759 ///- `commandBuffer` (self) must be valid and not destroyed.
10760 ///- `commandBuffer` must be externally synchronized.
10761 ///
10762 ///# Panics
10763 ///Panics if `vkCmdDrawIndexedIndirectCount` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10764 ///
10765 ///# Usage Notes
10766 ///
10767 ///Draws indexed geometry with both the draw parameters and the draw
10768 ///**count** read from GPU buffers. The `count_buffer` contains a
10769 ///`u32` that limits how many `DrawIndexedIndirectCommand` entries from
10770 ///the main buffer are actually executed, up to `max_draw_count`.
10771 ///
10772 ///This is the key primitive for GPU-driven rendering pipelines: a
10773 ///compute shader fills an indirect buffer and writes the surviving
10774 ///draw count after culling. The CPU does not need to know the count.
10775 ///
10776 ///The main buffer must have `BUFFER_USAGE_INDIRECT_BUFFER`. The count
10777 ///buffer must also have `BUFFER_USAGE_INDIRECT_BUFFER`. The count
10778 ///offset must be a multiple of 4.
10779 ///
10780 ///Core in Vulkan 1.2. Previously available via
10781 ///`VK_KHR_draw_indirect_count`.
10782 pub unsafe fn cmd_draw_indexed_indirect_count(
10783 &self,
10784 command_buffer: CommandBuffer,
10785 buffer: Buffer,
10786 offset: u64,
10787 count_buffer: Buffer,
10788 count_buffer_offset: u64,
10789 max_draw_count: u32,
10790 stride: u32,
10791 ) {
10792 let fp = self
10793 .commands()
10794 .cmd_draw_indexed_indirect_count
10795 .expect("vkCmdDrawIndexedIndirectCount not loaded");
10796 unsafe {
10797 fp(
10798 command_buffer,
10799 buffer,
10800 offset,
10801 count_buffer,
10802 count_buffer_offset,
10803 max_draw_count,
10804 stride,
10805 )
10806 };
10807 }
10808 ///Wraps [`vkCmdSetCheckpointNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetCheckpointNV.html).
10809 /**
10810 Provided by **VK_NV_device_diagnostic_checkpoints**.*/
10811 ///
10812 ///# Safety
10813 ///- `commandBuffer` (self) must be valid and not destroyed.
10814 ///- `commandBuffer` must be externally synchronized.
10815 ///
10816 ///# Panics
10817 ///Panics if `vkCmdSetCheckpointNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10818 ///
10819 ///# Usage Notes
10820 ///
10821 ///Inserts a checkpoint marker into the command buffer for
10822 ///diagnostic purposes. If the device is lost, the most recently
10823 ///executed checkpoint can be retrieved with
10824 ///`get_queue_checkpoint_data_nv` to identify which commands
10825 ///completed before the failure.
10826 ///
10827 ///Requires `VK_NV_device_diagnostic_checkpoints`.
10828 pub unsafe fn cmd_set_checkpoint_nv(
10829 &self,
10830 command_buffer: CommandBuffer,
10831 p_checkpoint_marker: *const core::ffi::c_void,
10832 ) {
10833 let fp = self
10834 .commands()
10835 .cmd_set_checkpoint_nv
10836 .expect("vkCmdSetCheckpointNV not loaded");
10837 unsafe { fp(command_buffer, p_checkpoint_marker) };
10838 }
10839 ///Wraps [`vkGetQueueCheckpointDataNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetQueueCheckpointDataNV.html).
10840 /**
10841 Provided by **VK_NV_device_diagnostic_checkpoints**.*/
10842 ///
10843 ///# Safety
10844 ///- `queue` (self) must be valid and not destroyed.
10845 ///
10846 ///# Panics
10847 ///Panics if `vkGetQueueCheckpointDataNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10848 ///
10849 ///# Usage Notes
10850 ///
10851 ///Retrieves the checkpoint markers that were most recently executed
10852 ///on a queue before a device-lost event. Use with
10853 ///`cmd_set_checkpoint_nv` for post-mortem debugging.
10854 ///
10855 ///Requires `VK_NV_device_diagnostic_checkpoints`.
10856 pub unsafe fn get_queue_checkpoint_data_nv(&self, queue: Queue) -> Vec<CheckpointDataNV> {
10857 let fp = self
10858 .commands()
10859 .get_queue_checkpoint_data_nv
10860 .expect("vkGetQueueCheckpointDataNV not loaded");
10861 fill_two_call(|count, data| unsafe { fp(queue, count, data) })
10862 }
10863 ///Wraps [`vkCmdBindTransformFeedbackBuffersEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindTransformFeedbackBuffersEXT.html).
10864 /**
10865 Provided by **VK_EXT_transform_feedback**.*/
10866 ///
10867 ///# Safety
10868 ///- `commandBuffer` (self) must be valid and not destroyed.
10869 ///- `commandBuffer` must be externally synchronized.
10870 ///
10871 ///# Panics
10872 ///Panics if `vkCmdBindTransformFeedbackBuffersEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10873 ///
10874 ///# Usage Notes
10875 ///
10876 ///Binds buffers for transform feedback output. Each binding slot
10877 ///receives vertex data streamed from the vertex or geometry shader
10878 ///during a transform feedback pass.
10879 ///
10880 ///`first_binding` is the first binding index. Arrays of buffers,
10881 ///offsets, and sizes specify the output targets.
10882 ///
10883 ///Must be called before `cmd_begin_transform_feedback_ext`.
10884 ///
10885 ///Requires `VK_EXT_transform_feedback`.
10886 pub unsafe fn cmd_bind_transform_feedback_buffers_ext(
10887 &self,
10888 command_buffer: CommandBuffer,
10889 first_binding: u32,
10890 p_buffers: &[Buffer],
10891 p_offsets: &[u64],
10892 p_sizes: &[u64],
10893 ) {
10894 let fp = self
10895 .commands()
10896 .cmd_bind_transform_feedback_buffers_ext
10897 .expect("vkCmdBindTransformFeedbackBuffersEXT not loaded");
10898 unsafe {
10899 fp(
10900 command_buffer,
10901 first_binding,
10902 p_buffers.len() as u32,
10903 p_buffers.as_ptr(),
10904 p_offsets.as_ptr(),
10905 p_sizes.as_ptr(),
10906 )
10907 };
10908 }
10909 ///Wraps [`vkCmdBeginTransformFeedbackEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginTransformFeedbackEXT.html).
10910 /**
10911 Provided by **VK_EXT_transform_feedback**.*/
10912 ///
10913 ///# Safety
10914 ///- `commandBuffer` (self) must be valid and not destroyed.
10915 ///- `commandBuffer` must be externally synchronized.
10916 ///
10917 ///# Panics
10918 ///Panics if `vkCmdBeginTransformFeedbackEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10919 ///
10920 ///# Usage Notes
10921 ///
10922 ///Begins a transform feedback pass. Vertex shader outputs (or
10923 ///geometry shader outputs) are written to transform feedback buffers
10924 ///previously bound with `cmd_bind_transform_feedback_buffers_ext`.
10925 ///
10926 ///`first_counter_buffer` and `p_counter_buffer_offsets` specify
10927 ///where to resume writing from (pass null offsets to start from
10928 ///scratch).
10929 ///
10930 ///End with `cmd_end_transform_feedback_ext`.
10931 ///
10932 ///Requires `VK_EXT_transform_feedback` and the
10933 ///`transformFeedback` feature.
10934 pub unsafe fn cmd_begin_transform_feedback_ext(
10935 &self,
10936 command_buffer: CommandBuffer,
10937 first_counter_buffer: u32,
10938 p_counter_buffers: &[Buffer],
10939 p_counter_buffer_offsets: &[u64],
10940 ) {
10941 let fp = self
10942 .commands()
10943 .cmd_begin_transform_feedback_ext
10944 .expect("vkCmdBeginTransformFeedbackEXT not loaded");
10945 unsafe {
10946 fp(
10947 command_buffer,
10948 first_counter_buffer,
10949 p_counter_buffers.len() as u32,
10950 p_counter_buffers.as_ptr(),
10951 p_counter_buffer_offsets.as_ptr(),
10952 )
10953 };
10954 }
10955 ///Wraps [`vkCmdEndTransformFeedbackEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndTransformFeedbackEXT.html).
10956 /**
10957 Provided by **VK_EXT_transform_feedback**.*/
10958 ///
10959 ///# Safety
10960 ///- `commandBuffer` (self) must be valid and not destroyed.
10961 ///- `commandBuffer` must be externally synchronized.
10962 ///
10963 ///# Panics
10964 ///Panics if `vkCmdEndTransformFeedbackEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10965 ///
10966 ///# Usage Notes
10967 ///
10968 ///Ends a transform feedback pass started with
10969 ///`cmd_begin_transform_feedback_ext`. Counter values are written
10970 ///back to the counter buffers so that a subsequent pass can resume
10971 ///where this one left off.
10972 ///
10973 ///Requires `VK_EXT_transform_feedback`.
10974 pub unsafe fn cmd_end_transform_feedback_ext(
10975 &self,
10976 command_buffer: CommandBuffer,
10977 first_counter_buffer: u32,
10978 p_counter_buffers: &[Buffer],
10979 p_counter_buffer_offsets: &[u64],
10980 ) {
10981 let fp = self
10982 .commands()
10983 .cmd_end_transform_feedback_ext
10984 .expect("vkCmdEndTransformFeedbackEXT not loaded");
10985 unsafe {
10986 fp(
10987 command_buffer,
10988 first_counter_buffer,
10989 p_counter_buffers.len() as u32,
10990 p_counter_buffers.as_ptr(),
10991 p_counter_buffer_offsets.as_ptr(),
10992 )
10993 };
10994 }
10995 ///Wraps [`vkCmdBeginQueryIndexedEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginQueryIndexedEXT.html).
10996 /**
10997 Provided by **VK_EXT_transform_feedback**.*/
10998 ///
10999 ///# Safety
11000 ///- `commandBuffer` (self) must be valid and not destroyed.
11001 ///- `commandBuffer` must be externally synchronized.
11002 ///
11003 ///# Panics
11004 ///Panics if `vkCmdBeginQueryIndexedEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11005 ///
11006 ///# Usage Notes
11007 ///
11008 ///Begins an indexed query, like `cmd_begin_query` but with an
11009 ///additional `index` parameter that selects which vertex stream
11010 ///to query when used with transform feedback statistics queries.
11011 ///
11012 ///For `QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT`, the index
11013 ///selects the stream (0–3). For other query types, index must be 0.
11014 ///
11015 ///End with `cmd_end_query_indexed_ext`.
11016 ///
11017 ///Requires `VK_EXT_transform_feedback`.
11018 pub unsafe fn cmd_begin_query_indexed_ext(
11019 &self,
11020 command_buffer: CommandBuffer,
11021 query_pool: QueryPool,
11022 query: u32,
11023 flags: QueryControlFlags,
11024 index: u32,
11025 ) {
11026 let fp = self
11027 .commands()
11028 .cmd_begin_query_indexed_ext
11029 .expect("vkCmdBeginQueryIndexedEXT not loaded");
11030 unsafe { fp(command_buffer, query_pool, query, flags, index) };
11031 }
11032 ///Wraps [`vkCmdEndQueryIndexedEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndQueryIndexedEXT.html).
11033 /**
11034 Provided by **VK_EXT_transform_feedback**.*/
11035 ///
11036 ///# Safety
11037 ///- `commandBuffer` (self) must be valid and not destroyed.
11038 ///- `commandBuffer` must be externally synchronized.
11039 ///
11040 ///# Panics
11041 ///Panics if `vkCmdEndQueryIndexedEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11042 ///
11043 ///# Usage Notes
11044 ///
11045 ///Ends an indexed query started with `cmd_begin_query_indexed_ext`.
11046 ///The `index` parameter must match the one used in the begin call.
11047 ///
11048 ///Requires `VK_EXT_transform_feedback`.
11049 pub unsafe fn cmd_end_query_indexed_ext(
11050 &self,
11051 command_buffer: CommandBuffer,
11052 query_pool: QueryPool,
11053 query: u32,
11054 index: u32,
11055 ) {
11056 let fp = self
11057 .commands()
11058 .cmd_end_query_indexed_ext
11059 .expect("vkCmdEndQueryIndexedEXT not loaded");
11060 unsafe { fp(command_buffer, query_pool, query, index) };
11061 }
11062 ///Wraps [`vkCmdDrawIndirectByteCountEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndirectByteCountEXT.html).
11063 /**
11064 Provided by **VK_EXT_transform_feedback**.*/
11065 ///
11066 ///# Safety
11067 ///- `commandBuffer` (self) must be valid and not destroyed.
11068 ///- `commandBuffer` must be externally synchronized.
11069 ///
11070 ///# Panics
11071 ///Panics if `vkCmdDrawIndirectByteCountEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11072 ///
11073 ///# Usage Notes
11074 ///
11075 ///Draws vertices using a byte count stored in a counter buffer
11076 ///(typically written by a transform feedback pass). The vertex
11077 ///count is computed as `counter_value / vertex_stride`.
11078 ///
11079 ///`counter_offset` accounts for any header bytes before the
11080 ///counter value in the buffer.
11081 ///
11082 ///Requires `VK_EXT_transform_feedback`.
11083 pub unsafe fn cmd_draw_indirect_byte_count_ext(
11084 &self,
11085 command_buffer: CommandBuffer,
11086 instance_count: u32,
11087 first_instance: u32,
11088 counter_buffer: Buffer,
11089 counter_buffer_offset: u64,
11090 counter_offset: u32,
11091 vertex_stride: u32,
11092 ) {
11093 let fp = self
11094 .commands()
11095 .cmd_draw_indirect_byte_count_ext
11096 .expect("vkCmdDrawIndirectByteCountEXT not loaded");
11097 unsafe {
11098 fp(
11099 command_buffer,
11100 instance_count,
11101 first_instance,
11102 counter_buffer,
11103 counter_buffer_offset,
11104 counter_offset,
11105 vertex_stride,
11106 )
11107 };
11108 }
11109 ///Wraps [`vkCmdSetExclusiveScissorNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetExclusiveScissorNV.html).
11110 /**
11111 Provided by **VK_NV_scissor_exclusive**.*/
11112 ///
11113 ///# Safety
11114 ///- `commandBuffer` (self) must be valid and not destroyed.
11115 ///- `commandBuffer` must be externally synchronized.
11116 ///
11117 ///# Panics
11118 ///Panics if `vkCmdSetExclusiveScissorNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11119 ///
11120 ///# Usage Notes
11121 ///
11122 ///Dynamically sets the exclusive scissor rectangles for one or
11123 ///more viewports. Fragments outside these rectangles are discarded
11124 ///when exclusive scissor testing is enabled.
11125 ///
11126 ///Requires `VK_NV_scissor_exclusive`.
11127 pub unsafe fn cmd_set_exclusive_scissor_nv(
11128 &self,
11129 command_buffer: CommandBuffer,
11130 first_exclusive_scissor: u32,
11131 p_exclusive_scissors: &[Rect2D],
11132 ) {
11133 let fp = self
11134 .commands()
11135 .cmd_set_exclusive_scissor_nv
11136 .expect("vkCmdSetExclusiveScissorNV not loaded");
11137 unsafe {
11138 fp(
11139 command_buffer,
11140 first_exclusive_scissor,
11141 p_exclusive_scissors.len() as u32,
11142 p_exclusive_scissors.as_ptr(),
11143 )
11144 };
11145 }
11146 ///Wraps [`vkCmdSetExclusiveScissorEnableNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetExclusiveScissorEnableNV.html).
11147 /**
11148 Provided by **VK_NV_scissor_exclusive**.*/
11149 ///
11150 ///# Safety
11151 ///- `commandBuffer` (self) must be valid and not destroyed.
11152 ///- `commandBuffer` must be externally synchronized.
11153 ///
11154 ///# Panics
11155 ///Panics if `vkCmdSetExclusiveScissorEnableNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11156 ///
11157 ///# Usage Notes
11158 ///
11159 ///Dynamically enables or disables the exclusive scissor test for
11160 ///one or more viewports. When enabled, fragments outside the
11161 ///exclusive scissor rectangle are discarded.
11162 ///
11163 ///Requires `VK_NV_scissor_exclusive`.
11164 pub unsafe fn cmd_set_exclusive_scissor_enable_nv(
11165 &self,
11166 command_buffer: CommandBuffer,
11167 first_exclusive_scissor: u32,
11168 p_exclusive_scissor_enables: &[u32],
11169 ) {
11170 let fp = self
11171 .commands()
11172 .cmd_set_exclusive_scissor_enable_nv
11173 .expect("vkCmdSetExclusiveScissorEnableNV not loaded");
11174 unsafe {
11175 fp(
11176 command_buffer,
11177 first_exclusive_scissor,
11178 p_exclusive_scissor_enables.len() as u32,
11179 p_exclusive_scissor_enables.as_ptr(),
11180 )
11181 };
11182 }
11183 ///Wraps [`vkCmdBindShadingRateImageNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindShadingRateImageNV.html).
11184 /**
11185 Provided by **VK_NV_shading_rate_image**.*/
11186 ///
11187 ///# Safety
11188 ///- `commandBuffer` (self) must be valid and not destroyed.
11189 ///- `commandBuffer` must be externally synchronized.
11190 ///
11191 ///# Panics
11192 ///Panics if `vkCmdBindShadingRateImageNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11193 ///
11194 ///# Usage Notes
11195 ///
11196 ///Binds a shading rate image that controls per-region fragment
11197 ///shading rate. Each texel in the image maps to a tile of the
11198 ///framebuffer and specifies the coarse shading rate for that tile.
11199 ///
11200 ///Requires `VK_NV_shading_rate_image`.
11201 pub unsafe fn cmd_bind_shading_rate_image_nv(
11202 &self,
11203 command_buffer: CommandBuffer,
11204 image_view: ImageView,
11205 image_layout: ImageLayout,
11206 ) {
11207 let fp = self
11208 .commands()
11209 .cmd_bind_shading_rate_image_nv
11210 .expect("vkCmdBindShadingRateImageNV not loaded");
11211 unsafe { fp(command_buffer, image_view, image_layout) };
11212 }
11213 ///Wraps [`vkCmdSetViewportShadingRatePaletteNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetViewportShadingRatePaletteNV.html).
11214 /**
11215 Provided by **VK_NV_shading_rate_image**.*/
11216 ///
11217 ///# Safety
11218 ///- `commandBuffer` (self) must be valid and not destroyed.
11219 ///- `commandBuffer` must be externally synchronized.
11220 ///
11221 ///# Panics
11222 ///Panics if `vkCmdSetViewportShadingRatePaletteNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11223 ///
11224 ///# Usage Notes
11225 ///
11226 ///Sets the shading rate palette for one or more viewports. The
11227 ///palette maps shading rate image texel values to actual shading
11228 ///rates (e.g., 1x1, 2x2, 4x4).
11229 ///
11230 ///Requires `VK_NV_shading_rate_image`.
11231 pub unsafe fn cmd_set_viewport_shading_rate_palette_nv(
11232 &self,
11233 command_buffer: CommandBuffer,
11234 first_viewport: u32,
11235 p_shading_rate_palettes: &[ShadingRatePaletteNV],
11236 ) {
11237 let fp = self
11238 .commands()
11239 .cmd_set_viewport_shading_rate_palette_nv
11240 .expect("vkCmdSetViewportShadingRatePaletteNV not loaded");
11241 unsafe {
11242 fp(
11243 command_buffer,
11244 first_viewport,
11245 p_shading_rate_palettes.len() as u32,
11246 p_shading_rate_palettes.as_ptr(),
11247 )
11248 };
11249 }
11250 ///Wraps [`vkCmdSetCoarseSampleOrderNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetCoarseSampleOrderNV.html).
11251 /**
11252 Provided by **VK_NV_shading_rate_image**.*/
11253 ///
11254 ///# Safety
11255 ///- `commandBuffer` (self) must be valid and not destroyed.
11256 ///- `commandBuffer` must be externally synchronized.
11257 ///
11258 ///# Panics
11259 ///Panics if `vkCmdSetCoarseSampleOrderNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11260 ///
11261 ///# Usage Notes
11262 ///
11263 ///Sets the sample ordering for coarse shading rate fragments. By
11264 ///default, the driver chooses sample order; use this to specify a
11265 ///custom order when the fragment shader relies on specific sample
11266 ///positions within coarse fragments.
11267 ///
11268 ///Requires `VK_NV_shading_rate_image`.
11269 pub unsafe fn cmd_set_coarse_sample_order_nv(
11270 &self,
11271 command_buffer: CommandBuffer,
11272 sample_order_type: CoarseSampleOrderTypeNV,
11273 p_custom_sample_orders: &[CoarseSampleOrderCustomNV],
11274 ) {
11275 let fp = self
11276 .commands()
11277 .cmd_set_coarse_sample_order_nv
11278 .expect("vkCmdSetCoarseSampleOrderNV not loaded");
11279 unsafe {
11280 fp(
11281 command_buffer,
11282 sample_order_type,
11283 p_custom_sample_orders.len() as u32,
11284 p_custom_sample_orders.as_ptr(),
11285 )
11286 };
11287 }
11288 ///Wraps [`vkCmdDrawMeshTasksNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMeshTasksNV.html).
11289 /**
11290 Provided by **VK_NV_mesh_shader**.*/
11291 ///
11292 ///# Safety
11293 ///- `commandBuffer` (self) must be valid and not destroyed.
11294 ///- `commandBuffer` must be externally synchronized.
11295 ///
11296 ///# Panics
11297 ///Panics if `vkCmdDrawMeshTasksNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11298 ///
11299 ///# Usage Notes
11300 ///
11301 ///Dispatches mesh shader work using the NV mesh shader model.
11302 ///Launches `task_count` task shader workgroups starting at
11303 ///`first_task`.
11304 ///
11305 ///This is the legacy NV path; prefer `cmd_draw_mesh_tasks_ext`
11306 ///for new code.
11307 ///
11308 ///Requires `VK_NV_mesh_shader`.
11309 pub unsafe fn cmd_draw_mesh_tasks_nv(
11310 &self,
11311 command_buffer: CommandBuffer,
11312 task_count: u32,
11313 first_task: u32,
11314 ) {
11315 let fp = self
11316 .commands()
11317 .cmd_draw_mesh_tasks_nv
11318 .expect("vkCmdDrawMeshTasksNV not loaded");
11319 unsafe { fp(command_buffer, task_count, first_task) };
11320 }
11321 ///Wraps [`vkCmdDrawMeshTasksIndirectNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMeshTasksIndirectNV.html).
11322 /**
11323 Provided by **VK_NV_mesh_shader**.*/
11324 ///
11325 ///# Safety
11326 ///- `commandBuffer` (self) must be valid and not destroyed.
11327 ///- `commandBuffer` must be externally synchronized.
11328 ///
11329 ///# Panics
11330 ///Panics if `vkCmdDrawMeshTasksIndirectNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11331 ///
11332 ///# Usage Notes
11333 ///
11334 ///Indirect variant of `cmd_draw_mesh_tasks_nv`. Reads draw
11335 ///parameters from a buffer, enabling GPU-driven mesh shader
11336 ///dispatch.
11337 ///
11338 ///Requires `VK_NV_mesh_shader`.
11339 pub unsafe fn cmd_draw_mesh_tasks_indirect_nv(
11340 &self,
11341 command_buffer: CommandBuffer,
11342 buffer: Buffer,
11343 offset: u64,
11344 draw_count: u32,
11345 stride: u32,
11346 ) {
11347 let fp = self
11348 .commands()
11349 .cmd_draw_mesh_tasks_indirect_nv
11350 .expect("vkCmdDrawMeshTasksIndirectNV not loaded");
11351 unsafe { fp(command_buffer, buffer, offset, draw_count, stride) };
11352 }
11353 ///Wraps [`vkCmdDrawMeshTasksIndirectCountNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMeshTasksIndirectCountNV.html).
11354 /**
11355 Provided by **VK_NV_mesh_shader**.*/
11356 ///
11357 ///# Safety
11358 ///- `commandBuffer` (self) must be valid and not destroyed.
11359 ///- `commandBuffer` must be externally synchronized.
11360 ///
11361 ///# Panics
11362 ///Panics if `vkCmdDrawMeshTasksIndirectCountNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11363 ///
11364 ///# Usage Notes
11365 ///
11366 ///Indirect-count variant of `cmd_draw_mesh_tasks_nv`. Reads both
11367 ///the draw parameters and the draw count from GPU buffers, enabling
11368 ///fully GPU-driven mesh shader dispatch where the number of draws
11369 ///is determined at runtime.
11370 ///
11371 ///Requires `VK_NV_mesh_shader`.
11372 pub unsafe fn cmd_draw_mesh_tasks_indirect_count_nv(
11373 &self,
11374 command_buffer: CommandBuffer,
11375 buffer: Buffer,
11376 offset: u64,
11377 count_buffer: Buffer,
11378 count_buffer_offset: u64,
11379 max_draw_count: u32,
11380 stride: u32,
11381 ) {
11382 let fp = self
11383 .commands()
11384 .cmd_draw_mesh_tasks_indirect_count_nv
11385 .expect("vkCmdDrawMeshTasksIndirectCountNV not loaded");
11386 unsafe {
11387 fp(
11388 command_buffer,
11389 buffer,
11390 offset,
11391 count_buffer,
11392 count_buffer_offset,
11393 max_draw_count,
11394 stride,
11395 )
11396 };
11397 }
11398 ///Wraps [`vkCmdDrawMeshTasksEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMeshTasksEXT.html).
11399 /**
11400 Provided by **VK_EXT_mesh_shader**.*/
11401 ///
11402 ///# Safety
11403 ///- `commandBuffer` (self) must be valid and not destroyed.
11404 ///- `commandBuffer` must be externally synchronized.
11405 ///
11406 ///# Panics
11407 ///Panics if `vkCmdDrawMeshTasksEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11408 ///
11409 ///# Usage Notes
11410 ///
11411 ///Dispatches mesh shader work groups. `group_count_x/y/z` specify
11412 ///the number of task or mesh shader work groups to launch.
11413 ///
11414 ///Each work group runs the mesh shader (or task shader, if bound)
11415 ///which emits primitives directly without traditional vertex/index
11416 ///buffers.
11417 ///
11418 ///Requires `VK_EXT_mesh_shader` and the `meshShader` feature.
11419 pub unsafe fn cmd_draw_mesh_tasks_ext(
11420 &self,
11421 command_buffer: CommandBuffer,
11422 group_count_x: u32,
11423 group_count_y: u32,
11424 group_count_z: u32,
11425 ) {
11426 let fp = self
11427 .commands()
11428 .cmd_draw_mesh_tasks_ext
11429 .expect("vkCmdDrawMeshTasksEXT not loaded");
11430 unsafe { fp(command_buffer, group_count_x, group_count_y, group_count_z) };
11431 }
11432 ///Wraps [`vkCmdDrawMeshTasksIndirectEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMeshTasksIndirectEXT.html).
11433 /**
11434 Provided by **VK_EXT_mesh_shader**.*/
11435 ///
11436 ///# Safety
11437 ///- `commandBuffer` (self) must be valid and not destroyed.
11438 ///- `commandBuffer` must be externally synchronized.
11439 ///
11440 ///# Panics
11441 ///Panics if `vkCmdDrawMeshTasksIndirectEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11442 ///
11443 ///# Usage Notes
11444 ///
11445 ///Indirect version of `cmd_draw_mesh_tasks_ext`. Reads mesh shader
11446 ///dispatch parameters from a buffer. Each indirect command contains
11447 ///group counts (x, y, z).
11448 ///
11449 ///`draw_count` specifies how many indirect commands to execute.
11450 ///`stride` is the byte stride between commands in the buffer.
11451 ///
11452 ///Requires `VK_EXT_mesh_shader`.
11453 pub unsafe fn cmd_draw_mesh_tasks_indirect_ext(
11454 &self,
11455 command_buffer: CommandBuffer,
11456 buffer: Buffer,
11457 offset: u64,
11458 draw_count: u32,
11459 stride: u32,
11460 ) {
11461 let fp = self
11462 .commands()
11463 .cmd_draw_mesh_tasks_indirect_ext
11464 .expect("vkCmdDrawMeshTasksIndirectEXT not loaded");
11465 unsafe { fp(command_buffer, buffer, offset, draw_count, stride) };
11466 }
11467 ///Wraps [`vkCmdDrawMeshTasksIndirectCountEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMeshTasksIndirectCountEXT.html).
11468 /**
11469 Provided by **VK_EXT_mesh_shader**.*/
11470 ///
11471 ///# Safety
11472 ///- `commandBuffer` (self) must be valid and not destroyed.
11473 ///- `commandBuffer` must be externally synchronized.
11474 ///
11475 ///# Panics
11476 ///Panics if `vkCmdDrawMeshTasksIndirectCountEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11477 ///
11478 ///# Usage Notes
11479 ///
11480 ///Count-indirect version of mesh shader dispatch. Both the dispatch
11481 ///parameters and the draw count are read from GPU buffers, enabling
11482 ///fully GPU-driven mesh shader workloads.
11483 ///
11484 ///`max_draw_count` caps the count read from the count buffer.
11485 ///
11486 ///Requires `VK_EXT_mesh_shader`.
11487 pub unsafe fn cmd_draw_mesh_tasks_indirect_count_ext(
11488 &self,
11489 command_buffer: CommandBuffer,
11490 buffer: Buffer,
11491 offset: u64,
11492 count_buffer: Buffer,
11493 count_buffer_offset: u64,
11494 max_draw_count: u32,
11495 stride: u32,
11496 ) {
11497 let fp = self
11498 .commands()
11499 .cmd_draw_mesh_tasks_indirect_count_ext
11500 .expect("vkCmdDrawMeshTasksIndirectCountEXT not loaded");
11501 unsafe {
11502 fp(
11503 command_buffer,
11504 buffer,
11505 offset,
11506 count_buffer,
11507 count_buffer_offset,
11508 max_draw_count,
11509 stride,
11510 )
11511 };
11512 }
11513 ///Wraps [`vkCompileDeferredNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCompileDeferredNV.html).
11514 /**
11515 Provided by **VK_NV_ray_tracing**.*/
11516 ///
11517 ///# Errors
11518 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
11519 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
11520 ///- `VK_ERROR_UNKNOWN`
11521 ///- `VK_ERROR_VALIDATION_FAILED`
11522 ///
11523 ///# Safety
11524 ///- `device` (self) must be valid and not destroyed.
11525 ///
11526 ///# Panics
11527 ///Panics if `vkCompileDeferredNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11528 ///
11529 ///# Usage Notes
11530 ///
11531 ///Triggers compilation of a deferred shader in an NV ray tracing
11532 ///pipeline. When a pipeline is created with
11533 ///`PIPELINE_CREATE_DEFER_COMPILE_BIT_NV`, individual shaders can
11534 ///be compiled on demand using this command.
11535 ///
11536 ///Useful for spreading compilation cost across frames or threads.
11537 ///
11538 ///Requires `VK_NV_ray_tracing`.
11539 pub unsafe fn compile_deferred_nv(&self, pipeline: Pipeline, shader: u32) -> VkResult<()> {
11540 let fp = self
11541 .commands()
11542 .compile_deferred_nv
11543 .expect("vkCompileDeferredNV not loaded");
11544 check(unsafe { fp(self.handle(), pipeline, shader) })
11545 }
11546 ///Wraps [`vkCreateAccelerationStructureNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateAccelerationStructureNV.html).
11547 /**
11548 Provided by **VK_NV_ray_tracing**.*/
11549 ///
11550 ///# Errors
11551 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
11552 ///- `VK_ERROR_UNKNOWN`
11553 ///- `VK_ERROR_VALIDATION_FAILED`
11554 ///
11555 ///# Safety
11556 ///- `device` (self) must be valid and not destroyed.
11557 ///
11558 ///# Panics
11559 ///Panics if `vkCreateAccelerationStructureNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11560 ///
11561 ///# Usage Notes
11562 ///
11563 ///Creates an NV ray tracing acceleration structure. This is the
11564 ///legacy NV path; prefer `create_acceleration_structure_khr` for
11565 ///new code.
11566 ///
11567 ///The NV acceleration structure owns its memory implicitly, bind
11568 ///memory with `bind_acceleration_structure_memory_nv`. Destroy with
11569 ///`destroy_acceleration_structure_nv`.
11570 ///
11571 ///Requires `VK_NV_ray_tracing`.
11572 pub unsafe fn create_acceleration_structure_nv(
11573 &self,
11574 p_create_info: &AccelerationStructureCreateInfoNV,
11575 allocator: Option<&AllocationCallbacks>,
11576 ) -> VkResult<AccelerationStructureNV> {
11577 let fp = self
11578 .commands()
11579 .create_acceleration_structure_nv
11580 .expect("vkCreateAccelerationStructureNV not loaded");
11581 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
11582 let mut out = unsafe { core::mem::zeroed() };
11583 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
11584 Ok(out)
11585 }
11586 ///Wraps [`vkCmdBindInvocationMaskHUAWEI`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindInvocationMaskHUAWEI.html).
11587 /**
11588 Provided by **VK_HUAWEI_invocation_mask**.*/
11589 ///
11590 ///# Safety
11591 ///- `commandBuffer` (self) must be valid and not destroyed.
11592 ///- `commandBuffer` must be externally synchronized.
11593 ///
11594 ///# Panics
11595 ///Panics if `vkCmdBindInvocationMaskHUAWEI` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11596 ///
11597 ///# Usage Notes
11598 ///
11599 ///Binds an image view as an invocation mask for ray tracing. The
11600 ///mask selectively enables or disables ray generation shader
11601 ///invocations per pixel, allowing efficient partial-screen ray
11602 ///tracing on Huawei GPUs.
11603 ///
11604 ///Requires `VK_HUAWEI_invocation_mask`.
11605 pub unsafe fn cmd_bind_invocation_mask_huawei(
11606 &self,
11607 command_buffer: CommandBuffer,
11608 image_view: ImageView,
11609 image_layout: ImageLayout,
11610 ) {
11611 let fp = self
11612 .commands()
11613 .cmd_bind_invocation_mask_huawei
11614 .expect("vkCmdBindInvocationMaskHUAWEI not loaded");
11615 unsafe { fp(command_buffer, image_view, image_layout) };
11616 }
11617 ///Wraps [`vkDestroyAccelerationStructureKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyAccelerationStructureKHR.html).
11618 /**
11619 Provided by **VK_KHR_acceleration_structure**.*/
11620 ///
11621 ///# Safety
11622 ///- `device` (self) must be valid and not destroyed.
11623 ///- `accelerationStructure` must be externally synchronized.
11624 ///
11625 ///# Panics
11626 ///Panics if `vkDestroyAccelerationStructureKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11627 ///
11628 ///# Usage Notes
11629 ///
11630 ///Destroys an acceleration structure. The structure must not be
11631 ///referenced by any pending ray tracing command or TLAS build.
11632 ///
11633 ///Destroying the acceleration structure does not free the backing
11634 ///buffer, destroy or reclaim it separately.
11635 pub unsafe fn destroy_acceleration_structure_khr(
11636 &self,
11637 acceleration_structure: AccelerationStructureKHR,
11638 allocator: Option<&AllocationCallbacks>,
11639 ) {
11640 let fp = self
11641 .commands()
11642 .destroy_acceleration_structure_khr
11643 .expect("vkDestroyAccelerationStructureKHR not loaded");
11644 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
11645 unsafe { fp(self.handle(), acceleration_structure, alloc_ptr) };
11646 }
11647 ///Wraps [`vkDestroyAccelerationStructureNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyAccelerationStructureNV.html).
11648 /**
11649 Provided by **VK_NV_ray_tracing**.*/
11650 ///
11651 ///# Safety
11652 ///- `device` (self) must be valid and not destroyed.
11653 ///- `accelerationStructure` must be externally synchronized.
11654 ///
11655 ///# Panics
11656 ///Panics if `vkDestroyAccelerationStructureNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11657 ///
11658 ///# Usage Notes
11659 ///
11660 ///Destroys an NV acceleration structure created with
11661 ///`create_acceleration_structure_nv`. The structure must not be
11662 ///referenced by any pending command.
11663 ///
11664 ///Requires `VK_NV_ray_tracing`.
11665 pub unsafe fn destroy_acceleration_structure_nv(
11666 &self,
11667 acceleration_structure: AccelerationStructureNV,
11668 allocator: Option<&AllocationCallbacks>,
11669 ) {
11670 let fp = self
11671 .commands()
11672 .destroy_acceleration_structure_nv
11673 .expect("vkDestroyAccelerationStructureNV not loaded");
11674 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
11675 unsafe { fp(self.handle(), acceleration_structure, alloc_ptr) };
11676 }
11677 ///Wraps [`vkGetAccelerationStructureMemoryRequirementsNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetAccelerationStructureMemoryRequirementsNV.html).
11678 /**
11679 Provided by **VK_NV_ray_tracing**.*/
11680 ///
11681 ///# Safety
11682 ///- `device` (self) must be valid and not destroyed.
11683 ///
11684 ///# Panics
11685 ///Panics if `vkGetAccelerationStructureMemoryRequirementsNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11686 ///
11687 ///# Usage Notes
11688 ///
11689 ///Queries the memory requirements for an NV acceleration structure,
11690 ///including the scratch memory needed for builds and updates. Use
11691 ///the result to allocate and bind memory before building.
11692 ///
11693 ///Requires `VK_NV_ray_tracing`.
11694 pub unsafe fn get_acceleration_structure_memory_requirements_nv(
11695 &self,
11696 p_info: &AccelerationStructureMemoryRequirementsInfoNV,
11697 ) -> MemoryRequirements2KHR {
11698 let fp = self
11699 .commands()
11700 .get_acceleration_structure_memory_requirements_nv
11701 .expect("vkGetAccelerationStructureMemoryRequirementsNV not loaded");
11702 let mut out = unsafe { core::mem::zeroed() };
11703 unsafe { fp(self.handle(), p_info, &mut out) };
11704 out
11705 }
11706 ///Wraps [`vkBindAccelerationStructureMemoryNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBindAccelerationStructureMemoryNV.html).
11707 /**
11708 Provided by **VK_NV_ray_tracing**.*/
11709 ///
11710 ///# Errors
11711 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
11712 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
11713 ///- `VK_ERROR_UNKNOWN`
11714 ///- `VK_ERROR_VALIDATION_FAILED`
11715 ///
11716 ///# Safety
11717 ///- `device` (self) must be valid and not destroyed.
11718 ///
11719 ///# Panics
11720 ///Panics if `vkBindAccelerationStructureMemoryNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11721 ///
11722 ///# Usage Notes
11723 ///
11724 ///Binds device memory to one or more NV acceleration structures.
11725 ///Must be called before the structure can be used in a build or
11726 ///trace command.
11727 ///
11728 ///Requires `VK_NV_ray_tracing`.
11729 pub unsafe fn bind_acceleration_structure_memory_nv(
11730 &self,
11731 p_bind_infos: &[BindAccelerationStructureMemoryInfoNV],
11732 ) -> VkResult<()> {
11733 let fp = self
11734 .commands()
11735 .bind_acceleration_structure_memory_nv
11736 .expect("vkBindAccelerationStructureMemoryNV not loaded");
11737 check(unsafe {
11738 fp(
11739 self.handle(),
11740 p_bind_infos.len() as u32,
11741 p_bind_infos.as_ptr(),
11742 )
11743 })
11744 }
11745 ///Wraps [`vkCmdCopyAccelerationStructureNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyAccelerationStructureNV.html).
11746 /**
11747 Provided by **VK_NV_ray_tracing**.*/
11748 ///
11749 ///# Safety
11750 ///- `commandBuffer` (self) must be valid and not destroyed.
11751 ///- `commandBuffer` must be externally synchronized.
11752 ///
11753 ///# Panics
11754 ///Panics if `vkCmdCopyAccelerationStructureNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11755 ///
11756 ///# Usage Notes
11757 ///
11758 ///Copies or compacts an NV acceleration structure. Use `CLONE` mode
11759 ///for a full copy, or `COMPACT` to produce a smaller copy after
11760 ///querying the compacted size.
11761 ///
11762 ///Requires `VK_NV_ray_tracing`.
11763 pub unsafe fn cmd_copy_acceleration_structure_nv(
11764 &self,
11765 command_buffer: CommandBuffer,
11766 dst: AccelerationStructureNV,
11767 src: AccelerationStructureNV,
11768 mode: CopyAccelerationStructureModeKHR,
11769 ) {
11770 let fp = self
11771 .commands()
11772 .cmd_copy_acceleration_structure_nv
11773 .expect("vkCmdCopyAccelerationStructureNV not loaded");
11774 unsafe { fp(command_buffer, dst, src, mode) };
11775 }
11776 ///Wraps [`vkCmdCopyAccelerationStructureKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyAccelerationStructureKHR.html).
11777 /**
11778 Provided by **VK_KHR_acceleration_structure**.*/
11779 ///
11780 ///# Safety
11781 ///- `commandBuffer` (self) must be valid and not destroyed.
11782 ///- `commandBuffer` must be externally synchronized.
11783 ///
11784 ///# Panics
11785 ///Panics if `vkCmdCopyAccelerationStructureKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11786 ///
11787 ///# Usage Notes
11788 ///
11789 ///Copies an acceleration structure. Modes:
11790 ///
11791 ///- `COPY_ACCELERATION_STRUCTURE_MODE_CLONE`: full copy. The
11792 /// destination must be at least as large as the source.
11793 ///- `COPY_ACCELERATION_STRUCTURE_MODE_COMPACT`: copies into a smaller
11794 /// buffer after a compaction query. Use this to reclaim memory after
11795 /// building.
11796 ///
11797 ///**Compaction workflow**:
11798 ///
11799 ///1. Build with `BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION`.
11800 ///2. Query compacted size with
11801 /// `cmd_write_acceleration_structures_properties_khr`.
11802 ///3. Create a new, smaller backing buffer.
11803 ///4. Copy with `MODE_COMPACT`.
11804 ///
11805 ///Compaction typically saves 50–70% of BLAS memory.
11806 pub unsafe fn cmd_copy_acceleration_structure_khr(
11807 &self,
11808 command_buffer: CommandBuffer,
11809 p_info: &CopyAccelerationStructureInfoKHR,
11810 ) {
11811 let fp = self
11812 .commands()
11813 .cmd_copy_acceleration_structure_khr
11814 .expect("vkCmdCopyAccelerationStructureKHR not loaded");
11815 unsafe { fp(command_buffer, p_info) };
11816 }
11817 ///Wraps [`vkCopyAccelerationStructureKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCopyAccelerationStructureKHR.html).
11818 /**
11819 Provided by **VK_KHR_acceleration_structure**.*/
11820 ///
11821 ///# Errors
11822 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
11823 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
11824 ///- `VK_ERROR_UNKNOWN`
11825 ///- `VK_ERROR_VALIDATION_FAILED`
11826 ///
11827 ///# Safety
11828 ///- `device` (self) must be valid and not destroyed.
11829 ///
11830 ///# Panics
11831 ///Panics if `vkCopyAccelerationStructureKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11832 ///
11833 ///# Usage Notes
11834 ///
11835 ///Host-side acceleration structure copy. The CPU counterpart to
11836 ///`cmd_copy_acceleration_structure_khr`. Supports the same clone and
11837 ///compact modes.
11838 ///
11839 ///Requires the `acceleration_structure_host_commands` feature.
11840 pub unsafe fn copy_acceleration_structure_khr(
11841 &self,
11842 deferred_operation: DeferredOperationKHR,
11843 p_info: &CopyAccelerationStructureInfoKHR,
11844 ) -> VkResult<()> {
11845 let fp = self
11846 .commands()
11847 .copy_acceleration_structure_khr
11848 .expect("vkCopyAccelerationStructureKHR not loaded");
11849 check(unsafe { fp(self.handle(), deferred_operation, p_info) })
11850 }
11851 ///Wraps [`vkCmdCopyAccelerationStructureToMemoryKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyAccelerationStructureToMemoryKHR.html).
11852 /**
11853 Provided by **VK_KHR_acceleration_structure**.*/
11854 ///
11855 ///# Safety
11856 ///- `commandBuffer` (self) must be valid and not destroyed.
11857 ///- `commandBuffer` must be externally synchronized.
11858 ///
11859 ///# Panics
11860 ///Panics if `vkCmdCopyAccelerationStructureToMemoryKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11861 ///
11862 ///# Usage Notes
11863 ///
11864 ///Serializes an acceleration structure into a buffer for storage or
11865 ///transfer. The serialized format is opaque and driver-specific, it
11866 ///can only be deserialized on the same driver and hardware.
11867 ///
11868 ///Use this for:
11869 ///
11870 ///- Saving acceleration structures to disk for faster subsequent loads.
11871 ///- Transferring structures between devices in a device group.
11872 ///
11873 ///Deserialize with `cmd_copy_memory_to_acceleration_structure_khr`.
11874 pub unsafe fn cmd_copy_acceleration_structure_to_memory_khr(
11875 &self,
11876 command_buffer: CommandBuffer,
11877 p_info: &CopyAccelerationStructureToMemoryInfoKHR,
11878 ) {
11879 let fp = self
11880 .commands()
11881 .cmd_copy_acceleration_structure_to_memory_khr
11882 .expect("vkCmdCopyAccelerationStructureToMemoryKHR not loaded");
11883 unsafe { fp(command_buffer, p_info) };
11884 }
11885 ///Wraps [`vkCopyAccelerationStructureToMemoryKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCopyAccelerationStructureToMemoryKHR.html).
11886 /**
11887 Provided by **VK_KHR_acceleration_structure**.*/
11888 ///
11889 ///# Errors
11890 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
11891 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
11892 ///- `VK_ERROR_UNKNOWN`
11893 ///- `VK_ERROR_VALIDATION_FAILED`
11894 ///
11895 ///# Safety
11896 ///- `device` (self) must be valid and not destroyed.
11897 ///
11898 ///# Panics
11899 ///Panics if `vkCopyAccelerationStructureToMemoryKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11900 ///
11901 ///# Usage Notes
11902 ///
11903 ///Host-side acceleration structure serialization. The CPU counterpart
11904 ///to `cmd_copy_acceleration_structure_to_memory_khr`.
11905 ///
11906 ///Requires the `acceleration_structure_host_commands` feature.
11907 pub unsafe fn copy_acceleration_structure_to_memory_khr(
11908 &self,
11909 deferred_operation: DeferredOperationKHR,
11910 p_info: &CopyAccelerationStructureToMemoryInfoKHR,
11911 ) -> VkResult<()> {
11912 let fp = self
11913 .commands()
11914 .copy_acceleration_structure_to_memory_khr
11915 .expect("vkCopyAccelerationStructureToMemoryKHR not loaded");
11916 check(unsafe { fp(self.handle(), deferred_operation, p_info) })
11917 }
11918 ///Wraps [`vkCmdCopyMemoryToAccelerationStructureKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMemoryToAccelerationStructureKHR.html).
11919 /**
11920 Provided by **VK_KHR_acceleration_structure**.*/
11921 ///
11922 ///# Safety
11923 ///- `commandBuffer` (self) must be valid and not destroyed.
11924 ///- `commandBuffer` must be externally synchronized.
11925 ///
11926 ///# Panics
11927 ///Panics if `vkCmdCopyMemoryToAccelerationStructureKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11928 ///
11929 ///# Usage Notes
11930 ///
11931 ///Deserializes an acceleration structure from a buffer that was
11932 ///previously written by
11933 ///`cmd_copy_acceleration_structure_to_memory_khr`.
11934 ///
11935 ///The data must have been serialized on the same driver and hardware
11936 ///(check `acceleration_structure_uuid` compatibility before loading).
11937 ///
11938 ///After deserialization the acceleration structure is ready for use
11939 ///in ray tracing commands.
11940 pub unsafe fn cmd_copy_memory_to_acceleration_structure_khr(
11941 &self,
11942 command_buffer: CommandBuffer,
11943 p_info: &CopyMemoryToAccelerationStructureInfoKHR,
11944 ) {
11945 let fp = self
11946 .commands()
11947 .cmd_copy_memory_to_acceleration_structure_khr
11948 .expect("vkCmdCopyMemoryToAccelerationStructureKHR not loaded");
11949 unsafe { fp(command_buffer, p_info) };
11950 }
11951 ///Wraps [`vkCopyMemoryToAccelerationStructureKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCopyMemoryToAccelerationStructureKHR.html).
11952 /**
11953 Provided by **VK_KHR_acceleration_structure**.*/
11954 ///
11955 ///# Errors
11956 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
11957 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
11958 ///- `VK_ERROR_UNKNOWN`
11959 ///- `VK_ERROR_VALIDATION_FAILED`
11960 ///
11961 ///# Safety
11962 ///- `device` (self) must be valid and not destroyed.
11963 ///
11964 ///# Panics
11965 ///Panics if `vkCopyMemoryToAccelerationStructureKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11966 ///
11967 ///# Usage Notes
11968 ///
11969 ///Host-side acceleration structure deserialization. The CPU counterpart
11970 ///to `cmd_copy_memory_to_acceleration_structure_khr`.
11971 ///
11972 ///Requires the `acceleration_structure_host_commands` feature.
11973 pub unsafe fn copy_memory_to_acceleration_structure_khr(
11974 &self,
11975 deferred_operation: DeferredOperationKHR,
11976 p_info: &CopyMemoryToAccelerationStructureInfoKHR,
11977 ) -> VkResult<()> {
11978 let fp = self
11979 .commands()
11980 .copy_memory_to_acceleration_structure_khr
11981 .expect("vkCopyMemoryToAccelerationStructureKHR not loaded");
11982 check(unsafe { fp(self.handle(), deferred_operation, p_info) })
11983 }
11984 ///Wraps [`vkCmdWriteAccelerationStructuresPropertiesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWriteAccelerationStructuresPropertiesKHR.html).
11985 /**
11986 Provided by **VK_KHR_acceleration_structure**.*/
11987 ///
11988 ///# Safety
11989 ///- `commandBuffer` (self) must be valid and not destroyed.
11990 ///- `commandBuffer` must be externally synchronized.
11991 ///
11992 ///# Panics
11993 ///Panics if `vkCmdWriteAccelerationStructuresPropertiesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11994 ///
11995 ///# Usage Notes
11996 ///
11997 ///Writes acceleration structure properties into a query pool. The
11998 ///primary use is querying `QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE`
11999 ///after a build to determine the compacted size before copying.
12000 ///
12001 ///**Compaction workflow**:
12002 ///
12003 ///1. Build with `ALLOW_COMPACTION`.
12004 ///2. `cmd_write_acceleration_structures_properties_khr` with
12005 /// `COMPACTED_SIZE` query type.
12006 ///3. Read the result from the query pool.
12007 ///4. Create a smaller buffer and copy with `MODE_COMPACT`.
12008 ///
12009 ///Also supports `QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE`
12010 ///for estimating serialization buffer requirements.
12011 pub unsafe fn cmd_write_acceleration_structures_properties_khr(
12012 &self,
12013 command_buffer: CommandBuffer,
12014 p_acceleration_structures: &[AccelerationStructureKHR],
12015 query_type: QueryType,
12016 query_pool: QueryPool,
12017 first_query: u32,
12018 ) {
12019 let fp = self
12020 .commands()
12021 .cmd_write_acceleration_structures_properties_khr
12022 .expect("vkCmdWriteAccelerationStructuresPropertiesKHR not loaded");
12023 unsafe {
12024 fp(
12025 command_buffer,
12026 p_acceleration_structures.len() as u32,
12027 p_acceleration_structures.as_ptr(),
12028 query_type,
12029 query_pool,
12030 first_query,
12031 )
12032 };
12033 }
12034 ///Wraps [`vkCmdWriteAccelerationStructuresPropertiesNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWriteAccelerationStructuresPropertiesNV.html).
12035 /**
12036 Provided by **VK_NV_ray_tracing**.*/
12037 ///
12038 ///# Safety
12039 ///- `commandBuffer` (self) must be valid and not destroyed.
12040 ///- `commandBuffer` must be externally synchronized.
12041 ///
12042 ///# Panics
12043 ///Panics if `vkCmdWriteAccelerationStructuresPropertiesNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12044 ///
12045 ///# Usage Notes
12046 ///
12047 ///Writes acceleration structure properties (such as compacted size)
12048 ///into a query pool. Use this after a build to determine the
12049 ///compacted size before calling `cmd_copy_acceleration_structure_nv`
12050 ///with `COMPACT` mode.
12051 ///
12052 ///Requires `VK_NV_ray_tracing`.
12053 pub unsafe fn cmd_write_acceleration_structures_properties_nv(
12054 &self,
12055 command_buffer: CommandBuffer,
12056 p_acceleration_structures: &[AccelerationStructureNV],
12057 query_type: QueryType,
12058 query_pool: QueryPool,
12059 first_query: u32,
12060 ) {
12061 let fp = self
12062 .commands()
12063 .cmd_write_acceleration_structures_properties_nv
12064 .expect("vkCmdWriteAccelerationStructuresPropertiesNV not loaded");
12065 unsafe {
12066 fp(
12067 command_buffer,
12068 p_acceleration_structures.len() as u32,
12069 p_acceleration_structures.as_ptr(),
12070 query_type,
12071 query_pool,
12072 first_query,
12073 )
12074 };
12075 }
12076 ///Wraps [`vkCmdBuildAccelerationStructureNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBuildAccelerationStructureNV.html).
12077 /**
12078 Provided by **VK_NV_ray_tracing**.*/
12079 ///
12080 ///# Safety
12081 ///- `commandBuffer` (self) must be valid and not destroyed.
12082 ///- `commandBuffer` must be externally synchronized.
12083 ///
12084 ///# Panics
12085 ///Panics if `vkCmdBuildAccelerationStructureNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12086 ///
12087 ///# Usage Notes
12088 ///
12089 ///Builds or updates an NV acceleration structure from geometry data.
12090 ///Set `update` to non-zero to refit an existing structure in place
12091 ///(faster but lower quality than a full rebuild).
12092 ///
12093 ///A scratch buffer is required; query its size with
12094 ///`get_acceleration_structure_memory_requirements_nv`.
12095 ///
12096 ///Requires `VK_NV_ray_tracing`.
12097 pub unsafe fn cmd_build_acceleration_structure_nv(
12098 &self,
12099 command_buffer: CommandBuffer,
12100 p_info: &AccelerationStructureInfoNV,
12101 instance_data: Buffer,
12102 instance_offset: u64,
12103 update: bool,
12104 dst: AccelerationStructureNV,
12105 src: AccelerationStructureNV,
12106 scratch: Buffer,
12107 scratch_offset: u64,
12108 ) {
12109 let fp = self
12110 .commands()
12111 .cmd_build_acceleration_structure_nv
12112 .expect("vkCmdBuildAccelerationStructureNV not loaded");
12113 unsafe {
12114 fp(
12115 command_buffer,
12116 p_info,
12117 instance_data,
12118 instance_offset,
12119 update as u32,
12120 dst,
12121 src,
12122 scratch,
12123 scratch_offset,
12124 )
12125 };
12126 }
12127 ///Wraps [`vkWriteAccelerationStructuresPropertiesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkWriteAccelerationStructuresPropertiesKHR.html).
12128 /**
12129 Provided by **VK_KHR_acceleration_structure**.*/
12130 ///
12131 ///# Errors
12132 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
12133 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
12134 ///- `VK_ERROR_UNKNOWN`
12135 ///- `VK_ERROR_VALIDATION_FAILED`
12136 ///
12137 ///# Safety
12138 ///- `device` (self) must be valid and not destroyed.
12139 ///
12140 ///# Panics
12141 ///Panics if `vkWriteAccelerationStructuresPropertiesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12142 ///
12143 ///# Usage Notes
12144 ///
12145 ///Host-side query of acceleration structure properties. The CPU
12146 ///counterpart to `cmd_write_acceleration_structures_properties_khr`.
12147 ///
12148 ///Writes results directly to a host buffer rather than a query pool.
12149 ///Supports the same query types: compacted size and serialization
12150 ///size.
12151 ///
12152 ///Requires the `acceleration_structure_host_commands` feature.
12153 pub unsafe fn write_acceleration_structures_properties_khr(
12154 &self,
12155 p_acceleration_structures: &[AccelerationStructureKHR],
12156 query_type: QueryType,
12157 data_size: usize,
12158 p_data: *mut core::ffi::c_void,
12159 stride: usize,
12160 ) -> VkResult<()> {
12161 let fp = self
12162 .commands()
12163 .write_acceleration_structures_properties_khr
12164 .expect("vkWriteAccelerationStructuresPropertiesKHR not loaded");
12165 check(unsafe {
12166 fp(
12167 self.handle(),
12168 p_acceleration_structures.len() as u32,
12169 p_acceleration_structures.as_ptr(),
12170 query_type,
12171 data_size,
12172 p_data,
12173 stride,
12174 )
12175 })
12176 }
12177 ///Wraps [`vkCmdTraceRaysKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdTraceRaysKHR.html).
12178 /**
12179 Provided by **VK_KHR_ray_tracing_pipeline**.*/
12180 ///
12181 ///# Safety
12182 ///- `commandBuffer` (self) must be valid and not destroyed.
12183 ///- `commandBuffer` must be externally synchronized.
12184 ///
12185 ///# Panics
12186 ///Panics if `vkCmdTraceRaysKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12187 ///
12188 ///# Usage Notes
12189 ///
12190 ///Dispatches rays into the scene. This is the primary ray tracing
12191 ///dispatch command, the ray tracing equivalent of `cmd_draw` or
12192 ///`cmd_dispatch`.
12193 ///
12194 ///Each of the four shader binding table (SBT) regions points to a
12195 ///device memory region containing shader group handles:
12196 ///
12197 ///- **Raygen**: exactly one entry, the ray generation shader.
12198 ///- **Miss**: shaders invoked when a ray hits nothing.
12199 ///- **Hit**: shader groups invoked on ray-geometry intersection.
12200 ///- **Callable**: shaders invoked explicitly from other stages.
12201 ///
12202 ///The `width`, `height`, and `depth` parameters define the 3D launch
12203 ///dimensions. Each invocation gets a unique `gl_LaunchIDEXT`. For
12204 ///a fullscreen ray trace, use the render target resolution with
12205 ///`depth = 1`.
12206 ///
12207 ///The SBT entries must be built from handles retrieved with
12208 ///`get_ray_tracing_shader_group_handles_khr`, stored in a buffer
12209 ///with `BUFFER_USAGE_SHADER_BINDING_TABLE`. Each region's `stride`
12210 ///must be a multiple of `shaderGroupHandleAlignment` and the base
12211 ///address must be aligned to `shaderGroupBaseAlignment`.
12212 pub unsafe fn cmd_trace_rays_khr(
12213 &self,
12214 command_buffer: CommandBuffer,
12215 p_raygen_shader_binding_table: &StridedDeviceAddressRegionKHR,
12216 p_miss_shader_binding_table: &StridedDeviceAddressRegionKHR,
12217 p_hit_shader_binding_table: &StridedDeviceAddressRegionKHR,
12218 p_callable_shader_binding_table: &StridedDeviceAddressRegionKHR,
12219 width: u32,
12220 height: u32,
12221 depth: u32,
12222 ) {
12223 let fp = self
12224 .commands()
12225 .cmd_trace_rays_khr
12226 .expect("vkCmdTraceRaysKHR not loaded");
12227 unsafe {
12228 fp(
12229 command_buffer,
12230 p_raygen_shader_binding_table,
12231 p_miss_shader_binding_table,
12232 p_hit_shader_binding_table,
12233 p_callable_shader_binding_table,
12234 width,
12235 height,
12236 depth,
12237 )
12238 };
12239 }
12240 ///Wraps [`vkCmdTraceRaysNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdTraceRaysNV.html).
12241 /**
12242 Provided by **VK_NV_ray_tracing**.*/
12243 ///
12244 ///# Safety
12245 ///- `commandBuffer` (self) must be valid and not destroyed.
12246 ///- `commandBuffer` must be externally synchronized.
12247 ///
12248 ///# Panics
12249 ///Panics if `vkCmdTraceRaysNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12250 ///
12251 ///# Usage Notes
12252 ///
12253 ///Dispatches a ray tracing workload using the NV ray tracing
12254 ///pipeline. Takes shader binding table buffer/offset/stride for
12255 ///each shader stage (raygen, miss, closest hit, callable) and the
12256 ///dispatch dimensions.
12257 ///
12258 ///This is the legacy NV path; prefer `cmd_trace_rays_khr` for new
12259 ///code.
12260 ///
12261 ///Requires `VK_NV_ray_tracing`.
12262 pub unsafe fn cmd_trace_rays_nv(
12263 &self,
12264 command_buffer: CommandBuffer,
12265 raygen_shader_binding_table_buffer: Buffer,
12266 raygen_shader_binding_offset: u64,
12267 miss_shader_binding_table_buffer: Buffer,
12268 miss_shader_binding_offset: u64,
12269 miss_shader_binding_stride: u64,
12270 hit_shader_binding_table_buffer: Buffer,
12271 hit_shader_binding_offset: u64,
12272 hit_shader_binding_stride: u64,
12273 callable_shader_binding_table_buffer: Buffer,
12274 callable_shader_binding_offset: u64,
12275 callable_shader_binding_stride: u64,
12276 width: u32,
12277 height: u32,
12278 depth: u32,
12279 ) {
12280 let fp = self
12281 .commands()
12282 .cmd_trace_rays_nv
12283 .expect("vkCmdTraceRaysNV not loaded");
12284 unsafe {
12285 fp(
12286 command_buffer,
12287 raygen_shader_binding_table_buffer,
12288 raygen_shader_binding_offset,
12289 miss_shader_binding_table_buffer,
12290 miss_shader_binding_offset,
12291 miss_shader_binding_stride,
12292 hit_shader_binding_table_buffer,
12293 hit_shader_binding_offset,
12294 hit_shader_binding_stride,
12295 callable_shader_binding_table_buffer,
12296 callable_shader_binding_offset,
12297 callable_shader_binding_stride,
12298 width,
12299 height,
12300 depth,
12301 )
12302 };
12303 }
12304 ///Wraps [`vkGetRayTracingShaderGroupHandlesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetRayTracingShaderGroupHandlesKHR.html).
12305 /**
12306 Provided by **VK_KHR_ray_tracing_pipeline**.*/
12307 ///
12308 ///# Errors
12309 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
12310 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
12311 ///- `VK_ERROR_UNKNOWN`
12312 ///- `VK_ERROR_VALIDATION_FAILED`
12313 ///
12314 ///# Safety
12315 ///- `device` (self) must be valid and not destroyed.
12316 ///
12317 ///# Panics
12318 ///Panics if `vkGetRayTracingShaderGroupHandlesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12319 ///
12320 ///# Usage Notes
12321 ///
12322 ///Retrieves opaque shader group handles from a ray tracing pipeline.
12323 ///These handles are copied into GPU-visible buffers to build the
12324 ///**shader binding table** (SBT) that `cmd_trace_rays_khr` indexes
12325 ///into.
12326 ///
12327 ///Each handle is `shaderGroupHandleSize` bytes (query from
12328 ///`PhysicalDeviceRayTracingPipelinePropertiesKHR`, typically 32
12329 ///bytes). The `p_data` buffer must be at least
12330 ///`group_count * shaderGroupHandleSize` bytes.
12331 ///
12332 ///`first_group` and `group_count` index into the `groups` array
12333 ///from `RayTracingPipelineCreateInfoKHR`. Handles are written
12334 ///sequentially, group `first_group` first, then
12335 ///`first_group + 1`, and so on.
12336 ///
12337 ///After retrieving handles, copy them into a buffer with
12338 ///`BUFFER_USAGE_SHADER_BINDING_TABLE` at the correct stride and
12339 ///alignment for each SBT region.
12340 pub unsafe fn get_ray_tracing_shader_group_handles_khr(
12341 &self,
12342 pipeline: Pipeline,
12343 first_group: u32,
12344 group_count: u32,
12345 data_size: usize,
12346 p_data: *mut core::ffi::c_void,
12347 ) -> VkResult<()> {
12348 let fp = self
12349 .commands()
12350 .get_ray_tracing_shader_group_handles_khr
12351 .expect("vkGetRayTracingShaderGroupHandlesKHR not loaded");
12352 check(unsafe {
12353 fp(
12354 self.handle(),
12355 pipeline,
12356 first_group,
12357 group_count,
12358 data_size,
12359 p_data,
12360 )
12361 })
12362 }
12363 ///Wraps [`vkGetRayTracingCaptureReplayShaderGroupHandlesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetRayTracingCaptureReplayShaderGroupHandlesKHR.html).
12364 /**
12365 Provided by **VK_KHR_ray_tracing_pipeline**.*/
12366 ///
12367 ///# Errors
12368 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
12369 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
12370 ///- `VK_ERROR_UNKNOWN`
12371 ///- `VK_ERROR_VALIDATION_FAILED`
12372 ///
12373 ///# Safety
12374 ///- `device` (self) must be valid and not destroyed.
12375 ///
12376 ///# Panics
12377 ///Panics if `vkGetRayTracingCaptureReplayShaderGroupHandlesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12378 ///
12379 ///# Usage Notes
12380 ///
12381 ///Retrieves opaque capture/replay handles for shader groups. These
12382 ///handles allow recreating a ray tracing pipeline with identical
12383 ///shader group assignments on a subsequent run, enabling
12384 ///deterministic replay of GPU traces.
12385 ///
12386 ///Use this for tools, profilers, and capture-replay frameworks.
12387 ///The handles are passed back via
12388 ///`RayTracingShaderGroupCreateInfoKHR::shader_group_capture_replay_handle`
12389 ///when recreating the pipeline.
12390 ///
12391 ///The pipeline must have been created with
12392 ///`PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY`.
12393 ///Requires the `rayTracingPipelineShaderGroupHandleCaptureReplay`
12394 ///device feature.
12395 ///
12396 ///The buffer layout is the same as
12397 ///`get_ray_tracing_shader_group_handles_khr`, sequential handles
12398 ///of `shaderGroupHandleSize` bytes each.
12399 pub unsafe fn get_ray_tracing_capture_replay_shader_group_handles_khr(
12400 &self,
12401 pipeline: Pipeline,
12402 first_group: u32,
12403 group_count: u32,
12404 data_size: usize,
12405 p_data: *mut core::ffi::c_void,
12406 ) -> VkResult<()> {
12407 let fp = self
12408 .commands()
12409 .get_ray_tracing_capture_replay_shader_group_handles_khr
12410 .expect("vkGetRayTracingCaptureReplayShaderGroupHandlesKHR not loaded");
12411 check(unsafe {
12412 fp(
12413 self.handle(),
12414 pipeline,
12415 first_group,
12416 group_count,
12417 data_size,
12418 p_data,
12419 )
12420 })
12421 }
12422 ///Wraps [`vkGetAccelerationStructureHandleNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetAccelerationStructureHandleNV.html).
12423 /**
12424 Provided by **VK_NV_ray_tracing**.*/
12425 ///
12426 ///# Errors
12427 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
12428 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
12429 ///- `VK_ERROR_UNKNOWN`
12430 ///- `VK_ERROR_VALIDATION_FAILED`
12431 ///
12432 ///# Safety
12433 ///- `device` (self) must be valid and not destroyed.
12434 ///
12435 ///# Panics
12436 ///Panics if `vkGetAccelerationStructureHandleNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12437 ///
12438 ///# Usage Notes
12439 ///
12440 ///Retrieves an opaque handle for an NV acceleration structure. This
12441 ///handle is used when building a top-level acceleration structure
12442 ///that references bottom-level structures.
12443 ///
12444 ///Requires `VK_NV_ray_tracing`.
12445 pub unsafe fn get_acceleration_structure_handle_nv(
12446 &self,
12447 acceleration_structure: AccelerationStructureNV,
12448 data_size: usize,
12449 p_data: *mut core::ffi::c_void,
12450 ) -> VkResult<()> {
12451 let fp = self
12452 .commands()
12453 .get_acceleration_structure_handle_nv
12454 .expect("vkGetAccelerationStructureHandleNV not loaded");
12455 check(unsafe { fp(self.handle(), acceleration_structure, data_size, p_data) })
12456 }
12457 ///Wraps [`vkCreateRayTracingPipelinesNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateRayTracingPipelinesNV.html).
12458 /**
12459 Provided by **VK_NV_ray_tracing**.*/
12460 ///
12461 ///# Errors
12462 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
12463 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
12464 ///- `VK_ERROR_INVALID_SHADER_NV`
12465 ///- `VK_ERROR_UNKNOWN`
12466 ///- `VK_ERROR_VALIDATION_FAILED`
12467 ///
12468 ///# Safety
12469 ///- `device` (self) must be valid and not destroyed.
12470 ///- `pipelineCache` must be externally synchronized.
12471 ///
12472 ///# Panics
12473 ///Panics if `vkCreateRayTracingPipelinesNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12474 ///
12475 ///# Usage Notes
12476 ///
12477 ///Creates one or more ray tracing pipelines using the NV model.
12478 ///This is the legacy NV path; prefer
12479 ///`create_ray_tracing_pipelines_khr` for new code.
12480 ///
12481 ///Supports a pipeline cache for faster subsequent creation.
12482 ///
12483 ///Requires `VK_NV_ray_tracing`.
12484 pub unsafe fn create_ray_tracing_pipelines_nv(
12485 &self,
12486 pipeline_cache: PipelineCache,
12487 p_create_infos: &[RayTracingPipelineCreateInfoNV],
12488 allocator: Option<&AllocationCallbacks>,
12489 ) -> VkResult<Vec<Pipeline>> {
12490 let fp = self
12491 .commands()
12492 .create_ray_tracing_pipelines_nv
12493 .expect("vkCreateRayTracingPipelinesNV not loaded");
12494 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
12495 let count = p_create_infos.len();
12496 let mut out = vec![unsafe { core::mem::zeroed() }; count];
12497 check(unsafe {
12498 fp(
12499 self.handle(),
12500 pipeline_cache,
12501 p_create_infos.len() as u32,
12502 p_create_infos.as_ptr(),
12503 alloc_ptr,
12504 out.as_mut_ptr(),
12505 )
12506 })?;
12507 Ok(out)
12508 }
12509 ///Wraps [`vkCreateRayTracingPipelinesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateRayTracingPipelinesKHR.html).
12510 /**
12511 Provided by **VK_KHR_ray_tracing_pipeline**.*/
12512 ///
12513 ///# Errors
12514 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
12515 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
12516 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS`
12517 ///- `VK_ERROR_UNKNOWN`
12518 ///- `VK_ERROR_VALIDATION_FAILED`
12519 ///
12520 ///# Safety
12521 ///- `device` (self) must be valid and not destroyed.
12522 ///- `pipelineCache` must be externally synchronized.
12523 ///
12524 ///# Panics
12525 ///Panics if `vkCreateRayTracingPipelinesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12526 ///
12527 ///# Usage Notes
12528 ///
12529 ///Creates one or more ray tracing pipelines. A ray tracing pipeline
12530 ///contains the shader stages (ray generation, miss, closest hit,
12531 ///any hit, intersection, callable) and shader groups that define
12532 ///how rays interact with geometry.
12533 ///
12534 ///Unlike graphics pipelines, ray tracing pipelines organize shaders
12535 ///into **groups**:
12536 ///
12537 ///- **General**: ray generation, miss, or callable shaders.
12538 ///- **Triangles hit**: closest hit + optional any hit for triangles.
12539 ///- **Procedural hit**: intersection + closest hit + optional any hit
12540 /// for custom geometry (AABBs).
12541 ///
12542 ///Pass a `DeferredOperationKHR` handle to compile asynchronously,
12543 ///the call returns `OPERATION_DEFERRED_KHR` and the pipeline handles
12544 ///are not valid until the deferred operation completes. Pass a null
12545 ///handle for synchronous creation.
12546 ///
12547 ///Supports `pipeline_cache` for faster creation on subsequent runs
12548 ///and `base_pipeline_handle` / `base_pipeline_index` for derivative
12549 ///pipelines when `PIPELINE_CREATE_DERIVATIVE` is set.
12550 ///
12551 ///After creation, retrieve shader group handles with
12552 ///`get_ray_tracing_shader_group_handles_khr` to build the shader
12553 ///binding table.
12554 pub unsafe fn create_ray_tracing_pipelines_khr(
12555 &self,
12556 deferred_operation: DeferredOperationKHR,
12557 pipeline_cache: PipelineCache,
12558 p_create_infos: &[RayTracingPipelineCreateInfoKHR],
12559 allocator: Option<&AllocationCallbacks>,
12560 ) -> VkResult<Vec<Pipeline>> {
12561 let fp = self
12562 .commands()
12563 .create_ray_tracing_pipelines_khr
12564 .expect("vkCreateRayTracingPipelinesKHR not loaded");
12565 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
12566 let count = p_create_infos.len();
12567 let mut out = vec![unsafe { core::mem::zeroed() }; count];
12568 check(unsafe {
12569 fp(
12570 self.handle(),
12571 deferred_operation,
12572 pipeline_cache,
12573 p_create_infos.len() as u32,
12574 p_create_infos.as_ptr(),
12575 alloc_ptr,
12576 out.as_mut_ptr(),
12577 )
12578 })?;
12579 Ok(out)
12580 }
12581 ///Wraps [`vkCmdTraceRaysIndirectKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdTraceRaysIndirectKHR.html).
12582 /**
12583 Provided by **VK_KHR_ray_tracing_pipeline**.*/
12584 ///
12585 ///# Safety
12586 ///- `commandBuffer` (self) must be valid and not destroyed.
12587 ///- `commandBuffer` must be externally synchronized.
12588 ///
12589 ///# Panics
12590 ///Panics if `vkCmdTraceRaysIndirectKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12591 ///
12592 ///# Usage Notes
12593 ///
12594 ///Dispatches rays with launch dimensions read from a GPU buffer.
12595 ///Identical to `cmd_trace_rays_khr` except the `width`, `height`,
12596 ///and `depth` are sourced from a `TraceRaysIndirectCommandKHR`
12597 ///struct at `indirect_device_address`.
12598 ///
12599 ///This enables the GPU to determine ray dispatch dimensions without
12600 ///a CPU round-trip, useful when the dispatch size depends on prior
12601 ///GPU work such as culling, tile classification, or adaptive
12602 ///sampling.
12603 ///
12604 ///The indirect buffer must have been created with
12605 ///`BUFFER_USAGE_INDIRECT_BUFFER` and the address must be aligned
12606 ///to 4 bytes. The SBT parameters are still provided directly on
12607 ///the CPU side.
12608 ///
12609 ///Requires the `rayTracingPipelineTraceRaysIndirect` feature.
12610 pub unsafe fn cmd_trace_rays_indirect_khr(
12611 &self,
12612 command_buffer: CommandBuffer,
12613 p_raygen_shader_binding_table: &StridedDeviceAddressRegionKHR,
12614 p_miss_shader_binding_table: &StridedDeviceAddressRegionKHR,
12615 p_hit_shader_binding_table: &StridedDeviceAddressRegionKHR,
12616 p_callable_shader_binding_table: &StridedDeviceAddressRegionKHR,
12617 indirect_device_address: u64,
12618 ) {
12619 let fp = self
12620 .commands()
12621 .cmd_trace_rays_indirect_khr
12622 .expect("vkCmdTraceRaysIndirectKHR not loaded");
12623 unsafe {
12624 fp(
12625 command_buffer,
12626 p_raygen_shader_binding_table,
12627 p_miss_shader_binding_table,
12628 p_hit_shader_binding_table,
12629 p_callable_shader_binding_table,
12630 indirect_device_address,
12631 )
12632 };
12633 }
12634 ///Wraps [`vkCmdTraceRaysIndirect2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdTraceRaysIndirect2KHR.html).
12635 /**
12636 Provided by **VK_KHR_ray_tracing_maintenance1**.*/
12637 ///
12638 ///# Safety
12639 ///- `commandBuffer` (self) must be valid and not destroyed.
12640 ///- `commandBuffer` must be externally synchronized.
12641 ///
12642 ///# Panics
12643 ///Panics if `vkCmdTraceRaysIndirect2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12644 ///
12645 ///# Usage Notes
12646 ///
12647 ///Fully indirect ray dispatch, both the shader binding table
12648 ///addresses and the launch dimensions are read from a GPU buffer.
12649 ///This is the most flexible ray tracing dispatch.
12650 ///
12651 ///The `indirect_device_address` points to a
12652 ///`TraceRaysIndirectCommand2KHR` struct on the device, which
12653 ///contains all four SBT regions (raygen, miss, hit, callable) plus
12654 ///the `width`, `height`, and `depth`.
12655 ///
12656 ///This allows the GPU to dynamically select which shaders to use
12657 ///and how many rays to launch, enabling advanced techniques like
12658 ///GPU-driven material sorting or multi-pass ray tracing without
12659 ///CPU synchronization.
12660 ///
12661 ///Provided by `VK_KHR_ray_tracing_maintenance1`, not the base
12662 ///ray tracing pipeline extension. Requires the
12663 ///`rayTracingPipelineTraceRaysIndirect2` feature.
12664 pub unsafe fn cmd_trace_rays_indirect2_khr(
12665 &self,
12666 command_buffer: CommandBuffer,
12667 indirect_device_address: u64,
12668 ) {
12669 let fp = self
12670 .commands()
12671 .cmd_trace_rays_indirect2_khr
12672 .expect("vkCmdTraceRaysIndirect2KHR not loaded");
12673 unsafe { fp(command_buffer, indirect_device_address) };
12674 }
12675 ///Wraps [`vkGetClusterAccelerationStructureBuildSizesNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetClusterAccelerationStructureBuildSizesNV.html).
12676 /**
12677 Provided by **VK_NV_cluster_acceleration_structure**.*/
12678 ///
12679 ///# Safety
12680 ///- `device` (self) must be valid and not destroyed.
12681 ///
12682 ///# Panics
12683 ///Panics if `vkGetClusterAccelerationStructureBuildSizesNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12684 ///
12685 ///# Usage Notes
12686 ///
12687 ///Queries the buffer sizes needed to build a cluster acceleration
12688 ///structure. Use the returned sizes to allocate the destination
12689 ///and scratch buffers before building.
12690 ///
12691 ///Requires `VK_NV_cluster_acceleration_structure`.
12692 pub unsafe fn get_cluster_acceleration_structure_build_sizes_nv(
12693 &self,
12694 p_info: &ClusterAccelerationStructureInputInfoNV,
12695 p_size_info: &mut AccelerationStructureBuildSizesInfoKHR,
12696 ) {
12697 let fp = self
12698 .commands()
12699 .get_cluster_acceleration_structure_build_sizes_nv
12700 .expect("vkGetClusterAccelerationStructureBuildSizesNV not loaded");
12701 unsafe { fp(self.handle(), p_info, p_size_info) };
12702 }
12703 ///Wraps [`vkCmdBuildClusterAccelerationStructureIndirectNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBuildClusterAccelerationStructureIndirectNV.html).
12704 /**
12705 Provided by **VK_NV_cluster_acceleration_structure**.*/
12706 ///
12707 ///# Safety
12708 ///- `commandBuffer` (self) must be valid and not destroyed.
12709 ///- `commandBuffer` must be externally synchronized.
12710 ///
12711 ///# Panics
12712 ///Panics if `vkCmdBuildClusterAccelerationStructureIndirectNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12713 ///
12714 ///# Usage Notes
12715 ///
12716 ///Builds a cluster acceleration structure using indirect parameters.
12717 ///Cluster acceleration structures organize geometry into spatial
12718 ///clusters for more efficient ray traversal on NVIDIA hardware.
12719 ///
12720 ///Requires `VK_NV_cluster_acceleration_structure`.
12721 pub unsafe fn cmd_build_cluster_acceleration_structure_indirect_nv(
12722 &self,
12723 command_buffer: CommandBuffer,
12724 p_command_infos: &ClusterAccelerationStructureCommandsInfoNV,
12725 ) {
12726 let fp = self
12727 .commands()
12728 .cmd_build_cluster_acceleration_structure_indirect_nv
12729 .expect("vkCmdBuildClusterAccelerationStructureIndirectNV not loaded");
12730 unsafe { fp(command_buffer, p_command_infos) };
12731 }
12732 ///Wraps [`vkGetDeviceAccelerationStructureCompatibilityKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceAccelerationStructureCompatibilityKHR.html).
12733 /**
12734 Provided by **VK_KHR_acceleration_structure**.*/
12735 ///
12736 ///# Safety
12737 ///- `device` (self) must be valid and not destroyed.
12738 ///
12739 ///# Panics
12740 ///Panics if `vkGetDeviceAccelerationStructureCompatibilityKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12741 ///
12742 ///# Usage Notes
12743 ///
12744 ///Checks whether a serialized acceleration structure (from
12745 ///`copy_acceleration_structure_to_memory_khr`) is compatible with
12746 ///this device and can be deserialized.
12747 ///
12748 ///Returns `ACCELERATION_STRUCTURE_COMPATIBILITY_COMPATIBLE` if the
12749 ///data can be loaded, or `INCOMPATIBLE` if not. Incompatibility
12750 ///typically means the data was serialized on different hardware or a
12751 ///different driver version.
12752 ///
12753 ///Check compatibility before attempting deserialization to avoid
12754 ///errors.
12755 pub unsafe fn get_device_acceleration_structure_compatibility_khr(
12756 &self,
12757 p_version_info: &AccelerationStructureVersionInfoKHR,
12758 ) -> AccelerationStructureCompatibilityKHR {
12759 let fp = self
12760 .commands()
12761 .get_device_acceleration_structure_compatibility_khr
12762 .expect("vkGetDeviceAccelerationStructureCompatibilityKHR not loaded");
12763 let mut out = unsafe { core::mem::zeroed() };
12764 unsafe { fp(self.handle(), p_version_info, &mut out) };
12765 out
12766 }
12767 ///Wraps [`vkGetRayTracingShaderGroupStackSizeKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetRayTracingShaderGroupStackSizeKHR.html).
12768 /**
12769 Provided by **VK_KHR_ray_tracing_pipeline**.*/
12770 ///
12771 ///# Safety
12772 ///- `device` (self) must be valid and not destroyed.
12773 ///
12774 ///# Panics
12775 ///Panics if `vkGetRayTracingShaderGroupStackSizeKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12776 ///
12777 ///# Usage Notes
12778 ///
12779 ///Queries the stack size contribution of a single shader within a
12780 ///shader group. The result is used to compute the total pipeline
12781 ///stack size for `cmd_set_ray_tracing_pipeline_stack_size_khr`.
12782 ///
12783 ///`group` indexes into the shader groups array from pipeline
12784 ///creation. `group_shader` selects which shader within the group:
12785 ///`GENERAL`, `CLOSEST_HIT`, `ANY_HIT`, or `INTERSECTION`.
12786 ///
12787 ///The default pipeline stack size is computed automatically at
12788 ///creation time, but it assumes worst-case recursion. If you know
12789 ///your actual `maxPipelineRayRecursionDepth` is lower, query
12790 ///individual stack sizes and compute a tighter total to reduce
12791 ///scratch memory usage.
12792 ///
12793 ///Stack size computation formula (from spec):
12794 ///
12795 ///`raygen + max(closesthit + intersection, miss, callable) * maxRecursionDepth`
12796 ///
12797 ///Call this per-shader, aggregate across all groups, then set the
12798 ///result with `cmd_set_ray_tracing_pipeline_stack_size_khr`.
12799 pub unsafe fn get_ray_tracing_shader_group_stack_size_khr(
12800 &self,
12801 pipeline: Pipeline,
12802 group: u32,
12803 group_shader: ShaderGroupShaderKHR,
12804 ) -> u64 {
12805 let fp = self
12806 .commands()
12807 .get_ray_tracing_shader_group_stack_size_khr
12808 .expect("vkGetRayTracingShaderGroupStackSizeKHR not loaded");
12809 unsafe { fp(self.handle(), pipeline, group, group_shader) }
12810 }
12811 ///Wraps [`vkCmdSetRayTracingPipelineStackSizeKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetRayTracingPipelineStackSizeKHR.html).
12812 /**
12813 Provided by **VK_KHR_ray_tracing_pipeline**.*/
12814 ///
12815 ///# Safety
12816 ///- `commandBuffer` (self) must be valid and not destroyed.
12817 ///- `commandBuffer` must be externally synchronized.
12818 ///
12819 ///# Panics
12820 ///Panics if `vkCmdSetRayTracingPipelineStackSizeKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12821 ///
12822 ///# Usage Notes
12823 ///
12824 ///Overrides the default ray tracing pipeline stack size for the
12825 ///bound pipeline. The stack is scratch memory used during shader
12826 ///execution and recursion.
12827 ///
12828 ///The default stack size (set at pipeline creation) assumes
12829 ///worst-case recursion depth across all shader groups. If your
12830 ///application uses a lower effective recursion depth or only a
12831 ///subset of shader groups, setting a smaller stack size reduces
12832 ///per-invocation memory usage and may improve occupancy.
12833 ///
12834 ///Compute the required size by querying individual shader
12835 ///contributions with `get_ray_tracing_shader_group_stack_size_khr`
12836 ///and applying the recursion formula from the spec.
12837 ///
12838 ///This is a dynamic state command, it takes effect for subsequent
12839 ///`cmd_trace_rays_khr` calls within the same command buffer.
12840 ///Binding a new pipeline resets the stack size to the pipeline's
12841 ///default.
12842 pub unsafe fn cmd_set_ray_tracing_pipeline_stack_size_khr(
12843 &self,
12844 command_buffer: CommandBuffer,
12845 pipeline_stack_size: u32,
12846 ) {
12847 let fp = self
12848 .commands()
12849 .cmd_set_ray_tracing_pipeline_stack_size_khr
12850 .expect("vkCmdSetRayTracingPipelineStackSizeKHR not loaded");
12851 unsafe { fp(command_buffer, pipeline_stack_size) };
12852 }
12853 ///Wraps [`vkGetImageViewHandleNVX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageViewHandleNVX.html).
12854 /**
12855 Provided by **VK_NVX_image_view_handle**.*/
12856 ///
12857 ///# Safety
12858 ///- `device` (self) must be valid and not destroyed.
12859 ///
12860 ///# Panics
12861 ///Panics if `vkGetImageViewHandleNVX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12862 ///
12863 ///# Usage Notes
12864 ///
12865 ///Returns a 32-bit handle for an image view that can be used as a
12866 ///bindless descriptor index. Use with `get_image_view_address_nvx`
12867 ///for fully bindless texture access.
12868 ///
12869 ///Requires `VK_NVX_image_view_handle`.
12870 pub unsafe fn get_image_view_handle_nvx(&self, p_info: &ImageViewHandleInfoNVX) -> u32 {
12871 let fp = self
12872 .commands()
12873 .get_image_view_handle_nvx
12874 .expect("vkGetImageViewHandleNVX not loaded");
12875 unsafe { fp(self.handle(), p_info) }
12876 }
12877 ///Wraps [`vkGetImageViewHandle64NVX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageViewHandle64NVX.html).
12878 /**
12879 Provided by **VK_NVX_image_view_handle**.*/
12880 ///
12881 ///# Safety
12882 ///- `device` (self) must be valid and not destroyed.
12883 ///
12884 ///# Panics
12885 ///Panics if `vkGetImageViewHandle64NVX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12886 ///
12887 ///# Usage Notes
12888 ///
12889 ///Returns a 64-bit handle for an image view. The 64-bit variant
12890 ///accommodates larger descriptor heaps than the 32-bit
12891 ///`get_image_view_handle_nvx`.
12892 ///
12893 ///Requires `VK_NVX_image_view_handle`.
12894 pub unsafe fn get_image_view_handle64_nvx(&self, p_info: &ImageViewHandleInfoNVX) -> u64 {
12895 let fp = self
12896 .commands()
12897 .get_image_view_handle64_nvx
12898 .expect("vkGetImageViewHandle64NVX not loaded");
12899 unsafe { fp(self.handle(), p_info) }
12900 }
12901 ///Wraps [`vkGetImageViewAddressNVX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageViewAddressNVX.html).
12902 /**
12903 Provided by **VK_NVX_image_view_handle**.*/
12904 ///
12905 ///# Errors
12906 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
12907 ///- `VK_ERROR_UNKNOWN`
12908 ///- `VK_ERROR_VALIDATION_FAILED`
12909 ///
12910 ///# Safety
12911 ///- `device` (self) must be valid and not destroyed.
12912 ///
12913 ///# Panics
12914 ///Panics if `vkGetImageViewAddressNVX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12915 ///
12916 ///# Usage Notes
12917 ///
12918 ///Queries the device address and size of an image view's descriptor
12919 ///data. The address can be used for raw pointer-based descriptor
12920 ///access in shaders.
12921 ///
12922 ///Requires `VK_NVX_image_view_handle`.
12923 pub unsafe fn get_image_view_address_nvx(
12924 &self,
12925 image_view: ImageView,
12926 p_properties: &mut ImageViewAddressPropertiesNVX,
12927 ) -> VkResult<()> {
12928 let fp = self
12929 .commands()
12930 .get_image_view_address_nvx
12931 .expect("vkGetImageViewAddressNVX not loaded");
12932 check(unsafe { fp(self.handle(), image_view, p_properties) })
12933 }
12934 ///Wraps [`vkGetDeviceCombinedImageSamplerIndexNVX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceCombinedImageSamplerIndexNVX.html).
12935 /**
12936 Provided by **VK_NVX_image_view_handle**.*/
12937 ///
12938 ///# Safety
12939 ///- `device` (self) must be valid and not destroyed.
12940 ///
12941 ///# Panics
12942 ///Panics if `vkGetDeviceCombinedImageSamplerIndexNVX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12943 ///
12944 ///# Usage Notes
12945 ///
12946 ///Returns the combined image-sampler descriptor index for a given
12947 ///image view and sampler pair. Used for bindless combined image-
12948 ///sampler access.
12949 ///
12950 ///Requires `VK_NVX_image_view_handle`.
12951 pub unsafe fn get_device_combined_image_sampler_index_nvx(
12952 &self,
12953 image_view_index: u64,
12954 sampler_index: u64,
12955 ) -> u64 {
12956 let fp = self
12957 .commands()
12958 .get_device_combined_image_sampler_index_nvx
12959 .expect("vkGetDeviceCombinedImageSamplerIndexNVX not loaded");
12960 unsafe { fp(self.handle(), image_view_index, sampler_index) }
12961 }
12962 ///Wraps [`vkGetDeviceGroupSurfacePresentModes2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceGroupSurfacePresentModes2EXT.html).
12963 /**
12964 Provided by **VK_EXT_full_screen_exclusive**.*/
12965 ///
12966 ///# Errors
12967 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
12968 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
12969 ///- `VK_ERROR_SURFACE_LOST_KHR`
12970 ///- `VK_ERROR_UNKNOWN`
12971 ///- `VK_ERROR_VALIDATION_FAILED`
12972 ///
12973 ///# Safety
12974 ///- `device` (self) must be valid and not destroyed.
12975 ///
12976 ///# Panics
12977 ///Panics if `vkGetDeviceGroupSurfacePresentModes2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12978 ///
12979 ///# Usage Notes
12980 ///
12981 ///Queries the supported present modes for a device group and surface,
12982 ///using the extended surface info structure. This is the
12983 ///`VK_EXT_full_screen_exclusive` variant of
12984 ///`get_device_group_surface_present_modes_khr`, allowing full-screen
12985 ///exclusive configuration to be factored into the query.
12986 ///
12987 ///Requires `VK_EXT_full_screen_exclusive`. Windows only.
12988 pub unsafe fn get_device_group_surface_present_modes2_ext(
12989 &self,
12990 p_surface_info: &PhysicalDeviceSurfaceInfo2KHR,
12991 ) -> VkResult<DeviceGroupPresentModeFlagsKHR> {
12992 let fp = self
12993 .commands()
12994 .get_device_group_surface_present_modes2_ext
12995 .expect("vkGetDeviceGroupSurfacePresentModes2EXT not loaded");
12996 let mut out = unsafe { core::mem::zeroed() };
12997 check(unsafe { fp(self.handle(), p_surface_info, &mut out) })?;
12998 Ok(out)
12999 }
13000 ///Wraps [`vkAcquireFullScreenExclusiveModeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAcquireFullScreenExclusiveModeEXT.html).
13001 /**
13002 Provided by **VK_EXT_full_screen_exclusive**.*/
13003 ///
13004 ///# Errors
13005 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13006 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
13007 ///- `VK_ERROR_INITIALIZATION_FAILED`
13008 ///- `VK_ERROR_SURFACE_LOST_KHR`
13009 ///- `VK_ERROR_UNKNOWN`
13010 ///- `VK_ERROR_VALIDATION_FAILED`
13011 ///
13012 ///# Safety
13013 ///- `device` (self) must be valid and not destroyed.
13014 ///
13015 ///# Panics
13016 ///Panics if `vkAcquireFullScreenExclusiveModeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13017 ///
13018 ///# Usage Notes
13019 ///
13020 ///Acquires full-screen exclusive mode for a swapchain, giving the
13021 ///application direct control over the display output. This can
13022 ///reduce latency and enable adaptive sync.
13023 ///
13024 ///The swapchain must have been created with
13025 ///`SurfaceFullScreenExclusiveInfoEXT` in its pNext chain.
13026 ///Release with `release_full_screen_exclusive_mode_ext`.
13027 ///
13028 ///Requires `VK_EXT_full_screen_exclusive`. Windows only.
13029 pub unsafe fn acquire_full_screen_exclusive_mode_ext(
13030 &self,
13031 swapchain: SwapchainKHR,
13032 ) -> VkResult<()> {
13033 let fp = self
13034 .commands()
13035 .acquire_full_screen_exclusive_mode_ext
13036 .expect("vkAcquireFullScreenExclusiveModeEXT not loaded");
13037 check(unsafe { fp(self.handle(), swapchain) })
13038 }
13039 ///Wraps [`vkReleaseFullScreenExclusiveModeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkReleaseFullScreenExclusiveModeEXT.html).
13040 /**
13041 Provided by **VK_EXT_full_screen_exclusive**.*/
13042 ///
13043 ///# Errors
13044 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13045 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
13046 ///- `VK_ERROR_SURFACE_LOST_KHR`
13047 ///- `VK_ERROR_UNKNOWN`
13048 ///- `VK_ERROR_VALIDATION_FAILED`
13049 ///
13050 ///# Safety
13051 ///- `device` (self) must be valid and not destroyed.
13052 ///
13053 ///# Panics
13054 ///Panics if `vkReleaseFullScreenExclusiveModeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13055 ///
13056 ///# Usage Notes
13057 ///
13058 ///Releases full-screen exclusive mode previously acquired with
13059 ///`acquire_full_screen_exclusive_mode_ext`. The swapchain returns
13060 ///to shared/composed presentation.
13061 ///
13062 ///Requires `VK_EXT_full_screen_exclusive`. Windows only.
13063 pub unsafe fn release_full_screen_exclusive_mode_ext(
13064 &self,
13065 swapchain: SwapchainKHR,
13066 ) -> VkResult<()> {
13067 let fp = self
13068 .commands()
13069 .release_full_screen_exclusive_mode_ext
13070 .expect("vkReleaseFullScreenExclusiveModeEXT not loaded");
13071 check(unsafe { fp(self.handle(), swapchain) })
13072 }
13073 ///Wraps [`vkAcquireProfilingLockKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAcquireProfilingLockKHR.html).
13074 /**
13075 Provided by **VK_KHR_performance_query**.*/
13076 ///
13077 ///# Errors
13078 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13079 ///- `VK_TIMEOUT`
13080 ///- `VK_ERROR_UNKNOWN`
13081 ///- `VK_ERROR_VALIDATION_FAILED`
13082 ///
13083 ///# Safety
13084 ///- `device` (self) must be valid and not destroyed.
13085 ///
13086 ///# Panics
13087 ///Panics if `vkAcquireProfilingLockKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13088 ///
13089 ///# Usage Notes
13090 ///
13091 ///Acquires the device profiling lock, which must be held while
13092 ///submitting command buffers that contain performance queries.
13093 ///Only one thread can hold the lock at a time.
13094 ///
13095 ///The `AcquireProfilingLockInfoKHR` specifies a timeout in
13096 ///nanoseconds. Returns `TIMEOUT` if the lock cannot be acquired
13097 ///within that period.
13098 ///
13099 ///Release with `release_profiling_lock_khr` when profiling
13100 ///submission is complete.
13101 ///
13102 ///Requires `VK_KHR_performance_query`.
13103 pub unsafe fn acquire_profiling_lock_khr(
13104 &self,
13105 p_info: &AcquireProfilingLockInfoKHR,
13106 ) -> VkResult<()> {
13107 let fp = self
13108 .commands()
13109 .acquire_profiling_lock_khr
13110 .expect("vkAcquireProfilingLockKHR not loaded");
13111 check(unsafe { fp(self.handle(), p_info) })
13112 }
13113 ///Wraps [`vkReleaseProfilingLockKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkReleaseProfilingLockKHR.html).
13114 /**
13115 Provided by **VK_KHR_performance_query**.*/
13116 ///
13117 ///# Safety
13118 ///- `device` (self) must be valid and not destroyed.
13119 ///
13120 ///# Panics
13121 ///Panics if `vkReleaseProfilingLockKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13122 ///
13123 ///# Usage Notes
13124 ///
13125 ///Releases the device profiling lock previously acquired with
13126 ///`acquire_profiling_lock_khr`. Must be called after all command
13127 ///buffers containing performance queries have been submitted.
13128 ///
13129 ///Requires `VK_KHR_performance_query`.
13130 pub unsafe fn release_profiling_lock_khr(&self) {
13131 let fp = self
13132 .commands()
13133 .release_profiling_lock_khr
13134 .expect("vkReleaseProfilingLockKHR not loaded");
13135 unsafe { fp(self.handle()) };
13136 }
13137 ///Wraps [`vkGetImageDrmFormatModifierPropertiesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageDrmFormatModifierPropertiesEXT.html).
13138 /**
13139 Provided by **VK_EXT_image_drm_format_modifier**.*/
13140 ///
13141 ///# Errors
13142 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13143 ///- `VK_ERROR_UNKNOWN`
13144 ///- `VK_ERROR_VALIDATION_FAILED`
13145 ///
13146 ///# Safety
13147 ///- `device` (self) must be valid and not destroyed.
13148 ///
13149 ///# Panics
13150 ///Panics if `vkGetImageDrmFormatModifierPropertiesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13151 ///
13152 ///# Usage Notes
13153 ///
13154 ///Queries which DRM format modifier was selected for an image
13155 ///created with `VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT`. The
13156 ///chosen modifier determines the memory layout and is needed
13157 ///when sharing the image with other DRM/KMS clients.
13158 ///
13159 ///Requires `VK_EXT_image_drm_format_modifier`.
13160 pub unsafe fn get_image_drm_format_modifier_properties_ext(
13161 &self,
13162 image: Image,
13163 p_properties: &mut ImageDrmFormatModifierPropertiesEXT,
13164 ) -> VkResult<()> {
13165 let fp = self
13166 .commands()
13167 .get_image_drm_format_modifier_properties_ext
13168 .expect("vkGetImageDrmFormatModifierPropertiesEXT not loaded");
13169 check(unsafe { fp(self.handle(), image, p_properties) })
13170 }
13171 ///Wraps [`vkGetBufferOpaqueCaptureAddress`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetBufferOpaqueCaptureAddress.html).
13172 /**
13173 Provided by **VK_BASE_VERSION_1_2**.*/
13174 ///
13175 ///# Safety
13176 ///- `device` (self) must be valid and not destroyed.
13177 ///
13178 ///# Panics
13179 ///Panics if `vkGetBufferOpaqueCaptureAddress` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13180 ///
13181 ///# Usage Notes
13182 ///
13183 ///Returns an opaque capture address for a buffer that was created with
13184 ///`BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY`. This address is used
13185 ///to recreate the buffer at the same virtual address in a replay
13186 ///session (e.g. for GPU crash dump replay or deterministic replay
13187 ///tools).
13188 ///
13189 ///Most applications do not need this, it is primarily for debugging
13190 ///and profiling tools. Use `get_buffer_device_address` for runtime
13191 ///buffer address access.
13192 pub unsafe fn get_buffer_opaque_capture_address(
13193 &self,
13194 p_info: &BufferDeviceAddressInfo,
13195 ) -> u64 {
13196 let fp = self
13197 .commands()
13198 .get_buffer_opaque_capture_address
13199 .expect("vkGetBufferOpaqueCaptureAddress not loaded");
13200 unsafe { fp(self.handle(), p_info) }
13201 }
13202 ///Wraps [`vkGetBufferDeviceAddress`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetBufferDeviceAddress.html).
13203 /**
13204 Provided by **VK_BASE_VERSION_1_2**.*/
13205 ///
13206 ///# Safety
13207 ///- `device` (self) must be valid and not destroyed.
13208 ///
13209 ///# Panics
13210 ///Panics if `vkGetBufferDeviceAddress` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13211 ///
13212 ///# Usage Notes
13213 ///
13214 ///Returns a 64-bit GPU virtual address for a buffer. This address can
13215 ///be passed to shaders via push constants or descriptors, enabling
13216 ///direct pointer-style access to buffer data from GPU code.
13217 ///
13218 ///The buffer must have been created with
13219 ///`BUFFER_USAGE_SHADER_DEVICE_ADDRESS` and the
13220 ///`buffer_device_address` feature must be enabled.
13221 ///
13222 ///**Use cases**:
13223 ///
13224 ///- **Bindless rendering**: pass buffer addresses in a storage buffer
13225 /// or push constant instead of binding individual descriptors.
13226 ///- **Acceleration structures**: ray tracing BLASes and TLASes
13227 /// reference geometry buffers by device address.
13228 ///- **GPU-driven pipelines**: indirect command generators read vertex
13229 /// and index data by address.
13230 ///
13231 ///The address remains valid for the lifetime of the buffer. If the
13232 ///buffer was created with
13233 ///`BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY`, the address can be
13234 ///captured and replayed across sessions.
13235 pub unsafe fn get_buffer_device_address(&self, p_info: &BufferDeviceAddressInfo) -> u64 {
13236 let fp = self
13237 .commands()
13238 .get_buffer_device_address
13239 .expect("vkGetBufferDeviceAddress not loaded");
13240 unsafe { fp(self.handle(), p_info) }
13241 }
13242 ///Wraps [`vkInitializePerformanceApiINTEL`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkInitializePerformanceApiINTEL.html).
13243 /**
13244 Provided by **VK_INTEL_performance_query**.*/
13245 ///
13246 ///# Errors
13247 ///- `VK_ERROR_TOO_MANY_OBJECTS`
13248 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13249 ///- `VK_ERROR_UNKNOWN`
13250 ///- `VK_ERROR_VALIDATION_FAILED`
13251 ///
13252 ///# Safety
13253 ///- `device` (self) must be valid and not destroyed.
13254 ///
13255 ///# Panics
13256 ///Panics if `vkInitializePerformanceApiINTEL` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13257 ///
13258 ///# Usage Notes
13259 ///
13260 ///Initializes the Intel performance query API on a device. Must be
13261 ///called before using any other Intel performance query commands.
13262 ///Uninitialize with `uninitialize_performance_api_intel`.
13263 ///
13264 ///Requires `VK_INTEL_performance_query`.
13265 pub unsafe fn initialize_performance_api_intel(
13266 &self,
13267 p_initialize_info: &InitializePerformanceApiInfoINTEL,
13268 ) -> VkResult<()> {
13269 let fp = self
13270 .commands()
13271 .initialize_performance_api_intel
13272 .expect("vkInitializePerformanceApiINTEL not loaded");
13273 check(unsafe { fp(self.handle(), p_initialize_info) })
13274 }
13275 ///Wraps [`vkUninitializePerformanceApiINTEL`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkUninitializePerformanceApiINTEL.html).
13276 /**
13277 Provided by **VK_INTEL_performance_query**.*/
13278 ///
13279 ///# Safety
13280 ///- `device` (self) must be valid and not destroyed.
13281 ///
13282 ///# Panics
13283 ///Panics if `vkUninitializePerformanceApiINTEL` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13284 ///
13285 ///# Usage Notes
13286 ///
13287 ///Shuts down the Intel performance query API on a device, releasing
13288 ///any internal resources. Call when performance profiling is
13289 ///complete.
13290 ///
13291 ///Requires `VK_INTEL_performance_query`.
13292 pub unsafe fn uninitialize_performance_api_intel(&self) {
13293 let fp = self
13294 .commands()
13295 .uninitialize_performance_api_intel
13296 .expect("vkUninitializePerformanceApiINTEL not loaded");
13297 unsafe { fp(self.handle()) };
13298 }
13299 ///Wraps [`vkCmdSetPerformanceMarkerINTEL`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetPerformanceMarkerINTEL.html).
13300 /**
13301 Provided by **VK_INTEL_performance_query**.*/
13302 ///
13303 ///# Errors
13304 ///- `VK_ERROR_TOO_MANY_OBJECTS`
13305 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13306 ///- `VK_ERROR_UNKNOWN`
13307 ///- `VK_ERROR_VALIDATION_FAILED`
13308 ///
13309 ///# Safety
13310 ///- `commandBuffer` (self) must be valid and not destroyed.
13311 ///- `commandBuffer` must be externally synchronized.
13312 ///
13313 ///# Panics
13314 ///Panics if `vkCmdSetPerformanceMarkerINTEL` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13315 ///
13316 ///# Usage Notes
13317 ///
13318 ///Sets a performance marker in the command buffer to delimit a
13319 ///region of interest for Intel GPU profiling. Counters sampled
13320 ///between markers are attributed to the marked region.
13321 ///
13322 ///Requires `VK_INTEL_performance_query`.
13323 pub unsafe fn cmd_set_performance_marker_intel(
13324 &self,
13325 command_buffer: CommandBuffer,
13326 p_marker_info: &PerformanceMarkerInfoINTEL,
13327 ) -> VkResult<()> {
13328 let fp = self
13329 .commands()
13330 .cmd_set_performance_marker_intel
13331 .expect("vkCmdSetPerformanceMarkerINTEL not loaded");
13332 check(unsafe { fp(command_buffer, p_marker_info) })
13333 }
13334 ///Wraps [`vkCmdSetPerformanceStreamMarkerINTEL`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetPerformanceStreamMarkerINTEL.html).
13335 /**
13336 Provided by **VK_INTEL_performance_query**.*/
13337 ///
13338 ///# Errors
13339 ///- `VK_ERROR_TOO_MANY_OBJECTS`
13340 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13341 ///- `VK_ERROR_UNKNOWN`
13342 ///- `VK_ERROR_VALIDATION_FAILED`
13343 ///
13344 ///# Safety
13345 ///- `commandBuffer` (self) must be valid and not destroyed.
13346 ///- `commandBuffer` must be externally synchronized.
13347 ///
13348 ///# Panics
13349 ///Panics if `vkCmdSetPerformanceStreamMarkerINTEL` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13350 ///
13351 ///# Usage Notes
13352 ///
13353 ///Sets a performance stream marker in the command buffer. Stream
13354 ///markers identify points in the command stream for correlating
13355 ///performance counter data with specific GPU work.
13356 ///
13357 ///Requires `VK_INTEL_performance_query`.
13358 pub unsafe fn cmd_set_performance_stream_marker_intel(
13359 &self,
13360 command_buffer: CommandBuffer,
13361 p_marker_info: &PerformanceStreamMarkerInfoINTEL,
13362 ) -> VkResult<()> {
13363 let fp = self
13364 .commands()
13365 .cmd_set_performance_stream_marker_intel
13366 .expect("vkCmdSetPerformanceStreamMarkerINTEL not loaded");
13367 check(unsafe { fp(command_buffer, p_marker_info) })
13368 }
13369 ///Wraps [`vkCmdSetPerformanceOverrideINTEL`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetPerformanceOverrideINTEL.html).
13370 /**
13371 Provided by **VK_INTEL_performance_query**.*/
13372 ///
13373 ///# Errors
13374 ///- `VK_ERROR_TOO_MANY_OBJECTS`
13375 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13376 ///- `VK_ERROR_UNKNOWN`
13377 ///- `VK_ERROR_VALIDATION_FAILED`
13378 ///
13379 ///# Safety
13380 ///- `commandBuffer` (self) must be valid and not destroyed.
13381 ///- `commandBuffer` must be externally synchronized.
13382 ///
13383 ///# Panics
13384 ///Panics if `vkCmdSetPerformanceOverrideINTEL` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13385 ///
13386 ///# Usage Notes
13387 ///
13388 ///Overrides hardware performance settings for the remainder of the
13389 ///command buffer (e.g., forcing specific EU thread counts). Used
13390 ///for controlled profiling experiments.
13391 ///
13392 ///Requires `VK_INTEL_performance_query`.
13393 pub unsafe fn cmd_set_performance_override_intel(
13394 &self,
13395 command_buffer: CommandBuffer,
13396 p_override_info: &PerformanceOverrideInfoINTEL,
13397 ) -> VkResult<()> {
13398 let fp = self
13399 .commands()
13400 .cmd_set_performance_override_intel
13401 .expect("vkCmdSetPerformanceOverrideINTEL not loaded");
13402 check(unsafe { fp(command_buffer, p_override_info) })
13403 }
13404 ///Wraps [`vkAcquirePerformanceConfigurationINTEL`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAcquirePerformanceConfigurationINTEL.html).
13405 /**
13406 Provided by **VK_INTEL_performance_query**.*/
13407 ///
13408 ///# Errors
13409 ///- `VK_ERROR_TOO_MANY_OBJECTS`
13410 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13411 ///- `VK_ERROR_UNKNOWN`
13412 ///- `VK_ERROR_VALIDATION_FAILED`
13413 ///
13414 ///# Safety
13415 ///- `device` (self) must be valid and not destroyed.
13416 ///
13417 ///# Panics
13418 ///Panics if `vkAcquirePerformanceConfigurationINTEL` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13419 ///
13420 ///# Usage Notes
13421 ///
13422 ///Acquires a performance configuration that enables specific
13423 ///hardware counters for profiling. Apply to a queue with
13424 ///`queue_set_performance_configuration_intel`. Release with
13425 ///`release_performance_configuration_intel`.
13426 ///
13427 ///Requires `VK_INTEL_performance_query`.
13428 pub unsafe fn acquire_performance_configuration_intel(
13429 &self,
13430 p_acquire_info: &PerformanceConfigurationAcquireInfoINTEL,
13431 ) -> VkResult<PerformanceConfigurationINTEL> {
13432 let fp = self
13433 .commands()
13434 .acquire_performance_configuration_intel
13435 .expect("vkAcquirePerformanceConfigurationINTEL not loaded");
13436 let mut out = unsafe { core::mem::zeroed() };
13437 check(unsafe { fp(self.handle(), p_acquire_info, &mut out) })?;
13438 Ok(out)
13439 }
13440 ///Wraps [`vkReleasePerformanceConfigurationINTEL`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkReleasePerformanceConfigurationINTEL.html).
13441 /**
13442 Provided by **VK_INTEL_performance_query**.*/
13443 ///
13444 ///# Errors
13445 ///- `VK_ERROR_TOO_MANY_OBJECTS`
13446 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13447 ///- `VK_ERROR_UNKNOWN`
13448 ///- `VK_ERROR_VALIDATION_FAILED`
13449 ///
13450 ///# Safety
13451 ///- `device` (self) must be valid and not destroyed.
13452 ///- `configuration` must be externally synchronized.
13453 ///
13454 ///# Panics
13455 ///Panics if `vkReleasePerformanceConfigurationINTEL` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13456 ///
13457 ///# Usage Notes
13458 ///
13459 ///Releases a performance configuration acquired with
13460 ///`acquire_performance_configuration_intel`.
13461 ///
13462 ///Requires `VK_INTEL_performance_query`.
13463 pub unsafe fn release_performance_configuration_intel(
13464 &self,
13465 configuration: PerformanceConfigurationINTEL,
13466 ) -> VkResult<()> {
13467 let fp = self
13468 .commands()
13469 .release_performance_configuration_intel
13470 .expect("vkReleasePerformanceConfigurationINTEL not loaded");
13471 check(unsafe { fp(self.handle(), configuration) })
13472 }
13473 ///Wraps [`vkQueueSetPerformanceConfigurationINTEL`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueSetPerformanceConfigurationINTEL.html).
13474 /**
13475 Provided by **VK_INTEL_performance_query**.*/
13476 ///
13477 ///# Errors
13478 ///- `VK_ERROR_TOO_MANY_OBJECTS`
13479 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13480 ///- `VK_ERROR_UNKNOWN`
13481 ///- `VK_ERROR_VALIDATION_FAILED`
13482 ///
13483 ///# Safety
13484 ///- `queue` (self) must be valid and not destroyed.
13485 ///- `queue` must be externally synchronized.
13486 ///
13487 ///# Panics
13488 ///Panics if `vkQueueSetPerformanceConfigurationINTEL` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13489 ///
13490 ///# Usage Notes
13491 ///
13492 ///Applies a performance configuration to a queue, enabling the
13493 ///selected hardware counters for all subsequent submissions to
13494 ///that queue.
13495 ///
13496 ///Requires `VK_INTEL_performance_query`.
13497 pub unsafe fn queue_set_performance_configuration_intel(
13498 &self,
13499 queue: Queue,
13500 configuration: PerformanceConfigurationINTEL,
13501 ) -> VkResult<()> {
13502 let fp = self
13503 .commands()
13504 .queue_set_performance_configuration_intel
13505 .expect("vkQueueSetPerformanceConfigurationINTEL not loaded");
13506 check(unsafe { fp(queue, configuration) })
13507 }
13508 ///Wraps [`vkGetPerformanceParameterINTEL`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPerformanceParameterINTEL.html).
13509 /**
13510 Provided by **VK_INTEL_performance_query**.*/
13511 ///
13512 ///# Errors
13513 ///- `VK_ERROR_TOO_MANY_OBJECTS`
13514 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13515 ///- `VK_ERROR_UNKNOWN`
13516 ///- `VK_ERROR_VALIDATION_FAILED`
13517 ///
13518 ///# Safety
13519 ///- `device` (self) must be valid and not destroyed.
13520 ///
13521 ///# Panics
13522 ///Panics if `vkGetPerformanceParameterINTEL` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13523 ///
13524 ///# Usage Notes
13525 ///
13526 ///Queries a performance parameter value from the Intel driver, such
13527 ///as GPU clock frequency or EU count. Useful for normalizing
13528 ///profiling results.
13529 ///
13530 ///Requires `VK_INTEL_performance_query`.
13531 pub unsafe fn get_performance_parameter_intel(
13532 &self,
13533 parameter: PerformanceParameterTypeINTEL,
13534 ) -> VkResult<PerformanceValueINTEL> {
13535 let fp = self
13536 .commands()
13537 .get_performance_parameter_intel
13538 .expect("vkGetPerformanceParameterINTEL not loaded");
13539 let mut out = unsafe { core::mem::zeroed() };
13540 check(unsafe { fp(self.handle(), parameter, &mut out) })?;
13541 Ok(out)
13542 }
13543 ///Wraps [`vkGetDeviceMemoryOpaqueCaptureAddress`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceMemoryOpaqueCaptureAddress.html).
13544 /**
13545 Provided by **VK_BASE_VERSION_1_2**.*/
13546 ///
13547 ///# Safety
13548 ///- `device` (self) must be valid and not destroyed.
13549 ///
13550 ///# Panics
13551 ///Panics if `vkGetDeviceMemoryOpaqueCaptureAddress` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13552 ///
13553 ///# Usage Notes
13554 ///
13555 ///Returns an opaque capture address for a device memory allocation
13556 ///that was created with
13557 ///`MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY`. Used in conjunction
13558 ///with `get_buffer_opaque_capture_address` to replay buffer address
13559 ///assignments.
13560 ///
13561 ///This is a debugging/replay tool feature. Most applications do not
13562 ///need this.
13563 pub unsafe fn get_device_memory_opaque_capture_address(
13564 &self,
13565 p_info: &DeviceMemoryOpaqueCaptureAddressInfo,
13566 ) -> u64 {
13567 let fp = self
13568 .commands()
13569 .get_device_memory_opaque_capture_address
13570 .expect("vkGetDeviceMemoryOpaqueCaptureAddress not loaded");
13571 unsafe { fp(self.handle(), p_info) }
13572 }
13573 ///Wraps [`vkGetPipelineExecutablePropertiesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPipelineExecutablePropertiesKHR.html).
13574 /**
13575 Provided by **VK_KHR_pipeline_executable_properties**.*/
13576 ///
13577 ///# Errors
13578 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13579 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
13580 ///- `VK_ERROR_UNKNOWN`
13581 ///- `VK_ERROR_VALIDATION_FAILED`
13582 ///
13583 ///# Safety
13584 ///- `device` (self) must be valid and not destroyed.
13585 ///
13586 ///# Panics
13587 ///Panics if `vkGetPipelineExecutablePropertiesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13588 ///
13589 ///# Usage Notes
13590 ///
13591 ///Lists the executable components within a pipeline. A single
13592 ///pipeline may contain multiple executables, for example, a
13593 ///graphics pipeline typically has separate vertex and fragment
13594 ///shader executables.
13595 ///
13596 ///Each returned `PipelineExecutablePropertiesKHR` contains a name,
13597 ///description, and shader stage flags identifying the executable.
13598 ///Use these to index into `get_pipeline_executable_statistics_khr`
13599 ///and `get_pipeline_executable_internal_representations_khr`.
13600 ///
13601 ///The pipeline must have been created with
13602 ///`PIPELINE_CREATE_CAPTURE_STATISTICS` or
13603 ///`PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS`. This is a
13604 ///debugging and profiling tool, not intended for shipping builds.
13605 pub unsafe fn get_pipeline_executable_properties_khr(
13606 &self,
13607 p_pipeline_info: &PipelineInfoKHR,
13608 ) -> VkResult<Vec<PipelineExecutablePropertiesKHR>> {
13609 let fp = self
13610 .commands()
13611 .get_pipeline_executable_properties_khr
13612 .expect("vkGetPipelineExecutablePropertiesKHR not loaded");
13613 enumerate_two_call(|count, data| unsafe { fp(self.handle(), p_pipeline_info, count, data) })
13614 }
13615 ///Wraps [`vkGetPipelineExecutableStatisticsKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPipelineExecutableStatisticsKHR.html).
13616 /**
13617 Provided by **VK_KHR_pipeline_executable_properties**.*/
13618 ///
13619 ///# Errors
13620 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13621 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
13622 ///- `VK_ERROR_UNKNOWN`
13623 ///- `VK_ERROR_VALIDATION_FAILED`
13624 ///
13625 ///# Safety
13626 ///- `device` (self) must be valid and not destroyed.
13627 ///
13628 ///# Panics
13629 ///Panics if `vkGetPipelineExecutableStatisticsKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13630 ///
13631 ///# Usage Notes
13632 ///
13633 ///Retrieves compiler statistics for a specific pipeline executable.
13634 ///Statistics include metrics like register usage, instruction count,
13635 ///scratch memory, and other driver-specific values.
13636 ///
13637 ///Identify the executable by index from
13638 ///`get_pipeline_executable_properties_khr` via
13639 ///`PipelineExecutableInfoKHR`.
13640 ///
13641 ///Each statistic has a name, description, format (bool, int, float,
13642 ///or string), and value. The available statistics are
13643 ///driver-specific, different vendors report different metrics.
13644 ///
13645 ///The pipeline must have been created with
13646 ///`PIPELINE_CREATE_CAPTURE_STATISTICS`. This is a profiling tool
13647 ///for shader optimization, use it to compare register pressure
13648 ///or instruction counts across shader variants.
13649 pub unsafe fn get_pipeline_executable_statistics_khr(
13650 &self,
13651 p_executable_info: &PipelineExecutableInfoKHR,
13652 ) -> VkResult<Vec<PipelineExecutableStatisticKHR>> {
13653 let fp = self
13654 .commands()
13655 .get_pipeline_executable_statistics_khr
13656 .expect("vkGetPipelineExecutableStatisticsKHR not loaded");
13657 enumerate_two_call(|count, data| unsafe {
13658 fp(self.handle(), p_executable_info, count, data)
13659 })
13660 }
13661 ///Wraps [`vkGetPipelineExecutableInternalRepresentationsKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPipelineExecutableInternalRepresentationsKHR.html).
13662 /**
13663 Provided by **VK_KHR_pipeline_executable_properties**.*/
13664 ///
13665 ///# Errors
13666 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13667 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
13668 ///- `VK_ERROR_UNKNOWN`
13669 ///- `VK_ERROR_VALIDATION_FAILED`
13670 ///
13671 ///# Safety
13672 ///- `device` (self) must be valid and not destroyed.
13673 ///
13674 ///# Panics
13675 ///Panics if `vkGetPipelineExecutableInternalRepresentationsKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13676 ///
13677 ///# Usage Notes
13678 ///
13679 ///Retrieves internal representations (IR) of a pipeline executable.
13680 ///These are driver-specific intermediate or final shader
13681 ///representations, for example, SPIR-V, vendor IR, or GPU ISA
13682 ///disassembly.
13683 ///
13684 ///Each representation has a name, description, and opaque data
13685 ///blob. Whether the data is human-readable text or binary depends
13686 ///on `is_text` in the returned structure.
13687 ///
13688 ///The pipeline must have been created with
13689 ///`PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS`. Enabling
13690 ///this flag may disable optimizations, so only use it for
13691 ///debugging and shader analysis, not in production.
13692 ///
13693 ///Identify the executable by index from
13694 ///`get_pipeline_executable_properties_khr`.
13695 pub unsafe fn get_pipeline_executable_internal_representations_khr(
13696 &self,
13697 p_executable_info: &PipelineExecutableInfoKHR,
13698 ) -> VkResult<Vec<PipelineExecutableInternalRepresentationKHR>> {
13699 let fp = self
13700 .commands()
13701 .get_pipeline_executable_internal_representations_khr
13702 .expect("vkGetPipelineExecutableInternalRepresentationsKHR not loaded");
13703 enumerate_two_call(|count, data| unsafe {
13704 fp(self.handle(), p_executable_info, count, data)
13705 })
13706 }
13707 ///Wraps [`vkCmdSetLineStipple`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetLineStipple.html).
13708 /**
13709 Provided by **VK_GRAPHICS_VERSION_1_4**.*/
13710 ///
13711 ///# Safety
13712 ///- `commandBuffer` (self) must be valid and not destroyed.
13713 ///- `commandBuffer` must be externally synchronized.
13714 ///
13715 ///# Panics
13716 ///Panics if `vkCmdSetLineStipple` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13717 ///
13718 ///# Usage Notes
13719 ///
13720 ///Dynamically sets the line stipple pattern and repeat factor. Only
13721 ///takes effect if the pipeline was created with
13722 ///`DYNAMIC_STATE_LINE_STIPPLE`.
13723 ///
13724 ///The `stipple_factor` (1–256) controls how many pixels each bit of
13725 ///the pattern spans. The `stipple_pattern` is a 16-bit bitmask where
13726 ///each bit represents a pixel, 1 is drawn, 0 is discarded.
13727 ///
13728 ///Line stippling requires `VK_EXT_line_rasterization` and the
13729 ///`stippled_*_lines` device features, depending on which line
13730 ///rasterisation mode you use.
13731 ///
13732 ///Core dynamic state in Vulkan 1.4.
13733 pub unsafe fn cmd_set_line_stipple(
13734 &self,
13735 command_buffer: CommandBuffer,
13736 line_stipple_factor: u32,
13737 line_stipple_pattern: u16,
13738 ) {
13739 let fp = self
13740 .commands()
13741 .cmd_set_line_stipple
13742 .expect("vkCmdSetLineStipple not loaded");
13743 unsafe { fp(command_buffer, line_stipple_factor, line_stipple_pattern) };
13744 }
13745 ///Wraps [`vkGetFaultData`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetFaultData.html).
13746 /**
13747 Provided by **VKSC_VERSION_1_0**.*/
13748 ///
13749 ///# Errors
13750 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13751 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
13752 ///- `VK_ERROR_UNKNOWN`
13753 ///- `VK_ERROR_VALIDATION_FAILED`
13754 ///
13755 ///# Safety
13756 ///- `device` (self) must be valid and not destroyed.
13757 ///
13758 ///# Panics
13759 ///Panics if `vkGetFaultData` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13760 ///
13761 ///# Usage Notes
13762 ///
13763 ///Queries recorded fault data from the device. Part of Vulkan SC
13764 ///(Safety Critical) for fault reporting in safety-certified
13765 ///environments. Uses the two-call idiom. The
13766 ///`fault_query_behavior` controls whether queried faults are
13767 ///cleared. Also reports the count of unrecorded faults that
13768 ///overflowed the internal buffer.
13769 ///
13770 ///Requires Vulkan SC.
13771 pub unsafe fn get_fault_data(
13772 &self,
13773 fault_query_behavior: FaultQueryBehavior,
13774 p_unrecorded_faults: *mut u32,
13775 ) -> VkResult<Vec<FaultData>> {
13776 let fp = self
13777 .commands()
13778 .get_fault_data
13779 .expect("vkGetFaultData not loaded");
13780 enumerate_two_call(|count, data| unsafe {
13781 fp(
13782 self.handle(),
13783 fault_query_behavior,
13784 p_unrecorded_faults,
13785 count,
13786 data,
13787 )
13788 })
13789 }
13790 ///Wraps [`vkCreateAccelerationStructureKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateAccelerationStructureKHR.html).
13791 /**
13792 Provided by **VK_KHR_acceleration_structure**.*/
13793 ///
13794 ///# Errors
13795 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13796 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
13797 ///- `VK_ERROR_UNKNOWN`
13798 ///- `VK_ERROR_VALIDATION_FAILED`
13799 ///
13800 ///# Safety
13801 ///- `device` (self) must be valid and not destroyed.
13802 ///
13803 ///# Panics
13804 ///Panics if `vkCreateAccelerationStructureKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13805 ///
13806 ///# Usage Notes
13807 ///
13808 ///Creates an acceleration structure for hardware ray tracing. An
13809 ///acceleration structure is a spatial data structure (typically a BVH)
13810 ///that the GPU traverses during ray intersection tests.
13811 ///
13812 ///**Two levels**:
13813 ///
13814 ///- **Bottom-level (BLAS)**: contains geometry (triangles or AABBs).
13815 /// Create one per mesh or mesh group.
13816 ///- **Top-level (TLAS)**: contains instances that reference BLASes
13817 /// with per-instance transforms. Create one per scene.
13818 ///
13819 ///The acceleration structure needs a backing buffer created with
13820 ///`BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE`. Query the required
13821 ///size with `get_acceleration_structure_build_sizes_khr` first.
13822 ///
13823 ///After creation, build the structure with
13824 ///`cmd_build_acceleration_structures_khr`. The structure is not usable
13825 ///for tracing until built.
13826 pub unsafe fn create_acceleration_structure_khr(
13827 &self,
13828 p_create_info: &AccelerationStructureCreateInfoKHR,
13829 allocator: Option<&AllocationCallbacks>,
13830 ) -> VkResult<AccelerationStructureKHR> {
13831 let fp = self
13832 .commands()
13833 .create_acceleration_structure_khr
13834 .expect("vkCreateAccelerationStructureKHR not loaded");
13835 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
13836 let mut out = unsafe { core::mem::zeroed() };
13837 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
13838 Ok(out)
13839 }
13840 ///Wraps [`vkCmdBuildAccelerationStructuresKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBuildAccelerationStructuresKHR.html).
13841 /**
13842 Provided by **VK_KHR_acceleration_structure**.*/
13843 ///
13844 ///# Safety
13845 ///- `commandBuffer` (self) must be valid and not destroyed.
13846 ///- `commandBuffer` must be externally synchronized.
13847 ///
13848 ///# Panics
13849 ///Panics if `vkCmdBuildAccelerationStructuresKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13850 ///
13851 ///# Usage Notes
13852 ///
13853 ///Records a GPU-side acceleration structure build or update. This is
13854 ///the primary way to build BLASes and TLASes for ray tracing.
13855 ///
13856 ///**Build vs update**: an initial build creates the structure from
13857 ///scratch. An update (`BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE`)
13858 ///modifies an existing structure in-place, which is faster but
13859 ///produces lower traversal quality. Use updates for dynamic geometry
13860 ///(e.g. animated characters) and full rebuilds when geometry changes
13861 ///significantly.
13862 ///
13863 ///**Scratch buffer**: builds require a temporary scratch buffer.
13864 ///Query the required size with
13865 ///`get_acceleration_structure_build_sizes_khr` and create a buffer
13866 ///with `BUFFER_USAGE_STORAGE_BUFFER`.
13867 ///
13868 ///Multiple builds can be batched in a single call. The driver may
13869 ///execute them in parallel.
13870 ///
13871 ///Must be recorded outside a render pass.
13872 pub unsafe fn cmd_build_acceleration_structures_khr(
13873 &self,
13874 command_buffer: CommandBuffer,
13875 p_infos: &[AccelerationStructureBuildGeometryInfoKHR],
13876 pp_build_range_infos: *const *const AccelerationStructureBuildRangeInfoKHR,
13877 ) {
13878 let fp = self
13879 .commands()
13880 .cmd_build_acceleration_structures_khr
13881 .expect("vkCmdBuildAccelerationStructuresKHR not loaded");
13882 unsafe {
13883 fp(
13884 command_buffer,
13885 p_infos.len() as u32,
13886 p_infos.as_ptr(),
13887 pp_build_range_infos,
13888 )
13889 };
13890 }
13891 ///Wraps [`vkCmdBuildAccelerationStructuresIndirectKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBuildAccelerationStructuresIndirectKHR.html).
13892 /**
13893 Provided by **VK_KHR_acceleration_structure**.*/
13894 ///
13895 ///# Safety
13896 ///- `commandBuffer` (self) must be valid and not destroyed.
13897 ///- `commandBuffer` must be externally synchronized.
13898 ///
13899 ///# Panics
13900 ///Panics if `vkCmdBuildAccelerationStructuresIndirectKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13901 ///
13902 ///# Usage Notes
13903 ///
13904 ///GPU-side acceleration structure build with indirect parameters. The
13905 ///primitive counts and build ranges are read from GPU buffers rather
13906 ///than specified on the CPU.
13907 ///
13908 ///This enables fully GPU-driven scene management where a compute
13909 ///shader determines which geometry to include and writes the build
13910 ///parameters.
13911 ///
13912 ///Requires the `acceleration_structure_indirect_build` feature.
13913 pub unsafe fn cmd_build_acceleration_structures_indirect_khr(
13914 &self,
13915 command_buffer: CommandBuffer,
13916 p_infos: &[AccelerationStructureBuildGeometryInfoKHR],
13917 p_indirect_device_addresses: &[u64],
13918 p_indirect_strides: &[u32],
13919 pp_max_primitive_counts: *const *const u32,
13920 ) {
13921 let fp = self
13922 .commands()
13923 .cmd_build_acceleration_structures_indirect_khr
13924 .expect("vkCmdBuildAccelerationStructuresIndirectKHR not loaded");
13925 unsafe {
13926 fp(
13927 command_buffer,
13928 p_infos.len() as u32,
13929 p_infos.as_ptr(),
13930 p_indirect_device_addresses.as_ptr(),
13931 p_indirect_strides.as_ptr(),
13932 pp_max_primitive_counts,
13933 )
13934 };
13935 }
13936 ///Wraps [`vkBuildAccelerationStructuresKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBuildAccelerationStructuresKHR.html).
13937 /**
13938 Provided by **VK_KHR_acceleration_structure**.*/
13939 ///
13940 ///# Errors
13941 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13942 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
13943 ///- `VK_ERROR_UNKNOWN`
13944 ///- `VK_ERROR_VALIDATION_FAILED`
13945 ///
13946 ///# Safety
13947 ///- `device` (self) must be valid and not destroyed.
13948 ///
13949 ///# Panics
13950 ///Panics if `vkBuildAccelerationStructuresKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13951 ///
13952 ///# Usage Notes
13953 ///
13954 ///Builds or updates acceleration structures on the **host** (CPU).
13955 ///This is the CPU-side alternative to
13956 ///`cmd_build_acceleration_structures_khr`.
13957 ///
13958 ///Host builds are useful for offline processing, tools, or when GPU
13959 ///build capacity is limited. However, GPU builds are significantly
13960 ///faster for real-time applications.
13961 ///
13962 ///Requires the `acceleration_structure_host_commands` feature.
13963 pub unsafe fn build_acceleration_structures_khr(
13964 &self,
13965 deferred_operation: DeferredOperationKHR,
13966 p_infos: &[AccelerationStructureBuildGeometryInfoKHR],
13967 pp_build_range_infos: *const *const AccelerationStructureBuildRangeInfoKHR,
13968 ) -> VkResult<()> {
13969 let fp = self
13970 .commands()
13971 .build_acceleration_structures_khr
13972 .expect("vkBuildAccelerationStructuresKHR not loaded");
13973 check(unsafe {
13974 fp(
13975 self.handle(),
13976 deferred_operation,
13977 p_infos.len() as u32,
13978 p_infos.as_ptr(),
13979 pp_build_range_infos,
13980 )
13981 })
13982 }
13983 ///Wraps [`vkGetAccelerationStructureDeviceAddressKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetAccelerationStructureDeviceAddressKHR.html).
13984 /**
13985 Provided by **VK_KHR_acceleration_structure**.*/
13986 ///
13987 ///# Safety
13988 ///- `device` (self) must be valid and not destroyed.
13989 ///
13990 ///# Panics
13991 ///Panics if `vkGetAccelerationStructureDeviceAddressKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13992 ///
13993 ///# Usage Notes
13994 ///
13995 ///Returns the GPU device address of an acceleration structure. This
13996 ///address is used when building a TLAS, each instance in the TLAS
13997 ///references a BLAS by its device address.
13998 ///
13999 ///The address remains valid for the lifetime of the acceleration
14000 ///structure.
14001 pub unsafe fn get_acceleration_structure_device_address_khr(
14002 &self,
14003 p_info: &AccelerationStructureDeviceAddressInfoKHR,
14004 ) -> u64 {
14005 let fp = self
14006 .commands()
14007 .get_acceleration_structure_device_address_khr
14008 .expect("vkGetAccelerationStructureDeviceAddressKHR not loaded");
14009 unsafe { fp(self.handle(), p_info) }
14010 }
14011 ///Wraps [`vkCreateDeferredOperationKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateDeferredOperationKHR.html).
14012 /**
14013 Provided by **VK_KHR_deferred_host_operations**.*/
14014 ///
14015 ///# Errors
14016 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
14017 ///- `VK_ERROR_UNKNOWN`
14018 ///- `VK_ERROR_VALIDATION_FAILED`
14019 ///
14020 ///# Safety
14021 ///- `device` (self) must be valid and not destroyed.
14022 ///
14023 ///# Panics
14024 ///Panics if `vkCreateDeferredOperationKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14025 ///
14026 ///# Usage Notes
14027 ///
14028 ///Creates a deferred operation handle. Deferred operations allow
14029 ///expensive host-side work (such as ray tracing pipeline compilation)
14030 ///to be split across multiple CPU threads.
14031 ///
14032 ///The typical workflow:
14033 ///
14034 ///1. Create a deferred operation with this command.
14035 ///2. Pass the handle to a deferrable command (e.g.,
14036 /// `create_ray_tracing_pipelines_khr`). If deferred, it returns
14037 /// `OPERATION_DEFERRED_KHR`.
14038 ///3. Query `get_deferred_operation_max_concurrency_khr` to learn
14039 /// how many threads can contribute.
14040 ///4. Call `deferred_operation_join_khr` from each worker thread.
14041 ///5. Once all joins return `SUCCESS`, retrieve the result with
14042 /// `get_deferred_operation_result_khr`.
14043 ///6. Destroy the handle with `destroy_deferred_operation_khr`.
14044 ///
14045 ///The handle itself is lightweight, it is just a token for tracking
14046 ///the deferred work.
14047 pub unsafe fn create_deferred_operation_khr(
14048 &self,
14049 allocator: Option<&AllocationCallbacks>,
14050 ) -> VkResult<DeferredOperationKHR> {
14051 let fp = self
14052 .commands()
14053 .create_deferred_operation_khr
14054 .expect("vkCreateDeferredOperationKHR not loaded");
14055 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
14056 let mut out = unsafe { core::mem::zeroed() };
14057 check(unsafe { fp(self.handle(), alloc_ptr, &mut out) })?;
14058 Ok(out)
14059 }
14060 ///Wraps [`vkDestroyDeferredOperationKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyDeferredOperationKHR.html).
14061 /**
14062 Provided by **VK_KHR_deferred_host_operations**.*/
14063 ///
14064 ///# Safety
14065 ///- `device` (self) must be valid and not destroyed.
14066 ///- `operation` must be externally synchronized.
14067 ///
14068 ///# Panics
14069 ///Panics if `vkDestroyDeferredOperationKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14070 ///
14071 ///# Usage Notes
14072 ///
14073 ///Destroys a deferred operation handle. The operation must have
14074 ///completed before destruction, either all joining threads returned
14075 ///`SUCCESS` or `THREAD_DONE_KHR`, or the operation was never
14076 ///deferred.
14077 ///
14078 ///Do not destroy while threads are still joined to the operation.
14079 pub unsafe fn destroy_deferred_operation_khr(
14080 &self,
14081 operation: DeferredOperationKHR,
14082 allocator: Option<&AllocationCallbacks>,
14083 ) {
14084 let fp = self
14085 .commands()
14086 .destroy_deferred_operation_khr
14087 .expect("vkDestroyDeferredOperationKHR not loaded");
14088 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
14089 unsafe { fp(self.handle(), operation, alloc_ptr) };
14090 }
14091 ///Wraps [`vkGetDeferredOperationMaxConcurrencyKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeferredOperationMaxConcurrencyKHR.html).
14092 /**
14093 Provided by **VK_KHR_deferred_host_operations**.*/
14094 ///
14095 ///# Safety
14096 ///- `device` (self) must be valid and not destroyed.
14097 ///
14098 ///# Panics
14099 ///Panics if `vkGetDeferredOperationMaxConcurrencyKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14100 ///
14101 ///# Usage Notes
14102 ///
14103 ///Returns the maximum number of threads that can usefully join this
14104 ///deferred operation. Spawning more threads than this value wastes
14105 ///resources, additional joins will return `THREAD_IDLE_KHR`.
14106 ///
14107 ///The returned value may decrease over time as work completes, so
14108 ///query it just before spawning worker threads.
14109 ///
14110 ///A return value of zero means the operation is already complete
14111 ///or requires no additional threads.
14112 pub unsafe fn get_deferred_operation_max_concurrency_khr(
14113 &self,
14114 operation: DeferredOperationKHR,
14115 ) -> u32 {
14116 let fp = self
14117 .commands()
14118 .get_deferred_operation_max_concurrency_khr
14119 .expect("vkGetDeferredOperationMaxConcurrencyKHR not loaded");
14120 unsafe { fp(self.handle(), operation) }
14121 }
14122 ///Wraps [`vkGetDeferredOperationResultKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeferredOperationResultKHR.html).
14123 /**
14124 Provided by **VK_KHR_deferred_host_operations**.*/
14125 ///
14126 ///# Errors
14127 ///- `VK_ERROR_UNKNOWN`
14128 ///- `VK_ERROR_VALIDATION_FAILED`
14129 ///
14130 ///# Safety
14131 ///- `device` (self) must be valid and not destroyed.
14132 ///
14133 ///# Panics
14134 ///Panics if `vkGetDeferredOperationResultKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14135 ///
14136 ///# Usage Notes
14137 ///
14138 ///Returns the result of a completed deferred operation. The returned
14139 ///`VkResult` is the same value that the original deferrable command
14140 ///would have returned if it had executed synchronously.
14141 ///
14142 ///Only call this after the operation has fully completed (all joins
14143 ///returned `SUCCESS` or `THREAD_DONE_KHR`). Calling on an
14144 ///in-progress operation returns `NOT_READY`.
14145 ///
14146 ///For example, if `create_ray_tracing_pipelines_khr` was deferred,
14147 ///this returns whether pipeline creation succeeded or failed.
14148 pub unsafe fn get_deferred_operation_result_khr(
14149 &self,
14150 operation: DeferredOperationKHR,
14151 ) -> VkResult<()> {
14152 let fp = self
14153 .commands()
14154 .get_deferred_operation_result_khr
14155 .expect("vkGetDeferredOperationResultKHR not loaded");
14156 check(unsafe { fp(self.handle(), operation) })
14157 }
14158 ///Wraps [`vkDeferredOperationJoinKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDeferredOperationJoinKHR.html).
14159 /**
14160 Provided by **VK_KHR_deferred_host_operations**.*/
14161 ///
14162 ///# Errors
14163 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
14164 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
14165 ///- `VK_ERROR_UNKNOWN`
14166 ///- `VK_ERROR_VALIDATION_FAILED`
14167 ///
14168 ///# Safety
14169 ///- `device` (self) must be valid and not destroyed.
14170 ///
14171 ///# Panics
14172 ///Panics if `vkDeferredOperationJoinKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14173 ///
14174 ///# Usage Notes
14175 ///
14176 ///Joins the calling thread to a deferred operation, contributing
14177 ///CPU time to its completion. Multiple threads can join the same
14178 ///operation concurrently.
14179 ///
14180 ///Return values:
14181 ///
14182 ///- `SUCCESS`, the operation completed. The calling thread was
14183 /// the last one needed.
14184 ///- `THREAD_DONE_KHR`, this thread's contribution is finished,
14185 /// but the operation may still be in progress on other threads.
14186 ///- `THREAD_IDLE_KHR`, the operation has enough threads; this
14187 /// one was not needed. Retry later or move on.
14188 ///
14189 ///Call this in a loop per thread until it returns `SUCCESS` or
14190 ///`THREAD_DONE_KHR`. After all threads finish, check the final
14191 ///result with `get_deferred_operation_result_khr`.
14192 ///
14193 ///The number of useful threads is bounded by
14194 ///`get_deferred_operation_max_concurrency_khr`.
14195 pub unsafe fn deferred_operation_join_khr(
14196 &self,
14197 operation: DeferredOperationKHR,
14198 ) -> VkResult<()> {
14199 let fp = self
14200 .commands()
14201 .deferred_operation_join_khr
14202 .expect("vkDeferredOperationJoinKHR not loaded");
14203 check(unsafe { fp(self.handle(), operation) })
14204 }
14205 ///Wraps [`vkGetPipelineIndirectMemoryRequirementsNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPipelineIndirectMemoryRequirementsNV.html).
14206 /**
14207 Provided by **VK_NV_device_generated_commands_compute**.*/
14208 ///
14209 ///# Safety
14210 ///- `device` (self) must be valid and not destroyed.
14211 ///
14212 ///# Panics
14213 ///Panics if `vkGetPipelineIndirectMemoryRequirementsNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14214 ///
14215 ///# Usage Notes
14216 ///
14217 ///Queries the memory requirements for storing a compute pipeline's
14218 ///indirect dispatch metadata. Allocate a buffer of this size and
14219 ///pass it when creating the pipeline for device-generated compute
14220 ///dispatch.
14221 ///
14222 ///Requires `VK_NV_device_generated_commands_compute`.
14223 pub unsafe fn get_pipeline_indirect_memory_requirements_nv(
14224 &self,
14225 p_create_info: &ComputePipelineCreateInfo,
14226 p_memory_requirements: &mut MemoryRequirements2,
14227 ) {
14228 let fp = self
14229 .commands()
14230 .get_pipeline_indirect_memory_requirements_nv
14231 .expect("vkGetPipelineIndirectMemoryRequirementsNV not loaded");
14232 unsafe { fp(self.handle(), p_create_info, p_memory_requirements) };
14233 }
14234 ///Wraps [`vkGetPipelineIndirectDeviceAddressNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPipelineIndirectDeviceAddressNV.html).
14235 /**
14236 Provided by **VK_NV_device_generated_commands_compute**.*/
14237 ///
14238 ///# Safety
14239 ///- `device` (self) must be valid and not destroyed.
14240 ///
14241 ///# Panics
14242 ///Panics if `vkGetPipelineIndirectDeviceAddressNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14243 ///
14244 ///# Usage Notes
14245 ///
14246 ///Returns the device address of a compute pipeline's indirect
14247 ///dispatch metadata. The GPU writes to this address to select
14248 ///which pipeline to dispatch in device-generated compute workflows.
14249 ///
14250 ///Requires `VK_NV_device_generated_commands_compute`.
14251 pub unsafe fn get_pipeline_indirect_device_address_nv(
14252 &self,
14253 p_info: &PipelineIndirectDeviceAddressInfoNV,
14254 ) -> u64 {
14255 let fp = self
14256 .commands()
14257 .get_pipeline_indirect_device_address_nv
14258 .expect("vkGetPipelineIndirectDeviceAddressNV not loaded");
14259 unsafe { fp(self.handle(), p_info) }
14260 }
14261 ///Wraps [`vkAntiLagUpdateAMD`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAntiLagUpdateAMD.html).
14262 /**
14263 Provided by **VK_AMD_anti_lag**.*/
14264 ///
14265 ///# Safety
14266 ///- `device` (self) must be valid and not destroyed.
14267 ///
14268 ///# Panics
14269 ///Panics if `vkAntiLagUpdateAMD` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14270 ///
14271 ///# Usage Notes
14272 ///
14273 ///Submits anti-lag timing data to reduce input-to-display latency.
14274 ///Called once per frame with presentation timing hints so the driver
14275 ///can pace GPU work to minimise latency.
14276 ///
14277 ///Requires `VK_AMD_anti_lag`.
14278 pub unsafe fn anti_lag_update_amd(&self, p_data: &AntiLagDataAMD) {
14279 let fp = self
14280 .commands()
14281 .anti_lag_update_amd
14282 .expect("vkAntiLagUpdateAMD not loaded");
14283 unsafe { fp(self.handle(), p_data) };
14284 }
14285 ///Wraps [`vkCmdSetCullMode`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetCullMode.html).
14286 /**
14287 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14288 ///
14289 ///# Safety
14290 ///- `commandBuffer` (self) must be valid and not destroyed.
14291 ///- `commandBuffer` must be externally synchronized.
14292 ///
14293 ///# Panics
14294 ///Panics if `vkCmdSetCullMode` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14295 ///
14296 ///# Usage Notes
14297 ///
14298 ///Dynamically sets the triangle culling mode. Only takes effect if
14299 ///the pipeline was created with `DYNAMIC_STATE_CULL_MODE`.
14300 ///
14301 ///Values: `CULL_MODE_NONE`, `CULL_MODE_FRONT`, `CULL_MODE_BACK`,
14302 ///`CULL_MODE_FRONT_AND_BACK`.
14303 ///
14304 ///Common pattern: set `CULL_MODE_BACK` for opaque geometry and
14305 ///`CULL_MODE_NONE` for double-sided or transparent materials, without
14306 ///needing separate pipelines.
14307 ///
14308 ///Core dynamic state in Vulkan 1.3.
14309 pub unsafe fn cmd_set_cull_mode(
14310 &self,
14311 command_buffer: CommandBuffer,
14312 cull_mode: CullModeFlags,
14313 ) {
14314 let fp = self
14315 .commands()
14316 .cmd_set_cull_mode
14317 .expect("vkCmdSetCullMode not loaded");
14318 unsafe { fp(command_buffer, cull_mode) };
14319 }
14320 ///Wraps [`vkCmdSetFrontFace`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetFrontFace.html).
14321 /**
14322 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14323 ///
14324 ///# Safety
14325 ///- `commandBuffer` (self) must be valid and not destroyed.
14326 ///- `commandBuffer` must be externally synchronized.
14327 ///
14328 ///# Panics
14329 ///Panics if `vkCmdSetFrontFace` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14330 ///
14331 ///# Usage Notes
14332 ///
14333 ///Dynamically sets which triangle winding order is considered
14334 ///front-facing. Only takes effect if the pipeline was created with
14335 ///`DYNAMIC_STATE_FRONT_FACE`.
14336 ///
14337 ///Values: `FRONT_FACE_COUNTER_CLOCKWISE` (the Vulkan default) or
14338 ///`FRONT_FACE_CLOCKWISE`.
14339 ///
14340 ///Useful when rendering mirrored or reflected geometry where the
14341 ///winding order is flipped, without needing a separate pipeline.
14342 ///
14343 ///Core dynamic state in Vulkan 1.3.
14344 pub unsafe fn cmd_set_front_face(&self, command_buffer: CommandBuffer, front_face: FrontFace) {
14345 let fp = self
14346 .commands()
14347 .cmd_set_front_face
14348 .expect("vkCmdSetFrontFace not loaded");
14349 unsafe { fp(command_buffer, front_face) };
14350 }
14351 ///Wraps [`vkCmdSetPrimitiveTopology`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetPrimitiveTopology.html).
14352 /**
14353 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14354 ///
14355 ///# Safety
14356 ///- `commandBuffer` (self) must be valid and not destroyed.
14357 ///- `commandBuffer` must be externally synchronized.
14358 ///
14359 ///# Panics
14360 ///Panics if `vkCmdSetPrimitiveTopology` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14361 ///
14362 ///# Usage Notes
14363 ///
14364 ///Dynamically sets the primitive topology. Only takes effect if the
14365 ///pipeline was created with `DYNAMIC_STATE_PRIMITIVE_TOPOLOGY`.
14366 ///
14367 ///Values include `POINT_LIST`, `LINE_LIST`, `LINE_STRIP`,
14368 ///`TRIANGLE_LIST`, `TRIANGLE_STRIP`, `TRIANGLE_FAN`,
14369 ///`LINE_LIST_WITH_ADJACENCY`, `PATCH_LIST`, etc.
14370 ///
14371 ///The dynamic topology must be in the same topology class as the
14372 ///pipeline's static topology (e.g. you can switch between
14373 ///`TRIANGLE_LIST` and `TRIANGLE_STRIP` since both are triangle
14374 ///topologies, but not between `TRIANGLE_LIST` and `LINE_LIST`).
14375 ///
14376 ///Core dynamic state in Vulkan 1.3.
14377 pub unsafe fn cmd_set_primitive_topology(
14378 &self,
14379 command_buffer: CommandBuffer,
14380 primitive_topology: PrimitiveTopology,
14381 ) {
14382 let fp = self
14383 .commands()
14384 .cmd_set_primitive_topology
14385 .expect("vkCmdSetPrimitiveTopology not loaded");
14386 unsafe { fp(command_buffer, primitive_topology) };
14387 }
14388 ///Wraps [`vkCmdSetViewportWithCount`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetViewportWithCount.html).
14389 /**
14390 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14391 ///
14392 ///# Safety
14393 ///- `commandBuffer` (self) must be valid and not destroyed.
14394 ///- `commandBuffer` must be externally synchronized.
14395 ///
14396 ///# Panics
14397 ///Panics if `vkCmdSetViewportWithCount` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14398 ///
14399 ///# Usage Notes
14400 ///
14401 ///Dynamically sets both the viewports and the viewport count. Only
14402 ///takes effect if the pipeline was created with
14403 ///`DYNAMIC_STATE_VIEWPORT_WITH_COUNT`.
14404 ///
14405 ///Unlike `cmd_set_viewport` (which requires the count to match the
14406 ///pipeline's static `viewport_count`), this command also sets the
14407 ///count dynamically. The viewport count must match the scissor count
14408 ///set by `cmd_set_scissor_with_count`.
14409 ///
14410 ///Core dynamic state in Vulkan 1.3.
14411 pub unsafe fn cmd_set_viewport_with_count(
14412 &self,
14413 command_buffer: CommandBuffer,
14414 p_viewports: &[Viewport],
14415 ) {
14416 let fp = self
14417 .commands()
14418 .cmd_set_viewport_with_count
14419 .expect("vkCmdSetViewportWithCount not loaded");
14420 unsafe {
14421 fp(
14422 command_buffer,
14423 p_viewports.len() as u32,
14424 p_viewports.as_ptr(),
14425 )
14426 };
14427 }
14428 ///Wraps [`vkCmdSetScissorWithCount`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetScissorWithCount.html).
14429 /**
14430 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14431 ///
14432 ///# Safety
14433 ///- `commandBuffer` (self) must be valid and not destroyed.
14434 ///- `commandBuffer` must be externally synchronized.
14435 ///
14436 ///# Panics
14437 ///Panics if `vkCmdSetScissorWithCount` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14438 ///
14439 ///# Usage Notes
14440 ///
14441 ///Dynamically sets both the scissor rectangles and the scissor count.
14442 ///Only takes effect if the pipeline was created with
14443 ///`DYNAMIC_STATE_SCISSOR_WITH_COUNT`.
14444 ///
14445 ///Unlike `cmd_set_scissor` (which requires the count to match the
14446 ///pipeline's static `viewport_count`), this command also sets the
14447 ///count dynamically. The scissor count must match the viewport count
14448 ///set by `cmd_set_viewport_with_count`.
14449 ///
14450 ///Core dynamic state in Vulkan 1.3.
14451 pub unsafe fn cmd_set_scissor_with_count(
14452 &self,
14453 command_buffer: CommandBuffer,
14454 p_scissors: &[Rect2D],
14455 ) {
14456 let fp = self
14457 .commands()
14458 .cmd_set_scissor_with_count
14459 .expect("vkCmdSetScissorWithCount not loaded");
14460 unsafe { fp(command_buffer, p_scissors.len() as u32, p_scissors.as_ptr()) };
14461 }
14462 ///Wraps [`vkCmdBindIndexBuffer2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindIndexBuffer2.html).
14463 /**
14464 Provided by **VK_GRAPHICS_VERSION_1_4**.*/
14465 ///
14466 ///# Safety
14467 ///- `commandBuffer` (self) must be valid and not destroyed.
14468 ///- `commandBuffer` must be externally synchronized.
14469 ///
14470 ///# Panics
14471 ///Panics if `vkCmdBindIndexBuffer2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14472 ///
14473 ///# Usage Notes
14474 ///
14475 ///Vulkan 1.4 version of `cmd_bind_index_buffer` that additionally
14476 ///accepts a `size` parameter specifying the valid range of the index
14477 ///buffer. This enables the driver to perform bounds checking.
14478 ///
14479 ///Pass `VK_WHOLE_SIZE` for the size to use the remainder of the buffer
14480 ///from the offset.
14481 ///
14482 ///Prefer this over `cmd_bind_index_buffer` when targeting Vulkan 1.4+.
14483 pub unsafe fn cmd_bind_index_buffer2(
14484 &self,
14485 command_buffer: CommandBuffer,
14486 buffer: Buffer,
14487 offset: u64,
14488 size: u64,
14489 index_type: IndexType,
14490 ) {
14491 let fp = self
14492 .commands()
14493 .cmd_bind_index_buffer2
14494 .expect("vkCmdBindIndexBuffer2 not loaded");
14495 unsafe { fp(command_buffer, buffer, offset, size, index_type) };
14496 }
14497 ///Wraps [`vkCmdBindVertexBuffers2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindVertexBuffers2.html).
14498 /**
14499 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14500 ///
14501 ///# Safety
14502 ///- `commandBuffer` (self) must be valid and not destroyed.
14503 ///- `commandBuffer` must be externally synchronized.
14504 ///
14505 ///# Panics
14506 ///Panics if `vkCmdBindVertexBuffers2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14507 ///
14508 ///# Usage Notes
14509 ///
14510 ///Vulkan 1.3 version of `cmd_bind_vertex_buffers` that additionally
14511 ///accepts optional buffer sizes and strides.
14512 ///
14513 ///**Sizes**: if provided, the driver knows where each buffer ends and
14514 ///can perform bounds checking. Pass null to use the full buffer size.
14515 ///
14516 ///**Strides**: if provided, overrides the stride specified in the
14517 ///pipeline's vertex input state. This enables dynamic vertex stride
14518 ///without creating separate pipeline permutations. Pass null to use
14519 ///the pipeline's static stride.
14520 ///
14521 ///Prefer this over `cmd_bind_vertex_buffers` when targeting
14522 ///Vulkan 1.3+.
14523 pub unsafe fn cmd_bind_vertex_buffers2(
14524 &self,
14525 command_buffer: CommandBuffer,
14526 first_binding: u32,
14527 p_buffers: &[Buffer],
14528 p_offsets: &[u64],
14529 p_sizes: &[u64],
14530 p_strides: &[u64],
14531 ) {
14532 let fp = self
14533 .commands()
14534 .cmd_bind_vertex_buffers2
14535 .expect("vkCmdBindVertexBuffers2 not loaded");
14536 unsafe {
14537 fp(
14538 command_buffer,
14539 first_binding,
14540 p_buffers.len() as u32,
14541 p_buffers.as_ptr(),
14542 p_offsets.as_ptr(),
14543 p_sizes.as_ptr(),
14544 p_strides.as_ptr(),
14545 )
14546 };
14547 }
14548 ///Wraps [`vkCmdSetDepthTestEnable`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthTestEnable.html).
14549 /**
14550 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14551 ///
14552 ///# Safety
14553 ///- `commandBuffer` (self) must be valid and not destroyed.
14554 ///- `commandBuffer` must be externally synchronized.
14555 ///
14556 ///# Panics
14557 ///Panics if `vkCmdSetDepthTestEnable` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14558 ///
14559 ///# Usage Notes
14560 ///
14561 ///Dynamically enables or disables depth testing. Only takes effect if
14562 ///the pipeline was created with `DYNAMIC_STATE_DEPTH_TEST_ENABLE`.
14563 ///
14564 ///When disabled, all fragments pass the depth test regardless of the
14565 ///depth buffer contents. Useful for UI overlays, skyboxes, or
14566 ///full-screen post-processing passes.
14567 ///
14568 ///Core dynamic state in Vulkan 1.3.
14569 pub unsafe fn cmd_set_depth_test_enable(
14570 &self,
14571 command_buffer: CommandBuffer,
14572 depth_test_enable: bool,
14573 ) {
14574 let fp = self
14575 .commands()
14576 .cmd_set_depth_test_enable
14577 .expect("vkCmdSetDepthTestEnable not loaded");
14578 unsafe { fp(command_buffer, depth_test_enable as u32) };
14579 }
14580 ///Wraps [`vkCmdSetDepthWriteEnable`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthWriteEnable.html).
14581 /**
14582 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14583 ///
14584 ///# Safety
14585 ///- `commandBuffer` (self) must be valid and not destroyed.
14586 ///- `commandBuffer` must be externally synchronized.
14587 ///
14588 ///# Panics
14589 ///Panics if `vkCmdSetDepthWriteEnable` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14590 ///
14591 ///# Usage Notes
14592 ///
14593 ///Dynamically enables or disables writes to the depth buffer. Only
14594 ///takes effect if the pipeline was created with
14595 ///`DYNAMIC_STATE_DEPTH_WRITE_ENABLE`.
14596 ///
14597 ///Disable depth writes when:
14598 ///
14599 ///- Drawing transparent objects (they should test against depth but
14600 /// not write to it).
14601 ///- Drawing skyboxes after the opaque pass.
14602 ///- Performing post-processing with depth reads but no depth output.
14603 ///
14604 ///Depth testing and depth writing are independent controls, you can
14605 ///test without writing, or write without testing.
14606 ///
14607 ///Core dynamic state in Vulkan 1.3.
14608 pub unsafe fn cmd_set_depth_write_enable(
14609 &self,
14610 command_buffer: CommandBuffer,
14611 depth_write_enable: bool,
14612 ) {
14613 let fp = self
14614 .commands()
14615 .cmd_set_depth_write_enable
14616 .expect("vkCmdSetDepthWriteEnable not loaded");
14617 unsafe { fp(command_buffer, depth_write_enable as u32) };
14618 }
14619 ///Wraps [`vkCmdSetDepthCompareOp`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthCompareOp.html).
14620 /**
14621 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14622 ///
14623 ///# Safety
14624 ///- `commandBuffer` (self) must be valid and not destroyed.
14625 ///- `commandBuffer` must be externally synchronized.
14626 ///
14627 ///# Panics
14628 ///Panics if `vkCmdSetDepthCompareOp` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14629 ///
14630 ///# Usage Notes
14631 ///
14632 ///Dynamically sets the depth comparison operator. Only takes effect if
14633 ///the pipeline was created with `DYNAMIC_STATE_DEPTH_COMPARE_OP`.
14634 ///
14635 ///Values: `COMPARE_OP_LESS` (the common default for forward rendering),
14636 ///`COMPARE_OP_GREATER` (for reverse-Z), `COMPARE_OP_LESS_OR_EQUAL`,
14637 ///`COMPARE_OP_ALWAYS`, etc.
14638 ///
14639 ///**Reverse-Z**: using a reversed depth buffer (near=1.0, far=0.0)
14640 ///with `COMPARE_OP_GREATER` provides better floating-point precision
14641 ///distribution across the depth range. This is the recommended setup
14642 ///for modern rendering.
14643 ///
14644 ///Core dynamic state in Vulkan 1.3.
14645 pub unsafe fn cmd_set_depth_compare_op(
14646 &self,
14647 command_buffer: CommandBuffer,
14648 depth_compare_op: CompareOp,
14649 ) {
14650 let fp = self
14651 .commands()
14652 .cmd_set_depth_compare_op
14653 .expect("vkCmdSetDepthCompareOp not loaded");
14654 unsafe { fp(command_buffer, depth_compare_op) };
14655 }
14656 ///Wraps [`vkCmdSetDepthBoundsTestEnable`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthBoundsTestEnable.html).
14657 /**
14658 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14659 ///
14660 ///# Safety
14661 ///- `commandBuffer` (self) must be valid and not destroyed.
14662 ///- `commandBuffer` must be externally synchronized.
14663 ///
14664 ///# Panics
14665 ///Panics if `vkCmdSetDepthBoundsTestEnable` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14666 ///
14667 ///# Usage Notes
14668 ///
14669 ///Dynamically enables or disables the depth bounds test. Only takes
14670 ///effect if the pipeline was created with
14671 ///`DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE`.
14672 ///
14673 ///When enabled, fragments are discarded if the existing depth buffer
14674 ///value falls outside the range set by `cmd_set_depth_bounds`. When
14675 ///disabled, the test is skipped.
14676 ///
14677 ///Requires the `depth_bounds` device feature.
14678 ///
14679 ///Core dynamic state in Vulkan 1.3.
14680 pub unsafe fn cmd_set_depth_bounds_test_enable(
14681 &self,
14682 command_buffer: CommandBuffer,
14683 depth_bounds_test_enable: bool,
14684 ) {
14685 let fp = self
14686 .commands()
14687 .cmd_set_depth_bounds_test_enable
14688 .expect("vkCmdSetDepthBoundsTestEnable not loaded");
14689 unsafe { fp(command_buffer, depth_bounds_test_enable as u32) };
14690 }
14691 ///Wraps [`vkCmdSetStencilTestEnable`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetStencilTestEnable.html).
14692 /**
14693 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14694 ///
14695 ///# Safety
14696 ///- `commandBuffer` (self) must be valid and not destroyed.
14697 ///- `commandBuffer` must be externally synchronized.
14698 ///
14699 ///# Panics
14700 ///Panics if `vkCmdSetStencilTestEnable` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14701 ///
14702 ///# Usage Notes
14703 ///
14704 ///Dynamically enables or disables stencil testing. Only takes effect
14705 ///if the pipeline was created with
14706 ///`DYNAMIC_STATE_STENCIL_TEST_ENABLE`.
14707 ///
14708 ///When disabled, fragments pass the stencil test unconditionally and
14709 ///no stencil writes occur.
14710 ///
14711 ///Core dynamic state in Vulkan 1.3.
14712 pub unsafe fn cmd_set_stencil_test_enable(
14713 &self,
14714 command_buffer: CommandBuffer,
14715 stencil_test_enable: bool,
14716 ) {
14717 let fp = self
14718 .commands()
14719 .cmd_set_stencil_test_enable
14720 .expect("vkCmdSetStencilTestEnable not loaded");
14721 unsafe { fp(command_buffer, stencil_test_enable as u32) };
14722 }
14723 ///Wraps [`vkCmdSetStencilOp`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetStencilOp.html).
14724 /**
14725 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14726 ///
14727 ///# Safety
14728 ///- `commandBuffer` (self) must be valid and not destroyed.
14729 ///- `commandBuffer` must be externally synchronized.
14730 ///
14731 ///# Panics
14732 ///Panics if `vkCmdSetStencilOp` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14733 ///
14734 ///# Usage Notes
14735 ///
14736 ///Dynamically sets the stencil operations for front-facing,
14737 ///back-facing, or both face sets. Only takes effect if the pipeline
14738 ///was created with `DYNAMIC_STATE_STENCIL_OP`.
14739 ///
14740 ///Sets four values per face:
14741 ///
14742 ///- **`fail_op`**: action when the stencil test fails.
14743 ///- **`pass_op`**: action when both stencil and depth tests pass.
14744 ///- **`depth_fail_op`**: action when stencil passes but depth fails.
14745 ///- **`compare_op`**: the stencil comparison function.
14746 ///
14747 ///Common operations: `KEEP`, `REPLACE`, `INCREMENT_AND_CLAMP`,
14748 ///`DECREMENT_AND_CLAMP`, `INVERT`, `ZERO`.
14749 ///
14750 ///Core dynamic state in Vulkan 1.3.
14751 pub unsafe fn cmd_set_stencil_op(
14752 &self,
14753 command_buffer: CommandBuffer,
14754 face_mask: StencilFaceFlags,
14755 fail_op: StencilOp,
14756 pass_op: StencilOp,
14757 depth_fail_op: StencilOp,
14758 compare_op: CompareOp,
14759 ) {
14760 let fp = self
14761 .commands()
14762 .cmd_set_stencil_op
14763 .expect("vkCmdSetStencilOp not loaded");
14764 unsafe {
14765 fp(
14766 command_buffer,
14767 face_mask,
14768 fail_op,
14769 pass_op,
14770 depth_fail_op,
14771 compare_op,
14772 )
14773 };
14774 }
14775 ///Wraps [`vkCmdSetPatchControlPointsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetPatchControlPointsEXT.html).
14776 /**
14777 Provided by **VK_EXT_extended_dynamic_state2**.*/
14778 ///
14779 ///# Safety
14780 ///- `commandBuffer` (self) must be valid and not destroyed.
14781 ///- `commandBuffer` must be externally synchronized.
14782 ///
14783 ///# Panics
14784 ///Panics if `vkCmdSetPatchControlPointsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14785 ///
14786 ///# Usage Notes
14787 ///
14788 ///Dynamically sets the number of control points per patch for
14789 ///tessellation. Overrides the value specified at pipeline creation.
14790 ///
14791 ///Typical values: 3 (triangles), 4 (quads), 16 (bicubic patches).
14792 ///The maximum is `maxTessellationPatchSize` (at least 32).
14793 ///
14794 ///Requires the `extendedDynamicState2PatchControlPoints` feature.
14795 ///
14796 ///Provided by `VK_EXT_extended_dynamic_state2`.
14797 pub unsafe fn cmd_set_patch_control_points_ext(
14798 &self,
14799 command_buffer: CommandBuffer,
14800 patch_control_points: u32,
14801 ) {
14802 let fp = self
14803 .commands()
14804 .cmd_set_patch_control_points_ext
14805 .expect("vkCmdSetPatchControlPointsEXT not loaded");
14806 unsafe { fp(command_buffer, patch_control_points) };
14807 }
14808 ///Wraps [`vkCmdSetRasterizerDiscardEnable`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetRasterizerDiscardEnable.html).
14809 /**
14810 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14811 ///
14812 ///# Safety
14813 ///- `commandBuffer` (self) must be valid and not destroyed.
14814 ///- `commandBuffer` must be externally synchronized.
14815 ///
14816 ///# Panics
14817 ///Panics if `vkCmdSetRasterizerDiscardEnable` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14818 ///
14819 ///# Usage Notes
14820 ///
14821 ///Dynamically enables or disables rasterizer discard. Only takes
14822 ///effect if the pipeline was created with
14823 ///`DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE`.
14824 ///
14825 ///When enabled, primitives are discarded before rasterisation, no
14826 ///fragments are generated and no colour/depth output is produced. The
14827 ///vertex and geometry shader stages still execute.
14828 ///
14829 ///Use cases:
14830 ///
14831 ///- **Transform feedback only**: capture transformed vertices without
14832 /// rendering.
14833 ///- **Occlusion pre-pass**: skip fragment shading when only the depth
14834 /// or stencil output matters (though depth writes still require
14835 /// rasterisation).
14836 ///
14837 ///Core dynamic state in Vulkan 1.3.
14838 pub unsafe fn cmd_set_rasterizer_discard_enable(
14839 &self,
14840 command_buffer: CommandBuffer,
14841 rasterizer_discard_enable: bool,
14842 ) {
14843 let fp = self
14844 .commands()
14845 .cmd_set_rasterizer_discard_enable
14846 .expect("vkCmdSetRasterizerDiscardEnable not loaded");
14847 unsafe { fp(command_buffer, rasterizer_discard_enable as u32) };
14848 }
14849 ///Wraps [`vkCmdSetDepthBiasEnable`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthBiasEnable.html).
14850 /**
14851 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14852 ///
14853 ///# Safety
14854 ///- `commandBuffer` (self) must be valid and not destroyed.
14855 ///- `commandBuffer` must be externally synchronized.
14856 ///
14857 ///# Panics
14858 ///Panics if `vkCmdSetDepthBiasEnable` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14859 ///
14860 ///# Usage Notes
14861 ///
14862 ///Dynamically enables or disables depth bias. Only takes effect if the
14863 ///pipeline was created with `DYNAMIC_STATE_DEPTH_BIAS_ENABLE`.
14864 ///
14865 ///When enabled, the depth bias values set by `cmd_set_depth_bias` are
14866 ///applied to fragment depth values. When disabled, no bias is applied
14867 ///regardless of the bias values.
14868 ///
14869 ///Useful for toggling shadow map bias without separate pipelines.
14870 ///
14871 ///Core dynamic state in Vulkan 1.3.
14872 pub unsafe fn cmd_set_depth_bias_enable(
14873 &self,
14874 command_buffer: CommandBuffer,
14875 depth_bias_enable: bool,
14876 ) {
14877 let fp = self
14878 .commands()
14879 .cmd_set_depth_bias_enable
14880 .expect("vkCmdSetDepthBiasEnable not loaded");
14881 unsafe { fp(command_buffer, depth_bias_enable as u32) };
14882 }
14883 ///Wraps [`vkCmdSetLogicOpEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetLogicOpEXT.html).
14884 /**
14885 Provided by **VK_EXT_extended_dynamic_state2**.*/
14886 ///
14887 ///# Safety
14888 ///- `commandBuffer` (self) must be valid and not destroyed.
14889 ///- `commandBuffer` must be externally synchronized.
14890 ///
14891 ///# Panics
14892 ///Panics if `vkCmdSetLogicOpEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14893 ///
14894 ///# Usage Notes
14895 ///
14896 ///Dynamically sets the logic operation used for color blending.
14897 ///Logic ops (AND, OR, XOR, etc.) operate on the raw integer bit
14898 ///patterns of the fragment and framebuffer values.
14899 ///
14900 ///Only effective when logic op is enabled in the pipeline
14901 ///(`logicOpEnable`). Requires the `extendedDynamicState2LogicOp`
14902 ///feature.
14903 ///
14904 ///Provided by `VK_EXT_extended_dynamic_state2`.
14905 pub unsafe fn cmd_set_logic_op_ext(&self, command_buffer: CommandBuffer, logic_op: LogicOp) {
14906 let fp = self
14907 .commands()
14908 .cmd_set_logic_op_ext
14909 .expect("vkCmdSetLogicOpEXT not loaded");
14910 unsafe { fp(command_buffer, logic_op) };
14911 }
14912 ///Wraps [`vkCmdSetPrimitiveRestartEnable`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetPrimitiveRestartEnable.html).
14913 /**
14914 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14915 ///
14916 ///# Safety
14917 ///- `commandBuffer` (self) must be valid and not destroyed.
14918 ///- `commandBuffer` must be externally synchronized.
14919 ///
14920 ///# Panics
14921 ///Panics if `vkCmdSetPrimitiveRestartEnable` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14922 ///
14923 ///# Usage Notes
14924 ///
14925 ///Dynamically enables or disables primitive restart. Only takes effect
14926 ///if the pipeline was created with
14927 ///`DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE`.
14928 ///
14929 ///When enabled, a special index value (0xFFFF for UINT16, 0xFFFFFFFF
14930 ///for UINT32) in the index buffer ends the current primitive and
14931 ///starts a new one. This lets you draw multiple triangle strips or
14932 ///line strips from a single draw call without degenerate triangles.
14933 ///
14934 ///Only meaningful for strip topologies (`TRIANGLE_STRIP`,
14935 ///`LINE_STRIP`, `TRIANGLE_FAN`, etc.).
14936 ///
14937 ///Core dynamic state in Vulkan 1.3.
14938 pub unsafe fn cmd_set_primitive_restart_enable(
14939 &self,
14940 command_buffer: CommandBuffer,
14941 primitive_restart_enable: bool,
14942 ) {
14943 let fp = self
14944 .commands()
14945 .cmd_set_primitive_restart_enable
14946 .expect("vkCmdSetPrimitiveRestartEnable not loaded");
14947 unsafe { fp(command_buffer, primitive_restart_enable as u32) };
14948 }
14949 ///Wraps [`vkCmdSetTessellationDomainOriginEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetTessellationDomainOriginEXT.html).
14950 /**
14951 Provided by **VK_EXT_extended_dynamic_state3**.*/
14952 ///
14953 ///# Safety
14954 ///- `commandBuffer` (self) must be valid and not destroyed.
14955 ///- `commandBuffer` must be externally synchronized.
14956 ///
14957 ///# Panics
14958 ///Panics if `vkCmdSetTessellationDomainOriginEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14959 ///
14960 ///# Usage Notes
14961 ///
14962 ///Dynamically sets the tessellation domain origin:
14963 ///- `UPPER_LEFT`: Vulkan default, (0,0) is the upper-left corner.
14964 ///- `LOWER_LEFT`: OpenGL convention, (0,0) is the lower-left.
14965 ///
14966 ///Affects how tessellation coordinates are interpreted. Useful when
14967 ///porting OpenGL tessellation shaders.
14968 ///
14969 ///Provided by `VK_EXT_extended_dynamic_state3`.
14970 pub unsafe fn cmd_set_tessellation_domain_origin_ext(
14971 &self,
14972 command_buffer: CommandBuffer,
14973 domain_origin: TessellationDomainOrigin,
14974 ) {
14975 let fp = self
14976 .commands()
14977 .cmd_set_tessellation_domain_origin_ext
14978 .expect("vkCmdSetTessellationDomainOriginEXT not loaded");
14979 unsafe { fp(command_buffer, domain_origin) };
14980 }
14981 ///Wraps [`vkCmdSetDepthClampEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthClampEnableEXT.html).
14982 /**
14983 Provided by **VK_EXT_extended_dynamic_state3**.*/
14984 ///
14985 ///# Safety
14986 ///- `commandBuffer` (self) must be valid and not destroyed.
14987 ///- `commandBuffer` must be externally synchronized.
14988 ///
14989 ///# Panics
14990 ///Panics if `vkCmdSetDepthClampEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14991 ///
14992 ///# Usage Notes
14993 ///
14994 ///Dynamically enables or disables depth clamping. When enabled,
14995 ///fragments outside the near/far depth range are clamped instead
14996 ///of being clipped.
14997 ///
14998 ///Useful for shadow mapping and other techniques where clipping
14999 ///at the near/far plane is undesirable.
15000 ///
15001 ///Requires the `depthClamp` device feature.
15002 ///
15003 ///Provided by `VK_EXT_extended_dynamic_state3`.
15004 pub unsafe fn cmd_set_depth_clamp_enable_ext(
15005 &self,
15006 command_buffer: CommandBuffer,
15007 depth_clamp_enable: bool,
15008 ) {
15009 let fp = self
15010 .commands()
15011 .cmd_set_depth_clamp_enable_ext
15012 .expect("vkCmdSetDepthClampEnableEXT not loaded");
15013 unsafe { fp(command_buffer, depth_clamp_enable as u32) };
15014 }
15015 ///Wraps [`vkCmdSetPolygonModeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetPolygonModeEXT.html).
15016 /**
15017 Provided by **VK_EXT_extended_dynamic_state3**.*/
15018 ///
15019 ///# Safety
15020 ///- `commandBuffer` (self) must be valid and not destroyed.
15021 ///- `commandBuffer` must be externally synchronized.
15022 ///
15023 ///# Panics
15024 ///Panics if `vkCmdSetPolygonModeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15025 ///
15026 ///# Usage Notes
15027 ///
15028 ///Dynamically sets the polygon rasterization mode:
15029 ///- `FILL`: normal filled triangles (default).
15030 ///- `LINE`: wireframe rendering.
15031 ///- `POINT`: vertices only.
15032 ///
15033 ///`LINE` and `POINT` require the `fillModeNonSolid` device feature.
15034 ///
15035 ///Provided by `VK_EXT_extended_dynamic_state3`.
15036 pub unsafe fn cmd_set_polygon_mode_ext(
15037 &self,
15038 command_buffer: CommandBuffer,
15039 polygon_mode: PolygonMode,
15040 ) {
15041 let fp = self
15042 .commands()
15043 .cmd_set_polygon_mode_ext
15044 .expect("vkCmdSetPolygonModeEXT not loaded");
15045 unsafe { fp(command_buffer, polygon_mode) };
15046 }
15047 ///Wraps [`vkCmdSetRasterizationSamplesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetRasterizationSamplesEXT.html).
15048 /**
15049 Provided by **VK_EXT_extended_dynamic_state3**.*/
15050 ///
15051 ///# Safety
15052 ///- `commandBuffer` (self) must be valid and not destroyed.
15053 ///- `commandBuffer` must be externally synchronized.
15054 ///
15055 ///# Panics
15056 ///Panics if `vkCmdSetRasterizationSamplesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15057 ///
15058 ///# Usage Notes
15059 ///
15060 ///Dynamically sets the number of rasterization samples
15061 ///(multisampling level). Overrides the sample count specified
15062 ///at pipeline creation.
15063 ///
15064 ///The sample count must be compatible with the render pass
15065 ///attachments.
15066 ///
15067 ///Provided by `VK_EXT_extended_dynamic_state3`.
15068 pub unsafe fn cmd_set_rasterization_samples_ext(
15069 &self,
15070 command_buffer: CommandBuffer,
15071 rasterization_samples: SampleCountFlagBits,
15072 ) {
15073 let fp = self
15074 .commands()
15075 .cmd_set_rasterization_samples_ext
15076 .expect("vkCmdSetRasterizationSamplesEXT not loaded");
15077 unsafe { fp(command_buffer, rasterization_samples) };
15078 }
15079 ///Wraps [`vkCmdSetSampleMaskEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetSampleMaskEXT.html).
15080 /**
15081 Provided by **VK_EXT_extended_dynamic_state3**.*/
15082 ///
15083 ///# Safety
15084 ///- `commandBuffer` (self) must be valid and not destroyed.
15085 ///- `commandBuffer` must be externally synchronized.
15086 ///
15087 ///# Panics
15088 ///Panics if `vkCmdSetSampleMaskEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15089 ///
15090 ///# Usage Notes
15091 ///
15092 ///Dynamically sets the sample mask. The sample mask is ANDed with
15093 ///the coverage mask to determine which samples are written. Bits
15094 ///that are zero disable the corresponding sample.
15095 ///
15096 ///The slice length must match `ceil(rasterizationSamples / 32)`.
15097 ///
15098 ///Provided by `VK_EXT_extended_dynamic_state3`.
15099 pub unsafe fn cmd_set_sample_mask_ext(
15100 &self,
15101 command_buffer: CommandBuffer,
15102 samples: SampleCountFlagBits,
15103 p_sample_mask: Option<&u32>,
15104 ) {
15105 let fp = self
15106 .commands()
15107 .cmd_set_sample_mask_ext
15108 .expect("vkCmdSetSampleMaskEXT not loaded");
15109 let p_sample_mask_ptr = p_sample_mask.map_or(core::ptr::null(), core::ptr::from_ref);
15110 unsafe { fp(command_buffer, samples, p_sample_mask_ptr) };
15111 }
15112 ///Wraps [`vkCmdSetAlphaToCoverageEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetAlphaToCoverageEnableEXT.html).
15113 /**
15114 Provided by **VK_EXT_extended_dynamic_state3**.*/
15115 ///
15116 ///# Safety
15117 ///- `commandBuffer` (self) must be valid and not destroyed.
15118 ///- `commandBuffer` must be externally synchronized.
15119 ///
15120 ///# Panics
15121 ///Panics if `vkCmdSetAlphaToCoverageEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15122 ///
15123 ///# Usage Notes
15124 ///
15125 ///Dynamically enables or disables alpha-to-coverage multisample
15126 ///mode. When enabled, the fragment's alpha value determines which
15127 ///samples are covered, providing order-independent transparency
15128 ///for foliage, fences, etc.
15129 ///
15130 ///Provided by `VK_EXT_extended_dynamic_state3`.
15131 pub unsafe fn cmd_set_alpha_to_coverage_enable_ext(
15132 &self,
15133 command_buffer: CommandBuffer,
15134 alpha_to_coverage_enable: bool,
15135 ) {
15136 let fp = self
15137 .commands()
15138 .cmd_set_alpha_to_coverage_enable_ext
15139 .expect("vkCmdSetAlphaToCoverageEnableEXT not loaded");
15140 unsafe { fp(command_buffer, alpha_to_coverage_enable as u32) };
15141 }
15142 ///Wraps [`vkCmdSetAlphaToOneEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetAlphaToOneEnableEXT.html).
15143 /**
15144 Provided by **VK_EXT_extended_dynamic_state3**.*/
15145 ///
15146 ///# Safety
15147 ///- `commandBuffer` (self) must be valid and not destroyed.
15148 ///- `commandBuffer` must be externally synchronized.
15149 ///
15150 ///# Panics
15151 ///Panics if `vkCmdSetAlphaToOneEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15152 ///
15153 ///# Usage Notes
15154 ///
15155 ///Dynamically enables or disables alpha-to-one mode. When enabled,
15156 ///the fragment's alpha value is replaced with 1.0 after
15157 ///alpha-to-coverage processing.
15158 ///
15159 ///Requires the `alphaToOne` device feature.
15160 ///
15161 ///Provided by `VK_EXT_extended_dynamic_state3`.
15162 pub unsafe fn cmd_set_alpha_to_one_enable_ext(
15163 &self,
15164 command_buffer: CommandBuffer,
15165 alpha_to_one_enable: bool,
15166 ) {
15167 let fp = self
15168 .commands()
15169 .cmd_set_alpha_to_one_enable_ext
15170 .expect("vkCmdSetAlphaToOneEnableEXT not loaded");
15171 unsafe { fp(command_buffer, alpha_to_one_enable as u32) };
15172 }
15173 ///Wraps [`vkCmdSetLogicOpEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetLogicOpEnableEXT.html).
15174 /**
15175 Provided by **VK_EXT_extended_dynamic_state3**.*/
15176 ///
15177 ///# Safety
15178 ///- `commandBuffer` (self) must be valid and not destroyed.
15179 ///- `commandBuffer` must be externally synchronized.
15180 ///
15181 ///# Panics
15182 ///Panics if `vkCmdSetLogicOpEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15183 ///
15184 ///# Usage Notes
15185 ///
15186 ///Dynamically enables or disables logic operations for color
15187 ///blending. When enabled, fragments are combined with framebuffer
15188 ///values using the logic op set by `cmd_set_logic_op_ext` instead
15189 ///of standard blend equations.
15190 ///
15191 ///Logic ops operate on integer bit patterns. They have no effect
15192 ///on floating-point color attachments.
15193 ///
15194 ///Provided by `VK_EXT_extended_dynamic_state3`.
15195 pub unsafe fn cmd_set_logic_op_enable_ext(
15196 &self,
15197 command_buffer: CommandBuffer,
15198 logic_op_enable: bool,
15199 ) {
15200 let fp = self
15201 .commands()
15202 .cmd_set_logic_op_enable_ext
15203 .expect("vkCmdSetLogicOpEnableEXT not loaded");
15204 unsafe { fp(command_buffer, logic_op_enable as u32) };
15205 }
15206 ///Wraps [`vkCmdSetColorBlendEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetColorBlendEnableEXT.html).
15207 /**
15208 Provided by **VK_EXT_extended_dynamic_state3**.*/
15209 ///
15210 ///# Safety
15211 ///- `commandBuffer` (self) must be valid and not destroyed.
15212 ///- `commandBuffer` must be externally synchronized.
15213 ///
15214 ///# Panics
15215 ///Panics if `vkCmdSetColorBlendEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15216 ///
15217 ///# Usage Notes
15218 ///
15219 ///Dynamically enables or disables color blending for each color
15220 ///attachment. Pass a slice of `Bool32` values, one per attachment
15221 ///starting at `first_attachment`.
15222 ///
15223 ///When blending is disabled for an attachment, the fragment color
15224 ///is written directly (no src/dst blending).
15225 ///
15226 ///Provided by `VK_EXT_extended_dynamic_state3`.
15227 pub unsafe fn cmd_set_color_blend_enable_ext(
15228 &self,
15229 command_buffer: CommandBuffer,
15230 first_attachment: u32,
15231 p_color_blend_enables: &[u32],
15232 ) {
15233 let fp = self
15234 .commands()
15235 .cmd_set_color_blend_enable_ext
15236 .expect("vkCmdSetColorBlendEnableEXT not loaded");
15237 unsafe {
15238 fp(
15239 command_buffer,
15240 first_attachment,
15241 p_color_blend_enables.len() as u32,
15242 p_color_blend_enables.as_ptr(),
15243 )
15244 };
15245 }
15246 ///Wraps [`vkCmdSetColorBlendEquationEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetColorBlendEquationEXT.html).
15247 /**
15248 Provided by **VK_EXT_extended_dynamic_state3**.*/
15249 ///
15250 ///# Safety
15251 ///- `commandBuffer` (self) must be valid and not destroyed.
15252 ///- `commandBuffer` must be externally synchronized.
15253 ///
15254 ///# Panics
15255 ///Panics if `vkCmdSetColorBlendEquationEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15256 ///
15257 ///# Usage Notes
15258 ///
15259 ///Dynamically sets the blend equation (src factor, dst factor,
15260 ///blend op) for each color attachment. Each `ColorBlendEquationEXT`
15261 ///specifies both the color and alpha blend parameters.
15262 ///
15263 ///Overrides the values set at pipeline creation. Only effective for
15264 ///attachments where blending is enabled.
15265 ///
15266 ///Provided by `VK_EXT_extended_dynamic_state3`.
15267 pub unsafe fn cmd_set_color_blend_equation_ext(
15268 &self,
15269 command_buffer: CommandBuffer,
15270 first_attachment: u32,
15271 p_color_blend_equations: &[ColorBlendEquationEXT],
15272 ) {
15273 let fp = self
15274 .commands()
15275 .cmd_set_color_blend_equation_ext
15276 .expect("vkCmdSetColorBlendEquationEXT not loaded");
15277 unsafe {
15278 fp(
15279 command_buffer,
15280 first_attachment,
15281 p_color_blend_equations.len() as u32,
15282 p_color_blend_equations.as_ptr(),
15283 )
15284 };
15285 }
15286 ///Wraps [`vkCmdSetColorWriteMaskEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetColorWriteMaskEXT.html).
15287 /**
15288 Provided by **VK_EXT_extended_dynamic_state3**.*/
15289 ///
15290 ///# Safety
15291 ///- `commandBuffer` (self) must be valid and not destroyed.
15292 ///- `commandBuffer` must be externally synchronized.
15293 ///
15294 ///# Panics
15295 ///Panics if `vkCmdSetColorWriteMaskEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15296 ///
15297 ///# Usage Notes
15298 ///
15299 ///Dynamically sets the color write mask for each color attachment.
15300 ///Each `ColorComponentFlags` value controls which channels (R, G,
15301 ///B, A) are written for the corresponding attachment.
15302 ///
15303 ///Provided by `VK_EXT_extended_dynamic_state3`.
15304 pub unsafe fn cmd_set_color_write_mask_ext(
15305 &self,
15306 command_buffer: CommandBuffer,
15307 first_attachment: u32,
15308 p_color_write_masks: &[ColorComponentFlags],
15309 ) {
15310 let fp = self
15311 .commands()
15312 .cmd_set_color_write_mask_ext
15313 .expect("vkCmdSetColorWriteMaskEXT not loaded");
15314 unsafe {
15315 fp(
15316 command_buffer,
15317 first_attachment,
15318 p_color_write_masks.len() as u32,
15319 p_color_write_masks.as_ptr(),
15320 )
15321 };
15322 }
15323 ///Wraps [`vkCmdSetRasterizationStreamEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetRasterizationStreamEXT.html).
15324 /**
15325 Provided by **VK_EXT_extended_dynamic_state3**.*/
15326 ///
15327 ///# Safety
15328 ///- `commandBuffer` (self) must be valid and not destroyed.
15329 ///- `commandBuffer` must be externally synchronized.
15330 ///
15331 ///# Panics
15332 ///Panics if `vkCmdSetRasterizationStreamEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15333 ///
15334 ///# Usage Notes
15335 ///
15336 ///Dynamically sets which vertex stream is used for rasterization
15337 ///when transform feedback is active. Stream 0 is always rasterized
15338 ///by default; other streams can be selected with this command.
15339 ///
15340 ///Requires `VK_EXT_transform_feedback` and the
15341 ///`geometryStreams` feature.
15342 ///
15343 ///Provided by `VK_EXT_extended_dynamic_state3`.
15344 pub unsafe fn cmd_set_rasterization_stream_ext(
15345 &self,
15346 command_buffer: CommandBuffer,
15347 rasterization_stream: u32,
15348 ) {
15349 let fp = self
15350 .commands()
15351 .cmd_set_rasterization_stream_ext
15352 .expect("vkCmdSetRasterizationStreamEXT not loaded");
15353 unsafe { fp(command_buffer, rasterization_stream) };
15354 }
15355 ///Wraps [`vkCmdSetConservativeRasterizationModeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetConservativeRasterizationModeEXT.html).
15356 /**
15357 Provided by **VK_EXT_extended_dynamic_state3**.*/
15358 ///
15359 ///# Safety
15360 ///- `commandBuffer` (self) must be valid and not destroyed.
15361 ///- `commandBuffer` must be externally synchronized.
15362 ///
15363 ///# Panics
15364 ///Panics if `vkCmdSetConservativeRasterizationModeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15365 ///
15366 ///# Usage Notes
15367 ///
15368 ///Dynamically sets the conservative rasterization mode:
15369 ///- `DISABLED`: normal rasterization.
15370 ///- `OVERESTIMATE`: a fragment is generated if the primitive
15371 /// overlaps any part of the pixel.
15372 ///- `UNDERESTIMATE`: a fragment is generated only if the pixel
15373 /// is fully covered.
15374 ///
15375 ///Requires `VK_EXT_conservative_rasterization`.
15376 ///
15377 ///Provided by `VK_EXT_extended_dynamic_state3`.
15378 pub unsafe fn cmd_set_conservative_rasterization_mode_ext(
15379 &self,
15380 command_buffer: CommandBuffer,
15381 conservative_rasterization_mode: ConservativeRasterizationModeEXT,
15382 ) {
15383 let fp = self
15384 .commands()
15385 .cmd_set_conservative_rasterization_mode_ext
15386 .expect("vkCmdSetConservativeRasterizationModeEXT not loaded");
15387 unsafe { fp(command_buffer, conservative_rasterization_mode) };
15388 }
15389 ///Wraps [`vkCmdSetExtraPrimitiveOverestimationSizeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetExtraPrimitiveOverestimationSizeEXT.html).
15390 /**
15391 Provided by **VK_EXT_extended_dynamic_state3**.*/
15392 ///
15393 ///# Safety
15394 ///- `commandBuffer` (self) must be valid and not destroyed.
15395 ///- `commandBuffer` must be externally synchronized.
15396 ///
15397 ///# Panics
15398 ///Panics if `vkCmdSetExtraPrimitiveOverestimationSizeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15399 ///
15400 ///# Usage Notes
15401 ///
15402 ///Dynamically sets the extra overestimation size for conservative
15403 ///rasterization. This expands the primitive by additional pixels
15404 ///beyond the minimum overestimation guaranteed by the implementation.
15405 ///
15406 ///The value is in units of pixels. 0.0 means no extra
15407 ///overestimation beyond the implementation minimum.
15408 ///
15409 ///Requires `VK_EXT_conservative_rasterization`.
15410 ///
15411 ///Provided by `VK_EXT_extended_dynamic_state3`.
15412 pub unsafe fn cmd_set_extra_primitive_overestimation_size_ext(
15413 &self,
15414 command_buffer: CommandBuffer,
15415 extra_primitive_overestimation_size: f32,
15416 ) {
15417 let fp = self
15418 .commands()
15419 .cmd_set_extra_primitive_overestimation_size_ext
15420 .expect("vkCmdSetExtraPrimitiveOverestimationSizeEXT not loaded");
15421 unsafe { fp(command_buffer, extra_primitive_overestimation_size) };
15422 }
15423 ///Wraps [`vkCmdSetDepthClipEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthClipEnableEXT.html).
15424 /**
15425 Provided by **VK_EXT_extended_dynamic_state3**.*/
15426 ///
15427 ///# Safety
15428 ///- `commandBuffer` (self) must be valid and not destroyed.
15429 ///- `commandBuffer` must be externally synchronized.
15430 ///
15431 ///# Panics
15432 ///Panics if `vkCmdSetDepthClipEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15433 ///
15434 ///# Usage Notes
15435 ///
15436 ///Dynamically enables or disables depth clipping. When disabled,
15437 ///primitives are not clipped against the near and far planes
15438 ///(equivalent to `depthClampEnable`, but controlled separately).
15439 ///
15440 ///Requires `VK_EXT_depth_clip_enable` and the `depthClipEnable`
15441 ///feature.
15442 ///
15443 ///Provided by `VK_EXT_extended_dynamic_state3`.
15444 pub unsafe fn cmd_set_depth_clip_enable_ext(
15445 &self,
15446 command_buffer: CommandBuffer,
15447 depth_clip_enable: bool,
15448 ) {
15449 let fp = self
15450 .commands()
15451 .cmd_set_depth_clip_enable_ext
15452 .expect("vkCmdSetDepthClipEnableEXT not loaded");
15453 unsafe { fp(command_buffer, depth_clip_enable as u32) };
15454 }
15455 ///Wraps [`vkCmdSetSampleLocationsEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetSampleLocationsEnableEXT.html).
15456 /**
15457 Provided by **VK_EXT_extended_dynamic_state3**.*/
15458 ///
15459 ///# Safety
15460 ///- `commandBuffer` (self) must be valid and not destroyed.
15461 ///- `commandBuffer` must be externally synchronized.
15462 ///
15463 ///# Panics
15464 ///Panics if `vkCmdSetSampleLocationsEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15465 ///
15466 ///# Usage Notes
15467 ///
15468 ///Dynamically enables or disables custom sample locations. When
15469 ///enabled, the sample positions used for multisampling are taken
15470 ///from the locations set by `cmd_set_sample_locations_ext` instead
15471 ///of the implementation defaults.
15472 ///
15473 ///Requires `VK_EXT_sample_locations`.
15474 ///
15475 ///Provided by `VK_EXT_extended_dynamic_state3`.
15476 pub unsafe fn cmd_set_sample_locations_enable_ext(
15477 &self,
15478 command_buffer: CommandBuffer,
15479 sample_locations_enable: bool,
15480 ) {
15481 let fp = self
15482 .commands()
15483 .cmd_set_sample_locations_enable_ext
15484 .expect("vkCmdSetSampleLocationsEnableEXT not loaded");
15485 unsafe { fp(command_buffer, sample_locations_enable as u32) };
15486 }
15487 ///Wraps [`vkCmdSetColorBlendAdvancedEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetColorBlendAdvancedEXT.html).
15488 /**
15489 Provided by **VK_EXT_extended_dynamic_state3**.*/
15490 ///
15491 ///# Safety
15492 ///- `commandBuffer` (self) must be valid and not destroyed.
15493 ///- `commandBuffer` must be externally synchronized.
15494 ///
15495 ///# Panics
15496 ///Panics if `vkCmdSetColorBlendAdvancedEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15497 ///
15498 ///# Usage Notes
15499 ///
15500 ///Dynamically sets advanced blend parameters per color attachment.
15501 ///Each `ColorBlendAdvancedEXT` specifies the advanced blend
15502 ///operation, whether src/dst are premultiplied, and the blend
15503 ///overlap mode (uncorrelated, disjoint, conjoint).
15504 ///
15505 ///Only applies when using advanced blend operations (not the
15506 ///standard blend factors). Requires `VK_EXT_blend_operation_advanced`.
15507 ///
15508 ///Provided by `VK_EXT_extended_dynamic_state3`.
15509 pub unsafe fn cmd_set_color_blend_advanced_ext(
15510 &self,
15511 command_buffer: CommandBuffer,
15512 first_attachment: u32,
15513 p_color_blend_advanced: &[ColorBlendAdvancedEXT],
15514 ) {
15515 let fp = self
15516 .commands()
15517 .cmd_set_color_blend_advanced_ext
15518 .expect("vkCmdSetColorBlendAdvancedEXT not loaded");
15519 unsafe {
15520 fp(
15521 command_buffer,
15522 first_attachment,
15523 p_color_blend_advanced.len() as u32,
15524 p_color_blend_advanced.as_ptr(),
15525 )
15526 };
15527 }
15528 ///Wraps [`vkCmdSetProvokingVertexModeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetProvokingVertexModeEXT.html).
15529 /**
15530 Provided by **VK_EXT_extended_dynamic_state3**.*/
15531 ///
15532 ///# Safety
15533 ///- `commandBuffer` (self) must be valid and not destroyed.
15534 ///- `commandBuffer` must be externally synchronized.
15535 ///
15536 ///# Panics
15537 ///Panics if `vkCmdSetProvokingVertexModeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15538 ///
15539 ///# Usage Notes
15540 ///
15541 ///Dynamically sets which vertex in a primitive is the provoking
15542 ///vertex (the vertex whose flat-shaded attributes are used):
15543 ///- `FIRST_VERTEX`: first vertex of the primitive (Vulkan default).
15544 ///- `LAST_VERTEX`: last vertex (OpenGL convention).
15545 ///
15546 ///Requires `VK_EXT_provoking_vertex` and the
15547 ///`provokingVertexLast` feature for `LAST_VERTEX` mode.
15548 ///
15549 ///Provided by `VK_EXT_extended_dynamic_state3`.
15550 pub unsafe fn cmd_set_provoking_vertex_mode_ext(
15551 &self,
15552 command_buffer: CommandBuffer,
15553 provoking_vertex_mode: ProvokingVertexModeEXT,
15554 ) {
15555 let fp = self
15556 .commands()
15557 .cmd_set_provoking_vertex_mode_ext
15558 .expect("vkCmdSetProvokingVertexModeEXT not loaded");
15559 unsafe { fp(command_buffer, provoking_vertex_mode) };
15560 }
15561 ///Wraps [`vkCmdSetLineRasterizationModeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetLineRasterizationModeEXT.html).
15562 /**
15563 Provided by **VK_EXT_extended_dynamic_state3**.*/
15564 ///
15565 ///# Safety
15566 ///- `commandBuffer` (self) must be valid and not destroyed.
15567 ///- `commandBuffer` must be externally synchronized.
15568 ///
15569 ///# Panics
15570 ///Panics if `vkCmdSetLineRasterizationModeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15571 ///
15572 ///# Usage Notes
15573 ///
15574 ///Dynamically sets the line rasterization mode:
15575 ///- `DEFAULT`: implementation default.
15576 ///- `RECTANGULAR`: lines are rasterized as parallelograms (Vulkan
15577 /// default).
15578 ///- `BRESENHAM`: pixel-exact Bresenham lines.
15579 ///- `RECTANGULAR_SMOOTH`: antialiased rectangular lines.
15580 ///
15581 ///Requires `VK_EXT_line_rasterization` and the corresponding
15582 ///device feature for the chosen mode.
15583 ///
15584 ///Provided by `VK_EXT_extended_dynamic_state3`.
15585 pub unsafe fn cmd_set_line_rasterization_mode_ext(
15586 &self,
15587 command_buffer: CommandBuffer,
15588 line_rasterization_mode: LineRasterizationModeEXT,
15589 ) {
15590 let fp = self
15591 .commands()
15592 .cmd_set_line_rasterization_mode_ext
15593 .expect("vkCmdSetLineRasterizationModeEXT not loaded");
15594 unsafe { fp(command_buffer, line_rasterization_mode) };
15595 }
15596 ///Wraps [`vkCmdSetLineStippleEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetLineStippleEnableEXT.html).
15597 /**
15598 Provided by **VK_EXT_extended_dynamic_state3**.*/
15599 ///
15600 ///# Safety
15601 ///- `commandBuffer` (self) must be valid and not destroyed.
15602 ///- `commandBuffer` must be externally synchronized.
15603 ///
15604 ///# Panics
15605 ///Panics if `vkCmdSetLineStippleEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15606 ///
15607 ///# Usage Notes
15608 ///
15609 ///Dynamically enables or disables line stippling. When enabled,
15610 ///lines are drawn with a repeating pattern defined by
15611 ///`cmd_set_line_stipple` (core 1.4) or `cmd_set_line_stipple_ext`.
15612 ///
15613 ///Requires `VK_EXT_line_rasterization` and the `stippledLineEnable`
15614 ///feature for the active line rasterization mode.
15615 ///
15616 ///Provided by `VK_EXT_extended_dynamic_state3`.
15617 pub unsafe fn cmd_set_line_stipple_enable_ext(
15618 &self,
15619 command_buffer: CommandBuffer,
15620 stippled_line_enable: bool,
15621 ) {
15622 let fp = self
15623 .commands()
15624 .cmd_set_line_stipple_enable_ext
15625 .expect("vkCmdSetLineStippleEnableEXT not loaded");
15626 unsafe { fp(command_buffer, stippled_line_enable as u32) };
15627 }
15628 ///Wraps [`vkCmdSetDepthClipNegativeOneToOneEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthClipNegativeOneToOneEXT.html).
15629 /**
15630 Provided by **VK_EXT_extended_dynamic_state3**.*/
15631 ///
15632 ///# Safety
15633 ///- `commandBuffer` (self) must be valid and not destroyed.
15634 ///- `commandBuffer` must be externally synchronized.
15635 ///
15636 ///# Panics
15637 ///Panics if `vkCmdSetDepthClipNegativeOneToOneEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15638 ///
15639 ///# Usage Notes
15640 ///
15641 ///Dynamically sets the depth clip range convention:
15642 ///- `true`: NDC depth range is [-1, 1] (OpenGL convention).
15643 ///- `false`: NDC depth range is [0, 1] (Vulkan default).
15644 ///
15645 ///Useful for porting OpenGL content or using reversed-Z with
15646 ///OpenGL-style projections.
15647 ///
15648 ///Requires `VK_EXT_depth_clip_control` and the
15649 ///`depthClipControl` feature.
15650 ///
15651 ///Provided by `VK_EXT_extended_dynamic_state3`.
15652 pub unsafe fn cmd_set_depth_clip_negative_one_to_one_ext(
15653 &self,
15654 command_buffer: CommandBuffer,
15655 negative_one_to_one: bool,
15656 ) {
15657 let fp = self
15658 .commands()
15659 .cmd_set_depth_clip_negative_one_to_one_ext
15660 .expect("vkCmdSetDepthClipNegativeOneToOneEXT not loaded");
15661 unsafe { fp(command_buffer, negative_one_to_one as u32) };
15662 }
15663 ///Wraps [`vkCmdSetViewportWScalingEnableNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetViewportWScalingEnableNV.html).
15664 /**
15665 Provided by **VK_EXT_extended_dynamic_state3**.*/
15666 ///
15667 ///# Safety
15668 ///- `commandBuffer` (self) must be valid and not destroyed.
15669 ///- `commandBuffer` must be externally synchronized.
15670 ///
15671 ///# Panics
15672 ///Panics if `vkCmdSetViewportWScalingEnableNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15673 ///
15674 ///# Usage Notes
15675 ///
15676 ///Dynamically enables or disables viewport W scaling. When enabled,
15677 ///the x and y viewport coordinates are divided by an additional
15678 ///per-viewport W scaling factor, which can be used for lens-matched
15679 ///shading in VR.
15680 ///
15681 ///Part of `VK_NV_clip_space_w_scaling`.
15682 ///
15683 ///Provided by `VK_EXT_extended_dynamic_state3`.
15684 pub unsafe fn cmd_set_viewport_w_scaling_enable_nv(
15685 &self,
15686 command_buffer: CommandBuffer,
15687 viewport_w_scaling_enable: bool,
15688 ) {
15689 let fp = self
15690 .commands()
15691 .cmd_set_viewport_w_scaling_enable_nv
15692 .expect("vkCmdSetViewportWScalingEnableNV not loaded");
15693 unsafe { fp(command_buffer, viewport_w_scaling_enable as u32) };
15694 }
15695 ///Wraps [`vkCmdSetViewportSwizzleNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetViewportSwizzleNV.html).
15696 /**
15697 Provided by **VK_EXT_extended_dynamic_state3**.*/
15698 ///
15699 ///# Safety
15700 ///- `commandBuffer` (self) must be valid and not destroyed.
15701 ///- `commandBuffer` must be externally synchronized.
15702 ///
15703 ///# Panics
15704 ///Panics if `vkCmdSetViewportSwizzleNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15705 ///
15706 ///# Usage Notes
15707 ///
15708 ///Dynamically sets the viewport swizzle for each viewport. A
15709 ///swizzle remaps each output component (x, y, z, w) to any input
15710 ///component, optionally negated.
15711 ///
15712 ///Useful for single-pass cubemap rendering and other multi-view
15713 ///projection tricks.
15714 ///
15715 ///Part of `VK_NV_viewport_swizzle`.
15716 ///
15717 ///Provided by `VK_EXT_extended_dynamic_state3`.
15718 pub unsafe fn cmd_set_viewport_swizzle_nv(
15719 &self,
15720 command_buffer: CommandBuffer,
15721 first_viewport: u32,
15722 p_viewport_swizzles: &[ViewportSwizzleNV],
15723 ) {
15724 let fp = self
15725 .commands()
15726 .cmd_set_viewport_swizzle_nv
15727 .expect("vkCmdSetViewportSwizzleNV not loaded");
15728 unsafe {
15729 fp(
15730 command_buffer,
15731 first_viewport,
15732 p_viewport_swizzles.len() as u32,
15733 p_viewport_swizzles.as_ptr(),
15734 )
15735 };
15736 }
15737 ///Wraps [`vkCmdSetCoverageToColorEnableNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetCoverageToColorEnableNV.html).
15738 /**
15739 Provided by **VK_EXT_extended_dynamic_state3**.*/
15740 ///
15741 ///# Safety
15742 ///- `commandBuffer` (self) must be valid and not destroyed.
15743 ///- `commandBuffer` must be externally synchronized.
15744 ///
15745 ///# Panics
15746 ///Panics if `vkCmdSetCoverageToColorEnableNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15747 ///
15748 ///# Usage Notes
15749 ///
15750 ///Dynamically enables or disables coverage-to-color mode. When
15751 ///enabled, the fragment coverage mask is written to a specified
15752 ///color attachment instead of (or in addition to) the normal color
15753 ///output.
15754 ///
15755 ///Part of `VK_NV_fragment_coverage_to_color`.
15756 ///
15757 ///Provided by `VK_EXT_extended_dynamic_state3`.
15758 pub unsafe fn cmd_set_coverage_to_color_enable_nv(
15759 &self,
15760 command_buffer: CommandBuffer,
15761 coverage_to_color_enable: bool,
15762 ) {
15763 let fp = self
15764 .commands()
15765 .cmd_set_coverage_to_color_enable_nv
15766 .expect("vkCmdSetCoverageToColorEnableNV not loaded");
15767 unsafe { fp(command_buffer, coverage_to_color_enable as u32) };
15768 }
15769 ///Wraps [`vkCmdSetCoverageToColorLocationNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetCoverageToColorLocationNV.html).
15770 /**
15771 Provided by **VK_EXT_extended_dynamic_state3**.*/
15772 ///
15773 ///# Safety
15774 ///- `commandBuffer` (self) must be valid and not destroyed.
15775 ///- `commandBuffer` must be externally synchronized.
15776 ///
15777 ///# Panics
15778 ///Panics if `vkCmdSetCoverageToColorLocationNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15779 ///
15780 ///# Usage Notes
15781 ///
15782 ///Dynamically sets which color attachment receives the coverage
15783 ///mask when coverage-to-color is enabled.
15784 ///
15785 ///Only effective when `cmd_set_coverage_to_color_enable_nv` is true.
15786 ///
15787 ///Part of `VK_NV_fragment_coverage_to_color`.
15788 ///
15789 ///Provided by `VK_EXT_extended_dynamic_state3`.
15790 pub unsafe fn cmd_set_coverage_to_color_location_nv(
15791 &self,
15792 command_buffer: CommandBuffer,
15793 coverage_to_color_location: u32,
15794 ) {
15795 let fp = self
15796 .commands()
15797 .cmd_set_coverage_to_color_location_nv
15798 .expect("vkCmdSetCoverageToColorLocationNV not loaded");
15799 unsafe { fp(command_buffer, coverage_to_color_location) };
15800 }
15801 ///Wraps [`vkCmdSetCoverageModulationModeNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetCoverageModulationModeNV.html).
15802 /**
15803 Provided by **VK_EXT_extended_dynamic_state3**.*/
15804 ///
15805 ///# Safety
15806 ///- `commandBuffer` (self) must be valid and not destroyed.
15807 ///- `commandBuffer` must be externally synchronized.
15808 ///
15809 ///# Panics
15810 ///Panics if `vkCmdSetCoverageModulationModeNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15811 ///
15812 ///# Usage Notes
15813 ///
15814 ///Dynamically sets how the coverage mask is combined with the
15815 ///fragment's color. Modes include `NONE`, `RGB`, `ALPHA`, and
15816 ///`RGBA`.
15817 ///
15818 ///Part of the NV coverage modulation feature used with
15819 ///`VK_NV_framebuffer_mixed_samples`.
15820 ///
15821 ///Provided by `VK_EXT_extended_dynamic_state3`.
15822 pub unsafe fn cmd_set_coverage_modulation_mode_nv(
15823 &self,
15824 command_buffer: CommandBuffer,
15825 coverage_modulation_mode: CoverageModulationModeNV,
15826 ) {
15827 let fp = self
15828 .commands()
15829 .cmd_set_coverage_modulation_mode_nv
15830 .expect("vkCmdSetCoverageModulationModeNV not loaded");
15831 unsafe { fp(command_buffer, coverage_modulation_mode) };
15832 }
15833 ///Wraps [`vkCmdSetCoverageModulationTableEnableNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetCoverageModulationTableEnableNV.html).
15834 /**
15835 Provided by **VK_EXT_extended_dynamic_state3**.*/
15836 ///
15837 ///# Safety
15838 ///- `commandBuffer` (self) must be valid and not destroyed.
15839 ///- `commandBuffer` must be externally synchronized.
15840 ///
15841 ///# Panics
15842 ///Panics if `vkCmdSetCoverageModulationTableEnableNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15843 ///
15844 ///# Usage Notes
15845 ///
15846 ///Dynamically enables or disables the coverage modulation lookup
15847 ///table. When enabled, the coverage value indexes into a table set
15848 ///by `cmd_set_coverage_modulation_table_nv` instead of using the
15849 ///default linear modulation.
15850 ///
15851 ///Part of `VK_NV_framebuffer_mixed_samples`.
15852 ///
15853 ///Provided by `VK_EXT_extended_dynamic_state3`.
15854 pub unsafe fn cmd_set_coverage_modulation_table_enable_nv(
15855 &self,
15856 command_buffer: CommandBuffer,
15857 coverage_modulation_table_enable: bool,
15858 ) {
15859 let fp = self
15860 .commands()
15861 .cmd_set_coverage_modulation_table_enable_nv
15862 .expect("vkCmdSetCoverageModulationTableEnableNV not loaded");
15863 unsafe { fp(command_buffer, coverage_modulation_table_enable as u32) };
15864 }
15865 ///Wraps [`vkCmdSetCoverageModulationTableNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetCoverageModulationTableNV.html).
15866 /**
15867 Provided by **VK_EXT_extended_dynamic_state3**.*/
15868 ///
15869 ///# Safety
15870 ///- `commandBuffer` (self) must be valid and not destroyed.
15871 ///- `commandBuffer` must be externally synchronized.
15872 ///
15873 ///# Panics
15874 ///Panics if `vkCmdSetCoverageModulationTableNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15875 ///
15876 ///# Usage Notes
15877 ///
15878 ///Dynamically sets the coverage modulation lookup table. Each entry
15879 ///maps a coverage sample count to a modulation factor (0.0–1.0).
15880 ///
15881 ///Only used when coverage modulation table is enabled via
15882 ///`cmd_set_coverage_modulation_table_enable_nv`.
15883 ///
15884 ///Part of `VK_NV_framebuffer_mixed_samples`.
15885 ///
15886 ///Provided by `VK_EXT_extended_dynamic_state3`.
15887 pub unsafe fn cmd_set_coverage_modulation_table_nv(
15888 &self,
15889 command_buffer: CommandBuffer,
15890 p_coverage_modulation_table: &[f32],
15891 ) {
15892 let fp = self
15893 .commands()
15894 .cmd_set_coverage_modulation_table_nv
15895 .expect("vkCmdSetCoverageModulationTableNV not loaded");
15896 unsafe {
15897 fp(
15898 command_buffer,
15899 p_coverage_modulation_table.len() as u32,
15900 p_coverage_modulation_table.as_ptr(),
15901 )
15902 };
15903 }
15904 ///Wraps [`vkCmdSetShadingRateImageEnableNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetShadingRateImageEnableNV.html).
15905 /**
15906 Provided by **VK_EXT_extended_dynamic_state3**.*/
15907 ///
15908 ///# Safety
15909 ///- `commandBuffer` (self) must be valid and not destroyed.
15910 ///- `commandBuffer` must be externally synchronized.
15911 ///
15912 ///# Panics
15913 ///Panics if `vkCmdSetShadingRateImageEnableNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15914 ///
15915 ///# Usage Notes
15916 ///
15917 ///Dynamically enables or disables the shading rate image. When
15918 ///enabled, fragment shading rate is read from a shading rate image
15919 ///attachment instead of using a uniform rate.
15920 ///
15921 ///Part of `VK_NV_shading_rate_image`.
15922 ///
15923 ///Provided by `VK_EXT_extended_dynamic_state3`.
15924 pub unsafe fn cmd_set_shading_rate_image_enable_nv(
15925 &self,
15926 command_buffer: CommandBuffer,
15927 shading_rate_image_enable: bool,
15928 ) {
15929 let fp = self
15930 .commands()
15931 .cmd_set_shading_rate_image_enable_nv
15932 .expect("vkCmdSetShadingRateImageEnableNV not loaded");
15933 unsafe { fp(command_buffer, shading_rate_image_enable as u32) };
15934 }
15935 ///Wraps [`vkCmdSetCoverageReductionModeNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetCoverageReductionModeNV.html).
15936 /**
15937 Provided by **VK_EXT_extended_dynamic_state3**.*/
15938 ///
15939 ///# Safety
15940 ///- `commandBuffer` (self) must be valid and not destroyed.
15941 ///- `commandBuffer` must be externally synchronized.
15942 ///
15943 ///# Panics
15944 ///Panics if `vkCmdSetCoverageReductionModeNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15945 ///
15946 ///# Usage Notes
15947 ///
15948 ///Dynamically sets the coverage reduction mode, which controls how
15949 ///the multisampled coverage mask is reduced to a color sample mask
15950 ///when the number of color samples is less than the rasterization
15951 ///samples.
15952 ///
15953 ///Part of `VK_NV_coverage_reduction_mode`.
15954 ///
15955 ///Provided by `VK_EXT_extended_dynamic_state3`.
15956 pub unsafe fn cmd_set_coverage_reduction_mode_nv(
15957 &self,
15958 command_buffer: CommandBuffer,
15959 coverage_reduction_mode: CoverageReductionModeNV,
15960 ) {
15961 let fp = self
15962 .commands()
15963 .cmd_set_coverage_reduction_mode_nv
15964 .expect("vkCmdSetCoverageReductionModeNV not loaded");
15965 unsafe { fp(command_buffer, coverage_reduction_mode) };
15966 }
15967 ///Wraps [`vkCmdSetRepresentativeFragmentTestEnableNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetRepresentativeFragmentTestEnableNV.html).
15968 /**
15969 Provided by **VK_EXT_extended_dynamic_state3**.*/
15970 ///
15971 ///# Safety
15972 ///- `commandBuffer` (self) must be valid and not destroyed.
15973 ///- `commandBuffer` must be externally synchronized.
15974 ///
15975 ///# Panics
15976 ///Panics if `vkCmdSetRepresentativeFragmentTestEnableNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15977 ///
15978 ///# Usage Notes
15979 ///
15980 ///Dynamically enables or disables the representative fragment test.
15981 ///When enabled, only one fragment per pixel is shaded (the
15982 ///"representative" fragment), and the rest are discarded early.
15983 ///
15984 ///Useful for visibility-only passes (e.g., occlusion culling)
15985 ///where full shading is unnecessary.
15986 ///
15987 ///Part of `VK_NV_representative_fragment_test`.
15988 ///
15989 ///Provided by `VK_EXT_extended_dynamic_state3`.
15990 pub unsafe fn cmd_set_representative_fragment_test_enable_nv(
15991 &self,
15992 command_buffer: CommandBuffer,
15993 representative_fragment_test_enable: bool,
15994 ) {
15995 let fp = self
15996 .commands()
15997 .cmd_set_representative_fragment_test_enable_nv
15998 .expect("vkCmdSetRepresentativeFragmentTestEnableNV not loaded");
15999 unsafe { fp(command_buffer, representative_fragment_test_enable as u32) };
16000 }
16001 ///Wraps [`vkCreatePrivateDataSlot`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreatePrivateDataSlot.html).
16002 /**
16003 Provided by **VK_BASE_VERSION_1_3**.*/
16004 ///
16005 ///# Errors
16006 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
16007 ///- `VK_ERROR_UNKNOWN`
16008 ///- `VK_ERROR_VALIDATION_FAILED`
16009 ///
16010 ///# Safety
16011 ///- `device` (self) must be valid and not destroyed.
16012 ///
16013 ///# Panics
16014 ///Panics if `vkCreatePrivateDataSlot` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16015 ///
16016 ///# Usage Notes
16017 ///
16018 ///Creates a private data slot that can be used to attach arbitrary
16019 ///application-defined `u64` values to any Vulkan object. Private data
16020 ///is a lightweight alternative to external hash maps for per-object
16021 ///metadata.
16022 ///
16023 ///Each slot represents one "key" that can be set on any object via
16024 ///`set_private_data` and read back via `get_private_data`.
16025 ///
16026 ///Use cases:
16027 ///
16028 ///- Tagging objects with debug IDs.
16029 ///- Associating application-specific state without a separate lookup
16030 /// table.
16031 ///- Layer and tool implementations that need per-object bookkeeping.
16032 ///
16033 ///Private data slots are cheap. The slot itself is just an index;
16034 ///the per-object storage is allocated lazily by the driver.
16035 pub unsafe fn create_private_data_slot(
16036 &self,
16037 p_create_info: &PrivateDataSlotCreateInfo,
16038 allocator: Option<&AllocationCallbacks>,
16039 ) -> VkResult<PrivateDataSlot> {
16040 let fp = self
16041 .commands()
16042 .create_private_data_slot
16043 .expect("vkCreatePrivateDataSlot not loaded");
16044 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
16045 let mut out = unsafe { core::mem::zeroed() };
16046 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
16047 Ok(out)
16048 }
16049 ///Wraps [`vkDestroyPrivateDataSlot`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyPrivateDataSlot.html).
16050 /**
16051 Provided by **VK_BASE_VERSION_1_3**.*/
16052 ///
16053 ///# Safety
16054 ///- `device` (self) must be valid and not destroyed.
16055 ///- `privateDataSlot` must be externally synchronized.
16056 ///
16057 ///# Panics
16058 ///Panics if `vkDestroyPrivateDataSlot` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16059 ///
16060 ///# Usage Notes
16061 ///
16062 ///Destroys a private data slot. Any data previously stored via
16063 ///`set_private_data` with this slot is discarded. Objects that had
16064 ///data set are not affected, they continue to exist normally.
16065 pub unsafe fn destroy_private_data_slot(
16066 &self,
16067 private_data_slot: PrivateDataSlot,
16068 allocator: Option<&AllocationCallbacks>,
16069 ) {
16070 let fp = self
16071 .commands()
16072 .destroy_private_data_slot
16073 .expect("vkDestroyPrivateDataSlot not loaded");
16074 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
16075 unsafe { fp(self.handle(), private_data_slot, alloc_ptr) };
16076 }
16077 ///Wraps [`vkSetPrivateData`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetPrivateData.html).
16078 /**
16079 Provided by **VK_BASE_VERSION_1_3**.*/
16080 ///
16081 ///# Errors
16082 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
16083 ///- `VK_ERROR_UNKNOWN`
16084 ///- `VK_ERROR_VALIDATION_FAILED`
16085 ///
16086 ///# Safety
16087 ///- `device` (self) must be valid and not destroyed.
16088 ///
16089 ///# Panics
16090 ///Panics if `vkSetPrivateData` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16091 ///
16092 ///# Usage Notes
16093 ///
16094 ///Stores a `u64` value on any Vulkan object for the given private data
16095 ///slot. Overwrites any previously stored value for this object/slot
16096 ///pair.
16097 ///
16098 ///Private data is per-device, the slot must have been created from
16099 ///the same device that owns the object. Setting data on an object from
16100 ///a different device is undefined behaviour.
16101 ///
16102 ///To clear the association, set the value to 0 or destroy the slot.
16103 pub unsafe fn set_private_data(
16104 &self,
16105 object_type: ObjectType,
16106 object_handle: u64,
16107 private_data_slot: PrivateDataSlot,
16108 data: u64,
16109 ) -> VkResult<()> {
16110 let fp = self
16111 .commands()
16112 .set_private_data
16113 .expect("vkSetPrivateData not loaded");
16114 check(unsafe {
16115 fp(
16116 self.handle(),
16117 object_type,
16118 object_handle,
16119 private_data_slot,
16120 data,
16121 )
16122 })
16123 }
16124 ///Wraps [`vkGetPrivateData`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPrivateData.html).
16125 /**
16126 Provided by **VK_BASE_VERSION_1_3**.*/
16127 ///
16128 ///# Safety
16129 ///- `device` (self) must be valid and not destroyed.
16130 ///
16131 ///# Panics
16132 ///Panics if `vkGetPrivateData` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16133 ///
16134 ///# Usage Notes
16135 ///
16136 ///Retrieves the `u64` value previously stored on a Vulkan object with
16137 ///`set_private_data` for the given private data slot. Returns 0 if no
16138 ///data was set for this object/slot combination.
16139 ///
16140 ///This is a lightweight per-object metadata lookup with no hash table
16141 ///overhead. See `create_private_data_slot` for usage patterns.
16142 pub unsafe fn get_private_data(
16143 &self,
16144 object_type: ObjectType,
16145 object_handle: u64,
16146 private_data_slot: PrivateDataSlot,
16147 ) -> u64 {
16148 let fp = self
16149 .commands()
16150 .get_private_data
16151 .expect("vkGetPrivateData not loaded");
16152 let mut out = unsafe { core::mem::zeroed() };
16153 unsafe {
16154 fp(
16155 self.handle(),
16156 object_type,
16157 object_handle,
16158 private_data_slot,
16159 &mut out,
16160 )
16161 };
16162 out
16163 }
16164 ///Wraps [`vkCmdCopyBuffer2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyBuffer2.html).
16165 /**
16166 Provided by **VK_BASE_VERSION_1_3**.*/
16167 ///
16168 ///# Safety
16169 ///- `commandBuffer` (self) must be valid and not destroyed.
16170 ///- `commandBuffer` must be externally synchronized.
16171 ///
16172 ///# Panics
16173 ///Panics if `vkCmdCopyBuffer2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16174 ///
16175 ///# Usage Notes
16176 ///
16177 ///Vulkan 1.3 version of `cmd_copy_buffer` that uses an extensible
16178 ///`CopyBufferInfo2` struct. Functionally identical to the 1.0 version
16179 ///but supports future extensions via pNext.
16180 ///
16181 ///Prefer this over `cmd_copy_buffer` when targeting Vulkan 1.3+.
16182 pub unsafe fn cmd_copy_buffer2(
16183 &self,
16184 command_buffer: CommandBuffer,
16185 p_copy_buffer_info: &CopyBufferInfo2,
16186 ) {
16187 let fp = self
16188 .commands()
16189 .cmd_copy_buffer2
16190 .expect("vkCmdCopyBuffer2 not loaded");
16191 unsafe { fp(command_buffer, p_copy_buffer_info) };
16192 }
16193 ///Wraps [`vkCmdCopyImage2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyImage2.html).
16194 /**
16195 Provided by **VK_BASE_VERSION_1_3**.*/
16196 ///
16197 ///# Safety
16198 ///- `commandBuffer` (self) must be valid and not destroyed.
16199 ///- `commandBuffer` must be externally synchronized.
16200 ///
16201 ///# Panics
16202 ///Panics if `vkCmdCopyImage2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16203 ///
16204 ///# Usage Notes
16205 ///
16206 ///Vulkan 1.3 version of `cmd_copy_image` that uses an extensible
16207 ///`CopyImageInfo2` struct.
16208 ///
16209 ///Functionally identical to the 1.0 version. Prefer this when
16210 ///targeting Vulkan 1.3+.
16211 pub unsafe fn cmd_copy_image2(
16212 &self,
16213 command_buffer: CommandBuffer,
16214 p_copy_image_info: &CopyImageInfo2,
16215 ) {
16216 let fp = self
16217 .commands()
16218 .cmd_copy_image2
16219 .expect("vkCmdCopyImage2 not loaded");
16220 unsafe { fp(command_buffer, p_copy_image_info) };
16221 }
16222 ///Wraps [`vkCmdBlitImage2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBlitImage2.html).
16223 /**
16224 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
16225 ///
16226 ///# Safety
16227 ///- `commandBuffer` (self) must be valid and not destroyed.
16228 ///- `commandBuffer` must be externally synchronized.
16229 ///
16230 ///# Panics
16231 ///Panics if `vkCmdBlitImage2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16232 ///
16233 ///# Usage Notes
16234 ///
16235 ///Vulkan 1.3 version of `cmd_blit_image` that uses an extensible
16236 ///`BlitImageInfo2` struct.
16237 ///
16238 ///Chain `BlitImageCubicWeightsInfoQCOM` for cubic filtering on
16239 ///Qualcomm hardware. Otherwise functionally identical to
16240 ///`cmd_blit_image`.
16241 ///
16242 ///Prefer this when targeting Vulkan 1.3+.
16243 pub unsafe fn cmd_blit_image2(
16244 &self,
16245 command_buffer: CommandBuffer,
16246 p_blit_image_info: &BlitImageInfo2,
16247 ) {
16248 let fp = self
16249 .commands()
16250 .cmd_blit_image2
16251 .expect("vkCmdBlitImage2 not loaded");
16252 unsafe { fp(command_buffer, p_blit_image_info) };
16253 }
16254 ///Wraps [`vkCmdCopyBufferToImage2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyBufferToImage2.html).
16255 /**
16256 Provided by **VK_BASE_VERSION_1_3**.*/
16257 ///
16258 ///# Safety
16259 ///- `commandBuffer` (self) must be valid and not destroyed.
16260 ///- `commandBuffer` must be externally synchronized.
16261 ///
16262 ///# Panics
16263 ///Panics if `vkCmdCopyBufferToImage2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16264 ///
16265 ///# Usage Notes
16266 ///
16267 ///Vulkan 1.3 version of `cmd_copy_buffer_to_image` that uses an
16268 ///extensible `CopyBufferToImageInfo2` struct.
16269 ///
16270 ///Functionally identical to the 1.0 version. Prefer this when
16271 ///targeting Vulkan 1.3+.
16272 pub unsafe fn cmd_copy_buffer_to_image2(
16273 &self,
16274 command_buffer: CommandBuffer,
16275 p_copy_buffer_to_image_info: &CopyBufferToImageInfo2,
16276 ) {
16277 let fp = self
16278 .commands()
16279 .cmd_copy_buffer_to_image2
16280 .expect("vkCmdCopyBufferToImage2 not loaded");
16281 unsafe { fp(command_buffer, p_copy_buffer_to_image_info) };
16282 }
16283 ///Wraps [`vkCmdCopyImageToBuffer2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyImageToBuffer2.html).
16284 /**
16285 Provided by **VK_BASE_VERSION_1_3**.*/
16286 ///
16287 ///# Safety
16288 ///- `commandBuffer` (self) must be valid and not destroyed.
16289 ///- `commandBuffer` must be externally synchronized.
16290 ///
16291 ///# Panics
16292 ///Panics if `vkCmdCopyImageToBuffer2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16293 ///
16294 ///# Usage Notes
16295 ///
16296 ///Vulkan 1.3 version of `cmd_copy_image_to_buffer` that uses an
16297 ///extensible `CopyImageToBufferInfo2` struct.
16298 ///
16299 ///Functionally identical to the 1.0 version. Prefer this when
16300 ///targeting Vulkan 1.3+.
16301 pub unsafe fn cmd_copy_image_to_buffer2(
16302 &self,
16303 command_buffer: CommandBuffer,
16304 p_copy_image_to_buffer_info: &CopyImageToBufferInfo2,
16305 ) {
16306 let fp = self
16307 .commands()
16308 .cmd_copy_image_to_buffer2
16309 .expect("vkCmdCopyImageToBuffer2 not loaded");
16310 unsafe { fp(command_buffer, p_copy_image_to_buffer_info) };
16311 }
16312 ///Wraps [`vkCmdResolveImage2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdResolveImage2.html).
16313 /**
16314 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
16315 ///
16316 ///# Safety
16317 ///- `commandBuffer` (self) must be valid and not destroyed.
16318 ///- `commandBuffer` must be externally synchronized.
16319 ///
16320 ///# Panics
16321 ///Panics if `vkCmdResolveImage2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16322 ///
16323 ///# Usage Notes
16324 ///
16325 ///Vulkan 1.3 version of `cmd_resolve_image` that uses an extensible
16326 ///`ResolveImageInfo2` struct.
16327 ///
16328 ///Functionally identical to `cmd_resolve_image`. Prefer this when
16329 ///targeting Vulkan 1.3+.
16330 pub unsafe fn cmd_resolve_image2(
16331 &self,
16332 command_buffer: CommandBuffer,
16333 p_resolve_image_info: &ResolveImageInfo2,
16334 ) {
16335 let fp = self
16336 .commands()
16337 .cmd_resolve_image2
16338 .expect("vkCmdResolveImage2 not loaded");
16339 unsafe { fp(command_buffer, p_resolve_image_info) };
16340 }
16341 ///Wraps [`vkCmdRefreshObjectsKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdRefreshObjectsKHR.html).
16342 ///
16343 ///# Safety
16344 ///- `commandBuffer` (self) must be valid and not destroyed.
16345 ///- `commandBuffer` must be externally synchronized.
16346 ///
16347 ///# Panics
16348 ///Panics if `vkCmdRefreshObjectsKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16349 ///
16350 ///# Usage Notes
16351 ///
16352 ///Refreshes a set of Vulkan objects managed by a refreshable object
16353 ///type, resetting their internal state. Used in safety-critical
16354 ///Vulkan SC environments to periodically refresh objects and detect
16355 ///hardware faults.
16356 ///
16357 ///Not relevant for desktop Vulkan. This is part of the
16358 ///`VK_KHR_object_refresh` extension used in automotive and embedded
16359 ///safety-critical environments.
16360 pub unsafe fn cmd_refresh_objects_khr(
16361 &self,
16362 command_buffer: CommandBuffer,
16363 p_refresh_objects: &RefreshObjectListKHR,
16364 ) {
16365 let fp = self
16366 .commands()
16367 .cmd_refresh_objects_khr
16368 .expect("vkCmdRefreshObjectsKHR not loaded");
16369 unsafe { fp(command_buffer, p_refresh_objects) };
16370 }
16371 ///Wraps [`vkCmdSetFragmentShadingRateKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetFragmentShadingRateKHR.html).
16372 /**
16373 Provided by **VK_KHR_fragment_shading_rate**.*/
16374 ///
16375 ///# Safety
16376 ///- `commandBuffer` (self) must be valid and not destroyed.
16377 ///- `commandBuffer` must be externally synchronized.
16378 ///
16379 ///# Panics
16380 ///Panics if `vkCmdSetFragmentShadingRateKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16381 ///
16382 ///# Usage Notes
16383 ///
16384 ///Sets the pipeline fragment shading rate and combiner operations
16385 ///as dynamic state. This controls how many pixels each fragment
16386 ///shader invocation covers, larger fragment sizes reduce shading
16387 ///cost at the expense of detail.
16388 ///
16389 ///`p_fragment_size` specifies the fragment size (e.g., 1x1, 1x2,
16390 ///2x2, 2x4, 4x4). Not all sizes are supported, query
16391 ///`get_physical_device_fragment_shading_rates_khr` for the list.
16392 ///
16393 ///`combiner_ops` defines how the pipeline rate, primitive rate
16394 ///(from the vertex shader), and attachment rate (from a shading
16395 ///rate image) are combined to produce the final rate.
16396 ///
16397 ///Requires `VK_KHR_fragment_shading_rate` and the
16398 ///`pipelineFragmentShadingRate` device feature.
16399 pub unsafe fn cmd_set_fragment_shading_rate_khr(
16400 &self,
16401 command_buffer: CommandBuffer,
16402 p_fragment_size: &Extent2D,
16403 combiner_ops: FragmentShadingRateCombinerOpKHR,
16404 ) {
16405 let fp = self
16406 .commands()
16407 .cmd_set_fragment_shading_rate_khr
16408 .expect("vkCmdSetFragmentShadingRateKHR not loaded");
16409 unsafe { fp(command_buffer, p_fragment_size, combiner_ops) };
16410 }
16411 ///Wraps [`vkCmdSetFragmentShadingRateEnumNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetFragmentShadingRateEnumNV.html).
16412 /**
16413 Provided by **VK_NV_fragment_shading_rate_enums**.*/
16414 ///
16415 ///# Safety
16416 ///- `commandBuffer` (self) must be valid and not destroyed.
16417 ///- `commandBuffer` must be externally synchronized.
16418 ///
16419 ///# Panics
16420 ///Panics if `vkCmdSetFragmentShadingRateEnumNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16421 ///
16422 ///# Usage Notes
16423 ///
16424 ///Dynamically sets the fragment shading rate using the NV-specific
16425 ///enum values. Provides finer control than the KHR variant,
16426 ///including support for supersample and no-invocations rates.
16427 ///
16428 ///Requires `VK_NV_fragment_shading_rate_enums`.
16429 pub unsafe fn cmd_set_fragment_shading_rate_enum_nv(
16430 &self,
16431 command_buffer: CommandBuffer,
16432 shading_rate: FragmentShadingRateNV,
16433 combiner_ops: FragmentShadingRateCombinerOpKHR,
16434 ) {
16435 let fp = self
16436 .commands()
16437 .cmd_set_fragment_shading_rate_enum_nv
16438 .expect("vkCmdSetFragmentShadingRateEnumNV not loaded");
16439 unsafe { fp(command_buffer, shading_rate, combiner_ops) };
16440 }
16441 ///Wraps [`vkGetAccelerationStructureBuildSizesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetAccelerationStructureBuildSizesKHR.html).
16442 /**
16443 Provided by **VK_KHR_acceleration_structure**.*/
16444 ///
16445 ///# Safety
16446 ///- `device` (self) must be valid and not destroyed.
16447 ///
16448 ///# Panics
16449 ///Panics if `vkGetAccelerationStructureBuildSizesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16450 ///
16451 ///# Usage Notes
16452 ///
16453 ///Queries the buffer sizes needed to build an acceleration structure:
16454 ///the final structure size, the scratch buffer size for builds, and
16455 ///the scratch buffer size for updates.
16456 ///
16457 ///Call this before creating the acceleration structure and scratch
16458 ///buffers. The `max_primitive_counts` parameter specifies the maximum
16459 ///number of primitives per geometry, the returned sizes are
16460 ///worst-case guarantees for those counts.
16461 ///
16462 ///The actual built size may be smaller. For BLASes, build with
16463 ///`ALLOW_COMPACTION` and query the compacted size afterwards to
16464 ///reclaim excess memory.
16465 pub unsafe fn get_acceleration_structure_build_sizes_khr(
16466 &self,
16467 build_type: AccelerationStructureBuildTypeKHR,
16468 p_build_info: &AccelerationStructureBuildGeometryInfoKHR,
16469 p_max_primitive_counts: *const u32,
16470 p_size_info: &mut AccelerationStructureBuildSizesInfoKHR,
16471 ) {
16472 let fp = self
16473 .commands()
16474 .get_acceleration_structure_build_sizes_khr
16475 .expect("vkGetAccelerationStructureBuildSizesKHR not loaded");
16476 unsafe {
16477 fp(
16478 self.handle(),
16479 build_type,
16480 p_build_info,
16481 p_max_primitive_counts,
16482 p_size_info,
16483 )
16484 };
16485 }
16486 ///Wraps [`vkCmdSetVertexInputEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetVertexInputEXT.html).
16487 /**
16488 Provided by **VK_EXT_vertex_input_dynamic_state**.*/
16489 ///
16490 ///# Safety
16491 ///- `commandBuffer` (self) must be valid and not destroyed.
16492 ///- `commandBuffer` must be externally synchronized.
16493 ///
16494 ///# Panics
16495 ///Panics if `vkCmdSetVertexInputEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16496 ///
16497 ///# Usage Notes
16498 ///
16499 ///Dynamically sets the complete vertex input state: bindings
16500 ///(stride, input rate) and attributes (location, format, offset).
16501 ///
16502 ///Replaces `VertexInputBindingDescription` and
16503 ///`VertexInputAttributeDescription` from pipeline creation. Pass
16504 ///arrays of `VertexInputBindingDescription2EXT` and
16505 ///`VertexInputAttributeDescription2EXT`.
16506 ///
16507 ///Provided by `VK_EXT_vertex_input_dynamic_state`.
16508 pub unsafe fn cmd_set_vertex_input_ext(
16509 &self,
16510 command_buffer: CommandBuffer,
16511 p_vertex_binding_descriptions: &[VertexInputBindingDescription2EXT],
16512 p_vertex_attribute_descriptions: &[VertexInputAttributeDescription2EXT],
16513 ) {
16514 let fp = self
16515 .commands()
16516 .cmd_set_vertex_input_ext
16517 .expect("vkCmdSetVertexInputEXT not loaded");
16518 unsafe {
16519 fp(
16520 command_buffer,
16521 p_vertex_binding_descriptions.len() as u32,
16522 p_vertex_binding_descriptions.as_ptr(),
16523 p_vertex_attribute_descriptions.len() as u32,
16524 p_vertex_attribute_descriptions.as_ptr(),
16525 )
16526 };
16527 }
16528 ///Wraps [`vkCmdSetColorWriteEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetColorWriteEnableEXT.html).
16529 /**
16530 Provided by **VK_EXT_color_write_enable**.*/
16531 ///
16532 ///# Safety
16533 ///- `commandBuffer` (self) must be valid and not destroyed.
16534 ///- `commandBuffer` must be externally synchronized.
16535 ///
16536 ///# Panics
16537 ///Panics if `vkCmdSetColorWriteEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16538 ///
16539 ///# Usage Notes
16540 ///
16541 ///Dynamically enables or disables color writing for each color
16542 ///attachment. Pass a slice of `Bool32` values, one per attachment.
16543 ///
16544 ///When color write is disabled for an attachment, no color output
16545 ///is written regardless of blend state.
16546 ///
16547 ///Unlike `cmd_set_color_write_mask_ext` (which controls per-channel
16548 ///masking), this is a simple on/off toggle per attachment.
16549 ///
16550 ///Provided by `VK_EXT_color_write_enable`.
16551 pub unsafe fn cmd_set_color_write_enable_ext(
16552 &self,
16553 command_buffer: CommandBuffer,
16554 p_color_write_enables: &[u32],
16555 ) {
16556 let fp = self
16557 .commands()
16558 .cmd_set_color_write_enable_ext
16559 .expect("vkCmdSetColorWriteEnableEXT not loaded");
16560 unsafe {
16561 fp(
16562 command_buffer,
16563 p_color_write_enables.len() as u32,
16564 p_color_write_enables.as_ptr(),
16565 )
16566 };
16567 }
16568 ///Wraps [`vkCmdSetEvent2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetEvent2.html).
16569 /**
16570 Provided by **VK_COMPUTE_VERSION_1_3**.*/
16571 ///
16572 ///# Safety
16573 ///- `commandBuffer` (self) must be valid and not destroyed.
16574 ///- `commandBuffer` must be externally synchronized.
16575 ///
16576 ///# Panics
16577 ///Panics if `vkCmdSetEvent2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16578 ///
16579 ///# Usage Notes
16580 ///
16581 ///Vulkan 1.3 version of `cmd_set_event` that takes a `DependencyInfo`
16582 ///describing the memory dependencies, rather than just a stage mask.
16583 ///
16584 ///This provides more precise dependency information to the driver and
16585 ///supports 64-bit stage and access flags. The dependency info specifies
16586 ///exactly what memory accesses and pipeline stages are involved, which
16587 ///can reduce unnecessary stalls.
16588 ///
16589 ///Prefer this over `cmd_set_event` when targeting Vulkan 1.3+.
16590 pub unsafe fn cmd_set_event2(
16591 &self,
16592 command_buffer: CommandBuffer,
16593 event: Event,
16594 p_dependency_info: &DependencyInfo,
16595 ) {
16596 let fp = self
16597 .commands()
16598 .cmd_set_event2
16599 .expect("vkCmdSetEvent2 not loaded");
16600 unsafe { fp(command_buffer, event, p_dependency_info) };
16601 }
16602 ///Wraps [`vkCmdResetEvent2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdResetEvent2.html).
16603 /**
16604 Provided by **VK_COMPUTE_VERSION_1_3**.*/
16605 ///
16606 ///# Safety
16607 ///- `commandBuffer` (self) must be valid and not destroyed.
16608 ///- `commandBuffer` must be externally synchronized.
16609 ///
16610 ///# Panics
16611 ///Panics if `vkCmdResetEvent2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16612 ///
16613 ///# Usage Notes
16614 ///
16615 ///Vulkan 1.3 version of `cmd_reset_event` that uses 64-bit pipeline
16616 ///stage flags. Supports newer stages not available in the original
16617 ///32-bit field.
16618 ///
16619 ///Prefer this over `cmd_reset_event` when targeting Vulkan 1.3+.
16620 pub unsafe fn cmd_reset_event2(
16621 &self,
16622 command_buffer: CommandBuffer,
16623 event: Event,
16624 stage_mask: PipelineStageFlags2,
16625 ) {
16626 let fp = self
16627 .commands()
16628 .cmd_reset_event2
16629 .expect("vkCmdResetEvent2 not loaded");
16630 unsafe { fp(command_buffer, event, stage_mask) };
16631 }
16632 ///Wraps [`vkCmdWaitEvents2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWaitEvents2.html).
16633 /**
16634 Provided by **VK_COMPUTE_VERSION_1_3**.*/
16635 ///
16636 ///# Safety
16637 ///- `commandBuffer` (self) must be valid and not destroyed.
16638 ///- `commandBuffer` must be externally synchronized.
16639 ///
16640 ///# Panics
16641 ///Panics if `vkCmdWaitEvents2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16642 ///
16643 ///# Usage Notes
16644 ///
16645 ///Vulkan 1.3 version of `cmd_wait_events` that takes per-event
16646 ///`DependencyInfo` structs instead of global stage masks and barriers.
16647 ///
16648 ///Each event can have its own set of memory barriers and stage masks,
16649 ///giving the driver more precise information about what each event
16650 ///protects.
16651 ///
16652 ///Prefer this over `cmd_wait_events` when targeting Vulkan 1.3+.
16653 pub unsafe fn cmd_wait_events2(
16654 &self,
16655 command_buffer: CommandBuffer,
16656 p_events: &[Event],
16657 p_dependency_infos: &[DependencyInfo],
16658 ) {
16659 let fp = self
16660 .commands()
16661 .cmd_wait_events2
16662 .expect("vkCmdWaitEvents2 not loaded");
16663 unsafe {
16664 fp(
16665 command_buffer,
16666 p_events.len() as u32,
16667 p_events.as_ptr(),
16668 p_dependency_infos.as_ptr(),
16669 )
16670 };
16671 }
16672 ///Wraps [`vkCmdPipelineBarrier2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPipelineBarrier2.html).
16673 /**
16674 Provided by **VK_BASE_VERSION_1_3**.*/
16675 ///
16676 ///# Safety
16677 ///- `commandBuffer` (self) must be valid and not destroyed.
16678 ///- `commandBuffer` must be externally synchronized.
16679 ///
16680 ///# Panics
16681 ///Panics if `vkCmdPipelineBarrier2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16682 ///
16683 ///# Usage Notes
16684 ///
16685 ///Vulkan 1.3 version of `cmd_pipeline_barrier` that uses
16686 ///`DependencyInfo` with `MemoryBarrier2`, `BufferMemoryBarrier2`, and
16687 ///`ImageMemoryBarrier2` structs.
16688 ///
16689 ///The key improvement over the 1.0 version is that stage and access
16690 ///masks are specified **per barrier** rather than globally for the
16691 ///entire call. This gives the driver more precise dependency
16692 ///information, which can reduce unnecessary stalls.
16693 ///
16694 ///The 1.3 barrier structs also use 64-bit stage and access flags,
16695 ///supporting stages and access types that do not fit in the original
16696 ///32-bit fields (e.g. ray tracing, mesh shading).
16697 ///
16698 ///Prefer this over `cmd_pipeline_barrier` when targeting Vulkan 1.3+.
16699 pub unsafe fn cmd_pipeline_barrier2(
16700 &self,
16701 command_buffer: CommandBuffer,
16702 p_dependency_info: &DependencyInfo,
16703 ) {
16704 let fp = self
16705 .commands()
16706 .cmd_pipeline_barrier2
16707 .expect("vkCmdPipelineBarrier2 not loaded");
16708 unsafe { fp(command_buffer, p_dependency_info) };
16709 }
16710 ///Wraps [`vkQueueSubmit2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueSubmit2.html).
16711 /**
16712 Provided by **VK_BASE_VERSION_1_3**.*/
16713 ///
16714 ///# Errors
16715 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
16716 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
16717 ///- `VK_ERROR_DEVICE_LOST`
16718 ///- `VK_ERROR_UNKNOWN`
16719 ///- `VK_ERROR_VALIDATION_FAILED`
16720 ///
16721 ///# Safety
16722 ///- `queue` (self) must be valid and not destroyed.
16723 ///- `queue` must be externally synchronized.
16724 ///- `fence` must be externally synchronized.
16725 ///
16726 ///# Panics
16727 ///Panics if `vkQueueSubmit2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16728 ///
16729 ///# Usage Notes
16730 ///
16731 ///Vulkan 1.3 version of `queue_submit` that uses `SubmitInfo2` with
16732 ///per-semaphore stage masks and 64-bit pipeline stage flags.
16733 ///
16734 ///Key improvements over `queue_submit`:
16735 ///
16736 ///- **Per-semaphore stage masks**: each wait semaphore has its own
16737 /// stage mask in `SemaphoreSubmitInfo`, instead of a parallel array.
16738 /// Clearer and less error-prone.
16739 ///- **64-bit stages**: supports newer pipeline stages.
16740 ///- **Timeline semaphores**: timeline values are embedded in
16741 /// `SemaphoreSubmitInfo` instead of requiring a separate pNext
16742 /// chain.
16743 ///
16744 ///Prefer this over `queue_submit` when targeting Vulkan 1.3+. The
16745 ///fence parameter works identically.
16746 pub unsafe fn queue_submit2(
16747 &self,
16748 queue: Queue,
16749 p_submits: &[SubmitInfo2],
16750 fence: Fence,
16751 ) -> VkResult<()> {
16752 let fp = self
16753 .commands()
16754 .queue_submit2
16755 .expect("vkQueueSubmit2 not loaded");
16756 check(unsafe { fp(queue, p_submits.len() as u32, p_submits.as_ptr(), fence) })
16757 }
16758 ///Wraps [`vkCmdWriteTimestamp2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWriteTimestamp2.html).
16759 /**
16760 Provided by **VK_BASE_VERSION_1_3**.*/
16761 ///
16762 ///# Safety
16763 ///- `commandBuffer` (self) must be valid and not destroyed.
16764 ///- `commandBuffer` must be externally synchronized.
16765 ///
16766 ///# Panics
16767 ///Panics if `vkCmdWriteTimestamp2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16768 ///
16769 ///# Usage Notes
16770 ///
16771 ///Vulkan 1.3 version of `cmd_write_timestamp` that uses 64-bit
16772 ///pipeline stage flags (`PipelineStageFlags2`).
16773 ///
16774 ///The wider stage flags support newer stages like
16775 ///`PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_KHR` and
16776 ///`PIPELINE_STAGE_2_MESH_SHADER_BIT_EXT` that do not fit in the
16777 ///original 32-bit field.
16778 ///
16779 ///Prefer this over `cmd_write_timestamp` when targeting Vulkan 1.3+.
16780 pub unsafe fn cmd_write_timestamp2(
16781 &self,
16782 command_buffer: CommandBuffer,
16783 stage: PipelineStageFlags2,
16784 query_pool: QueryPool,
16785 query: u32,
16786 ) {
16787 let fp = self
16788 .commands()
16789 .cmd_write_timestamp2
16790 .expect("vkCmdWriteTimestamp2 not loaded");
16791 unsafe { fp(command_buffer, stage, query_pool, query) };
16792 }
16793 ///Wraps [`vkCmdWriteBufferMarker2AMD`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWriteBufferMarker2AMD.html).
16794 /**
16795 Provided by **VK_AMD_buffer_marker**.*/
16796 ///
16797 ///# Safety
16798 ///- `commandBuffer` (self) must be valid and not destroyed.
16799 ///- `commandBuffer` must be externally synchronized.
16800 ///
16801 ///# Panics
16802 ///Panics if `vkCmdWriteBufferMarker2AMD` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16803 ///
16804 ///# Usage Notes
16805 ///
16806 ///Extended version of `cmd_write_buffer_marker_amd` that uses
16807 ///`PipelineStageFlags2` for the stage mask. Supports the full
16808 ///synchronization2 stage flags.
16809 ///
16810 ///Requires `VK_AMD_buffer_marker` + `VK_KHR_synchronization2`.
16811 pub unsafe fn cmd_write_buffer_marker2_amd(
16812 &self,
16813 command_buffer: CommandBuffer,
16814 stage: PipelineStageFlags2,
16815 dst_buffer: Buffer,
16816 dst_offset: u64,
16817 marker: u32,
16818 ) {
16819 let fp = self
16820 .commands()
16821 .cmd_write_buffer_marker2_amd
16822 .expect("vkCmdWriteBufferMarker2AMD not loaded");
16823 unsafe { fp(command_buffer, stage, dst_buffer, dst_offset, marker) };
16824 }
16825 ///Wraps [`vkGetQueueCheckpointData2NV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetQueueCheckpointData2NV.html).
16826 /**
16827 Provided by **VK_NV_device_diagnostic_checkpoints**.*/
16828 ///
16829 ///# Safety
16830 ///- `queue` (self) must be valid and not destroyed.
16831 ///
16832 ///# Panics
16833 ///Panics if `vkGetQueueCheckpointData2NV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16834 ///
16835 ///# Usage Notes
16836 ///
16837 ///Extended version of `get_queue_checkpoint_data_nv` that returns
16838 ///pipeline stage information alongside the checkpoint markers.
16839 ///Use for finer-grained post-mortem debugging after device loss.
16840 ///
16841 ///Requires `VK_NV_device_diagnostic_checkpoints` +
16842 ///`VK_KHR_synchronization2`.
16843 pub unsafe fn get_queue_checkpoint_data2_nv(&self, queue: Queue) -> Vec<CheckpointData2NV> {
16844 let fp = self
16845 .commands()
16846 .get_queue_checkpoint_data2_nv
16847 .expect("vkGetQueueCheckpointData2NV not loaded");
16848 fill_two_call(|count, data| unsafe { fp(queue, count, data) })
16849 }
16850 ///Wraps [`vkCopyMemoryToImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCopyMemoryToImage.html).
16851 /**
16852 Provided by **VK_BASE_VERSION_1_4**.*/
16853 ///
16854 ///# Errors
16855 ///- `VK_ERROR_INITIALIZATION_FAILED`
16856 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
16857 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
16858 ///- `VK_ERROR_MEMORY_MAP_FAILED`
16859 ///- `VK_ERROR_UNKNOWN`
16860 ///- `VK_ERROR_VALIDATION_FAILED`
16861 ///
16862 ///# Safety
16863 ///- `device` (self) must be valid and not destroyed.
16864 ///
16865 ///# Panics
16866 ///Panics if `vkCopyMemoryToImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16867 ///
16868 ///# Usage Notes
16869 ///
16870 ///Vulkan 1.4 host-side image upload. Copies texel data from a host
16871 ///memory pointer directly into an image without a staging buffer or
16872 ///command buffer.
16873 ///
16874 ///The image must be in `GENERAL` layout and must have been created
16875 ///with `HOST_TRANSFER` usage. The copy happens synchronously.
16876 ///
16877 ///This simplifies upload workflows that previously required a staging
16878 ///buffer + `cmd_copy_buffer_to_image` + layout transitions. However,
16879 ///the image must support host transfer and be in `GENERAL` layout,
16880 ///which may not be optimal for subsequent GPU reads.
16881 pub unsafe fn copy_memory_to_image(
16882 &self,
16883 p_copy_memory_to_image_info: &CopyMemoryToImageInfo,
16884 ) -> VkResult<()> {
16885 let fp = self
16886 .commands()
16887 .copy_memory_to_image
16888 .expect("vkCopyMemoryToImage not loaded");
16889 check(unsafe { fp(self.handle(), p_copy_memory_to_image_info) })
16890 }
16891 ///Wraps [`vkCopyImageToMemory`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCopyImageToMemory.html).
16892 /**
16893 Provided by **VK_BASE_VERSION_1_4**.*/
16894 ///
16895 ///# Errors
16896 ///- `VK_ERROR_INITIALIZATION_FAILED`
16897 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
16898 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
16899 ///- `VK_ERROR_MEMORY_MAP_FAILED`
16900 ///- `VK_ERROR_UNKNOWN`
16901 ///- `VK_ERROR_VALIDATION_FAILED`
16902 ///
16903 ///# Safety
16904 ///- `device` (self) must be valid and not destroyed.
16905 ///
16906 ///# Panics
16907 ///Panics if `vkCopyImageToMemory` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16908 ///
16909 ///# Usage Notes
16910 ///
16911 ///Vulkan 1.4 host-side image readback. Copies texel data from an
16912 ///image directly to a host memory pointer without a staging buffer or
16913 ///command buffer.
16914 ///
16915 ///The image must be in `GENERAL` layout and must have been created
16916 ///with `HOST_TRANSFER` usage. The copy happens synchronously.
16917 ///
16918 ///This simplifies CPU readback workflows that previously required a
16919 ///staging buffer + `cmd_copy_image_to_buffer` + fence wait + map.
16920 ///However, it requires the image to support host transfer, which not
16921 ///all implementations or formats support.
16922 pub unsafe fn copy_image_to_memory(
16923 &self,
16924 p_copy_image_to_memory_info: &CopyImageToMemoryInfo,
16925 ) -> VkResult<()> {
16926 let fp = self
16927 .commands()
16928 .copy_image_to_memory
16929 .expect("vkCopyImageToMemory not loaded");
16930 check(unsafe { fp(self.handle(), p_copy_image_to_memory_info) })
16931 }
16932 ///Wraps [`vkCopyImageToImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCopyImageToImage.html).
16933 /**
16934 Provided by **VK_BASE_VERSION_1_4**.*/
16935 ///
16936 ///# Errors
16937 ///- `VK_ERROR_INITIALIZATION_FAILED`
16938 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
16939 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
16940 ///- `VK_ERROR_MEMORY_MAP_FAILED`
16941 ///- `VK_ERROR_UNKNOWN`
16942 ///- `VK_ERROR_VALIDATION_FAILED`
16943 ///
16944 ///# Safety
16945 ///- `device` (self) must be valid and not destroyed.
16946 ///
16947 ///# Panics
16948 ///Panics if `vkCopyImageToImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16949 ///
16950 ///# Usage Notes
16951 ///
16952 ///Vulkan 1.4 host-side image-to-image copy. Copies texel data between
16953 ///two images from the CPU without recording a command buffer.
16954 ///
16955 ///Both images must be in `GENERAL` layout and must have been created
16956 ///with `HOST_TRANSFER` usage. The copy happens synchronously on the
16957 ///calling thread.
16958 ///
16959 ///Use cases are limited to CPU-side image manipulation (e.g. test
16960 ///utilities, offline processing). For GPU-side copies in a render
16961 ///loop, `cmd_copy_image2` is the standard path.
16962 pub unsafe fn copy_image_to_image(
16963 &self,
16964 p_copy_image_to_image_info: &CopyImageToImageInfo,
16965 ) -> VkResult<()> {
16966 let fp = self
16967 .commands()
16968 .copy_image_to_image
16969 .expect("vkCopyImageToImage not loaded");
16970 check(unsafe { fp(self.handle(), p_copy_image_to_image_info) })
16971 }
16972 ///Wraps [`vkTransitionImageLayout`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkTransitionImageLayout.html).
16973 /**
16974 Provided by **VK_BASE_VERSION_1_4**.*/
16975 ///
16976 ///# Errors
16977 ///- `VK_ERROR_INITIALIZATION_FAILED`
16978 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
16979 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
16980 ///- `VK_ERROR_MEMORY_MAP_FAILED`
16981 ///- `VK_ERROR_UNKNOWN`
16982 ///- `VK_ERROR_VALIDATION_FAILED`
16983 ///
16984 ///# Safety
16985 ///- `device` (self) must be valid and not destroyed.
16986 ///
16987 ///# Panics
16988 ///Panics if `vkTransitionImageLayout` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16989 ///
16990 ///# Usage Notes
16991 ///
16992 ///Vulkan 1.4 host-side image layout transition. Transitions an image
16993 ///between layouts from the CPU without recording a command buffer.
16994 ///
16995 ///The image must have been created with `HOST_TRANSFER` usage. The
16996 ///transition happens synchronously on the calling thread.
16997 ///
16998 ///This simplifies workflows where you need to transition an image
16999 ///layout outside of a command buffer, for example, transitioning a
17000 ///newly created host-transfer image from `UNDEFINED` to `GENERAL`
17001 ///before performing host-side copies.
17002 ///
17003 ///For GPU-side layout transitions (the common case), use
17004 ///`cmd_pipeline_barrier2` with an image memory barrier.
17005 pub unsafe fn transition_image_layout(
17006 &self,
17007 p_transitions: &[HostImageLayoutTransitionInfo],
17008 ) -> VkResult<()> {
17009 let fp = self
17010 .commands()
17011 .transition_image_layout
17012 .expect("vkTransitionImageLayout not loaded");
17013 check(unsafe {
17014 fp(
17015 self.handle(),
17016 p_transitions.len() as u32,
17017 p_transitions.as_ptr(),
17018 )
17019 })
17020 }
17021 ///Wraps [`vkGetCommandPoolMemoryConsumption`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetCommandPoolMemoryConsumption.html).
17022 /**
17023 Provided by **VKSC_VERSION_1_0**.*/
17024 ///
17025 ///# Safety
17026 ///- `device` (self) must be valid and not destroyed.
17027 ///- `commandPool` must be externally synchronized.
17028 ///- `commandBuffer` must be externally synchronized.
17029 ///
17030 ///# Panics
17031 ///Panics if `vkGetCommandPoolMemoryConsumption` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17032 ///
17033 ///# Usage Notes
17034 ///
17035 ///Queries the memory consumption of a command pool or a specific
17036 ///command buffer within it. Part of Vulkan SC (Safety Critical)
17037 ///for tracking resource budgets in safety-certified environments.
17038 ///Pass a null command buffer to query the entire pool.
17039 ///
17040 ///Requires Vulkan SC.
17041 pub unsafe fn get_command_pool_memory_consumption(
17042 &self,
17043 command_pool: CommandPool,
17044 command_buffer: CommandBuffer,
17045 p_consumption: &mut CommandPoolMemoryConsumption,
17046 ) {
17047 let fp = self
17048 .commands()
17049 .get_command_pool_memory_consumption
17050 .expect("vkGetCommandPoolMemoryConsumption not loaded");
17051 unsafe { fp(self.handle(), command_pool, command_buffer, p_consumption) };
17052 }
17053 ///Wraps [`vkCreateVideoSessionKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateVideoSessionKHR.html).
17054 /**
17055 Provided by **VK_KHR_video_queue**.*/
17056 ///
17057 ///# Errors
17058 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
17059 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
17060 ///- `VK_ERROR_INITIALIZATION_FAILED`
17061 ///- `VK_ERROR_VIDEO_STD_VERSION_NOT_SUPPORTED_KHR`
17062 ///- `VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR`
17063 ///- `VK_ERROR_UNKNOWN`
17064 ///- `VK_ERROR_VALIDATION_FAILED`
17065 ///
17066 ///# Safety
17067 ///- `device` (self) must be valid and not destroyed.
17068 ///
17069 ///# Panics
17070 ///Panics if `vkCreateVideoSessionKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17071 ///
17072 ///# Usage Notes
17073 ///
17074 ///Creates a video session for hardware-accelerated video decoding
17075 ///or encoding. The session defines the video codec profile,
17076 ///resolution range, format, and maximum reference picture count.
17077 ///
17078 ///Key fields in `VideoSessionCreateInfoKHR`:
17079 ///
17080 ///- `video_profile`: codec (H.264, H.265, AV1) and profile/level.
17081 ///- `max_coded_extent`: maximum frame resolution.
17082 ///- `picture_format` / `reference_picture_format`: image formats
17083 /// for decoded pictures and DPB (decoded picture buffer) slots.
17084 ///- `max_dpb_slots` / `max_active_reference_pictures`: reference
17085 /// frame capacity.
17086 ///
17087 ///After creation, query memory requirements with
17088 ///`get_video_session_memory_requirements_khr`, allocate and bind
17089 ///memory with `bind_video_session_memory_khr`, then create session
17090 ///parameters with `create_video_session_parameters_khr`.
17091 pub unsafe fn create_video_session_khr(
17092 &self,
17093 p_create_info: &VideoSessionCreateInfoKHR,
17094 allocator: Option<&AllocationCallbacks>,
17095 ) -> VkResult<VideoSessionKHR> {
17096 let fp = self
17097 .commands()
17098 .create_video_session_khr
17099 .expect("vkCreateVideoSessionKHR not loaded");
17100 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
17101 let mut out = unsafe { core::mem::zeroed() };
17102 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
17103 Ok(out)
17104 }
17105 ///Wraps [`vkDestroyVideoSessionKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyVideoSessionKHR.html).
17106 /**
17107 Provided by **VK_KHR_video_queue**.*/
17108 ///
17109 ///# Safety
17110 ///- `device` (self) must be valid and not destroyed.
17111 ///- `videoSession` must be externally synchronized.
17112 ///
17113 ///# Panics
17114 ///Panics if `vkDestroyVideoSessionKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17115 ///
17116 ///# Usage Notes
17117 ///
17118 ///Destroys a video session and releases its internal resources.
17119 ///Any video session parameters created against this session become
17120 ///invalid, destroy them first.
17121 ///
17122 ///All command buffers referencing this session must have completed
17123 ///execution before destruction.
17124 pub unsafe fn destroy_video_session_khr(
17125 &self,
17126 video_session: VideoSessionKHR,
17127 allocator: Option<&AllocationCallbacks>,
17128 ) {
17129 let fp = self
17130 .commands()
17131 .destroy_video_session_khr
17132 .expect("vkDestroyVideoSessionKHR not loaded");
17133 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
17134 unsafe { fp(self.handle(), video_session, alloc_ptr) };
17135 }
17136 ///Wraps [`vkCreateVideoSessionParametersKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateVideoSessionParametersKHR.html).
17137 /**
17138 Provided by **VK_KHR_video_queue**.*/
17139 ///
17140 ///# Errors
17141 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
17142 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
17143 ///- `VK_ERROR_INITIALIZATION_FAILED`
17144 ///- `VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR`
17145 ///- `VK_ERROR_UNKNOWN`
17146 ///- `VK_ERROR_VALIDATION_FAILED`
17147 ///
17148 ///# Safety
17149 ///- `device` (self) must be valid and not destroyed.
17150 ///
17151 ///# Panics
17152 ///Panics if `vkCreateVideoSessionParametersKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17153 ///
17154 ///# Usage Notes
17155 ///
17156 ///Creates a video session parameters object that holds codec-specific
17157 ///parameter sets (SPS, PPS for H.264/H.265, sequence headers for
17158 ///AV1). These are referenced during decode/encode operations.
17159 ///
17160 ///Chain the appropriate codec-specific struct into `pNext`:
17161 ///
17162 ///- `VideoDecodeH264SessionParametersCreateInfoKHR` for H.264 decode.
17163 ///- `VideoDecodeH265SessionParametersCreateInfoKHR` for H.265 decode.
17164 ///- `VideoEncodeH264SessionParametersCreateInfoKHR` for H.264 encode.
17165 ///
17166 ///Parameters can be added incrementally with
17167 ///`update_video_session_parameters_khr`. A template parameter object
17168 ///can be specified to inherit existing parameters.
17169 pub unsafe fn create_video_session_parameters_khr(
17170 &self,
17171 p_create_info: &VideoSessionParametersCreateInfoKHR,
17172 allocator: Option<&AllocationCallbacks>,
17173 ) -> VkResult<VideoSessionParametersKHR> {
17174 let fp = self
17175 .commands()
17176 .create_video_session_parameters_khr
17177 .expect("vkCreateVideoSessionParametersKHR not loaded");
17178 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
17179 let mut out = unsafe { core::mem::zeroed() };
17180 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
17181 Ok(out)
17182 }
17183 ///Wraps [`vkUpdateVideoSessionParametersKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkUpdateVideoSessionParametersKHR.html).
17184 /**
17185 Provided by **VK_KHR_video_queue**.*/
17186 ///
17187 ///# Errors
17188 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
17189 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
17190 ///- `VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR`
17191 ///- `VK_ERROR_UNKNOWN`
17192 ///- `VK_ERROR_VALIDATION_FAILED`
17193 ///
17194 ///# Safety
17195 ///- `device` (self) must be valid and not destroyed.
17196 ///
17197 ///# Panics
17198 ///Panics if `vkUpdateVideoSessionParametersKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17199 ///
17200 ///# Usage Notes
17201 ///
17202 ///Adds new codec-specific parameter sets to an existing video
17203 ///session parameters object. For example, adding new SPS/PPS
17204 ///entries for H.264 as they are encountered in the bitstream.
17205 ///
17206 ///Chain the codec-specific update struct into the `pNext` of
17207 ///`VideoSessionParametersUpdateInfoKHR`. The `update_sequence_count`
17208 ///must increment monotonically with each update.
17209 ///
17210 ///Parameters cannot be removed or modified, only new entries can
17211 ///be added. If a parameter set with the same ID already exists,
17212 ///the update fails.
17213 pub unsafe fn update_video_session_parameters_khr(
17214 &self,
17215 video_session_parameters: VideoSessionParametersKHR,
17216 p_update_info: &VideoSessionParametersUpdateInfoKHR,
17217 ) -> VkResult<()> {
17218 let fp = self
17219 .commands()
17220 .update_video_session_parameters_khr
17221 .expect("vkUpdateVideoSessionParametersKHR not loaded");
17222 check(unsafe { fp(self.handle(), video_session_parameters, p_update_info) })
17223 }
17224 ///Wraps [`vkGetEncodedVideoSessionParametersKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetEncodedVideoSessionParametersKHR.html).
17225 /**
17226 Provided by **VK_KHR_video_encode_queue**.*/
17227 ///
17228 ///# Errors
17229 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
17230 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
17231 ///- `VK_ERROR_UNKNOWN`
17232 ///- `VK_ERROR_VALIDATION_FAILED`
17233 ///
17234 ///# Safety
17235 ///- `device` (self) must be valid and not destroyed.
17236 ///
17237 ///# Panics
17238 ///Panics if `vkGetEncodedVideoSessionParametersKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17239 ///
17240 ///# Usage Notes
17241 ///
17242 ///Retrieves the encoded (serialized) form of video session
17243 ///parameters, typically codec headers (SPS/PPS for H.264/H.265,
17244 ///sequence header for AV1) that must be prepended to the encoded
17245 ///bitstream.
17246 ///
17247 ///Uses the two-call pattern: call with null `p_data` to query
17248 ///the size, allocate, then call again to fill the buffer.
17249 ///
17250 ///The `p_feedback_info` output indicates whether the driver
17251 ///modified or overrode any parameters relative to what was
17252 ///requested (check `has_overrides`).
17253 ///
17254 ///This data is the codec parameter payload that decoders need to
17255 ///initialize before processing encoded frames.
17256 pub unsafe fn get_encoded_video_session_parameters_khr(
17257 &self,
17258 p_video_session_parameters_info: &VideoEncodeSessionParametersGetInfoKHR,
17259 p_feedback_info: &mut VideoEncodeSessionParametersFeedbackInfoKHR,
17260 p_data: *mut core::ffi::c_void,
17261 ) -> VkResult<usize> {
17262 let fp = self
17263 .commands()
17264 .get_encoded_video_session_parameters_khr
17265 .expect("vkGetEncodedVideoSessionParametersKHR not loaded");
17266 let mut out = unsafe { core::mem::zeroed() };
17267 check(unsafe {
17268 fp(
17269 self.handle(),
17270 p_video_session_parameters_info,
17271 p_feedback_info,
17272 &mut out,
17273 p_data,
17274 )
17275 })?;
17276 Ok(out)
17277 }
17278 ///Wraps [`vkDestroyVideoSessionParametersKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyVideoSessionParametersKHR.html).
17279 /**
17280 Provided by **VK_KHR_video_queue**.*/
17281 ///
17282 ///# Safety
17283 ///- `device` (self) must be valid and not destroyed.
17284 ///- `videoSessionParameters` must be externally synchronized.
17285 ///
17286 ///# Panics
17287 ///Panics if `vkDestroyVideoSessionParametersKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17288 ///
17289 ///# Usage Notes
17290 ///
17291 ///Destroys a video session parameters object. All command buffers
17292 ///referencing these parameters must have completed execution before
17293 ///destruction.
17294 ///
17295 ///The video session itself is not affected, other parameter objects
17296 ///associated with the same session remain valid.
17297 pub unsafe fn destroy_video_session_parameters_khr(
17298 &self,
17299 video_session_parameters: VideoSessionParametersKHR,
17300 allocator: Option<&AllocationCallbacks>,
17301 ) {
17302 let fp = self
17303 .commands()
17304 .destroy_video_session_parameters_khr
17305 .expect("vkDestroyVideoSessionParametersKHR not loaded");
17306 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
17307 unsafe { fp(self.handle(), video_session_parameters, alloc_ptr) };
17308 }
17309 ///Wraps [`vkGetVideoSessionMemoryRequirementsKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetVideoSessionMemoryRequirementsKHR.html).
17310 /**
17311 Provided by **VK_KHR_video_queue**.*/
17312 ///
17313 ///# Errors
17314 ///- `VK_ERROR_UNKNOWN`
17315 ///- `VK_ERROR_VALIDATION_FAILED`
17316 ///
17317 ///# Safety
17318 ///- `device` (self) must be valid and not destroyed.
17319 ///
17320 ///# Panics
17321 ///Panics if `vkGetVideoSessionMemoryRequirementsKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17322 ///
17323 ///# Usage Notes
17324 ///
17325 ///Queries the memory requirements for a video session. A video
17326 ///session may require multiple memory bindings (each with different
17327 ///memory type requirements) for internal buffers used during
17328 ///decode/encode.
17329 ///
17330 ///Each returned `VideoSessionMemoryRequirementsKHR` has a
17331 ///`memory_bind_index` and a `MemoryRequirements` describing the
17332 ///size, alignment, and compatible memory types.
17333 ///
17334 ///Allocate a `DeviceMemory` for each requirement and bind them all
17335 ///with `bind_video_session_memory_khr` before using the session.
17336 pub unsafe fn get_video_session_memory_requirements_khr(
17337 &self,
17338 video_session: VideoSessionKHR,
17339 ) -> VkResult<Vec<VideoSessionMemoryRequirementsKHR>> {
17340 let fp = self
17341 .commands()
17342 .get_video_session_memory_requirements_khr
17343 .expect("vkGetVideoSessionMemoryRequirementsKHR not loaded");
17344 enumerate_two_call(|count, data| unsafe { fp(self.handle(), video_session, count, data) })
17345 }
17346 ///Wraps [`vkBindVideoSessionMemoryKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBindVideoSessionMemoryKHR.html).
17347 /**
17348 Provided by **VK_KHR_video_queue**.*/
17349 ///
17350 ///# Errors
17351 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
17352 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
17353 ///- `VK_ERROR_UNKNOWN`
17354 ///- `VK_ERROR_VALIDATION_FAILED`
17355 ///
17356 ///# Safety
17357 ///- `device` (self) must be valid and not destroyed.
17358 ///- `videoSession` must be externally synchronized.
17359 ///
17360 ///# Panics
17361 ///Panics if `vkBindVideoSessionMemoryKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17362 ///
17363 ///# Usage Notes
17364 ///
17365 ///Binds device memory to a video session. Each binding corresponds
17366 ///to a `memory_bind_index` from
17367 ///`get_video_session_memory_requirements_khr`.
17368 ///
17369 ///All required memory bindings must be satisfied before the session
17370 ///can be used in video coding operations. Each
17371 ///`BindVideoSessionMemoryInfoKHR` specifies the bind index, memory
17372 ///object, offset, and size.
17373 ///
17374 ///Memory can only be bound once per index, rebinding is not
17375 ///allowed.
17376 pub unsafe fn bind_video_session_memory_khr(
17377 &self,
17378 video_session: VideoSessionKHR,
17379 p_bind_session_memory_infos: &[BindVideoSessionMemoryInfoKHR],
17380 ) -> VkResult<()> {
17381 let fp = self
17382 .commands()
17383 .bind_video_session_memory_khr
17384 .expect("vkBindVideoSessionMemoryKHR not loaded");
17385 check(unsafe {
17386 fp(
17387 self.handle(),
17388 video_session,
17389 p_bind_session_memory_infos.len() as u32,
17390 p_bind_session_memory_infos.as_ptr(),
17391 )
17392 })
17393 }
17394 ///Wraps [`vkCmdDecodeVideoKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDecodeVideoKHR.html).
17395 /**
17396 Provided by **VK_KHR_video_decode_queue**.*/
17397 ///
17398 ///# Safety
17399 ///- `commandBuffer` (self) must be valid and not destroyed.
17400 ///- `commandBuffer` must be externally synchronized.
17401 ///
17402 ///# Panics
17403 ///Panics if `vkCmdDecodeVideoKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17404 ///
17405 ///# Usage Notes
17406 ///
17407 ///Decodes a single video frame from a compressed bitstream.
17408 ///Must be recorded within a video coding scope
17409 ///(`cmd_begin_video_coding_khr` / `cmd_end_video_coding_khr`).
17410 ///
17411 ///`VideoDecodeInfoKHR` specifies:
17412 ///
17413 ///- `src_buffer` / `src_buffer_offset` / `src_buffer_range`: the
17414 /// bitstream data containing the compressed frame.
17415 ///- `dst_picture_resource`: the output image view for the decoded
17416 /// frame.
17417 ///- `setup_reference_slot`: DPB slot to store this frame for use
17418 /// as a reference by future frames.
17419 ///- `reference_slots`: previously decoded reference frames needed
17420 /// to decode this frame.
17421 ///
17422 ///Chain codec-specific decode info (e.g.,
17423 ///`VideoDecodeH264PictureInfoKHR`) into `pNext`.
17424 pub unsafe fn cmd_decode_video_khr(
17425 &self,
17426 command_buffer: CommandBuffer,
17427 p_decode_info: &VideoDecodeInfoKHR,
17428 ) {
17429 let fp = self
17430 .commands()
17431 .cmd_decode_video_khr
17432 .expect("vkCmdDecodeVideoKHR not loaded");
17433 unsafe { fp(command_buffer, p_decode_info) };
17434 }
17435 ///Wraps [`vkCmdBeginVideoCodingKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginVideoCodingKHR.html).
17436 /**
17437 Provided by **VK_KHR_video_queue**.*/
17438 ///
17439 ///# Safety
17440 ///- `commandBuffer` (self) must be valid and not destroyed.
17441 ///- `commandBuffer` must be externally synchronized.
17442 ///
17443 ///# Panics
17444 ///Panics if `vkCmdBeginVideoCodingKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17445 ///
17446 ///# Usage Notes
17447 ///
17448 ///Begins a video coding scope within a command buffer. All video
17449 ///decode and encode commands must be recorded between
17450 ///`cmd_begin_video_coding_khr` and `cmd_end_video_coding_khr`.
17451 ///
17452 ///`VideoBeginCodingInfoKHR` specifies:
17453 ///
17454 ///- `video_session`: the session to use.
17455 ///- `video_session_parameters`: codec parameters (SPS/PPS, etc.).
17456 ///- `reference_slots`: DPB (decoded picture buffer) slots and their
17457 /// associated image views for reference pictures.
17458 ///
17459 ///The command buffer must be allocated from a queue family that
17460 ///supports the appropriate video operations (decode or encode),
17461 ///as reported by `QueueFamilyVideoPropertiesKHR`.
17462 pub unsafe fn cmd_begin_video_coding_khr(
17463 &self,
17464 command_buffer: CommandBuffer,
17465 p_begin_info: &VideoBeginCodingInfoKHR,
17466 ) {
17467 let fp = self
17468 .commands()
17469 .cmd_begin_video_coding_khr
17470 .expect("vkCmdBeginVideoCodingKHR not loaded");
17471 unsafe { fp(command_buffer, p_begin_info) };
17472 }
17473 ///Wraps [`vkCmdControlVideoCodingKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdControlVideoCodingKHR.html).
17474 /**
17475 Provided by **VK_KHR_video_queue**.*/
17476 ///
17477 ///# Safety
17478 ///- `commandBuffer` (self) must be valid and not destroyed.
17479 ///- `commandBuffer` must be externally synchronized.
17480 ///
17481 ///# Panics
17482 ///Panics if `vkCmdControlVideoCodingKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17483 ///
17484 ///# Usage Notes
17485 ///
17486 ///Issues control commands within a video coding scope. Used to
17487 ///reset the video session state or set encode quality/rate control
17488 ///parameters.
17489 ///
17490 ///`VideoCodingControlInfoKHR` flags include:
17491 ///
17492 ///- `RESET`: resets the video session to a clean state, clearing
17493 /// all DPB slots and internal codec state.
17494 ///- `ENCODE_RATE_CONTROL`: applies rate control settings (chain
17495 /// `VideoEncodeRateControlInfoKHR` into `pNext`).
17496 ///- `ENCODE_QUALITY_LEVEL`: sets the encode quality level.
17497 ///
17498 ///Must be recorded between `cmd_begin_video_coding_khr` and
17499 ///`cmd_end_video_coding_khr`.
17500 pub unsafe fn cmd_control_video_coding_khr(
17501 &self,
17502 command_buffer: CommandBuffer,
17503 p_coding_control_info: &VideoCodingControlInfoKHR,
17504 ) {
17505 let fp = self
17506 .commands()
17507 .cmd_control_video_coding_khr
17508 .expect("vkCmdControlVideoCodingKHR not loaded");
17509 unsafe { fp(command_buffer, p_coding_control_info) };
17510 }
17511 ///Wraps [`vkCmdEndVideoCodingKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndVideoCodingKHR.html).
17512 /**
17513 Provided by **VK_KHR_video_queue**.*/
17514 ///
17515 ///# Safety
17516 ///- `commandBuffer` (self) must be valid and not destroyed.
17517 ///- `commandBuffer` must be externally synchronized.
17518 ///
17519 ///# Panics
17520 ///Panics if `vkCmdEndVideoCodingKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17521 ///
17522 ///# Usage Notes
17523 ///
17524 ///Ends a video coding scope previously started with
17525 ///`cmd_begin_video_coding_khr`. After this call, video decode and
17526 ///encode commands can no longer be recorded until a new scope is
17527 ///started.
17528 ///
17529 ///The `VideoEndCodingInfoKHR` struct is currently reserved for
17530 ///future use (no flags defined).
17531 pub unsafe fn cmd_end_video_coding_khr(
17532 &self,
17533 command_buffer: CommandBuffer,
17534 p_end_coding_info: &VideoEndCodingInfoKHR,
17535 ) {
17536 let fp = self
17537 .commands()
17538 .cmd_end_video_coding_khr
17539 .expect("vkCmdEndVideoCodingKHR not loaded");
17540 unsafe { fp(command_buffer, p_end_coding_info) };
17541 }
17542 ///Wraps [`vkCmdEncodeVideoKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEncodeVideoKHR.html).
17543 /**
17544 Provided by **VK_KHR_video_encode_queue**.*/
17545 ///
17546 ///# Safety
17547 ///- `commandBuffer` (self) must be valid and not destroyed.
17548 ///- `commandBuffer` must be externally synchronized.
17549 ///
17550 ///# Panics
17551 ///Panics if `vkCmdEncodeVideoKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17552 ///
17553 ///# Usage Notes
17554 ///
17555 ///Encodes a single video frame into a compressed bitstream.
17556 ///Must be recorded within a video coding scope
17557 ///(`cmd_begin_video_coding_khr` / `cmd_end_video_coding_khr`).
17558 ///
17559 ///`VideoEncodeInfoKHR` specifies:
17560 ///
17561 ///- `dst_buffer` / `dst_buffer_offset` / `dst_buffer_range`: where
17562 /// to write the compressed output.
17563 ///- `src_picture_resource`: the input image view to encode.
17564 ///- `setup_reference_slot`: DPB slot to store the reconstructed
17565 /// frame for future reference.
17566 ///- `reference_slots`: reference frames for inter-prediction.
17567 ///
17568 ///Chain codec-specific encode info (e.g.,
17569 ///`VideoEncodeH264PictureInfoKHR`) into `pNext`. Configure rate
17570 ///control beforehand with `cmd_control_video_coding_khr`.
17571 pub unsafe fn cmd_encode_video_khr(
17572 &self,
17573 command_buffer: CommandBuffer,
17574 p_encode_info: &VideoEncodeInfoKHR,
17575 ) {
17576 let fp = self
17577 .commands()
17578 .cmd_encode_video_khr
17579 .expect("vkCmdEncodeVideoKHR not loaded");
17580 unsafe { fp(command_buffer, p_encode_info) };
17581 }
17582 ///Wraps [`vkCmdDecompressMemoryNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDecompressMemoryNV.html).
17583 /**
17584 Provided by **VK_NV_memory_decompression**.*/
17585 ///
17586 ///# Safety
17587 ///- `commandBuffer` (self) must be valid and not destroyed.
17588 ///- `commandBuffer` must be externally synchronized.
17589 ///
17590 ///# Panics
17591 ///Panics if `vkCmdDecompressMemoryNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17592 ///
17593 ///# Usage Notes
17594 ///
17595 ///Decompresses one or more memory regions on the GPU. Each region
17596 ///specifies source, destination, size, and decompression method.
17597 ///
17598 ///Requires `VK_NV_memory_decompression`.
17599 pub unsafe fn cmd_decompress_memory_nv(
17600 &self,
17601 command_buffer: CommandBuffer,
17602 p_decompress_memory_regions: &[DecompressMemoryRegionNV],
17603 ) {
17604 let fp = self
17605 .commands()
17606 .cmd_decompress_memory_nv
17607 .expect("vkCmdDecompressMemoryNV not loaded");
17608 unsafe {
17609 fp(
17610 command_buffer,
17611 p_decompress_memory_regions.len() as u32,
17612 p_decompress_memory_regions.as_ptr(),
17613 )
17614 };
17615 }
17616 ///Wraps [`vkCmdDecompressMemoryIndirectCountNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDecompressMemoryIndirectCountNV.html).
17617 /**
17618 Provided by **VK_NV_memory_decompression**.*/
17619 ///
17620 ///# Safety
17621 ///- `commandBuffer` (self) must be valid and not destroyed.
17622 ///- `commandBuffer` must be externally synchronized.
17623 ///
17624 ///# Panics
17625 ///Panics if `vkCmdDecompressMemoryIndirectCountNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17626 ///
17627 ///# Usage Notes
17628 ///
17629 ///Indirect-count variant of `cmd_decompress_memory_nv`. Reads the
17630 ///decompression region descriptors and count from GPU buffer
17631 ///addresses, enabling fully GPU-driven decompression.
17632 ///
17633 ///Requires `VK_NV_memory_decompression`.
17634 pub unsafe fn cmd_decompress_memory_indirect_count_nv(
17635 &self,
17636 command_buffer: CommandBuffer,
17637 indirect_commands_address: u64,
17638 indirect_commands_count_address: u64,
17639 stride: u32,
17640 ) {
17641 let fp = self
17642 .commands()
17643 .cmd_decompress_memory_indirect_count_nv
17644 .expect("vkCmdDecompressMemoryIndirectCountNV not loaded");
17645 unsafe {
17646 fp(
17647 command_buffer,
17648 indirect_commands_address,
17649 indirect_commands_count_address,
17650 stride,
17651 )
17652 };
17653 }
17654 ///Wraps [`vkGetPartitionedAccelerationStructuresBuildSizesNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPartitionedAccelerationStructuresBuildSizesNV.html).
17655 /**
17656 Provided by **VK_NV_partitioned_acceleration_structure**.*/
17657 ///
17658 ///# Safety
17659 ///- `device` (self) must be valid and not destroyed.
17660 ///
17661 ///# Panics
17662 ///Panics if `vkGetPartitionedAccelerationStructuresBuildSizesNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17663 ///
17664 ///# Usage Notes
17665 ///
17666 ///Queries the buffer sizes needed to build a partitioned
17667 ///acceleration structure. Use the returned sizes to allocate
17668 ///destination and scratch buffers.
17669 ///
17670 ///Requires `VK_NV_partitioned_acceleration_structure`.
17671 pub unsafe fn get_partitioned_acceleration_structures_build_sizes_nv(
17672 &self,
17673 p_info: &PartitionedAccelerationStructureInstancesInputNV,
17674 p_size_info: &mut AccelerationStructureBuildSizesInfoKHR,
17675 ) {
17676 let fp = self
17677 .commands()
17678 .get_partitioned_acceleration_structures_build_sizes_nv
17679 .expect("vkGetPartitionedAccelerationStructuresBuildSizesNV not loaded");
17680 unsafe { fp(self.handle(), p_info, p_size_info) };
17681 }
17682 ///Wraps [`vkCmdBuildPartitionedAccelerationStructuresNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBuildPartitionedAccelerationStructuresNV.html).
17683 /**
17684 Provided by **VK_NV_partitioned_acceleration_structure**.*/
17685 ///
17686 ///# Safety
17687 ///- `commandBuffer` (self) must be valid and not destroyed.
17688 ///- `commandBuffer` must be externally synchronized.
17689 ///
17690 ///# Panics
17691 ///Panics if `vkCmdBuildPartitionedAccelerationStructuresNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17692 ///
17693 ///# Usage Notes
17694 ///
17695 ///Builds a partitioned acceleration structure where instances are
17696 ///grouped into independently updatable partitions. This allows
17697 ///updating subsets of the TLAS without rebuilding the entire
17698 ///structure.
17699 ///
17700 ///Requires `VK_NV_partitioned_acceleration_structure`.
17701 pub unsafe fn cmd_build_partitioned_acceleration_structures_nv(
17702 &self,
17703 command_buffer: CommandBuffer,
17704 p_build_info: &BuildPartitionedAccelerationStructureInfoNV,
17705 ) {
17706 let fp = self
17707 .commands()
17708 .cmd_build_partitioned_acceleration_structures_nv
17709 .expect("vkCmdBuildPartitionedAccelerationStructuresNV not loaded");
17710 unsafe { fp(command_buffer, p_build_info) };
17711 }
17712 ///Wraps [`vkCmdDecompressMemoryEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDecompressMemoryEXT.html).
17713 /**
17714 Provided by **VK_EXT_memory_decompression**.*/
17715 ///
17716 ///# Safety
17717 ///- `commandBuffer` (self) must be valid and not destroyed.
17718 ///- `commandBuffer` must be externally synchronized.
17719 ///
17720 ///# Panics
17721 ///Panics if `vkCmdDecompressMemoryEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17722 ///
17723 ///# Usage Notes
17724 ///
17725 ///Decompresses data from one memory region into another on the GPU.
17726 ///The decompression algorithm is specified in the info structure.
17727 ///
17728 ///Useful for loading compressed assets directly on the GPU without
17729 ///a CPU round-trip.
17730 ///
17731 ///Requires `VK_EXT_memory_decompression`.
17732 pub unsafe fn cmd_decompress_memory_ext(
17733 &self,
17734 command_buffer: CommandBuffer,
17735 p_decompress_memory_info_ext: &DecompressMemoryInfoEXT,
17736 ) {
17737 let fp = self
17738 .commands()
17739 .cmd_decompress_memory_ext
17740 .expect("vkCmdDecompressMemoryEXT not loaded");
17741 unsafe { fp(command_buffer, p_decompress_memory_info_ext) };
17742 }
17743 ///Wraps [`vkCmdDecompressMemoryIndirectCountEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDecompressMemoryIndirectCountEXT.html).
17744 /**
17745 Provided by **VK_EXT_memory_decompression**.*/
17746 ///
17747 ///# Safety
17748 ///- `commandBuffer` (self) must be valid and not destroyed.
17749 ///- `commandBuffer` must be externally synchronized.
17750 ///
17751 ///# Panics
17752 ///Panics if `vkCmdDecompressMemoryIndirectCountEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17753 ///
17754 ///# Usage Notes
17755 ///
17756 ///Indirect variant of `cmd_decompress_memory_ext`. Reads the
17757 ///decompression parameters and count from GPU-visible buffer
17758 ///addresses, enabling fully GPU-driven decompression workflows.
17759 ///
17760 ///Requires `VK_EXT_memory_decompression`.
17761 pub unsafe fn cmd_decompress_memory_indirect_count_ext(
17762 &self,
17763 command_buffer: CommandBuffer,
17764 decompression_method: MemoryDecompressionMethodFlagsEXT,
17765 indirect_commands_address: u64,
17766 indirect_commands_count_address: u64,
17767 max_decompression_count: u32,
17768 stride: u32,
17769 ) {
17770 let fp = self
17771 .commands()
17772 .cmd_decompress_memory_indirect_count_ext
17773 .expect("vkCmdDecompressMemoryIndirectCountEXT not loaded");
17774 unsafe {
17775 fp(
17776 command_buffer,
17777 decompression_method,
17778 indirect_commands_address,
17779 indirect_commands_count_address,
17780 max_decompression_count,
17781 stride,
17782 )
17783 };
17784 }
17785 ///Wraps [`vkCreateCuModuleNVX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateCuModuleNVX.html).
17786 /**
17787 Provided by **VK_NVX_binary_import**.*/
17788 ///
17789 ///# Errors
17790 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
17791 ///- `VK_ERROR_INITIALIZATION_FAILED`
17792 ///- `VK_ERROR_UNKNOWN`
17793 ///- `VK_ERROR_VALIDATION_FAILED`
17794 ///
17795 ///# Safety
17796 ///- `device` (self) must be valid and not destroyed.
17797 ///
17798 ///# Panics
17799 ///Panics if `vkCreateCuModuleNVX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17800 ///
17801 ///# Usage Notes
17802 ///
17803 ///Creates a CUDA module from binary data using the legacy NVX
17804 ///path. Prefer `create_cuda_module_nv` for new code.
17805 ///
17806 ///Destroy with `destroy_cu_module_nvx`.
17807 ///
17808 ///Requires `VK_NVX_binary_import`.
17809 pub unsafe fn create_cu_module_nvx(
17810 &self,
17811 p_create_info: &CuModuleCreateInfoNVX,
17812 allocator: Option<&AllocationCallbacks>,
17813 ) -> VkResult<CuModuleNVX> {
17814 let fp = self
17815 .commands()
17816 .create_cu_module_nvx
17817 .expect("vkCreateCuModuleNVX not loaded");
17818 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
17819 let mut out = unsafe { core::mem::zeroed() };
17820 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
17821 Ok(out)
17822 }
17823 ///Wraps [`vkCreateCuFunctionNVX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateCuFunctionNVX.html).
17824 /**
17825 Provided by **VK_NVX_binary_import**.*/
17826 ///
17827 ///# Errors
17828 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
17829 ///- `VK_ERROR_INITIALIZATION_FAILED`
17830 ///- `VK_ERROR_UNKNOWN`
17831 ///- `VK_ERROR_VALIDATION_FAILED`
17832 ///
17833 ///# Safety
17834 ///- `device` (self) must be valid and not destroyed.
17835 ///
17836 ///# Panics
17837 ///Panics if `vkCreateCuFunctionNVX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17838 ///
17839 ///# Usage Notes
17840 ///
17841 ///Creates a CUDA function handle from an NVX binary module. This
17842 ///is the legacy NVX path; prefer `create_cuda_function_nv` for
17843 ///new code.
17844 ///
17845 ///Destroy with `destroy_cu_function_nvx`.
17846 ///
17847 ///Requires `VK_NVX_binary_import`.
17848 pub unsafe fn create_cu_function_nvx(
17849 &self,
17850 p_create_info: &CuFunctionCreateInfoNVX,
17851 allocator: Option<&AllocationCallbacks>,
17852 ) -> VkResult<CuFunctionNVX> {
17853 let fp = self
17854 .commands()
17855 .create_cu_function_nvx
17856 .expect("vkCreateCuFunctionNVX not loaded");
17857 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
17858 let mut out = unsafe { core::mem::zeroed() };
17859 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
17860 Ok(out)
17861 }
17862 ///Wraps [`vkDestroyCuModuleNVX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyCuModuleNVX.html).
17863 /**
17864 Provided by **VK_NVX_binary_import**.*/
17865 ///
17866 ///# Safety
17867 ///- `device` (self) must be valid and not destroyed.
17868 ///
17869 ///# Panics
17870 ///Panics if `vkDestroyCuModuleNVX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17871 ///
17872 ///# Usage Notes
17873 ///
17874 ///Destroys a CUDA module created with `create_cu_module_nvx`.
17875 ///
17876 ///Requires `VK_NVX_binary_import`.
17877 pub unsafe fn destroy_cu_module_nvx(
17878 &self,
17879 module: CuModuleNVX,
17880 allocator: Option<&AllocationCallbacks>,
17881 ) {
17882 let fp = self
17883 .commands()
17884 .destroy_cu_module_nvx
17885 .expect("vkDestroyCuModuleNVX not loaded");
17886 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
17887 unsafe { fp(self.handle(), module, alloc_ptr) };
17888 }
17889 ///Wraps [`vkDestroyCuFunctionNVX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyCuFunctionNVX.html).
17890 /**
17891 Provided by **VK_NVX_binary_import**.*/
17892 ///
17893 ///# Safety
17894 ///- `device` (self) must be valid and not destroyed.
17895 ///
17896 ///# Panics
17897 ///Panics if `vkDestroyCuFunctionNVX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17898 ///
17899 ///# Usage Notes
17900 ///
17901 ///Destroys a CUDA function handle created with
17902 ///`create_cu_function_nvx`.
17903 ///
17904 ///Requires `VK_NVX_binary_import`.
17905 pub unsafe fn destroy_cu_function_nvx(
17906 &self,
17907 function: CuFunctionNVX,
17908 allocator: Option<&AllocationCallbacks>,
17909 ) {
17910 let fp = self
17911 .commands()
17912 .destroy_cu_function_nvx
17913 .expect("vkDestroyCuFunctionNVX not loaded");
17914 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
17915 unsafe { fp(self.handle(), function, alloc_ptr) };
17916 }
17917 ///Wraps [`vkCmdCuLaunchKernelNVX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCuLaunchKernelNVX.html).
17918 /**
17919 Provided by **VK_NVX_binary_import**.*/
17920 ///
17921 ///# Safety
17922 ///- `commandBuffer` (self) must be valid and not destroyed.
17923 ///
17924 ///# Panics
17925 ///Panics if `vkCmdCuLaunchKernelNVX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17926 ///
17927 ///# Usage Notes
17928 ///
17929 ///Launches a CUDA kernel from a Vulkan command buffer using the
17930 ///legacy NVX binary import path. Prefer `cmd_cuda_launch_kernel_nv`
17931 ///for new code.
17932 ///
17933 ///Requires `VK_NVX_binary_import`.
17934 pub unsafe fn cmd_cu_launch_kernel_nvx(
17935 &self,
17936 command_buffer: CommandBuffer,
17937 p_launch_info: &CuLaunchInfoNVX,
17938 ) {
17939 let fp = self
17940 .commands()
17941 .cmd_cu_launch_kernel_nvx
17942 .expect("vkCmdCuLaunchKernelNVX not loaded");
17943 unsafe { fp(command_buffer, p_launch_info) };
17944 }
17945 ///Wraps [`vkGetDescriptorSetLayoutSizeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDescriptorSetLayoutSizeEXT.html).
17946 /**
17947 Provided by **VK_EXT_descriptor_buffer**.*/
17948 ///
17949 ///# Safety
17950 ///- `device` (self) must be valid and not destroyed.
17951 ///
17952 ///# Panics
17953 ///Panics if `vkGetDescriptorSetLayoutSizeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17954 ///
17955 ///# Usage Notes
17956 ///
17957 ///Returns the total byte size required to store all descriptors for
17958 ///the given descriptor set layout in a descriptor buffer.
17959 ///
17960 ///Use this to allocate the correct amount of buffer memory for each
17961 ///descriptor set, then write individual descriptors at offsets
17962 ///obtained from `get_descriptor_set_layout_binding_offset_ext`.
17963 ///
17964 ///Requires `VK_EXT_descriptor_buffer`.
17965 pub unsafe fn get_descriptor_set_layout_size_ext(&self, layout: DescriptorSetLayout) -> u64 {
17966 let fp = self
17967 .commands()
17968 .get_descriptor_set_layout_size_ext
17969 .expect("vkGetDescriptorSetLayoutSizeEXT not loaded");
17970 let mut out = unsafe { core::mem::zeroed() };
17971 unsafe { fp(self.handle(), layout, &mut out) };
17972 out
17973 }
17974 ///Wraps [`vkGetDescriptorSetLayoutBindingOffsetEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDescriptorSetLayoutBindingOffsetEXT.html).
17975 /**
17976 Provided by **VK_EXT_descriptor_buffer**.*/
17977 ///
17978 ///# Safety
17979 ///- `device` (self) must be valid and not destroyed.
17980 ///
17981 ///# Panics
17982 ///Panics if `vkGetDescriptorSetLayoutBindingOffsetEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17983 ///
17984 ///# Usage Notes
17985 ///
17986 ///Returns the byte offset of a specific binding within the
17987 ///descriptor buffer layout for the given descriptor set layout.
17988 ///
17989 ///Use this to compute where to write a descriptor with
17990 ///`get_descriptor_ext` within the buffer region for a set.
17991 ///
17992 ///Requires `VK_EXT_descriptor_buffer`.
17993 pub unsafe fn get_descriptor_set_layout_binding_offset_ext(
17994 &self,
17995 layout: DescriptorSetLayout,
17996 binding: u32,
17997 ) -> u64 {
17998 let fp = self
17999 .commands()
18000 .get_descriptor_set_layout_binding_offset_ext
18001 .expect("vkGetDescriptorSetLayoutBindingOffsetEXT not loaded");
18002 let mut out = unsafe { core::mem::zeroed() };
18003 unsafe { fp(self.handle(), layout, binding, &mut out) };
18004 out
18005 }
18006 ///Wraps [`vkGetDescriptorEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDescriptorEXT.html).
18007 /**
18008 Provided by **VK_EXT_descriptor_buffer**.*/
18009 ///
18010 ///# Safety
18011 ///- `device` (self) must be valid and not destroyed.
18012 ///
18013 ///# Panics
18014 ///Panics if `vkGetDescriptorEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18015 ///
18016 ///# Usage Notes
18017 ///
18018 ///Writes a descriptor directly into caller-provided memory.
18019 ///`DescriptorGetInfoEXT` specifies the descriptor type and resource
18020 ///(buffer, image, sampler, etc.). The descriptor is written to
18021 ///`p_descriptor` and must be `data_size` bytes.
18022 ///
18023 ///Query the required size per descriptor type with
18024 ///`PhysicalDeviceDescriptorBufferPropertiesEXT`.
18025 ///
18026 ///This is the core operation of descriptor buffers, instead of
18027 ///allocating descriptor sets, you write descriptors directly into
18028 ///mapped buffer memory.
18029 ///
18030 ///Requires `VK_EXT_descriptor_buffer`.
18031 pub unsafe fn get_descriptor_ext(
18032 &self,
18033 p_descriptor_info: &DescriptorGetInfoEXT,
18034 data_size: usize,
18035 p_descriptor: *mut core::ffi::c_void,
18036 ) {
18037 let fp = self
18038 .commands()
18039 .get_descriptor_ext
18040 .expect("vkGetDescriptorEXT not loaded");
18041 unsafe { fp(self.handle(), p_descriptor_info, data_size, p_descriptor) };
18042 }
18043 ///Wraps [`vkCmdBindDescriptorBuffersEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindDescriptorBuffersEXT.html).
18044 /**
18045 Provided by **VK_EXT_descriptor_buffer**.*/
18046 ///
18047 ///# Safety
18048 ///- `commandBuffer` (self) must be valid and not destroyed.
18049 ///- `commandBuffer` must be externally synchronized.
18050 ///
18051 ///# Panics
18052 ///Panics if `vkCmdBindDescriptorBuffersEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18053 ///
18054 ///# Usage Notes
18055 ///
18056 ///Binds one or more descriptor buffers to a command buffer. Each
18057 ///`DescriptorBufferBindingInfoEXT` specifies a buffer address and
18058 ///usage (resource descriptors, sampler descriptors, or push
18059 ///descriptors).
18060 ///
18061 ///After binding, use `cmd_set_descriptor_buffer_offsets_ext` to
18062 ///point specific descriptor sets at offsets within the bound buffers.
18063 ///
18064 ///Descriptor buffers are an alternative to descriptor sets/pools
18065 ///that stores descriptors inline in buffer memory.
18066 ///
18067 ///Requires `VK_EXT_descriptor_buffer`.
18068 pub unsafe fn cmd_bind_descriptor_buffers_ext(
18069 &self,
18070 command_buffer: CommandBuffer,
18071 p_binding_infos: &[DescriptorBufferBindingInfoEXT],
18072 ) {
18073 let fp = self
18074 .commands()
18075 .cmd_bind_descriptor_buffers_ext
18076 .expect("vkCmdBindDescriptorBuffersEXT not loaded");
18077 unsafe {
18078 fp(
18079 command_buffer,
18080 p_binding_infos.len() as u32,
18081 p_binding_infos.as_ptr(),
18082 )
18083 };
18084 }
18085 ///Wraps [`vkCmdSetDescriptorBufferOffsetsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDescriptorBufferOffsetsEXT.html).
18086 /**
18087 Provided by **VK_EXT_descriptor_buffer**.*/
18088 ///
18089 ///# Safety
18090 ///- `commandBuffer` (self) must be valid and not destroyed.
18091 ///- `commandBuffer` must be externally synchronized.
18092 ///
18093 ///# Panics
18094 ///Panics if `vkCmdSetDescriptorBufferOffsetsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18095 ///
18096 ///# Usage Notes
18097 ///
18098 ///Sets the offsets into bound descriptor buffers for one or more
18099 ///descriptor set slots. Each pair of (buffer_index, offset) maps
18100 ///a descriptor set to a region of a previously bound descriptor
18101 ///buffer.
18102 ///
18103 ///Must be called after `cmd_bind_descriptor_buffers_ext`.
18104 ///
18105 ///For the pNext-extensible variant, see
18106 ///`cmd_set_descriptor_buffer_offsets2_ext`.
18107 ///
18108 ///Requires `VK_EXT_descriptor_buffer`.
18109 pub unsafe fn cmd_set_descriptor_buffer_offsets_ext(
18110 &self,
18111 command_buffer: CommandBuffer,
18112 pipeline_bind_point: PipelineBindPoint,
18113 layout: PipelineLayout,
18114 first_set: u32,
18115 p_buffer_indices: &[u32],
18116 p_offsets: &[u64],
18117 ) {
18118 let fp = self
18119 .commands()
18120 .cmd_set_descriptor_buffer_offsets_ext
18121 .expect("vkCmdSetDescriptorBufferOffsetsEXT not loaded");
18122 unsafe {
18123 fp(
18124 command_buffer,
18125 pipeline_bind_point,
18126 layout,
18127 first_set,
18128 p_buffer_indices.len() as u32,
18129 p_buffer_indices.as_ptr(),
18130 p_offsets.as_ptr(),
18131 )
18132 };
18133 }
18134 ///Wraps [`vkCmdBindDescriptorBufferEmbeddedSamplersEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindDescriptorBufferEmbeddedSamplersEXT.html).
18135 /**
18136 Provided by **VK_EXT_descriptor_buffer**.*/
18137 ///
18138 ///# Safety
18139 ///- `commandBuffer` (self) must be valid and not destroyed.
18140 ///- `commandBuffer` must be externally synchronized.
18141 ///
18142 ///# Panics
18143 ///Panics if `vkCmdBindDescriptorBufferEmbeddedSamplersEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18144 ///
18145 ///# Usage Notes
18146 ///
18147 ///Binds embedded immutable samplers from a descriptor set layout
18148 ///that was created with `CREATE_EMBEDDED_IMMUTABLE_SAMPLERS_BIT`.
18149 ///These samplers are baked into the layout and do not need buffer
18150 ///memory.
18151 ///
18152 ///Specify the `pipeline_bind_point`, `layout`, and `set` index.
18153 ///
18154 ///For the pNext-extensible variant, see
18155 ///`cmd_bind_descriptor_buffer_embedded_samplers2_ext`.
18156 ///
18157 ///Requires `VK_EXT_descriptor_buffer`.
18158 pub unsafe fn cmd_bind_descriptor_buffer_embedded_samplers_ext(
18159 &self,
18160 command_buffer: CommandBuffer,
18161 pipeline_bind_point: PipelineBindPoint,
18162 layout: PipelineLayout,
18163 set: u32,
18164 ) {
18165 let fp = self
18166 .commands()
18167 .cmd_bind_descriptor_buffer_embedded_samplers_ext
18168 .expect("vkCmdBindDescriptorBufferEmbeddedSamplersEXT not loaded");
18169 unsafe { fp(command_buffer, pipeline_bind_point, layout, set) };
18170 }
18171 ///Wraps [`vkGetBufferOpaqueCaptureDescriptorDataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetBufferOpaqueCaptureDescriptorDataEXT.html).
18172 /**
18173 Provided by **VK_EXT_descriptor_buffer**.*/
18174 ///
18175 ///# Errors
18176 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18177 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
18178 ///- `VK_ERROR_UNKNOWN`
18179 ///- `VK_ERROR_VALIDATION_FAILED`
18180 ///
18181 ///# Safety
18182 ///- `device` (self) must be valid and not destroyed.
18183 ///
18184 ///# Panics
18185 ///Panics if `vkGetBufferOpaqueCaptureDescriptorDataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18186 ///
18187 ///# Usage Notes
18188 ///
18189 ///Retrieves opaque capture data for a buffer descriptor. The
18190 ///returned data can be used to reconstruct the descriptor in a
18191 ///replay or capture/replay scenario.
18192 ///
18193 ///The buffer must have been created with
18194 ///`CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT`.
18195 ///
18196 ///Requires `VK_EXT_descriptor_buffer` and
18197 ///`descriptorBufferCaptureReplay`.
18198 pub unsafe fn get_buffer_opaque_capture_descriptor_data_ext(
18199 &self,
18200 p_info: &BufferCaptureDescriptorDataInfoEXT,
18201 ) -> VkResult<core::ffi::c_void> {
18202 let fp = self
18203 .commands()
18204 .get_buffer_opaque_capture_descriptor_data_ext
18205 .expect("vkGetBufferOpaqueCaptureDescriptorDataEXT not loaded");
18206 let mut out = unsafe { core::mem::zeroed() };
18207 check(unsafe { fp(self.handle(), p_info, &mut out) })?;
18208 Ok(out)
18209 }
18210 ///Wraps [`vkGetImageOpaqueCaptureDescriptorDataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageOpaqueCaptureDescriptorDataEXT.html).
18211 /**
18212 Provided by **VK_EXT_descriptor_buffer**.*/
18213 ///
18214 ///# Errors
18215 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18216 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
18217 ///- `VK_ERROR_UNKNOWN`
18218 ///- `VK_ERROR_VALIDATION_FAILED`
18219 ///
18220 ///# Safety
18221 ///- `device` (self) must be valid and not destroyed.
18222 ///
18223 ///# Panics
18224 ///Panics if `vkGetImageOpaqueCaptureDescriptorDataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18225 ///
18226 ///# Usage Notes
18227 ///
18228 ///Retrieves opaque capture data for an image descriptor. The
18229 ///returned data can be used to reconstruct the descriptor in a
18230 ///capture/replay scenario.
18231 ///
18232 ///The image must have been created with
18233 ///`CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT`.
18234 ///
18235 ///Requires `VK_EXT_descriptor_buffer` and
18236 ///`descriptorBufferCaptureReplay`.
18237 pub unsafe fn get_image_opaque_capture_descriptor_data_ext(
18238 &self,
18239 p_info: &ImageCaptureDescriptorDataInfoEXT,
18240 ) -> VkResult<core::ffi::c_void> {
18241 let fp = self
18242 .commands()
18243 .get_image_opaque_capture_descriptor_data_ext
18244 .expect("vkGetImageOpaqueCaptureDescriptorDataEXT not loaded");
18245 let mut out = unsafe { core::mem::zeroed() };
18246 check(unsafe { fp(self.handle(), p_info, &mut out) })?;
18247 Ok(out)
18248 }
18249 ///Wraps [`vkGetImageViewOpaqueCaptureDescriptorDataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageViewOpaqueCaptureDescriptorDataEXT.html).
18250 /**
18251 Provided by **VK_EXT_descriptor_buffer**.*/
18252 ///
18253 ///# Errors
18254 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18255 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
18256 ///- `VK_ERROR_UNKNOWN`
18257 ///- `VK_ERROR_VALIDATION_FAILED`
18258 ///
18259 ///# Safety
18260 ///- `device` (self) must be valid and not destroyed.
18261 ///
18262 ///# Panics
18263 ///Panics if `vkGetImageViewOpaqueCaptureDescriptorDataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18264 ///
18265 ///# Usage Notes
18266 ///
18267 ///Retrieves opaque capture data for an image view descriptor. The
18268 ///returned data can be used to reconstruct the descriptor in a
18269 ///capture/replay scenario.
18270 ///
18271 ///The image view must have been created with
18272 ///`CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT`.
18273 ///
18274 ///Requires `VK_EXT_descriptor_buffer` and
18275 ///`descriptorBufferCaptureReplay`.
18276 pub unsafe fn get_image_view_opaque_capture_descriptor_data_ext(
18277 &self,
18278 p_info: &ImageViewCaptureDescriptorDataInfoEXT,
18279 ) -> VkResult<core::ffi::c_void> {
18280 let fp = self
18281 .commands()
18282 .get_image_view_opaque_capture_descriptor_data_ext
18283 .expect("vkGetImageViewOpaqueCaptureDescriptorDataEXT not loaded");
18284 let mut out = unsafe { core::mem::zeroed() };
18285 check(unsafe { fp(self.handle(), p_info, &mut out) })?;
18286 Ok(out)
18287 }
18288 ///Wraps [`vkGetSamplerOpaqueCaptureDescriptorDataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSamplerOpaqueCaptureDescriptorDataEXT.html).
18289 /**
18290 Provided by **VK_EXT_descriptor_buffer**.*/
18291 ///
18292 ///# Errors
18293 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18294 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
18295 ///- `VK_ERROR_UNKNOWN`
18296 ///- `VK_ERROR_VALIDATION_FAILED`
18297 ///
18298 ///# Safety
18299 ///- `device` (self) must be valid and not destroyed.
18300 ///
18301 ///# Panics
18302 ///Panics if `vkGetSamplerOpaqueCaptureDescriptorDataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18303 ///
18304 ///# Usage Notes
18305 ///
18306 ///Retrieves opaque capture data for a sampler descriptor. The
18307 ///returned data can be used to reconstruct the descriptor in a
18308 ///capture/replay scenario.
18309 ///
18310 ///The sampler must have been created with
18311 ///`CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT`.
18312 ///
18313 ///Requires `VK_EXT_descriptor_buffer` and
18314 ///`descriptorBufferCaptureReplay`.
18315 pub unsafe fn get_sampler_opaque_capture_descriptor_data_ext(
18316 &self,
18317 p_info: &SamplerCaptureDescriptorDataInfoEXT,
18318 ) -> VkResult<core::ffi::c_void> {
18319 let fp = self
18320 .commands()
18321 .get_sampler_opaque_capture_descriptor_data_ext
18322 .expect("vkGetSamplerOpaqueCaptureDescriptorDataEXT not loaded");
18323 let mut out = unsafe { core::mem::zeroed() };
18324 check(unsafe { fp(self.handle(), p_info, &mut out) })?;
18325 Ok(out)
18326 }
18327 ///Wraps [`vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT.html).
18328 /**
18329 Provided by **VK_EXT_descriptor_buffer**.*/
18330 ///
18331 ///# Errors
18332 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18333 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
18334 ///- `VK_ERROR_UNKNOWN`
18335 ///- `VK_ERROR_VALIDATION_FAILED`
18336 ///
18337 ///# Safety
18338 ///- `device` (self) must be valid and not destroyed.
18339 ///
18340 ///# Panics
18341 ///Panics if `vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18342 ///
18343 ///# Usage Notes
18344 ///
18345 ///Retrieves opaque capture data for an acceleration structure
18346 ///descriptor. The returned data can be used to reconstruct the
18347 ///descriptor in a replay or capture/replay scenario.
18348 ///
18349 ///The acceleration structure must have been created with
18350 ///`CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT`.
18351 ///
18352 ///Requires `VK_EXT_descriptor_buffer` and
18353 ///`descriptorBufferCaptureReplay`.
18354 pub unsafe fn get_acceleration_structure_opaque_capture_descriptor_data_ext(
18355 &self,
18356 p_info: &AccelerationStructureCaptureDescriptorDataInfoEXT,
18357 ) -> VkResult<core::ffi::c_void> {
18358 let fp = self
18359 .commands()
18360 .get_acceleration_structure_opaque_capture_descriptor_data_ext
18361 .expect("vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT not loaded");
18362 let mut out = unsafe { core::mem::zeroed() };
18363 check(unsafe { fp(self.handle(), p_info, &mut out) })?;
18364 Ok(out)
18365 }
18366 ///Wraps [`vkSetDeviceMemoryPriorityEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetDeviceMemoryPriorityEXT.html).
18367 /**
18368 Provided by **VK_EXT_pageable_device_local_memory**.*/
18369 ///
18370 ///# Safety
18371 ///- `device` (self) must be valid and not destroyed.
18372 ///
18373 ///# Panics
18374 ///Panics if `vkSetDeviceMemoryPriorityEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18375 ///
18376 ///# Usage Notes
18377 ///
18378 ///Dynamically updates the priority of a device memory allocation.
18379 ///Higher-priority allocations are less likely to be evicted under
18380 ///memory pressure. Use this to promote frequently accessed
18381 ///resources or demote resources that are no longer critical.
18382 ///
18383 ///Requires `VK_EXT_pageable_device_local_memory`.
18384 pub unsafe fn set_device_memory_priority_ext(&self, memory: DeviceMemory, priority: f32) {
18385 let fp = self
18386 .commands()
18387 .set_device_memory_priority_ext
18388 .expect("vkSetDeviceMemoryPriorityEXT not loaded");
18389 unsafe { fp(self.handle(), memory, priority) };
18390 }
18391 ///Wraps [`vkWaitForPresent2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkWaitForPresent2KHR.html).
18392 /**
18393 Provided by **VK_KHR_present_wait2**.*/
18394 ///
18395 ///# Errors
18396 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18397 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
18398 ///- `VK_ERROR_DEVICE_LOST`
18399 ///- `VK_ERROR_OUT_OF_DATE_KHR`
18400 ///- `VK_ERROR_SURFACE_LOST_KHR`
18401 ///- `VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT`
18402 ///- `VK_ERROR_UNKNOWN`
18403 ///- `VK_ERROR_VALIDATION_FAILED`
18404 ///
18405 ///# Safety
18406 ///- `device` (self) must be valid and not destroyed.
18407 ///- `swapchain` must be externally synchronized.
18408 ///
18409 ///# Panics
18410 ///Panics if `vkWaitForPresent2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18411 ///
18412 ///# Usage Notes
18413 ///
18414 ///Extensible version of `wait_for_present_khr`. Takes a
18415 ///`PresentWait2InfoKHR` struct (with `pNext` support) instead of
18416 ///separate `present_id` and `timeout` parameters.
18417 ///
18418 ///Provided by `VK_KHR_present_wait2`. Otherwise identical in
18419 ///behavior, blocks until the specified present ID completes or
18420 ///the timeout expires.
18421 pub unsafe fn wait_for_present2_khr(
18422 &self,
18423 swapchain: SwapchainKHR,
18424 p_present_wait2_info: &PresentWait2InfoKHR,
18425 ) -> VkResult<()> {
18426 let fp = self
18427 .commands()
18428 .wait_for_present2_khr
18429 .expect("vkWaitForPresent2KHR not loaded");
18430 check(unsafe { fp(self.handle(), swapchain, p_present_wait2_info) })
18431 }
18432 ///Wraps [`vkWaitForPresentKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkWaitForPresentKHR.html).
18433 /**
18434 Provided by **VK_KHR_present_wait**.*/
18435 ///
18436 ///# Errors
18437 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18438 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
18439 ///- `VK_ERROR_DEVICE_LOST`
18440 ///- `VK_ERROR_OUT_OF_DATE_KHR`
18441 ///- `VK_ERROR_SURFACE_LOST_KHR`
18442 ///- `VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT`
18443 ///- `VK_ERROR_UNKNOWN`
18444 ///- `VK_ERROR_VALIDATION_FAILED`
18445 ///
18446 ///# Safety
18447 ///- `device` (self) must be valid and not destroyed.
18448 ///- `swapchain` must be externally synchronized.
18449 ///
18450 ///# Panics
18451 ///Panics if `vkWaitForPresentKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18452 ///
18453 ///# Usage Notes
18454 ///
18455 ///Blocks the calling thread until a specific present operation
18456 ///completes on the display. `present_id` identifies which present
18457 ///to wait for, set it via `PresentIdKHR` chained into
18458 ///`PresentInfoKHR` during `queue_present_khr`.
18459 ///
18460 ///`timeout` is in nanoseconds. Returns `TIMEOUT` if the deadline
18461 ///expires before the present completes, `SUCCESS` if the present
18462 ///finished. Use `u64::MAX` for an indefinite wait.
18463 ///
18464 ///Requires `VK_KHR_present_wait` and `VK_KHR_present_id`.
18465 ///
18466 ///This is useful for frame pacing, wait for the previous frame's
18467 ///present to complete before starting the next frame's work to
18468 ///avoid queuing excessive frames.
18469 pub unsafe fn wait_for_present_khr(
18470 &self,
18471 swapchain: SwapchainKHR,
18472 present_id: u64,
18473 timeout: u64,
18474 ) -> VkResult<()> {
18475 let fp = self
18476 .commands()
18477 .wait_for_present_khr
18478 .expect("vkWaitForPresentKHR not loaded");
18479 check(unsafe { fp(self.handle(), swapchain, present_id, timeout) })
18480 }
18481 ///Wraps [`vkCreateBufferCollectionFUCHSIA`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateBufferCollectionFUCHSIA.html).
18482 /**
18483 Provided by **VK_FUCHSIA_buffer_collection**.*/
18484 ///
18485 ///# Errors
18486 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18487 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
18488 ///- `VK_ERROR_INITIALIZATION_FAILED`
18489 ///- `VK_ERROR_UNKNOWN`
18490 ///- `VK_ERROR_VALIDATION_FAILED`
18491 ///
18492 ///# Safety
18493 ///- `device` (self) must be valid and not destroyed.
18494 ///
18495 ///# Panics
18496 ///Panics if `vkCreateBufferCollectionFUCHSIA` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18497 ///
18498 ///# Usage Notes
18499 ///
18500 ///Creates a Fuchsia buffer collection that negotiates memory
18501 ///constraints between Vulkan and other Fuchsia services (e.g.
18502 ///scenic, camera). Fuchsia OS only. After creation, set buffer
18503 ///or image constraints before allocating.
18504 ///
18505 ///Requires `VK_FUCHSIA_buffer_collection`.
18506 pub unsafe fn create_buffer_collection_fuchsia(
18507 &self,
18508 p_create_info: &BufferCollectionCreateInfoFUCHSIA,
18509 allocator: Option<&AllocationCallbacks>,
18510 ) -> VkResult<BufferCollectionFUCHSIA> {
18511 let fp = self
18512 .commands()
18513 .create_buffer_collection_fuchsia
18514 .expect("vkCreateBufferCollectionFUCHSIA not loaded");
18515 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
18516 let mut out = unsafe { core::mem::zeroed() };
18517 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
18518 Ok(out)
18519 }
18520 ///Wraps [`vkSetBufferCollectionBufferConstraintsFUCHSIA`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetBufferCollectionBufferConstraintsFUCHSIA.html).
18521 /**
18522 Provided by **VK_FUCHSIA_buffer_collection**.*/
18523 ///
18524 ///# Errors
18525 ///- `VK_ERROR_INITIALIZATION_FAILED`
18526 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18527 ///- `VK_ERROR_FORMAT_NOT_SUPPORTED`
18528 ///- `VK_ERROR_UNKNOWN`
18529 ///- `VK_ERROR_VALIDATION_FAILED`
18530 ///
18531 ///# Safety
18532 ///- `device` (self) must be valid and not destroyed.
18533 ///
18534 ///# Panics
18535 ///Panics if `vkSetBufferCollectionBufferConstraintsFUCHSIA` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18536 ///
18537 ///# Usage Notes
18538 ///
18539 ///Sets buffer constraints on a Fuchsia buffer collection. The
18540 ///constraints describe the Vulkan buffer usage requirements that
18541 ///must be negotiated with other collection participants. Fuchsia
18542 ///OS only.
18543 ///
18544 ///Requires `VK_FUCHSIA_buffer_collection`.
18545 pub unsafe fn set_buffer_collection_buffer_constraints_fuchsia(
18546 &self,
18547 collection: BufferCollectionFUCHSIA,
18548 p_buffer_constraints_info: &BufferConstraintsInfoFUCHSIA,
18549 ) -> VkResult<()> {
18550 let fp = self
18551 .commands()
18552 .set_buffer_collection_buffer_constraints_fuchsia
18553 .expect("vkSetBufferCollectionBufferConstraintsFUCHSIA not loaded");
18554 check(unsafe { fp(self.handle(), collection, p_buffer_constraints_info) })
18555 }
18556 ///Wraps [`vkSetBufferCollectionImageConstraintsFUCHSIA`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetBufferCollectionImageConstraintsFUCHSIA.html).
18557 /**
18558 Provided by **VK_FUCHSIA_buffer_collection**.*/
18559 ///
18560 ///# Errors
18561 ///- `VK_ERROR_INITIALIZATION_FAILED`
18562 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18563 ///- `VK_ERROR_FORMAT_NOT_SUPPORTED`
18564 ///- `VK_ERROR_UNKNOWN`
18565 ///- `VK_ERROR_VALIDATION_FAILED`
18566 ///
18567 ///# Safety
18568 ///- `device` (self) must be valid and not destroyed.
18569 ///
18570 ///# Panics
18571 ///Panics if `vkSetBufferCollectionImageConstraintsFUCHSIA` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18572 ///
18573 ///# Usage Notes
18574 ///
18575 ///Sets image constraints on a Fuchsia buffer collection. The
18576 ///constraints describe the Vulkan image format and usage
18577 ///requirements that must be negotiated with other collection
18578 ///participants. Fuchsia OS only.
18579 ///
18580 ///Requires `VK_FUCHSIA_buffer_collection`.
18581 pub unsafe fn set_buffer_collection_image_constraints_fuchsia(
18582 &self,
18583 collection: BufferCollectionFUCHSIA,
18584 p_image_constraints_info: &ImageConstraintsInfoFUCHSIA,
18585 ) -> VkResult<()> {
18586 let fp = self
18587 .commands()
18588 .set_buffer_collection_image_constraints_fuchsia
18589 .expect("vkSetBufferCollectionImageConstraintsFUCHSIA not loaded");
18590 check(unsafe { fp(self.handle(), collection, p_image_constraints_info) })
18591 }
18592 ///Wraps [`vkDestroyBufferCollectionFUCHSIA`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyBufferCollectionFUCHSIA.html).
18593 /**
18594 Provided by **VK_FUCHSIA_buffer_collection**.*/
18595 ///
18596 ///# Safety
18597 ///- `device` (self) must be valid and not destroyed.
18598 ///
18599 ///# Panics
18600 ///Panics if `vkDestroyBufferCollectionFUCHSIA` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18601 ///
18602 ///# Usage Notes
18603 ///
18604 ///Destroys a Fuchsia buffer collection. The collection must not
18605 ///be in use by any pending operations. Fuchsia OS only.
18606 ///
18607 ///Requires `VK_FUCHSIA_buffer_collection`.
18608 pub unsafe fn destroy_buffer_collection_fuchsia(
18609 &self,
18610 collection: BufferCollectionFUCHSIA,
18611 allocator: Option<&AllocationCallbacks>,
18612 ) {
18613 let fp = self
18614 .commands()
18615 .destroy_buffer_collection_fuchsia
18616 .expect("vkDestroyBufferCollectionFUCHSIA not loaded");
18617 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
18618 unsafe { fp(self.handle(), collection, alloc_ptr) };
18619 }
18620 ///Wraps [`vkGetBufferCollectionPropertiesFUCHSIA`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetBufferCollectionPropertiesFUCHSIA.html).
18621 /**
18622 Provided by **VK_FUCHSIA_buffer_collection**.*/
18623 ///
18624 ///# Errors
18625 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18626 ///- `VK_ERROR_INITIALIZATION_FAILED`
18627 ///- `VK_ERROR_UNKNOWN`
18628 ///- `VK_ERROR_VALIDATION_FAILED`
18629 ///
18630 ///# Safety
18631 ///- `device` (self) must be valid and not destroyed.
18632 ///
18633 ///# Panics
18634 ///Panics if `vkGetBufferCollectionPropertiesFUCHSIA` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18635 ///
18636 ///# Usage Notes
18637 ///
18638 ///Queries the negotiated properties of a Fuchsia buffer
18639 ///collection after constraints have been set. Returns memory
18640 ///type index, format, and other details needed for allocation.
18641 ///Fuchsia OS only.
18642 ///
18643 ///Requires `VK_FUCHSIA_buffer_collection`.
18644 pub unsafe fn get_buffer_collection_properties_fuchsia(
18645 &self,
18646 collection: BufferCollectionFUCHSIA,
18647 p_properties: &mut BufferCollectionPropertiesFUCHSIA,
18648 ) -> VkResult<()> {
18649 let fp = self
18650 .commands()
18651 .get_buffer_collection_properties_fuchsia
18652 .expect("vkGetBufferCollectionPropertiesFUCHSIA not loaded");
18653 check(unsafe { fp(self.handle(), collection, p_properties) })
18654 }
18655 ///Wraps [`vkCreateCudaModuleNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateCudaModuleNV.html).
18656 /**
18657 Provided by **VK_NV_cuda_kernel_launch**.*/
18658 ///
18659 ///# Errors
18660 ///- `VK_ERROR_INITIALIZATION_FAILED`
18661 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18662 ///- `VK_ERROR_UNKNOWN`
18663 ///- `VK_ERROR_VALIDATION_FAILED`
18664 ///
18665 ///# Safety
18666 ///- `device` (self) must be valid and not destroyed.
18667 ///
18668 ///# Panics
18669 ///Panics if `vkCreateCudaModuleNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18670 ///
18671 ///# Usage Notes
18672 ///
18673 ///Creates a CUDA module from PTX or cubin data. The module
18674 ///contains one or more kernel entry points that can be extracted
18675 ///with `create_cuda_function_nv`.
18676 ///
18677 ///Destroy with `destroy_cuda_module_nv`.
18678 ///
18679 ///Requires `VK_NV_cuda_kernel_launch`.
18680 pub unsafe fn create_cuda_module_nv(
18681 &self,
18682 p_create_info: &CudaModuleCreateInfoNV,
18683 allocator: Option<&AllocationCallbacks>,
18684 ) -> VkResult<CudaModuleNV> {
18685 let fp = self
18686 .commands()
18687 .create_cuda_module_nv
18688 .expect("vkCreateCudaModuleNV not loaded");
18689 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
18690 let mut out = unsafe { core::mem::zeroed() };
18691 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
18692 Ok(out)
18693 }
18694 ///Wraps [`vkGetCudaModuleCacheNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetCudaModuleCacheNV.html).
18695 /**
18696 Provided by **VK_NV_cuda_kernel_launch**.*/
18697 ///
18698 ///# Errors
18699 ///- `VK_ERROR_INITIALIZATION_FAILED`
18700 ///- `VK_ERROR_UNKNOWN`
18701 ///- `VK_ERROR_VALIDATION_FAILED`
18702 ///
18703 ///# Safety
18704 ///- `device` (self) must be valid and not destroyed.
18705 ///
18706 ///# Panics
18707 ///Panics if `vkGetCudaModuleCacheNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18708 ///
18709 ///# Usage Notes
18710 ///
18711 ///Retrieves the compiled cache data from a CUDA module for
18712 ///serialization. Call once with a null buffer to query the size,
18713 ///then again with an appropriately sized buffer. Feed the data
18714 ///back into `create_cuda_module_nv` on the next run to skip
18715 ///compilation.
18716 ///
18717 ///Requires `VK_NV_cuda_kernel_launch`.
18718 pub unsafe fn get_cuda_module_cache_nv(
18719 &self,
18720 module: CudaModuleNV,
18721 p_cache_data: *mut core::ffi::c_void,
18722 ) -> VkResult<usize> {
18723 let fp = self
18724 .commands()
18725 .get_cuda_module_cache_nv
18726 .expect("vkGetCudaModuleCacheNV not loaded");
18727 let mut out = unsafe { core::mem::zeroed() };
18728 check(unsafe { fp(self.handle(), module, &mut out, p_cache_data) })?;
18729 Ok(out)
18730 }
18731 ///Wraps [`vkCreateCudaFunctionNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateCudaFunctionNV.html).
18732 /**
18733 Provided by **VK_NV_cuda_kernel_launch**.*/
18734 ///
18735 ///# Errors
18736 ///- `VK_ERROR_INITIALIZATION_FAILED`
18737 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18738 ///- `VK_ERROR_UNKNOWN`
18739 ///- `VK_ERROR_VALIDATION_FAILED`
18740 ///
18741 ///# Safety
18742 ///- `device` (self) must be valid and not destroyed.
18743 ///
18744 ///# Panics
18745 ///Panics if `vkCreateCudaFunctionNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18746 ///
18747 ///# Usage Notes
18748 ///
18749 ///Creates a CUDA function handle from a CUDA module, identifying
18750 ///a specific kernel entry point. Use with
18751 ///`cmd_cuda_launch_kernel_nv` to dispatch the kernel.
18752 ///
18753 ///Destroy with `destroy_cuda_function_nv`.
18754 ///
18755 ///Requires `VK_NV_cuda_kernel_launch`.
18756 pub unsafe fn create_cuda_function_nv(
18757 &self,
18758 p_create_info: &CudaFunctionCreateInfoNV,
18759 allocator: Option<&AllocationCallbacks>,
18760 ) -> VkResult<CudaFunctionNV> {
18761 let fp = self
18762 .commands()
18763 .create_cuda_function_nv
18764 .expect("vkCreateCudaFunctionNV not loaded");
18765 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
18766 let mut out = unsafe { core::mem::zeroed() };
18767 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
18768 Ok(out)
18769 }
18770 ///Wraps [`vkDestroyCudaModuleNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyCudaModuleNV.html).
18771 /**
18772 Provided by **VK_NV_cuda_kernel_launch**.*/
18773 ///
18774 ///# Safety
18775 ///- `device` (self) must be valid and not destroyed.
18776 ///
18777 ///# Panics
18778 ///Panics if `vkDestroyCudaModuleNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18779 ///
18780 ///# Usage Notes
18781 ///
18782 ///Destroys a CUDA module created with `create_cuda_module_nv`.
18783 ///All functions extracted from this module must be destroyed first.
18784 ///
18785 ///Requires `VK_NV_cuda_kernel_launch`.
18786 pub unsafe fn destroy_cuda_module_nv(
18787 &self,
18788 module: CudaModuleNV,
18789 allocator: Option<&AllocationCallbacks>,
18790 ) {
18791 let fp = self
18792 .commands()
18793 .destroy_cuda_module_nv
18794 .expect("vkDestroyCudaModuleNV not loaded");
18795 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
18796 unsafe { fp(self.handle(), module, alloc_ptr) };
18797 }
18798 ///Wraps [`vkDestroyCudaFunctionNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyCudaFunctionNV.html).
18799 /**
18800 Provided by **VK_NV_cuda_kernel_launch**.*/
18801 ///
18802 ///# Safety
18803 ///- `device` (self) must be valid and not destroyed.
18804 ///
18805 ///# Panics
18806 ///Panics if `vkDestroyCudaFunctionNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18807 ///
18808 ///# Usage Notes
18809 ///
18810 ///Destroys a CUDA function handle created with
18811 ///`create_cuda_function_nv`.
18812 ///
18813 ///Requires `VK_NV_cuda_kernel_launch`.
18814 pub unsafe fn destroy_cuda_function_nv(
18815 &self,
18816 function: CudaFunctionNV,
18817 allocator: Option<&AllocationCallbacks>,
18818 ) {
18819 let fp = self
18820 .commands()
18821 .destroy_cuda_function_nv
18822 .expect("vkDestroyCudaFunctionNV not loaded");
18823 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
18824 unsafe { fp(self.handle(), function, alloc_ptr) };
18825 }
18826 ///Wraps [`vkCmdCudaLaunchKernelNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCudaLaunchKernelNV.html).
18827 /**
18828 Provided by **VK_NV_cuda_kernel_launch**.*/
18829 ///
18830 ///# Safety
18831 ///- `commandBuffer` (self) must be valid and not destroyed.
18832 ///
18833 ///# Panics
18834 ///Panics if `vkCmdCudaLaunchKernelNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18835 ///
18836 ///# Usage Notes
18837 ///
18838 ///Launches a CUDA kernel from within a Vulkan command buffer.
18839 ///The kernel is specified by a CUDA function handle created with
18840 ///`create_cuda_function_nv`. Grid dimensions and parameters are
18841 ///provided in the launch info.
18842 ///
18843 ///Requires `VK_NV_cuda_kernel_launch`.
18844 pub unsafe fn cmd_cuda_launch_kernel_nv(
18845 &self,
18846 command_buffer: CommandBuffer,
18847 p_launch_info: &CudaLaunchInfoNV,
18848 ) {
18849 let fp = self
18850 .commands()
18851 .cmd_cuda_launch_kernel_nv
18852 .expect("vkCmdCudaLaunchKernelNV not loaded");
18853 unsafe { fp(command_buffer, p_launch_info) };
18854 }
18855 ///Wraps [`vkCmdBeginRendering`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginRendering.html).
18856 /**
18857 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
18858 ///
18859 ///# Safety
18860 ///- `commandBuffer` (self) must be valid and not destroyed.
18861 ///- `commandBuffer` must be externally synchronized.
18862 ///
18863 ///# Panics
18864 ///Panics if `vkCmdBeginRendering` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18865 ///
18866 ///# Usage Notes
18867 ///
18868 ///Begins dynamic rendering, a Vulkan 1.3 alternative to render pass
18869 ///objects that specifies attachments inline at command recording time.
18870 ///
18871 ///**Advantages over render passes**:
18872 ///
18873 ///- No `RenderPass` or `Framebuffer` objects to create and manage.
18874 ///- Attachments are specified directly as image views in
18875 /// `RenderingInfo`.
18876 ///- Simpler code for applications that do not benefit from tile-based
18877 /// subpass optimisations.
18878 ///
18879 ///**`RenderingInfo`** specifies:
18880 ///
18881 ///- **Colour attachments**: image views, load/store ops, clear values.
18882 ///- **Depth attachment**: optional, with its own load/store ops.
18883 ///- **Stencil attachment**: optional, can share the same image view as
18884 /// depth.
18885 ///- **Render area and layer count**.
18886 ///
18887 ///**Flags**:
18888 ///
18889 ///- `RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS`: draw commands come
18890 /// from secondary command buffers.
18891 ///- `RENDERING_SUSPENDING` / `RENDERING_RESUMING`: split rendering
18892 /// across multiple command buffers.
18893 ///
18894 ///Graphics pipelines used with dynamic rendering must be created with
18895 ///`PipelineRenderingCreateInfo` instead of a render pass handle.
18896 pub unsafe fn cmd_begin_rendering(
18897 &self,
18898 command_buffer: CommandBuffer,
18899 p_rendering_info: &RenderingInfo,
18900 ) {
18901 let fp = self
18902 .commands()
18903 .cmd_begin_rendering
18904 .expect("vkCmdBeginRendering not loaded");
18905 unsafe { fp(command_buffer, p_rendering_info) };
18906 }
18907 ///Wraps [`vkCmdEndRendering`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndRendering.html).
18908 /**
18909 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
18910 ///
18911 ///# Safety
18912 ///- `commandBuffer` (self) must be valid and not destroyed.
18913 ///- `commandBuffer` must be externally synchronized.
18914 ///
18915 ///# Panics
18916 ///Panics if `vkCmdEndRendering` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18917 ///
18918 ///# Usage Notes
18919 ///
18920 ///Ends a dynamic rendering instance started by `cmd_begin_rendering`.
18921 ///Store operations and any resolve operations specified in the
18922 ///`RenderingInfo` are executed at this point.
18923 ///
18924 ///After this call, no draw commands may be recorded until a new
18925 ///rendering or render pass instance is begun.
18926 pub unsafe fn cmd_end_rendering(&self, command_buffer: CommandBuffer) {
18927 let fp = self
18928 .commands()
18929 .cmd_end_rendering
18930 .expect("vkCmdEndRendering not loaded");
18931 unsafe { fp(command_buffer) };
18932 }
18933 ///Wraps [`vkCmdEndRendering2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndRendering2KHR.html).
18934 /**
18935 Provided by **VK_KHR_maintenance10**.*/
18936 ///
18937 ///# Safety
18938 ///- `commandBuffer` (self) must be valid and not destroyed.
18939 ///- `commandBuffer` must be externally synchronized.
18940 ///
18941 ///# Panics
18942 ///Panics if `vkCmdEndRendering2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18943 ///
18944 ///# Usage Notes
18945 ///
18946 ///Extended version of `cmd_end_rendering` (core 1.3) that accepts
18947 ///an optional `RenderingEndInfoKHR` with pNext extensibility.
18948 ///
18949 ///Ends the current dynamic rendering pass. If `p_rendering_end_info`
18950 ///is `None`, behaves identically to `cmd_end_rendering`.
18951 ///
18952 ///Provided by `VK_KHR_maintenance7`.
18953 pub unsafe fn cmd_end_rendering2_khr(
18954 &self,
18955 command_buffer: CommandBuffer,
18956 p_rendering_end_info: Option<&RenderingEndInfoKHR>,
18957 ) {
18958 let fp = self
18959 .commands()
18960 .cmd_end_rendering2_khr
18961 .expect("vkCmdEndRendering2KHR not loaded");
18962 let p_rendering_end_info_ptr =
18963 p_rendering_end_info.map_or(core::ptr::null(), core::ptr::from_ref);
18964 unsafe { fp(command_buffer, p_rendering_end_info_ptr) };
18965 }
18966 ///Wraps [`vkGetDescriptorSetLayoutHostMappingInfoVALVE`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDescriptorSetLayoutHostMappingInfoVALVE.html).
18967 /**
18968 Provided by **VK_VALVE_descriptor_set_host_mapping**.*/
18969 ///
18970 ///# Safety
18971 ///- `device` (self) must be valid and not destroyed.
18972 ///
18973 ///# Panics
18974 ///Panics if `vkGetDescriptorSetLayoutHostMappingInfoVALVE` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18975 ///
18976 ///# Usage Notes
18977 ///
18978 ///Queries the host memory layout for a specific binding within a
18979 ///descriptor set layout. Returns the stride and offset needed to
18980 ///write descriptors directly via the host pointer obtained from
18981 ///`get_descriptor_set_host_mapping_valve`.
18982 ///
18983 ///Requires `VK_VALVE_descriptor_set_host_mapping`.
18984 pub unsafe fn get_descriptor_set_layout_host_mapping_info_valve(
18985 &self,
18986 p_binding_reference: &DescriptorSetBindingReferenceVALVE,
18987 p_host_mapping: &mut DescriptorSetLayoutHostMappingInfoVALVE,
18988 ) {
18989 let fp = self
18990 .commands()
18991 .get_descriptor_set_layout_host_mapping_info_valve
18992 .expect("vkGetDescriptorSetLayoutHostMappingInfoVALVE not loaded");
18993 unsafe { fp(self.handle(), p_binding_reference, p_host_mapping) };
18994 }
18995 ///Wraps [`vkGetDescriptorSetHostMappingVALVE`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDescriptorSetHostMappingVALVE.html).
18996 /**
18997 Provided by **VK_VALVE_descriptor_set_host_mapping**.*/
18998 ///
18999 ///# Safety
19000 ///- `device` (self) must be valid and not destroyed.
19001 ///
19002 ///# Panics
19003 ///Panics if `vkGetDescriptorSetHostMappingVALVE` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19004 ///
19005 ///# Usage Notes
19006 ///
19007 ///Retrieves a host pointer to the internal memory backing a
19008 ///descriptor set. Allows direct CPU writes to descriptor data,
19009 ///bypassing the normal `update_descriptor_sets` path for lower
19010 ///overhead. The layout must match what was queried with
19011 ///`get_descriptor_set_layout_host_mapping_info_valve`.
19012 ///
19013 ///Requires `VK_VALVE_descriptor_set_host_mapping`.
19014 pub unsafe fn get_descriptor_set_host_mapping_valve(
19015 &self,
19016 descriptor_set: DescriptorSet,
19017 pp_data: *mut *mut core::ffi::c_void,
19018 ) {
19019 let fp = self
19020 .commands()
19021 .get_descriptor_set_host_mapping_valve
19022 .expect("vkGetDescriptorSetHostMappingVALVE not loaded");
19023 unsafe { fp(self.handle(), descriptor_set, pp_data) };
19024 }
19025 ///Wraps [`vkCreateMicromapEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateMicromapEXT.html).
19026 /**
19027 Provided by **VK_EXT_opacity_micromap**.*/
19028 ///
19029 ///# Errors
19030 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19031 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
19032 ///- `VK_ERROR_UNKNOWN`
19033 ///- `VK_ERROR_VALIDATION_FAILED`
19034 ///
19035 ///# Safety
19036 ///- `device` (self) must be valid and not destroyed.
19037 ///
19038 ///# Panics
19039 ///Panics if `vkCreateMicromapEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19040 ///
19041 ///# Usage Notes
19042 ///
19043 ///Creates an opacity micromap object. Micromaps store per-triangle
19044 ///opacity or hit data at sub-triangle granularity, enabling the
19045 ///ray tracing implementation to skip fully transparent micro-
19046 ///triangles without invoking any-hit shaders.
19047 ///
19048 ///The `MicromapCreateInfoEXT` specifies the backing buffer, size,
19049 ///and type (`OPACITY_MICROMAP`).
19050 ///
19051 ///Build with `cmd_build_micromaps_ext` or `build_micromaps_ext`.
19052 ///Destroy with `destroy_micromap_ext`.
19053 ///
19054 ///Requires `VK_EXT_opacity_micromap`.
19055 pub unsafe fn create_micromap_ext(
19056 &self,
19057 p_create_info: &MicromapCreateInfoEXT,
19058 allocator: Option<&AllocationCallbacks>,
19059 ) -> VkResult<MicromapEXT> {
19060 let fp = self
19061 .commands()
19062 .create_micromap_ext
19063 .expect("vkCreateMicromapEXT not loaded");
19064 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
19065 let mut out = unsafe { core::mem::zeroed() };
19066 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
19067 Ok(out)
19068 }
19069 ///Wraps [`vkCmdBuildMicromapsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBuildMicromapsEXT.html).
19070 /**
19071 Provided by **VK_EXT_opacity_micromap**.*/
19072 ///
19073 ///# Safety
19074 ///- `commandBuffer` (self) must be valid and not destroyed.
19075 ///- `commandBuffer` must be externally synchronized.
19076 ///
19077 ///# Panics
19078 ///Panics if `vkCmdBuildMicromapsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19079 ///
19080 ///# Usage Notes
19081 ///
19082 ///Records a GPU-side micromap build into a command buffer. Each
19083 ///`MicromapBuildInfoEXT` specifies the source triangle opacity
19084 ///data, destination micromap, and scratch memory.
19085 ///
19086 ///For the CPU-side equivalent, see `build_micromaps_ext`.
19087 ///
19088 ///Requires `VK_EXT_opacity_micromap`.
19089 pub unsafe fn cmd_build_micromaps_ext(
19090 &self,
19091 command_buffer: CommandBuffer,
19092 p_infos: &[MicromapBuildInfoEXT],
19093 ) {
19094 let fp = self
19095 .commands()
19096 .cmd_build_micromaps_ext
19097 .expect("vkCmdBuildMicromapsEXT not loaded");
19098 unsafe { fp(command_buffer, p_infos.len() as u32, p_infos.as_ptr()) };
19099 }
19100 ///Wraps [`vkBuildMicromapsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBuildMicromapsEXT.html).
19101 /**
19102 Provided by **VK_EXT_opacity_micromap**.*/
19103 ///
19104 ///# Errors
19105 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19106 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
19107 ///- `VK_ERROR_UNKNOWN`
19108 ///- `VK_ERROR_VALIDATION_FAILED`
19109 ///
19110 ///# Safety
19111 ///- `device` (self) must be valid and not destroyed.
19112 ///
19113 ///# Panics
19114 ///Panics if `vkBuildMicromapsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19115 ///
19116 ///# Usage Notes
19117 ///
19118 ///Builds one or more micromaps on the host. This is the CPU-side
19119 ///equivalent of `cmd_build_micromaps_ext`.
19120 ///
19121 ///Each `MicromapBuildInfoEXT` specifies the source triangle data,
19122 ///destination micromap, and scratch memory.
19123 ///
19124 ///Requires `VK_EXT_opacity_micromap` and the
19125 ///`micromapHostCommands` feature.
19126 pub unsafe fn build_micromaps_ext(
19127 &self,
19128 deferred_operation: DeferredOperationKHR,
19129 p_infos: &[MicromapBuildInfoEXT],
19130 ) -> VkResult<()> {
19131 let fp = self
19132 .commands()
19133 .build_micromaps_ext
19134 .expect("vkBuildMicromapsEXT not loaded");
19135 check(unsafe {
19136 fp(
19137 self.handle(),
19138 deferred_operation,
19139 p_infos.len() as u32,
19140 p_infos.as_ptr(),
19141 )
19142 })
19143 }
19144 ///Wraps [`vkDestroyMicromapEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyMicromapEXT.html).
19145 /**
19146 Provided by **VK_EXT_opacity_micromap**.*/
19147 ///
19148 ///# Safety
19149 ///- `device` (self) must be valid and not destroyed.
19150 ///- `micromap` must be externally synchronized.
19151 ///
19152 ///# Panics
19153 ///Panics if `vkDestroyMicromapEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19154 ///
19155 ///# Usage Notes
19156 ///
19157 ///Destroys a micromap created with `create_micromap_ext`. The
19158 ///backing buffer is not freed, the application must manage buffer
19159 ///lifetime separately.
19160 ///
19161 ///Requires `VK_EXT_opacity_micromap`.
19162 pub unsafe fn destroy_micromap_ext(
19163 &self,
19164 micromap: MicromapEXT,
19165 allocator: Option<&AllocationCallbacks>,
19166 ) {
19167 let fp = self
19168 .commands()
19169 .destroy_micromap_ext
19170 .expect("vkDestroyMicromapEXT not loaded");
19171 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
19172 unsafe { fp(self.handle(), micromap, alloc_ptr) };
19173 }
19174 ///Wraps [`vkCmdCopyMicromapEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMicromapEXT.html).
19175 /**
19176 Provided by **VK_EXT_opacity_micromap**.*/
19177 ///
19178 ///# Safety
19179 ///- `commandBuffer` (self) must be valid and not destroyed.
19180 ///- `commandBuffer` must be externally synchronized.
19181 ///
19182 ///# Panics
19183 ///Panics if `vkCmdCopyMicromapEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19184 ///
19185 ///# Usage Notes
19186 ///
19187 ///Copies or compacts a micromap. The `CopyMicromapInfoEXT` specifies
19188 ///source, destination, and mode (`CLONE` or `COMPACT`).
19189 ///
19190 ///Use `COMPACT` after building with `BUILD_ALLOW_COMPACTION` to
19191 ///reduce memory usage. Query the compacted size with
19192 ///`cmd_write_micromaps_properties_ext`.
19193 ///
19194 ///Requires `VK_EXT_opacity_micromap`.
19195 pub unsafe fn cmd_copy_micromap_ext(
19196 &self,
19197 command_buffer: CommandBuffer,
19198 p_info: &CopyMicromapInfoEXT,
19199 ) {
19200 let fp = self
19201 .commands()
19202 .cmd_copy_micromap_ext
19203 .expect("vkCmdCopyMicromapEXT not loaded");
19204 unsafe { fp(command_buffer, p_info) };
19205 }
19206 ///Wraps [`vkCopyMicromapEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCopyMicromapEXT.html).
19207 /**
19208 Provided by **VK_EXT_opacity_micromap**.*/
19209 ///
19210 ///# Errors
19211 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19212 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
19213 ///- `VK_ERROR_UNKNOWN`
19214 ///- `VK_ERROR_VALIDATION_FAILED`
19215 ///
19216 ///# Safety
19217 ///- `device` (self) must be valid and not destroyed.
19218 ///
19219 ///# Panics
19220 ///Panics if `vkCopyMicromapEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19221 ///
19222 ///# Usage Notes
19223 ///
19224 ///Host-side micromap copy or compaction. This is the CPU equivalent
19225 ///of `cmd_copy_micromap_ext`.
19226 ///
19227 ///Requires `VK_EXT_opacity_micromap` and the
19228 ///`micromapHostCommands` feature.
19229 pub unsafe fn copy_micromap_ext(
19230 &self,
19231 deferred_operation: DeferredOperationKHR,
19232 p_info: &CopyMicromapInfoEXT,
19233 ) -> VkResult<()> {
19234 let fp = self
19235 .commands()
19236 .copy_micromap_ext
19237 .expect("vkCopyMicromapEXT not loaded");
19238 check(unsafe { fp(self.handle(), deferred_operation, p_info) })
19239 }
19240 ///Wraps [`vkCmdCopyMicromapToMemoryEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMicromapToMemoryEXT.html).
19241 /**
19242 Provided by **VK_EXT_opacity_micromap**.*/
19243 ///
19244 ///# Safety
19245 ///- `commandBuffer` (self) must be valid and not destroyed.
19246 ///- `commandBuffer` must be externally synchronized.
19247 ///
19248 ///# Panics
19249 ///Panics if `vkCmdCopyMicromapToMemoryEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19250 ///
19251 ///# Usage Notes
19252 ///
19253 ///Serializes a micromap into a buffer for storage or transfer.
19254 ///The `CopyMicromapToMemoryInfoEXT` specifies the source micromap
19255 ///and destination device address.
19256 ///
19257 ///Deserialize with `cmd_copy_memory_to_micromap_ext`.
19258 ///
19259 ///Requires `VK_EXT_opacity_micromap`.
19260 pub unsafe fn cmd_copy_micromap_to_memory_ext(
19261 &self,
19262 command_buffer: CommandBuffer,
19263 p_info: &CopyMicromapToMemoryInfoEXT,
19264 ) {
19265 let fp = self
19266 .commands()
19267 .cmd_copy_micromap_to_memory_ext
19268 .expect("vkCmdCopyMicromapToMemoryEXT not loaded");
19269 unsafe { fp(command_buffer, p_info) };
19270 }
19271 ///Wraps [`vkCopyMicromapToMemoryEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCopyMicromapToMemoryEXT.html).
19272 /**
19273 Provided by **VK_EXT_opacity_micromap**.*/
19274 ///
19275 ///# Errors
19276 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19277 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
19278 ///- `VK_ERROR_UNKNOWN`
19279 ///- `VK_ERROR_VALIDATION_FAILED`
19280 ///
19281 ///# Safety
19282 ///- `device` (self) must be valid and not destroyed.
19283 ///
19284 ///# Panics
19285 ///Panics if `vkCopyMicromapToMemoryEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19286 ///
19287 ///# Usage Notes
19288 ///
19289 ///Host-side serialization of a micromap into a buffer. This is the
19290 ///CPU equivalent of `cmd_copy_micromap_to_memory_ext`.
19291 ///
19292 ///Requires `VK_EXT_opacity_micromap` and the
19293 ///`micromapHostCommands` feature.
19294 pub unsafe fn copy_micromap_to_memory_ext(
19295 &self,
19296 deferred_operation: DeferredOperationKHR,
19297 p_info: &CopyMicromapToMemoryInfoEXT,
19298 ) -> VkResult<()> {
19299 let fp = self
19300 .commands()
19301 .copy_micromap_to_memory_ext
19302 .expect("vkCopyMicromapToMemoryEXT not loaded");
19303 check(unsafe { fp(self.handle(), deferred_operation, p_info) })
19304 }
19305 ///Wraps [`vkCmdCopyMemoryToMicromapEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMemoryToMicromapEXT.html).
19306 /**
19307 Provided by **VK_EXT_opacity_micromap**.*/
19308 ///
19309 ///# Safety
19310 ///- `commandBuffer` (self) must be valid and not destroyed.
19311 ///- `commandBuffer` must be externally synchronized.
19312 ///
19313 ///# Panics
19314 ///Panics if `vkCmdCopyMemoryToMicromapEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19315 ///
19316 ///# Usage Notes
19317 ///
19318 ///Deserializes a micromap from a buffer into a micromap object.
19319 ///This is the reverse of `cmd_copy_micromap_to_memory_ext`.
19320 ///
19321 ///Used for loading previously serialized micromaps from disk or
19322 ///transferring between devices.
19323 ///
19324 ///Requires `VK_EXT_opacity_micromap`.
19325 pub unsafe fn cmd_copy_memory_to_micromap_ext(
19326 &self,
19327 command_buffer: CommandBuffer,
19328 p_info: &CopyMemoryToMicromapInfoEXT,
19329 ) {
19330 let fp = self
19331 .commands()
19332 .cmd_copy_memory_to_micromap_ext
19333 .expect("vkCmdCopyMemoryToMicromapEXT not loaded");
19334 unsafe { fp(command_buffer, p_info) };
19335 }
19336 ///Wraps [`vkCopyMemoryToMicromapEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCopyMemoryToMicromapEXT.html).
19337 /**
19338 Provided by **VK_EXT_opacity_micromap**.*/
19339 ///
19340 ///# Errors
19341 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19342 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
19343 ///- `VK_ERROR_UNKNOWN`
19344 ///- `VK_ERROR_VALIDATION_FAILED`
19345 ///
19346 ///# Safety
19347 ///- `device` (self) must be valid and not destroyed.
19348 ///
19349 ///# Panics
19350 ///Panics if `vkCopyMemoryToMicromapEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19351 ///
19352 ///# Usage Notes
19353 ///
19354 ///Host-side deserialization of a micromap from a buffer. This is
19355 ///the CPU equivalent of `cmd_copy_memory_to_micromap_ext`.
19356 ///
19357 ///Requires `VK_EXT_opacity_micromap` and the
19358 ///`micromapHostCommands` feature.
19359 pub unsafe fn copy_memory_to_micromap_ext(
19360 &self,
19361 deferred_operation: DeferredOperationKHR,
19362 p_info: &CopyMemoryToMicromapInfoEXT,
19363 ) -> VkResult<()> {
19364 let fp = self
19365 .commands()
19366 .copy_memory_to_micromap_ext
19367 .expect("vkCopyMemoryToMicromapEXT not loaded");
19368 check(unsafe { fp(self.handle(), deferred_operation, p_info) })
19369 }
19370 ///Wraps [`vkCmdWriteMicromapsPropertiesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWriteMicromapsPropertiesEXT.html).
19371 /**
19372 Provided by **VK_EXT_opacity_micromap**.*/
19373 ///
19374 ///# Safety
19375 ///- `commandBuffer` (self) must be valid and not destroyed.
19376 ///- `commandBuffer` must be externally synchronized.
19377 ///
19378 ///# Panics
19379 ///Panics if `vkCmdWriteMicromapsPropertiesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19380 ///
19381 ///# Usage Notes
19382 ///
19383 ///Writes micromap properties (e.g., compacted size) to a query pool.
19384 ///Use `QUERY_TYPE_MICROMAP_COMPACTED_SIZE_EXT` to query the size
19385 ///needed for a compacted copy.
19386 ///
19387 ///Requires `VK_EXT_opacity_micromap`.
19388 pub unsafe fn cmd_write_micromaps_properties_ext(
19389 &self,
19390 command_buffer: CommandBuffer,
19391 p_micromaps: &[MicromapEXT],
19392 query_type: QueryType,
19393 query_pool: QueryPool,
19394 first_query: u32,
19395 ) {
19396 let fp = self
19397 .commands()
19398 .cmd_write_micromaps_properties_ext
19399 .expect("vkCmdWriteMicromapsPropertiesEXT not loaded");
19400 unsafe {
19401 fp(
19402 command_buffer,
19403 p_micromaps.len() as u32,
19404 p_micromaps.as_ptr(),
19405 query_type,
19406 query_pool,
19407 first_query,
19408 )
19409 };
19410 }
19411 ///Wraps [`vkWriteMicromapsPropertiesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkWriteMicromapsPropertiesEXT.html).
19412 /**
19413 Provided by **VK_EXT_opacity_micromap**.*/
19414 ///
19415 ///# Errors
19416 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19417 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
19418 ///- `VK_ERROR_UNKNOWN`
19419 ///- `VK_ERROR_VALIDATION_FAILED`
19420 ///
19421 ///# Safety
19422 ///- `device` (self) must be valid and not destroyed.
19423 ///
19424 ///# Panics
19425 ///Panics if `vkWriteMicromapsPropertiesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19426 ///
19427 ///# Usage Notes
19428 ///
19429 ///Host-side query of micromap properties. This is the CPU equivalent
19430 ///of `cmd_write_micromaps_properties_ext`.
19431 ///
19432 ///Typically used to query compacted size
19433 ///(`QUERY_TYPE_MICROMAP_COMPACTED_SIZE_EXT`) without going through
19434 ///a query pool.
19435 ///
19436 ///Requires `VK_EXT_opacity_micromap` and the
19437 ///`micromapHostCommands` feature.
19438 pub unsafe fn write_micromaps_properties_ext(
19439 &self,
19440 p_micromaps: &[MicromapEXT],
19441 query_type: QueryType,
19442 data_size: usize,
19443 p_data: *mut core::ffi::c_void,
19444 stride: usize,
19445 ) -> VkResult<()> {
19446 let fp = self
19447 .commands()
19448 .write_micromaps_properties_ext
19449 .expect("vkWriteMicromapsPropertiesEXT not loaded");
19450 check(unsafe {
19451 fp(
19452 self.handle(),
19453 p_micromaps.len() as u32,
19454 p_micromaps.as_ptr(),
19455 query_type,
19456 data_size,
19457 p_data,
19458 stride,
19459 )
19460 })
19461 }
19462 ///Wraps [`vkGetDeviceMicromapCompatibilityEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceMicromapCompatibilityEXT.html).
19463 /**
19464 Provided by **VK_EXT_opacity_micromap**.*/
19465 ///
19466 ///# Safety
19467 ///- `device` (self) must be valid and not destroyed.
19468 ///
19469 ///# Panics
19470 ///Panics if `vkGetDeviceMicromapCompatibilityEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19471 ///
19472 ///# Usage Notes
19473 ///
19474 ///Checks whether a serialized micromap is compatible with the
19475 ///current device. Returns `COMPATIBLE` or `INCOMPATIBLE`.
19476 ///
19477 ///Use this before deserializing a micromap (via
19478 ///`cmd_copy_memory_to_micromap_ext` or `copy_memory_to_micromap_ext`)
19479 ///to verify it will work on this device.
19480 ///
19481 ///Requires `VK_EXT_opacity_micromap`.
19482 pub unsafe fn get_device_micromap_compatibility_ext(
19483 &self,
19484 p_version_info: &MicromapVersionInfoEXT,
19485 ) -> AccelerationStructureCompatibilityKHR {
19486 let fp = self
19487 .commands()
19488 .get_device_micromap_compatibility_ext
19489 .expect("vkGetDeviceMicromapCompatibilityEXT not loaded");
19490 let mut out = unsafe { core::mem::zeroed() };
19491 unsafe { fp(self.handle(), p_version_info, &mut out) };
19492 out
19493 }
19494 ///Wraps [`vkGetMicromapBuildSizesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMicromapBuildSizesEXT.html).
19495 /**
19496 Provided by **VK_EXT_opacity_micromap**.*/
19497 ///
19498 ///# Safety
19499 ///- `device` (self) must be valid and not destroyed.
19500 ///
19501 ///# Panics
19502 ///Panics if `vkGetMicromapBuildSizesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19503 ///
19504 ///# Usage Notes
19505 ///
19506 ///Queries the memory requirements for building a micromap. Returns
19507 ///the destination micromap size and scratch memory size needed.
19508 ///
19509 ///Provide a `MicromapBuildInfoEXT` with the triangle counts and
19510 ///format. The addresses can be null, only the sizes and counts
19511 ///matter for this query.
19512 ///
19513 ///Use the results to allocate the micromap buffer and scratch buffer
19514 ///before calling `cmd_build_micromaps_ext`.
19515 ///
19516 ///Requires `VK_EXT_opacity_micromap`.
19517 pub unsafe fn get_micromap_build_sizes_ext(
19518 &self,
19519 build_type: AccelerationStructureBuildTypeKHR,
19520 p_build_info: &MicromapBuildInfoEXT,
19521 p_size_info: &mut MicromapBuildSizesInfoEXT,
19522 ) {
19523 let fp = self
19524 .commands()
19525 .get_micromap_build_sizes_ext
19526 .expect("vkGetMicromapBuildSizesEXT not loaded");
19527 unsafe { fp(self.handle(), build_type, p_build_info, p_size_info) };
19528 }
19529 ///Wraps [`vkGetShaderModuleIdentifierEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetShaderModuleIdentifierEXT.html).
19530 /**
19531 Provided by **VK_EXT_shader_module_identifier**.*/
19532 ///
19533 ///# Safety
19534 ///- `device` (self) must be valid and not destroyed.
19535 ///
19536 ///# Panics
19537 ///Panics if `vkGetShaderModuleIdentifierEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19538 ///
19539 ///# Usage Notes
19540 ///
19541 ///Retrieves the identifier for an existing shader module. The
19542 ///identifier can be used for pipeline cache lookups via
19543 ///`PipelineShaderStageModuleIdentifierCreateInfoEXT`.
19544 ///
19545 ///The identifier is deterministic for the same SPIR-V content
19546 ///on the same implementation.
19547 ///
19548 ///Requires `VK_EXT_shader_module_identifier`.
19549 pub unsafe fn get_shader_module_identifier_ext(
19550 &self,
19551 shader_module: ShaderModule,
19552 p_identifier: &mut ShaderModuleIdentifierEXT,
19553 ) {
19554 let fp = self
19555 .commands()
19556 .get_shader_module_identifier_ext
19557 .expect("vkGetShaderModuleIdentifierEXT not loaded");
19558 unsafe { fp(self.handle(), shader_module, p_identifier) };
19559 }
19560 ///Wraps [`vkGetShaderModuleCreateInfoIdentifierEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetShaderModuleCreateInfoIdentifierEXT.html).
19561 /**
19562 Provided by **VK_EXT_shader_module_identifier**.*/
19563 ///
19564 ///# Safety
19565 ///- `device` (self) must be valid and not destroyed.
19566 ///
19567 ///# Panics
19568 ///Panics if `vkGetShaderModuleCreateInfoIdentifierEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19569 ///
19570 ///# Usage Notes
19571 ///
19572 ///Computes an identifier for a shader module from its create info
19573 ///(SPIR-V code) without creating the module. The identifier can be
19574 ///used in `PipelineShaderStageModuleIdentifierCreateInfoEXT` to
19575 ///create pipelines from cached shader data.
19576 ///
19577 ///Useful for pipeline caching workflows where the SPIR-V is
19578 ///available but you want to avoid full module creation.
19579 ///
19580 ///Requires `VK_EXT_shader_module_identifier`.
19581 pub unsafe fn get_shader_module_create_info_identifier_ext(
19582 &self,
19583 p_create_info: &ShaderModuleCreateInfo,
19584 p_identifier: &mut ShaderModuleIdentifierEXT,
19585 ) {
19586 let fp = self
19587 .commands()
19588 .get_shader_module_create_info_identifier_ext
19589 .expect("vkGetShaderModuleCreateInfoIdentifierEXT not loaded");
19590 unsafe { fp(self.handle(), p_create_info, p_identifier) };
19591 }
19592 ///Wraps [`vkGetImageSubresourceLayout2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageSubresourceLayout2.html).
19593 /**
19594 Provided by **VK_BASE_VERSION_1_4**.*/
19595 ///
19596 ///# Safety
19597 ///- `device` (self) must be valid and not destroyed.
19598 ///
19599 ///# Panics
19600 ///Panics if `vkGetImageSubresourceLayout2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19601 ///
19602 ///# Usage Notes
19603 ///
19604 ///Vulkan 1.4 version of `get_image_subresource_layout` that uses
19605 ///extensible structs via pNext.
19606 ///
19607 ///Returns the layout (offset, size, row pitch, array pitch, depth
19608 ///pitch) for a given subresource of an existing image. Chain
19609 ///`ImageCompressionPropertiesEXT` to query fixed-rate compression
19610 ///state.
19611 ///
19612 ///For linear-tiling images, this tells you how to access texels
19613 ///through a mapped pointer. For optimal-tiling images, the layout is
19614 ///opaque and implementation-defined.
19615 pub unsafe fn get_image_subresource_layout2(
19616 &self,
19617 image: Image,
19618 p_subresource: &ImageSubresource2,
19619 p_layout: &mut SubresourceLayout2,
19620 ) {
19621 let fp = self
19622 .commands()
19623 .get_image_subresource_layout2
19624 .expect("vkGetImageSubresourceLayout2 not loaded");
19625 unsafe { fp(self.handle(), image, p_subresource, p_layout) };
19626 }
19627 ///Wraps [`vkGetPipelinePropertiesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPipelinePropertiesEXT.html).
19628 /**
19629 Provided by **VK_EXT_pipeline_properties**.*/
19630 ///
19631 ///# Errors
19632 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19633 ///- `VK_ERROR_UNKNOWN`
19634 ///- `VK_ERROR_VALIDATION_FAILED`
19635 ///
19636 ///# Safety
19637 ///- `device` (self) must be valid and not destroyed.
19638 ///
19639 ///# Panics
19640 ///Panics if `vkGetPipelinePropertiesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19641 ///
19642 ///# Usage Notes
19643 ///
19644 ///Queries properties of a pipeline, such as its pipeline identifier.
19645 ///The identifier can be used to correlate pipelines across processes
19646 ///or with external tools.
19647 ///
19648 ///Requires `VK_EXT_pipeline_properties`.
19649 pub unsafe fn get_pipeline_properties_ext(
19650 &self,
19651 p_pipeline_info: &PipelineInfoEXT,
19652 p_pipeline_properties: &mut BaseOutStructure,
19653 ) -> VkResult<()> {
19654 let fp = self
19655 .commands()
19656 .get_pipeline_properties_ext
19657 .expect("vkGetPipelinePropertiesEXT not loaded");
19658 check(unsafe { fp(self.handle(), p_pipeline_info, p_pipeline_properties) })
19659 }
19660 ///Wraps [`vkExportMetalObjectsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkExportMetalObjectsEXT.html).
19661 /**
19662 Provided by **VK_EXT_metal_objects**.*/
19663 ///
19664 ///# Safety
19665 ///- `device` (self) must be valid and not destroyed.
19666 ///
19667 ///# Panics
19668 ///Panics if `vkExportMetalObjectsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19669 ///
19670 ///# Usage Notes
19671 ///
19672 ///Exports the underlying Metal objects (device, command queue,
19673 ///textures, buffers, etc.) from Vulkan objects. Chain the
19674 ///appropriate export struct into the pNext of the info structure
19675 ///to select which Metal object to retrieve.
19676 ///
19677 ///Useful for Metal interop on Apple platforms where both APIs
19678 ///share the same GPU resources.
19679 ///
19680 ///Requires `VK_EXT_metal_objects`. macOS/iOS only.
19681 pub unsafe fn export_metal_objects_ext(
19682 &self,
19683 p_metal_objects_info: &mut ExportMetalObjectsInfoEXT,
19684 ) {
19685 let fp = self
19686 .commands()
19687 .export_metal_objects_ext
19688 .expect("vkExportMetalObjectsEXT not loaded");
19689 unsafe { fp(self.handle(), p_metal_objects_info) };
19690 }
19691 ///Wraps [`vkCmdBindTileMemoryQCOM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindTileMemoryQCOM.html).
19692 /**
19693 Provided by **VK_QCOM_tile_memory_heap**.*/
19694 ///
19695 ///# Safety
19696 ///- `commandBuffer` (self) must be valid and not destroyed.
19697 ///- `commandBuffer` must be externally synchronized.
19698 ///
19699 ///# Panics
19700 ///Panics if `vkCmdBindTileMemoryQCOM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19701 ///
19702 ///# Usage Notes
19703 ///
19704 ///Binds tile memory for use within a per-tile execution region on
19705 ///Qualcomm tile-based GPUs. Pass `None` to unbind. Tile memory
19706 ///provides fast on-chip scratch storage scoped to each tile.
19707 ///
19708 ///Requires `VK_QCOM_tile_shading`.
19709 pub unsafe fn cmd_bind_tile_memory_qcom(
19710 &self,
19711 command_buffer: CommandBuffer,
19712 p_tile_memory_bind_info: Option<&TileMemoryBindInfoQCOM>,
19713 ) {
19714 let fp = self
19715 .commands()
19716 .cmd_bind_tile_memory_qcom
19717 .expect("vkCmdBindTileMemoryQCOM not loaded");
19718 let p_tile_memory_bind_info_ptr =
19719 p_tile_memory_bind_info.map_or(core::ptr::null(), core::ptr::from_ref);
19720 unsafe { fp(command_buffer, p_tile_memory_bind_info_ptr) };
19721 }
19722 ///Wraps [`vkGetFramebufferTilePropertiesQCOM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetFramebufferTilePropertiesQCOM.html).
19723 /**
19724 Provided by **VK_QCOM_tile_properties**.*/
19725 ///
19726 ///# Errors
19727 ///- `VK_ERROR_UNKNOWN`
19728 ///- `VK_ERROR_VALIDATION_FAILED`
19729 ///
19730 ///# Safety
19731 ///- `device` (self) must be valid and not destroyed.
19732 ///
19733 ///# Panics
19734 ///Panics if `vkGetFramebufferTilePropertiesQCOM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19735 ///
19736 ///# Usage Notes
19737 ///
19738 ///Queries tile properties (tile dimensions and extents) for a
19739 ///framebuffer on Qualcomm tile-based GPUs. Uses the two-call
19740 ///idiom. Useful for optimising rendering to match the hardware
19741 ///tile layout.
19742 ///
19743 ///Requires `VK_QCOM_tile_properties`.
19744 pub unsafe fn get_framebuffer_tile_properties_qcom(
19745 &self,
19746 framebuffer: Framebuffer,
19747 ) -> VkResult<Vec<TilePropertiesQCOM>> {
19748 let fp = self
19749 .commands()
19750 .get_framebuffer_tile_properties_qcom
19751 .expect("vkGetFramebufferTilePropertiesQCOM not loaded");
19752 enumerate_two_call(|count, data| unsafe { fp(self.handle(), framebuffer, count, data) })
19753 }
19754 ///Wraps [`vkGetDynamicRenderingTilePropertiesQCOM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDynamicRenderingTilePropertiesQCOM.html).
19755 /**
19756 Provided by **VK_QCOM_tile_properties**.*/
19757 ///
19758 ///# Errors
19759 ///- `VK_ERROR_UNKNOWN`
19760 ///- `VK_ERROR_VALIDATION_FAILED`
19761 ///
19762 ///# Safety
19763 ///- `device` (self) must be valid and not destroyed.
19764 ///
19765 ///# Panics
19766 ///Panics if `vkGetDynamicRenderingTilePropertiesQCOM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19767 ///
19768 ///# Usage Notes
19769 ///
19770 ///Queries tile properties for a dynamic rendering pass (as opposed
19771 ///to a framebuffer-based render pass). Returns tile dimensions that
19772 ///would be used for the given rendering info on Qualcomm tile-based
19773 ///GPUs.
19774 ///
19775 ///Requires `VK_QCOM_tile_properties`.
19776 pub unsafe fn get_dynamic_rendering_tile_properties_qcom(
19777 &self,
19778 p_rendering_info: &RenderingInfo,
19779 p_properties: &mut TilePropertiesQCOM,
19780 ) -> VkResult<()> {
19781 let fp = self
19782 .commands()
19783 .get_dynamic_rendering_tile_properties_qcom
19784 .expect("vkGetDynamicRenderingTilePropertiesQCOM not loaded");
19785 check(unsafe { fp(self.handle(), p_rendering_info, p_properties) })
19786 }
19787 ///Wraps [`vkCreateOpticalFlowSessionNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateOpticalFlowSessionNV.html).
19788 /**
19789 Provided by **VK_NV_optical_flow**.*/
19790 ///
19791 ///# Errors
19792 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19793 ///- `VK_ERROR_INITIALIZATION_FAILED`
19794 ///- `VK_ERROR_UNKNOWN`
19795 ///- `VK_ERROR_VALIDATION_FAILED`
19796 ///
19797 ///# Safety
19798 ///- `device` (self) must be valid and not destroyed.
19799 ///
19800 ///# Panics
19801 ///Panics if `vkCreateOpticalFlowSessionNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19802 ///
19803 ///# Usage Notes
19804 ///
19805 ///Creates an optical flow session for GPU-accelerated motion
19806 ///estimation between image pairs. Configure the session with image
19807 ///format, resolution, and flow precision in the create info.
19808 ///
19809 ///Destroy with `destroy_optical_flow_session_nv`.
19810 ///
19811 ///Requires `VK_NV_optical_flow`.
19812 pub unsafe fn create_optical_flow_session_nv(
19813 &self,
19814 p_create_info: &OpticalFlowSessionCreateInfoNV,
19815 allocator: Option<&AllocationCallbacks>,
19816 ) -> VkResult<OpticalFlowSessionNV> {
19817 let fp = self
19818 .commands()
19819 .create_optical_flow_session_nv
19820 .expect("vkCreateOpticalFlowSessionNV not loaded");
19821 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
19822 let mut out = unsafe { core::mem::zeroed() };
19823 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
19824 Ok(out)
19825 }
19826 ///Wraps [`vkDestroyOpticalFlowSessionNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyOpticalFlowSessionNV.html).
19827 /**
19828 Provided by **VK_NV_optical_flow**.*/
19829 ///
19830 ///# Safety
19831 ///- `device` (self) must be valid and not destroyed.
19832 ///
19833 ///# Panics
19834 ///Panics if `vkDestroyOpticalFlowSessionNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19835 ///
19836 ///# Usage Notes
19837 ///
19838 ///Destroys an optical flow session created with
19839 ///`create_optical_flow_session_nv`.
19840 ///
19841 ///Requires `VK_NV_optical_flow`.
19842 pub unsafe fn destroy_optical_flow_session_nv(
19843 &self,
19844 session: OpticalFlowSessionNV,
19845 allocator: Option<&AllocationCallbacks>,
19846 ) {
19847 let fp = self
19848 .commands()
19849 .destroy_optical_flow_session_nv
19850 .expect("vkDestroyOpticalFlowSessionNV not loaded");
19851 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
19852 unsafe { fp(self.handle(), session, alloc_ptr) };
19853 }
19854 ///Wraps [`vkBindOpticalFlowSessionImageNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBindOpticalFlowSessionImageNV.html).
19855 /**
19856 Provided by **VK_NV_optical_flow**.*/
19857 ///
19858 ///# Errors
19859 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19860 ///- `VK_ERROR_INITIALIZATION_FAILED`
19861 ///- `VK_ERROR_UNKNOWN`
19862 ///- `VK_ERROR_VALIDATION_FAILED`
19863 ///
19864 ///# Safety
19865 ///- `device` (self) must be valid and not destroyed.
19866 ///
19867 ///# Panics
19868 ///Panics if `vkBindOpticalFlowSessionImageNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19869 ///
19870 ///# Usage Notes
19871 ///
19872 ///Binds an image view to an optical flow session at a specific
19873 ///binding point (reference, target, flow vector output, etc.).
19874 ///All required binding points must be bound before executing the
19875 ///optical flow.
19876 ///
19877 ///Requires `VK_NV_optical_flow`.
19878 pub unsafe fn bind_optical_flow_session_image_nv(
19879 &self,
19880 session: OpticalFlowSessionNV,
19881 binding_point: OpticalFlowSessionBindingPointNV,
19882 view: ImageView,
19883 layout: ImageLayout,
19884 ) -> VkResult<()> {
19885 let fp = self
19886 .commands()
19887 .bind_optical_flow_session_image_nv
19888 .expect("vkBindOpticalFlowSessionImageNV not loaded");
19889 check(unsafe { fp(self.handle(), session, binding_point, view, layout) })
19890 }
19891 ///Wraps [`vkCmdOpticalFlowExecuteNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdOpticalFlowExecuteNV.html).
19892 /**
19893 Provided by **VK_NV_optical_flow**.*/
19894 ///
19895 ///# Safety
19896 ///- `commandBuffer` (self) must be valid and not destroyed.
19897 ///
19898 ///# Panics
19899 ///Panics if `vkCmdOpticalFlowExecuteNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19900 ///
19901 ///# Usage Notes
19902 ///
19903 ///Executes optical flow estimation on the GPU using the bound
19904 ///reference and target images. Results are written to the bound
19905 ///flow vector output image.
19906 ///
19907 ///Requires `VK_NV_optical_flow`.
19908 pub unsafe fn cmd_optical_flow_execute_nv(
19909 &self,
19910 command_buffer: CommandBuffer,
19911 session: OpticalFlowSessionNV,
19912 p_execute_info: &OpticalFlowExecuteInfoNV,
19913 ) {
19914 let fp = self
19915 .commands()
19916 .cmd_optical_flow_execute_nv
19917 .expect("vkCmdOpticalFlowExecuteNV not loaded");
19918 unsafe { fp(command_buffer, session, p_execute_info) };
19919 }
19920 ///Wraps [`vkGetDeviceFaultInfoEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceFaultInfoEXT.html).
19921 /**
19922 Provided by **VK_EXT_device_fault**.*/
19923 ///
19924 ///# Errors
19925 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19926 ///- `VK_ERROR_UNKNOWN`
19927 ///- `VK_ERROR_VALIDATION_FAILED`
19928 ///
19929 ///# Safety
19930 ///- `device` (self) must be valid and not destroyed.
19931 ///
19932 ///# Panics
19933 ///Panics if `vkGetDeviceFaultInfoEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19934 ///
19935 ///# Usage Notes
19936 ///
19937 ///Retrieves diagnostic information after a device-lost error. Call
19938 ///once with a null info pointer to query the fault counts, then
19939 ///again with allocated structures to retrieve the fault details.
19940 ///
19941 ///The returned data is vendor-specific and intended for crash
19942 ///reporting and post-mortem debugging.
19943 ///
19944 ///Requires `VK_EXT_device_fault`.
19945 pub unsafe fn get_device_fault_info_ext(
19946 &self,
19947 p_fault_counts: &mut DeviceFaultCountsEXT,
19948 p_fault_info: &mut DeviceFaultInfoEXT,
19949 ) -> VkResult<()> {
19950 let fp = self
19951 .commands()
19952 .get_device_fault_info_ext
19953 .expect("vkGetDeviceFaultInfoEXT not loaded");
19954 check(unsafe { fp(self.handle(), p_fault_counts, p_fault_info) })
19955 }
19956 ///Wraps [`vkGetDeviceFaultReportsKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceFaultReportsKHR.html).
19957 /**
19958 Provided by **VK_KHR_device_fault**.*/
19959 ///
19960 ///# Errors
19961 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19962 ///- `VK_ERROR_UNKNOWN`
19963 ///- `VK_ERROR_VALIDATION_FAILED`
19964 ///
19965 ///# Safety
19966 ///- `device` (self) must be valid and not destroyed.
19967 ///
19968 ///# Panics
19969 ///Panics if `vkGetDeviceFaultReportsKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19970 ///
19971 ///# Usage Notes
19972 ///
19973 ///Retrieves fault reports after a device loss (`ERROR_DEVICE_LOST`).
19974 ///Returns a list of `DeviceFaultInfoKHR` structs describing what
19975 ///went wrong, address faults, vendor-specific fault codes, etc.
19976 ///
19977 ///`timeout` specifies how long to wait (in nanoseconds) for the
19978 ///driver to collect fault data. Use `UINT64_MAX` to wait
19979 ///indefinitely.
19980 ///
19981 ///For raw debug data suitable for vendor tools, follow up with
19982 ///`get_device_fault_debug_info_khr`.
19983 ///
19984 ///Requires `VK_KHR_device_fault`.
19985 pub unsafe fn get_device_fault_reports_khr(
19986 &self,
19987 timeout: u64,
19988 ) -> VkResult<Vec<DeviceFaultInfoKHR>> {
19989 let fp = self
19990 .commands()
19991 .get_device_fault_reports_khr
19992 .expect("vkGetDeviceFaultReportsKHR not loaded");
19993 enumerate_two_call(|count, data| unsafe { fp(self.handle(), timeout, count, data) })
19994 }
19995 ///Wraps [`vkGetDeviceFaultDebugInfoKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceFaultDebugInfoKHR.html).
19996 /**
19997 Provided by **VK_KHR_device_fault**.*/
19998 ///
19999 ///# Errors
20000 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20001 ///- `VK_ERROR_NOT_ENOUGH_SPACE_KHR`
20002 ///- `VK_ERROR_UNKNOWN`
20003 ///- `VK_ERROR_VALIDATION_FAILED`
20004 ///
20005 ///# Safety
20006 ///- `device` (self) must be valid and not destroyed.
20007 ///
20008 ///# Panics
20009 ///Panics if `vkGetDeviceFaultDebugInfoKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20010 ///
20011 ///# Usage Notes
20012 ///
20013 ///Retrieves debug information after a device fault (GPU crash or
20014 ///hang). The returned `DeviceFaultDebugInfoKHR` contains
20015 ///vendor-specific binary data that can be passed to GPU vendor
20016 ///diagnostic tools.
20017 ///
20018 ///Call `get_device_fault_reports_khr` first to get the high-level
20019 ///fault reports; this call provides the raw debug blob.
20020 ///
20021 ///Requires `VK_KHR_device_fault`.
20022 pub unsafe fn get_device_fault_debug_info_khr(
20023 &self,
20024 p_debug_info: &mut DeviceFaultDebugInfoKHR,
20025 ) -> VkResult<()> {
20026 let fp = self
20027 .commands()
20028 .get_device_fault_debug_info_khr
20029 .expect("vkGetDeviceFaultDebugInfoKHR not loaded");
20030 check(unsafe { fp(self.handle(), p_debug_info) })
20031 }
20032 ///Wraps [`vkCmdSetDepthBias2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthBias2EXT.html).
20033 /**
20034 Provided by **VK_EXT_depth_bias_control**.*/
20035 ///
20036 ///# Safety
20037 ///- `commandBuffer` (self) must be valid and not destroyed.
20038 ///- `commandBuffer` must be externally synchronized.
20039 ///
20040 ///# Panics
20041 ///Panics if `vkCmdSetDepthBias2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20042 ///
20043 ///# Usage Notes
20044 ///
20045 ///Extended version of `cmd_set_depth_bias` that takes a
20046 ///`DepthBiasInfoEXT` struct with pNext extensibility. This allows
20047 ///chaining `DepthBiasRepresentationInfoEXT` to control the depth
20048 ///bias representation (least-representable-value vs. float).
20049 ///
20050 ///Requires `VK_EXT_depth_bias_control`.
20051 pub unsafe fn cmd_set_depth_bias2_ext(
20052 &self,
20053 command_buffer: CommandBuffer,
20054 p_depth_bias_info: &DepthBiasInfoEXT,
20055 ) {
20056 let fp = self
20057 .commands()
20058 .cmd_set_depth_bias2_ext
20059 .expect("vkCmdSetDepthBias2EXT not loaded");
20060 unsafe { fp(command_buffer, p_depth_bias_info) };
20061 }
20062 ///Wraps [`vkReleaseSwapchainImagesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkReleaseSwapchainImagesKHR.html).
20063 /**
20064 Provided by **VK_KHR_swapchain_maintenance1**.*/
20065 ///
20066 ///# Errors
20067 ///- `VK_ERROR_SURFACE_LOST_KHR`
20068 ///- `VK_ERROR_UNKNOWN`
20069 ///- `VK_ERROR_VALIDATION_FAILED`
20070 ///
20071 ///# Safety
20072 ///- `device` (self) must be valid and not destroyed.
20073 ///
20074 ///# Panics
20075 ///Panics if `vkReleaseSwapchainImagesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20076 ///
20077 ///# Usage Notes
20078 ///
20079 ///Releases acquired swapchain images back to the swapchain without
20080 ///presenting them. Provided by `VK_KHR_swapchain_maintenance1`.
20081 ///
20082 ///Use this when you have acquired an image but decided not to render
20083 ///to it, for example, when aborting a frame due to a resize or
20084 ///error. Without this extension, the only way to return an acquired
20085 ///image is to present it.
20086 ///
20087 ///The released images return to the pool and can be acquired again.
20088 pub unsafe fn release_swapchain_images_khr(
20089 &self,
20090 p_release_info: &ReleaseSwapchainImagesInfoKHR,
20091 ) -> VkResult<()> {
20092 let fp = self
20093 .commands()
20094 .release_swapchain_images_khr
20095 .expect("vkReleaseSwapchainImagesKHR not loaded");
20096 check(unsafe { fp(self.handle(), p_release_info) })
20097 }
20098 ///Wraps [`vkGetDeviceImageSubresourceLayout`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceImageSubresourceLayout.html).
20099 /**
20100 Provided by **VK_BASE_VERSION_1_4**.*/
20101 ///
20102 ///# Safety
20103 ///- `device` (self) must be valid and not destroyed.
20104 ///
20105 ///# Panics
20106 ///Panics if `vkGetDeviceImageSubresourceLayout` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20107 ///
20108 ///# Usage Notes
20109 ///
20110 ///Vulkan 1.4 command that queries the subresource layout for an image
20111 ///**without creating it first**. Returns the offset, size, row pitch,
20112 ///array pitch, and depth pitch for a given subresource of a
20113 ///hypothetical image.
20114 ///
20115 ///Useful for pre-planning host-side memory layouts when using
20116 ///`HOST_TRANSFER` images, or for calculating buffer sizes for staging
20117 ///uploads.
20118 pub unsafe fn get_device_image_subresource_layout(
20119 &self,
20120 p_info: &DeviceImageSubresourceInfo,
20121 p_layout: &mut SubresourceLayout2,
20122 ) {
20123 let fp = self
20124 .commands()
20125 .get_device_image_subresource_layout
20126 .expect("vkGetDeviceImageSubresourceLayout not loaded");
20127 unsafe { fp(self.handle(), p_info, p_layout) };
20128 }
20129 ///Wraps [`vkUnmapMemory2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkUnmapMemory2.html).
20130 /**
20131 Provided by **VK_BASE_VERSION_1_4**.*/
20132 ///
20133 ///# Errors
20134 ///- `VK_ERROR_MEMORY_MAP_FAILED`
20135 ///- `VK_ERROR_UNKNOWN`
20136 ///- `VK_ERROR_VALIDATION_FAILED`
20137 ///
20138 ///# Safety
20139 ///- `device` (self) must be valid and not destroyed.
20140 ///
20141 ///# Panics
20142 ///Panics if `vkUnmapMemory2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20143 ///
20144 ///# Usage Notes
20145 ///
20146 ///Vulkan 1.4 version of `unmap_memory` that uses an extensible
20147 ///`MemoryUnmapInfo` struct. Supports `MEMORY_UNMAP_RESERVE` (if
20148 ///available) to keep the virtual address range reserved after
20149 ///unmapping, useful for placed mappings.
20150 ///
20151 ///For most applications, `unmap_memory` and `unmap_memory2` are
20152 ///equivalent. Prefer this when targeting Vulkan 1.4+.
20153 pub unsafe fn unmap_memory2(&self, p_memory_unmap_info: &MemoryUnmapInfo) -> VkResult<()> {
20154 let fp = self
20155 .commands()
20156 .unmap_memory2
20157 .expect("vkUnmapMemory2 not loaded");
20158 check(unsafe { fp(self.handle(), p_memory_unmap_info) })
20159 }
20160 ///Wraps [`vkCreateShadersEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateShadersEXT.html).
20161 /**
20162 Provided by **VK_EXT_shader_object**.*/
20163 ///
20164 ///# Errors
20165 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20166 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
20167 ///- `VK_ERROR_INITIALIZATION_FAILED`
20168 ///- `VK_ERROR_UNKNOWN`
20169 ///- `VK_ERROR_VALIDATION_FAILED`
20170 ///
20171 ///# Safety
20172 ///- `device` (self) must be valid and not destroyed.
20173 ///
20174 ///# Panics
20175 ///Panics if `vkCreateShadersEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20176 ///
20177 ///# Usage Notes
20178 ///
20179 ///Creates one or more shader objects from SPIR-V code. Shader
20180 ///objects are an alternative to pipelines, instead of baking
20181 ///shaders into monolithic pipeline objects, individual shader
20182 ///stages can be bound independently.
20183 ///
20184 ///Each `ShaderCreateInfoEXT` specifies the stage, code, entry
20185 ///point, and optional specialization constants.
20186 ///
20187 ///Bind with `cmd_bind_shaders_ext`. Destroy with
20188 ///`destroy_shader_ext`.
20189 ///
20190 ///Requires `VK_EXT_shader_object`.
20191 pub unsafe fn create_shaders_ext(
20192 &self,
20193 p_create_infos: &[ShaderCreateInfoEXT],
20194 allocator: Option<&AllocationCallbacks>,
20195 ) -> VkResult<Vec<ShaderEXT>> {
20196 let fp = self
20197 .commands()
20198 .create_shaders_ext
20199 .expect("vkCreateShadersEXT not loaded");
20200 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
20201 let count = p_create_infos.len();
20202 let mut out = vec![unsafe { core::mem::zeroed() }; count];
20203 check(unsafe {
20204 fp(
20205 self.handle(),
20206 p_create_infos.len() as u32,
20207 p_create_infos.as_ptr(),
20208 alloc_ptr,
20209 out.as_mut_ptr(),
20210 )
20211 })?;
20212 Ok(out)
20213 }
20214 ///Wraps [`vkDestroyShaderEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyShaderEXT.html).
20215 /**
20216 Provided by **VK_EXT_shader_object**.*/
20217 ///
20218 ///# Safety
20219 ///- `device` (self) must be valid and not destroyed.
20220 ///- `shader` must be externally synchronized.
20221 ///
20222 ///# Panics
20223 ///Panics if `vkDestroyShaderEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20224 ///
20225 ///# Usage Notes
20226 ///
20227 ///Destroys a shader object created with `create_shaders_ext`.
20228 ///
20229 ///Requires `VK_EXT_shader_object`.
20230 pub unsafe fn destroy_shader_ext(
20231 &self,
20232 shader: ShaderEXT,
20233 allocator: Option<&AllocationCallbacks>,
20234 ) {
20235 let fp = self
20236 .commands()
20237 .destroy_shader_ext
20238 .expect("vkDestroyShaderEXT not loaded");
20239 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
20240 unsafe { fp(self.handle(), shader, alloc_ptr) };
20241 }
20242 ///Wraps [`vkGetShaderBinaryDataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetShaderBinaryDataEXT.html).
20243 /**
20244 Provided by **VK_EXT_shader_object**.*/
20245 ///
20246 ///# Errors
20247 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20248 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
20249 ///- `VK_ERROR_UNKNOWN`
20250 ///- `VK_ERROR_VALIDATION_FAILED`
20251 ///
20252 ///# Safety
20253 ///- `device` (self) must be valid and not destroyed.
20254 ///
20255 ///# Panics
20256 ///Panics if `vkGetShaderBinaryDataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20257 ///
20258 ///# Usage Notes
20259 ///
20260 ///Retrieves the binary representation of a compiled shader object.
20261 ///The binary data can be cached to disk and used to create shader
20262 ///objects without recompiling from SPIR-V on subsequent runs.
20263 ///
20264 ///Call once with a null buffer to query the size, then again with
20265 ///an appropriately sized buffer. Shader binaries are
20266 ///implementation-specific and not portable between devices or
20267 ///driver versions.
20268 ///
20269 ///Requires `VK_EXT_shader_object`.
20270 pub unsafe fn get_shader_binary_data_ext(
20271 &self,
20272 shader: ShaderEXT,
20273 p_data: *mut core::ffi::c_void,
20274 ) -> VkResult<usize> {
20275 let fp = self
20276 .commands()
20277 .get_shader_binary_data_ext
20278 .expect("vkGetShaderBinaryDataEXT not loaded");
20279 let mut out = unsafe { core::mem::zeroed() };
20280 check(unsafe { fp(self.handle(), shader, &mut out, p_data) })?;
20281 Ok(out)
20282 }
20283 ///Wraps [`vkCmdBindShadersEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindShadersEXT.html).
20284 /**
20285 Provided by **VK_EXT_shader_object**.*/
20286 ///
20287 ///# Safety
20288 ///- `commandBuffer` (self) must be valid and not destroyed.
20289 ///- `commandBuffer` must be externally synchronized.
20290 ///
20291 ///# Panics
20292 ///Panics if `vkCmdBindShadersEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20293 ///
20294 ///# Usage Notes
20295 ///
20296 ///Binds shader objects to specified shader stages for subsequent
20297 ///draw or dispatch commands. Pass arrays of stages and
20298 ///corresponding shader handles.
20299 ///
20300 ///To unbind a stage, pass a null handle for that stage. All
20301 ///required stages for the draw/dispatch type must be bound.
20302 ///
20303 ///When using shader objects, you must also set all relevant dynamic
20304 ///state, there is no pipeline to provide defaults.
20305 ///
20306 ///Requires `VK_EXT_shader_object`.
20307 pub unsafe fn cmd_bind_shaders_ext(
20308 &self,
20309 command_buffer: CommandBuffer,
20310 p_stages: &[ShaderStageFlagBits],
20311 p_shaders: &[ShaderEXT],
20312 ) {
20313 let fp = self
20314 .commands()
20315 .cmd_bind_shaders_ext
20316 .expect("vkCmdBindShadersEXT not loaded");
20317 unsafe {
20318 fp(
20319 command_buffer,
20320 p_stages.len() as u32,
20321 p_stages.as_ptr(),
20322 p_shaders.as_ptr(),
20323 )
20324 };
20325 }
20326 ///Wraps [`vkSetSwapchainPresentTimingQueueSizeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetSwapchainPresentTimingQueueSizeEXT.html).
20327 /**
20328 Provided by **VK_EXT_present_timing**.*/
20329 ///
20330 ///# Errors
20331 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20332 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
20333 ///- `VK_ERROR_UNKNOWN`
20334 ///- `VK_ERROR_VALIDATION_FAILED`
20335 ///
20336 ///# Safety
20337 ///- `device` (self) must be valid and not destroyed.
20338 ///- `swapchain` must be externally synchronized.
20339 ///
20340 ///# Panics
20341 ///Panics if `vkSetSwapchainPresentTimingQueueSizeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20342 ///
20343 ///# Usage Notes
20344 ///
20345 ///Sets the maximum number of present timing results the driver
20346 ///will queue for later retrieval via `get_past_presentation_timing_ext`.
20347 ///A larger queue prevents timing data from being lost when the
20348 ///application cannot poll frequently.
20349 ///
20350 ///Requires `VK_EXT_present_timing`.
20351 pub unsafe fn set_swapchain_present_timing_queue_size_ext(
20352 &self,
20353 swapchain: SwapchainKHR,
20354 size: u32,
20355 ) -> VkResult<()> {
20356 let fp = self
20357 .commands()
20358 .set_swapchain_present_timing_queue_size_ext
20359 .expect("vkSetSwapchainPresentTimingQueueSizeEXT not loaded");
20360 check(unsafe { fp(self.handle(), swapchain, size) })
20361 }
20362 ///Wraps [`vkGetSwapchainTimingPropertiesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSwapchainTimingPropertiesEXT.html).
20363 /**
20364 Provided by **VK_EXT_present_timing**.*/
20365 ///
20366 ///# Errors
20367 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20368 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
20369 ///- `VK_ERROR_SURFACE_LOST_KHR`
20370 ///- `VK_ERROR_UNKNOWN`
20371 ///- `VK_ERROR_VALIDATION_FAILED`
20372 ///
20373 ///# Safety
20374 ///- `device` (self) must be valid and not destroyed.
20375 ///- `swapchain` must be externally synchronized.
20376 ///
20377 ///# Panics
20378 ///Panics if `vkGetSwapchainTimingPropertiesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20379 ///
20380 ///# Usage Notes
20381 ///
20382 ///Queries the timing properties of a swapchain, such as the refresh
20383 ///duration and present margin. Use this to calibrate frame pacing
20384 ///and target the display's native refresh interval.
20385 ///
20386 ///Requires `VK_EXT_present_timing`.
20387 pub unsafe fn get_swapchain_timing_properties_ext(
20388 &self,
20389 swapchain: SwapchainKHR,
20390 p_swapchain_timing_properties: &mut SwapchainTimingPropertiesEXT,
20391 ) -> VkResult<u64> {
20392 let fp = self
20393 .commands()
20394 .get_swapchain_timing_properties_ext
20395 .expect("vkGetSwapchainTimingPropertiesEXT not loaded");
20396 let mut out = unsafe { core::mem::zeroed() };
20397 check(unsafe {
20398 fp(
20399 self.handle(),
20400 swapchain,
20401 p_swapchain_timing_properties,
20402 &mut out,
20403 )
20404 })?;
20405 Ok(out)
20406 }
20407 ///Wraps [`vkGetSwapchainTimeDomainPropertiesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSwapchainTimeDomainPropertiesEXT.html).
20408 /**
20409 Provided by **VK_EXT_present_timing**.*/
20410 ///
20411 ///# Errors
20412 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20413 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
20414 ///- `VK_ERROR_SURFACE_LOST_KHR`
20415 ///- `VK_ERROR_UNKNOWN`
20416 ///- `VK_ERROR_VALIDATION_FAILED`
20417 ///
20418 ///# Safety
20419 ///- `device` (self) must be valid and not destroyed.
20420 ///- `swapchain` must be externally synchronized.
20421 ///
20422 ///# Panics
20423 ///Panics if `vkGetSwapchainTimeDomainPropertiesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20424 ///
20425 ///# Usage Notes
20426 ///
20427 ///Queries which time domains the swapchain supports for present
20428 ///timing. Use this to determine whether you can correlate present
20429 ///timestamps with the system clock or device-specific counters.
20430 ///
20431 ///Requires `VK_EXT_present_timing`.
20432 pub unsafe fn get_swapchain_time_domain_properties_ext(
20433 &self,
20434 swapchain: SwapchainKHR,
20435 p_swapchain_time_domain_properties: &mut SwapchainTimeDomainPropertiesEXT,
20436 ) -> VkResult<u64> {
20437 let fp = self
20438 .commands()
20439 .get_swapchain_time_domain_properties_ext
20440 .expect("vkGetSwapchainTimeDomainPropertiesEXT not loaded");
20441 let mut out = unsafe { core::mem::zeroed() };
20442 check(unsafe {
20443 fp(
20444 self.handle(),
20445 swapchain,
20446 p_swapchain_time_domain_properties,
20447 &mut out,
20448 )
20449 })?;
20450 Ok(out)
20451 }
20452 ///Wraps [`vkGetPastPresentationTimingEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPastPresentationTimingEXT.html).
20453 /**
20454 Provided by **VK_EXT_present_timing**.*/
20455 ///
20456 ///# Errors
20457 ///- `VK_ERROR_DEVICE_LOST`
20458 ///- `VK_ERROR_OUT_OF_DATE_KHR`
20459 ///- `VK_ERROR_SURFACE_LOST_KHR`
20460 ///- `VK_ERROR_UNKNOWN`
20461 ///- `VK_ERROR_VALIDATION_FAILED`
20462 ///
20463 ///# Safety
20464 ///- `device` (self) must be valid and not destroyed.
20465 ///
20466 ///# Panics
20467 ///Panics if `vkGetPastPresentationTimingEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20468 ///
20469 ///# Usage Notes
20470 ///
20471 ///Retrieves presentation timing data for previously presented images.
20472 ///Use this to measure actual vs. requested present times and detect
20473 ///missed frames or compositor latency.
20474 ///
20475 ///Requires `VK_EXT_present_timing`.
20476 pub unsafe fn get_past_presentation_timing_ext(
20477 &self,
20478 p_past_presentation_timing_info: &PastPresentationTimingInfoEXT,
20479 p_past_presentation_timing_properties: &mut PastPresentationTimingPropertiesEXT,
20480 ) -> VkResult<()> {
20481 let fp = self
20482 .commands()
20483 .get_past_presentation_timing_ext
20484 .expect("vkGetPastPresentationTimingEXT not loaded");
20485 check(unsafe {
20486 fp(
20487 self.handle(),
20488 p_past_presentation_timing_info,
20489 p_past_presentation_timing_properties,
20490 )
20491 })
20492 }
20493 ///Wraps [`vkGetScreenBufferPropertiesQNX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetScreenBufferPropertiesQNX.html).
20494 /**
20495 Provided by **VK_QNX_external_memory_screen_buffer**.*/
20496 ///
20497 ///# Errors
20498 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20499 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR`
20500 ///- `VK_ERROR_UNKNOWN`
20501 ///- `VK_ERROR_VALIDATION_FAILED`
20502 ///
20503 ///# Safety
20504 ///- `device` (self) must be valid and not destroyed.
20505 ///
20506 ///# Panics
20507 ///Panics if `vkGetScreenBufferPropertiesQNX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20508 ///
20509 ///# Usage Notes
20510 ///
20511 ///Queries Vulkan memory properties for a QNX Screen buffer. Use
20512 ///before importing the buffer as Vulkan memory to determine
20513 ///compatible memory types and size. QNX only.
20514 ///
20515 ///Requires `VK_QNX_external_memory_screen_buffer`.
20516 pub unsafe fn get_screen_buffer_properties_qnx(
20517 &self,
20518 buffer: *const core::ffi::c_void,
20519 p_properties: &mut ScreenBufferPropertiesQNX,
20520 ) -> VkResult<()> {
20521 let fp = self
20522 .commands()
20523 .get_screen_buffer_properties_qnx
20524 .expect("vkGetScreenBufferPropertiesQNX not loaded");
20525 check(unsafe { fp(self.handle(), buffer, p_properties) })
20526 }
20527 ///Wraps [`vkGetExecutionGraphPipelineScratchSizeAMDX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetExecutionGraphPipelineScratchSizeAMDX.html).
20528 /**
20529 Provided by **VK_AMDX_shader_enqueue**.*/
20530 ///
20531 ///# Errors
20532 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20533 ///- `VK_ERROR_UNKNOWN`
20534 ///- `VK_ERROR_VALIDATION_FAILED`
20535 ///
20536 ///# Safety
20537 ///- `device` (self) must be valid and not destroyed.
20538 ///
20539 ///# Panics
20540 ///Panics if `vkGetExecutionGraphPipelineScratchSizeAMDX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20541 ///
20542 ///# Usage Notes
20543 ///
20544 ///Queries the scratch memory size required to execute an execution
20545 ///graph pipeline. Allocate a buffer of at least this size and
20546 ///initialize it with `cmd_initialize_graph_scratch_memory_amdx`
20547 ///before dispatching the graph.
20548 ///
20549 ///Requires `VK_AMDX_shader_enqueue`.
20550 pub unsafe fn get_execution_graph_pipeline_scratch_size_amdx(
20551 &self,
20552 execution_graph: Pipeline,
20553 p_size_info: &mut ExecutionGraphPipelineScratchSizeAMDX,
20554 ) -> VkResult<()> {
20555 let fp = self
20556 .commands()
20557 .get_execution_graph_pipeline_scratch_size_amdx
20558 .expect("vkGetExecutionGraphPipelineScratchSizeAMDX not loaded");
20559 check(unsafe { fp(self.handle(), execution_graph, p_size_info) })
20560 }
20561 ///Wraps [`vkGetExecutionGraphPipelineNodeIndexAMDX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetExecutionGraphPipelineNodeIndexAMDX.html).
20562 /**
20563 Provided by **VK_AMDX_shader_enqueue**.*/
20564 ///
20565 ///# Errors
20566 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20567 ///- `VK_ERROR_UNKNOWN`
20568 ///- `VK_ERROR_VALIDATION_FAILED`
20569 ///
20570 ///# Safety
20571 ///- `device` (self) must be valid and not destroyed.
20572 ///
20573 ///# Panics
20574 ///Panics if `vkGetExecutionGraphPipelineNodeIndexAMDX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20575 ///
20576 ///# Usage Notes
20577 ///
20578 ///Queries the node index for a named shader node in an execution
20579 ///graph pipeline. The index is used when dispatching or enqueuing
20580 ///work to a specific node in the graph.
20581 ///
20582 ///Requires `VK_AMDX_shader_enqueue`.
20583 pub unsafe fn get_execution_graph_pipeline_node_index_amdx(
20584 &self,
20585 execution_graph: Pipeline,
20586 p_node_info: &PipelineShaderStageNodeCreateInfoAMDX,
20587 ) -> VkResult<u32> {
20588 let fp = self
20589 .commands()
20590 .get_execution_graph_pipeline_node_index_amdx
20591 .expect("vkGetExecutionGraphPipelineNodeIndexAMDX not loaded");
20592 let mut out = unsafe { core::mem::zeroed() };
20593 check(unsafe { fp(self.handle(), execution_graph, p_node_info, &mut out) })?;
20594 Ok(out)
20595 }
20596 ///Wraps [`vkCreateExecutionGraphPipelinesAMDX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateExecutionGraphPipelinesAMDX.html).
20597 /**
20598 Provided by **VK_AMDX_shader_enqueue**.*/
20599 ///
20600 ///# Errors
20601 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20602 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
20603 ///- `VK_ERROR_UNKNOWN`
20604 ///- `VK_ERROR_VALIDATION_FAILED`
20605 ///
20606 ///# Safety
20607 ///- `device` (self) must be valid and not destroyed.
20608 ///- `pipelineCache` must be externally synchronized.
20609 ///
20610 ///# Panics
20611 ///Panics if `vkCreateExecutionGraphPipelinesAMDX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20612 ///
20613 ///# Usage Notes
20614 ///
20615 ///Creates one or more execution graph pipelines for GPU-driven
20616 ///shader dispatch. An execution graph is a DAG of shader nodes
20617 ///where each node can enqueue work to other nodes, enabling complex
20618 ///GPU-driven workflows without CPU round-trips.
20619 ///
20620 ///Requires `VK_AMDX_shader_enqueue`.
20621 pub unsafe fn create_execution_graph_pipelines_amdx(
20622 &self,
20623 pipeline_cache: PipelineCache,
20624 p_create_infos: &[ExecutionGraphPipelineCreateInfoAMDX],
20625 allocator: Option<&AllocationCallbacks>,
20626 ) -> VkResult<Vec<Pipeline>> {
20627 let fp = self
20628 .commands()
20629 .create_execution_graph_pipelines_amdx
20630 .expect("vkCreateExecutionGraphPipelinesAMDX not loaded");
20631 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
20632 let count = p_create_infos.len();
20633 let mut out = vec![unsafe { core::mem::zeroed() }; count];
20634 check(unsafe {
20635 fp(
20636 self.handle(),
20637 pipeline_cache,
20638 p_create_infos.len() as u32,
20639 p_create_infos.as_ptr(),
20640 alloc_ptr,
20641 out.as_mut_ptr(),
20642 )
20643 })?;
20644 Ok(out)
20645 }
20646 ///Wraps [`vkCmdInitializeGraphScratchMemoryAMDX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdInitializeGraphScratchMemoryAMDX.html).
20647 /**
20648 Provided by **VK_AMDX_shader_enqueue**.*/
20649 ///
20650 ///# Safety
20651 ///- `commandBuffer` (self) must be valid and not destroyed.
20652 ///
20653 ///# Panics
20654 ///Panics if `vkCmdInitializeGraphScratchMemoryAMDX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20655 ///
20656 ///# Usage Notes
20657 ///
20658 ///Initializes the scratch memory buffer for an execution graph
20659 ///pipeline. Must be called before any `cmd_dispatch_graph_*_amdx`
20660 ///command that uses this scratch buffer.
20661 ///
20662 ///Requires `VK_AMDX_shader_enqueue`.
20663 pub unsafe fn cmd_initialize_graph_scratch_memory_amdx(
20664 &self,
20665 command_buffer: CommandBuffer,
20666 execution_graph: Pipeline,
20667 scratch: u64,
20668 scratch_size: u64,
20669 ) {
20670 let fp = self
20671 .commands()
20672 .cmd_initialize_graph_scratch_memory_amdx
20673 .expect("vkCmdInitializeGraphScratchMemoryAMDX not loaded");
20674 unsafe { fp(command_buffer, execution_graph, scratch, scratch_size) };
20675 }
20676 ///Wraps [`vkCmdDispatchGraphAMDX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDispatchGraphAMDX.html).
20677 /**
20678 Provided by **VK_AMDX_shader_enqueue**.*/
20679 ///
20680 ///# Safety
20681 ///- `commandBuffer` (self) must be valid and not destroyed.
20682 ///
20683 ///# Panics
20684 ///Panics if `vkCmdDispatchGraphAMDX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20685 ///
20686 ///# Usage Notes
20687 ///
20688 ///Dispatches an execution graph starting from the specified root
20689 ///nodes. The scratch buffer must have been initialized with
20690 ///`cmd_initialize_graph_scratch_memory_amdx`.
20691 ///
20692 ///Requires `VK_AMDX_shader_enqueue`.
20693 pub unsafe fn cmd_dispatch_graph_amdx(
20694 &self,
20695 command_buffer: CommandBuffer,
20696 scratch: u64,
20697 scratch_size: u64,
20698 p_count_info: &DispatchGraphCountInfoAMDX,
20699 ) {
20700 let fp = self
20701 .commands()
20702 .cmd_dispatch_graph_amdx
20703 .expect("vkCmdDispatchGraphAMDX not loaded");
20704 unsafe { fp(command_buffer, scratch, scratch_size, p_count_info) };
20705 }
20706 ///Wraps [`vkCmdDispatchGraphIndirectAMDX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDispatchGraphIndirectAMDX.html).
20707 /**
20708 Provided by **VK_AMDX_shader_enqueue**.*/
20709 ///
20710 ///# Safety
20711 ///- `commandBuffer` (self) must be valid and not destroyed.
20712 ///
20713 ///# Panics
20714 ///Panics if `vkCmdDispatchGraphIndirectAMDX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20715 ///
20716 ///# Usage Notes
20717 ///
20718 ///Indirect variant of `cmd_dispatch_graph_amdx`. Reads the graph
20719 ///dispatch payloads from a GPU buffer while the count info is
20720 ///provided on the CPU side.
20721 ///
20722 ///Requires `VK_AMDX_shader_enqueue`.
20723 pub unsafe fn cmd_dispatch_graph_indirect_amdx(
20724 &self,
20725 command_buffer: CommandBuffer,
20726 scratch: u64,
20727 scratch_size: u64,
20728 p_count_info: &DispatchGraphCountInfoAMDX,
20729 ) {
20730 let fp = self
20731 .commands()
20732 .cmd_dispatch_graph_indirect_amdx
20733 .expect("vkCmdDispatchGraphIndirectAMDX not loaded");
20734 unsafe { fp(command_buffer, scratch, scratch_size, p_count_info) };
20735 }
20736 ///Wraps [`vkCmdDispatchGraphIndirectCountAMDX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDispatchGraphIndirectCountAMDX.html).
20737 /**
20738 Provided by **VK_AMDX_shader_enqueue**.*/
20739 ///
20740 ///# Safety
20741 ///- `commandBuffer` (self) must be valid and not destroyed.
20742 ///
20743 ///# Panics
20744 ///Panics if `vkCmdDispatchGraphIndirectCountAMDX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20745 ///
20746 ///# Usage Notes
20747 ///
20748 ///Fully indirect variant of `cmd_dispatch_graph_amdx`. Both the
20749 ///dispatch payloads and the count are read from GPU buffers,
20750 ///enabling fully GPU-driven execution graph dispatch.
20751 ///
20752 ///Requires `VK_AMDX_shader_enqueue`.
20753 pub unsafe fn cmd_dispatch_graph_indirect_count_amdx(
20754 &self,
20755 command_buffer: CommandBuffer,
20756 scratch: u64,
20757 scratch_size: u64,
20758 count_info: u64,
20759 ) {
20760 let fp = self
20761 .commands()
20762 .cmd_dispatch_graph_indirect_count_amdx
20763 .expect("vkCmdDispatchGraphIndirectCountAMDX not loaded");
20764 unsafe { fp(command_buffer, scratch, scratch_size, count_info) };
20765 }
20766 ///Wraps [`vkCmdBindDescriptorSets2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindDescriptorSets2.html).
20767 /**
20768 Provided by **VK_COMPUTE_VERSION_1_4**.*/
20769 ///
20770 ///# Safety
20771 ///- `commandBuffer` (self) must be valid and not destroyed.
20772 ///- `commandBuffer` must be externally synchronized.
20773 ///
20774 ///# Panics
20775 ///Panics if `vkCmdBindDescriptorSets2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20776 ///
20777 ///# Usage Notes
20778 ///
20779 ///Vulkan 1.4 version of `cmd_bind_descriptor_sets` that uses an
20780 ///extensible `BindDescriptorSetsInfo` struct.
20781 ///
20782 ///Functionally equivalent to the 1.0 version. The extensible struct
20783 ///enables future extensions to modify binding behaviour via pNext.
20784 ///
20785 ///Prefer this when targeting Vulkan 1.4+.
20786 pub unsafe fn cmd_bind_descriptor_sets2(
20787 &self,
20788 command_buffer: CommandBuffer,
20789 p_bind_descriptor_sets_info: &BindDescriptorSetsInfo,
20790 ) {
20791 let fp = self
20792 .commands()
20793 .cmd_bind_descriptor_sets2
20794 .expect("vkCmdBindDescriptorSets2 not loaded");
20795 unsafe { fp(command_buffer, p_bind_descriptor_sets_info) };
20796 }
20797 ///Wraps [`vkCmdPushConstants2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPushConstants2.html).
20798 /**
20799 Provided by **VK_COMPUTE_VERSION_1_4**.*/
20800 ///
20801 ///# Safety
20802 ///- `commandBuffer` (self) must be valid and not destroyed.
20803 ///- `commandBuffer` must be externally synchronized.
20804 ///
20805 ///# Panics
20806 ///Panics if `vkCmdPushConstants2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20807 ///
20808 ///# Usage Notes
20809 ///
20810 ///Vulkan 1.4 version of `cmd_push_constants` that uses an extensible
20811 ///`PushConstantsInfo` struct.
20812 ///
20813 ///Functionally equivalent to the 1.0 version. Prefer this when
20814 ///targeting Vulkan 1.4+.
20815 pub unsafe fn cmd_push_constants2(
20816 &self,
20817 command_buffer: CommandBuffer,
20818 p_push_constants_info: &PushConstantsInfo,
20819 ) {
20820 let fp = self
20821 .commands()
20822 .cmd_push_constants2
20823 .expect("vkCmdPushConstants2 not loaded");
20824 unsafe { fp(command_buffer, p_push_constants_info) };
20825 }
20826 ///Wraps [`vkCmdPushDescriptorSet2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPushDescriptorSet2.html).
20827 /**
20828 Provided by **VK_COMPUTE_VERSION_1_4**.*/
20829 ///
20830 ///# Safety
20831 ///- `commandBuffer` (self) must be valid and not destroyed.
20832 ///- `commandBuffer` must be externally synchronized.
20833 ///
20834 ///# Panics
20835 ///Panics if `vkCmdPushDescriptorSet2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20836 ///
20837 ///# Usage Notes
20838 ///
20839 ///Vulkan 1.4 version of `cmd_push_descriptor_set` that uses an
20840 ///extensible `PushDescriptorSetInfo` struct.
20841 ///
20842 ///Functionally equivalent to the base version. Prefer this when
20843 ///targeting Vulkan 1.4+.
20844 pub unsafe fn cmd_push_descriptor_set2(
20845 &self,
20846 command_buffer: CommandBuffer,
20847 p_push_descriptor_set_info: &PushDescriptorSetInfo,
20848 ) {
20849 let fp = self
20850 .commands()
20851 .cmd_push_descriptor_set2
20852 .expect("vkCmdPushDescriptorSet2 not loaded");
20853 unsafe { fp(command_buffer, p_push_descriptor_set_info) };
20854 }
20855 ///Wraps [`vkCmdPushDescriptorSetWithTemplate2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPushDescriptorSetWithTemplate2.html).
20856 /**
20857 Provided by **VK_COMPUTE_VERSION_1_4**.*/
20858 ///
20859 ///# Safety
20860 ///- `commandBuffer` (self) must be valid and not destroyed.
20861 ///- `commandBuffer` must be externally synchronized.
20862 ///
20863 ///# Panics
20864 ///Panics if `vkCmdPushDescriptorSetWithTemplate2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20865 ///
20866 ///# Usage Notes
20867 ///
20868 ///Vulkan 1.4 version of `cmd_push_descriptor_set_with_template` that
20869 ///uses an extensible `PushDescriptorSetWithTemplateInfo` struct.
20870 ///
20871 ///Functionally equivalent to the base version. Prefer this when
20872 ///targeting Vulkan 1.4+.
20873 pub unsafe fn cmd_push_descriptor_set_with_template2(
20874 &self,
20875 command_buffer: CommandBuffer,
20876 p_push_descriptor_set_with_template_info: &PushDescriptorSetWithTemplateInfo,
20877 ) {
20878 let fp = self
20879 .commands()
20880 .cmd_push_descriptor_set_with_template2
20881 .expect("vkCmdPushDescriptorSetWithTemplate2 not loaded");
20882 unsafe { fp(command_buffer, p_push_descriptor_set_with_template_info) };
20883 }
20884 ///Wraps [`vkCmdSetDescriptorBufferOffsets2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDescriptorBufferOffsets2EXT.html).
20885 /**
20886 Provided by **VK_KHR_maintenance6**.*/
20887 ///
20888 ///# Safety
20889 ///- `commandBuffer` (self) must be valid and not destroyed.
20890 ///- `commandBuffer` must be externally synchronized.
20891 ///
20892 ///# Panics
20893 ///Panics if `vkCmdSetDescriptorBufferOffsets2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20894 ///
20895 ///# Usage Notes
20896 ///
20897 ///Extended version of `cmd_set_descriptor_buffer_offsets_ext` that
20898 ///takes a `SetDescriptorBufferOffsetsInfoEXT` struct with pNext
20899 ///extensibility.
20900 ///
20901 ///Sets the offsets into bound descriptor buffers for the specified
20902 ///pipeline layout. Each offset points to the start of a descriptor
20903 ///set's data within the bound descriptor buffer.
20904 ///
20905 ///Provided by `VK_KHR_maintenance6` (for the pNext-extensible
20906 ///variant of the `VK_EXT_descriptor_buffer` command).
20907 pub unsafe fn cmd_set_descriptor_buffer_offsets2_ext(
20908 &self,
20909 command_buffer: CommandBuffer,
20910 p_set_descriptor_buffer_offsets_info: &SetDescriptorBufferOffsetsInfoEXT,
20911 ) {
20912 let fp = self
20913 .commands()
20914 .cmd_set_descriptor_buffer_offsets2_ext
20915 .expect("vkCmdSetDescriptorBufferOffsets2EXT not loaded");
20916 unsafe { fp(command_buffer, p_set_descriptor_buffer_offsets_info) };
20917 }
20918 ///Wraps [`vkCmdBindDescriptorBufferEmbeddedSamplers2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindDescriptorBufferEmbeddedSamplers2EXT.html).
20919 /**
20920 Provided by **VK_KHR_maintenance6**.*/
20921 ///
20922 ///# Safety
20923 ///- `commandBuffer` (self) must be valid and not destroyed.
20924 ///- `commandBuffer` must be externally synchronized.
20925 ///
20926 ///# Panics
20927 ///Panics if `vkCmdBindDescriptorBufferEmbeddedSamplers2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20928 ///
20929 ///# Usage Notes
20930 ///
20931 ///Extended version of `cmd_bind_descriptor_buffer_embedded_samplers_ext`
20932 ///that takes a `BindDescriptorBufferEmbeddedSamplersInfoEXT` struct
20933 ///with pNext extensibility.
20934 ///
20935 ///Binds embedded immutable samplers from a descriptor set layout
20936 ///that was created with `CREATE_EMBEDDED_IMMUTABLE_SAMPLERS_BIT`.
20937 ///
20938 ///Provided by `VK_KHR_maintenance6` (for the pNext-extensible
20939 ///variant of the `VK_EXT_descriptor_buffer` command).
20940 pub unsafe fn cmd_bind_descriptor_buffer_embedded_samplers2_ext(
20941 &self,
20942 command_buffer: CommandBuffer,
20943 p_bind_descriptor_buffer_embedded_samplers_info: &BindDescriptorBufferEmbeddedSamplersInfoEXT,
20944 ) {
20945 let fp = self
20946 .commands()
20947 .cmd_bind_descriptor_buffer_embedded_samplers2_ext
20948 .expect("vkCmdBindDescriptorBufferEmbeddedSamplers2EXT not loaded");
20949 unsafe {
20950 fp(
20951 command_buffer,
20952 p_bind_descriptor_buffer_embedded_samplers_info,
20953 )
20954 };
20955 }
20956 ///Wraps [`vkSetLatencySleepModeNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetLatencySleepModeNV.html).
20957 /**
20958 Provided by **VK_NV_low_latency2**.*/
20959 ///
20960 ///# Errors
20961 ///- `VK_ERROR_INITIALIZATION_FAILED`
20962 ///- `VK_ERROR_UNKNOWN`
20963 ///- `VK_ERROR_VALIDATION_FAILED`
20964 ///
20965 ///# Safety
20966 ///- `device` (self) must be valid and not destroyed.
20967 ///
20968 ///# Panics
20969 ///Panics if `vkSetLatencySleepModeNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20970 ///
20971 ///# Usage Notes
20972 ///
20973 ///Configures the NVIDIA Reflex low-latency sleep mode for a
20974 ///swapchain. Enables or disables latency sleep and sets the target
20975 ///sleep duration. Call before `latency_sleep_nv` to activate the
20976 ///system.
20977 ///
20978 ///Requires `VK_NV_low_latency2`.
20979 pub unsafe fn set_latency_sleep_mode_nv(
20980 &self,
20981 swapchain: SwapchainKHR,
20982 p_sleep_mode_info: &LatencySleepModeInfoNV,
20983 ) -> VkResult<()> {
20984 let fp = self
20985 .commands()
20986 .set_latency_sleep_mode_nv
20987 .expect("vkSetLatencySleepModeNV not loaded");
20988 check(unsafe { fp(self.handle(), swapchain, p_sleep_mode_info) })
20989 }
20990 ///Wraps [`vkLatencySleepNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkLatencySleepNV.html).
20991 /**
20992 Provided by **VK_NV_low_latency2**.*/
20993 ///
20994 ///# Errors
20995 ///- `VK_ERROR_UNKNOWN`
20996 ///- `VK_ERROR_VALIDATION_FAILED`
20997 ///
20998 ///# Safety
20999 ///- `device` (self) must be valid and not destroyed.
21000 ///
21001 ///# Panics
21002 ///Panics if `vkLatencySleepNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21003 ///
21004 ///# Usage Notes
21005 ///
21006 ///Sleeps the calling thread until the optimal time to begin the
21007 ///next frame, as determined by the NVIDIA Reflex low-latency
21008 ///system. Reduces input-to-display latency by preventing the CPU
21009 ///from running too far ahead of the GPU.
21010 ///
21011 ///Requires `VK_NV_low_latency2`.
21012 pub unsafe fn latency_sleep_nv(
21013 &self,
21014 swapchain: SwapchainKHR,
21015 p_sleep_info: &LatencySleepInfoNV,
21016 ) -> VkResult<()> {
21017 let fp = self
21018 .commands()
21019 .latency_sleep_nv
21020 .expect("vkLatencySleepNV not loaded");
21021 check(unsafe { fp(self.handle(), swapchain, p_sleep_info) })
21022 }
21023 ///Wraps [`vkSetLatencyMarkerNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetLatencyMarkerNV.html).
21024 /**
21025 Provided by **VK_NV_low_latency2**.*/
21026 ///
21027 ///# Safety
21028 ///- `device` (self) must be valid and not destroyed.
21029 ///
21030 ///# Panics
21031 ///Panics if `vkSetLatencyMarkerNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21032 ///
21033 ///# Usage Notes
21034 ///
21035 ///Sets a latency marker at a specific point in the frame lifecycle
21036 ///(simulation start, render start, present, etc.). The markers are
21037 ///later retrieved with `get_latency_timings_nv` to measure per-
21038 ///stage latency.
21039 ///
21040 ///Requires `VK_NV_low_latency2`.
21041 pub unsafe fn set_latency_marker_nv(
21042 &self,
21043 swapchain: SwapchainKHR,
21044 p_latency_marker_info: &SetLatencyMarkerInfoNV,
21045 ) {
21046 let fp = self
21047 .commands()
21048 .set_latency_marker_nv
21049 .expect("vkSetLatencyMarkerNV not loaded");
21050 unsafe { fp(self.handle(), swapchain, p_latency_marker_info) };
21051 }
21052 ///Wraps [`vkGetLatencyTimingsNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetLatencyTimingsNV.html).
21053 /**
21054 Provided by **VK_NV_low_latency2**.*/
21055 ///
21056 ///# Safety
21057 ///- `device` (self) must be valid and not destroyed.
21058 ///
21059 ///# Panics
21060 ///Panics if `vkGetLatencyTimingsNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21061 ///
21062 ///# Usage Notes
21063 ///
21064 ///Retrieves per-frame latency timing data for a swapchain. Returns
21065 ///timestamps for each marker set with `set_latency_marker_nv`,
21066 ///enabling measurement of simulation, render, and present latency.
21067 ///
21068 ///Requires `VK_NV_low_latency2`.
21069 pub unsafe fn get_latency_timings_nv(
21070 &self,
21071 swapchain: SwapchainKHR,
21072 p_latency_marker_info: &mut GetLatencyMarkerInfoNV,
21073 ) {
21074 let fp = self
21075 .commands()
21076 .get_latency_timings_nv
21077 .expect("vkGetLatencyTimingsNV not loaded");
21078 unsafe { fp(self.handle(), swapchain, p_latency_marker_info) };
21079 }
21080 ///Wraps [`vkQueueNotifyOutOfBandNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueNotifyOutOfBandNV.html).
21081 /**
21082 Provided by **VK_NV_low_latency2**.*/
21083 ///
21084 ///# Safety
21085 ///- `queue` (self) must be valid and not destroyed.
21086 ///
21087 ///# Panics
21088 ///Panics if `vkQueueNotifyOutOfBandNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21089 ///
21090 ///# Usage Notes
21091 ///
21092 ///Notifies the low-latency system that a queue submission is
21093 ///out-of-band (e.g., a loading or async compute submission that
21094 ///should not be counted toward frame latency tracking).
21095 ///
21096 ///Requires `VK_NV_low_latency2`.
21097 pub unsafe fn queue_notify_out_of_band_nv(
21098 &self,
21099 queue: Queue,
21100 p_queue_type_info: &OutOfBandQueueTypeInfoNV,
21101 ) {
21102 let fp = self
21103 .commands()
21104 .queue_notify_out_of_band_nv
21105 .expect("vkQueueNotifyOutOfBandNV not loaded");
21106 unsafe { fp(queue, p_queue_type_info) };
21107 }
21108 ///Wraps [`vkCmdSetRenderingAttachmentLocations`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetRenderingAttachmentLocations.html).
21109 /**
21110 Provided by **VK_GRAPHICS_VERSION_1_4**.*/
21111 ///
21112 ///# Safety
21113 ///- `commandBuffer` (self) must be valid and not destroyed.
21114 ///- `commandBuffer` must be externally synchronized.
21115 ///
21116 ///# Panics
21117 ///Panics if `vkCmdSetRenderingAttachmentLocations` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21118 ///
21119 ///# Usage Notes
21120 ///
21121 ///Dynamically remaps colour attachment indices within a dynamic
21122 ///rendering instance. Allows fragment shader outputs to target
21123 ///different attachment slots without changing the pipeline.
21124 ///
21125 ///This is useful when the same shader outputs different data to
21126 ///different attachments depending on the rendering pass (e.g.
21127 ///G-buffer vs forward).
21128 ///
21129 ///Requires `dynamic_rendering_local_read` feature. Core in
21130 ///Vulkan 1.4.
21131 pub unsafe fn cmd_set_rendering_attachment_locations(
21132 &self,
21133 command_buffer: CommandBuffer,
21134 p_location_info: &RenderingAttachmentLocationInfo,
21135 ) {
21136 let fp = self
21137 .commands()
21138 .cmd_set_rendering_attachment_locations
21139 .expect("vkCmdSetRenderingAttachmentLocations not loaded");
21140 unsafe { fp(command_buffer, p_location_info) };
21141 }
21142 ///Wraps [`vkCmdSetRenderingInputAttachmentIndices`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetRenderingInputAttachmentIndices.html).
21143 /**
21144 Provided by **VK_GRAPHICS_VERSION_1_4**.*/
21145 ///
21146 ///# Safety
21147 ///- `commandBuffer` (self) must be valid and not destroyed.
21148 ///- `commandBuffer` must be externally synchronized.
21149 ///
21150 ///# Panics
21151 ///Panics if `vkCmdSetRenderingInputAttachmentIndices` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21152 ///
21153 ///# Usage Notes
21154 ///
21155 ///Dynamically remaps input attachment indices within a dynamic
21156 ///rendering instance. Allows fragment shaders to read from different
21157 ///colour or depth/stencil attachments without changing the pipeline.
21158 ///
21159 ///Paired with `cmd_set_rendering_attachment_locations` to enable
21160 ///flexible attachment routing in multi-pass rendering with dynamic
21161 ///rendering.
21162 ///
21163 ///Requires `dynamic_rendering_local_read` feature. Core in
21164 ///Vulkan 1.4.
21165 pub unsafe fn cmd_set_rendering_input_attachment_indices(
21166 &self,
21167 command_buffer: CommandBuffer,
21168 p_input_attachment_index_info: &RenderingInputAttachmentIndexInfo,
21169 ) {
21170 let fp = self
21171 .commands()
21172 .cmd_set_rendering_input_attachment_indices
21173 .expect("vkCmdSetRenderingInputAttachmentIndices not loaded");
21174 unsafe { fp(command_buffer, p_input_attachment_index_info) };
21175 }
21176 ///Wraps [`vkCmdSetDepthClampRangeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthClampRangeEXT.html).
21177 /**
21178 Provided by **VK_EXT_shader_object**.*/
21179 ///
21180 ///# Safety
21181 ///- `commandBuffer` (self) must be valid and not destroyed.
21182 ///- `commandBuffer` must be externally synchronized.
21183 ///
21184 ///# Panics
21185 ///Panics if `vkCmdSetDepthClampRangeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21186 ///
21187 ///# Usage Notes
21188 ///
21189 ///Dynamically sets the depth clamp range. When depth clamping is
21190 ///enabled, fragments are clamped to the specified min/max depth
21191 ///values instead of the viewport near/far range.
21192 ///
21193 ///Pass null to use the default viewport depth range for clamping.
21194 ///
21195 ///Requires `VK_EXT_depth_clamp_control` and the
21196 ///`depthClampControl` feature.
21197 pub unsafe fn cmd_set_depth_clamp_range_ext(
21198 &self,
21199 command_buffer: CommandBuffer,
21200 depth_clamp_mode: DepthClampModeEXT,
21201 p_depth_clamp_range: Option<&DepthClampRangeEXT>,
21202 ) {
21203 let fp = self
21204 .commands()
21205 .cmd_set_depth_clamp_range_ext
21206 .expect("vkCmdSetDepthClampRangeEXT not loaded");
21207 let p_depth_clamp_range_ptr =
21208 p_depth_clamp_range.map_or(core::ptr::null(), core::ptr::from_ref);
21209 unsafe { fp(command_buffer, depth_clamp_mode, p_depth_clamp_range_ptr) };
21210 }
21211 ///Wraps [`vkGetMemoryMetalHandleEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryMetalHandleEXT.html).
21212 /**
21213 Provided by **VK_EXT_external_memory_metal**.*/
21214 ///
21215 ///# Errors
21216 ///- `VK_ERROR_TOO_MANY_OBJECTS`
21217 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21218 ///- `VK_ERROR_UNKNOWN`
21219 ///- `VK_ERROR_VALIDATION_FAILED`
21220 ///
21221 ///# Safety
21222 ///- `device` (self) must be valid and not destroyed.
21223 ///
21224 ///# Panics
21225 ///Panics if `vkGetMemoryMetalHandleEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21226 ///
21227 ///# Usage Notes
21228 ///
21229 ///Exports a Vulkan device memory allocation as a Metal resource
21230 ///handle for cross-API interop on Apple platforms.
21231 ///
21232 ///Requires `VK_EXT_external_memory_metal`. macOS/iOS only.
21233 pub unsafe fn get_memory_metal_handle_ext(
21234 &self,
21235 p_get_metal_handle_info: &MemoryGetMetalHandleInfoEXT,
21236 p_handle: *mut *mut core::ffi::c_void,
21237 ) -> VkResult<()> {
21238 let fp = self
21239 .commands()
21240 .get_memory_metal_handle_ext
21241 .expect("vkGetMemoryMetalHandleEXT not loaded");
21242 check(unsafe { fp(self.handle(), p_get_metal_handle_info, p_handle) })
21243 }
21244 ///Wraps [`vkGetMemoryMetalHandlePropertiesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryMetalHandlePropertiesEXT.html).
21245 /**
21246 Provided by **VK_EXT_external_memory_metal**.*/
21247 ///
21248 ///# Errors
21249 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21250 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
21251 ///- `VK_ERROR_UNKNOWN`
21252 ///- `VK_ERROR_VALIDATION_FAILED`
21253 ///
21254 ///# Safety
21255 ///- `device` (self) must be valid and not destroyed.
21256 ///
21257 ///# Panics
21258 ///Panics if `vkGetMemoryMetalHandlePropertiesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21259 ///
21260 ///# Usage Notes
21261 ///
21262 ///Queries which Vulkan memory types are compatible with importing
21263 ///a Metal resource handle as external memory. Use before allocating
21264 ///device memory to determine valid memory type bits.
21265 ///
21266 ///Requires `VK_EXT_external_memory_metal`. macOS/iOS only.
21267 pub unsafe fn get_memory_metal_handle_properties_ext(
21268 &self,
21269 handle_type: ExternalMemoryHandleTypeFlagBits,
21270 p_handle: *const core::ffi::c_void,
21271 p_memory_metal_handle_properties: &mut MemoryMetalHandlePropertiesEXT,
21272 ) -> VkResult<()> {
21273 let fp = self
21274 .commands()
21275 .get_memory_metal_handle_properties_ext
21276 .expect("vkGetMemoryMetalHandlePropertiesEXT not loaded");
21277 check(unsafe {
21278 fp(
21279 self.handle(),
21280 handle_type,
21281 p_handle,
21282 p_memory_metal_handle_properties,
21283 )
21284 })
21285 }
21286 ///Wraps [`vkConvertCooperativeVectorMatrixNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkConvertCooperativeVectorMatrixNV.html).
21287 /**
21288 Provided by **VK_NV_cooperative_vector**.*/
21289 ///
21290 ///# Errors
21291 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21292 ///- `VK_ERROR_UNKNOWN`
21293 ///- `VK_ERROR_VALIDATION_FAILED`
21294 ///
21295 ///# Safety
21296 ///- `device` (self) must be valid and not destroyed.
21297 ///
21298 ///# Panics
21299 ///Panics if `vkConvertCooperativeVectorMatrixNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21300 ///
21301 ///# Usage Notes
21302 ///
21303 ///Host-side conversion of cooperative vector matrix data between
21304 ///formats or layouts. Use to prepare weight matrices on the CPU
21305 ///before uploading to the GPU for cooperative vector operations.
21306 ///
21307 ///Requires `VK_NV_cooperative_vector`.
21308 pub unsafe fn convert_cooperative_vector_matrix_nv(
21309 &self,
21310 p_info: &ConvertCooperativeVectorMatrixInfoNV,
21311 ) -> VkResult<()> {
21312 let fp = self
21313 .commands()
21314 .convert_cooperative_vector_matrix_nv
21315 .expect("vkConvertCooperativeVectorMatrixNV not loaded");
21316 check(unsafe { fp(self.handle(), p_info) })
21317 }
21318 ///Wraps [`vkCmdConvertCooperativeVectorMatrixNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdConvertCooperativeVectorMatrixNV.html).
21319 /**
21320 Provided by **VK_NV_cooperative_vector**.*/
21321 ///
21322 ///# Safety
21323 ///- `commandBuffer` (self) must be valid and not destroyed.
21324 ///- `commandBuffer` must be externally synchronized.
21325 ///
21326 ///# Panics
21327 ///Panics if `vkCmdConvertCooperativeVectorMatrixNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21328 ///
21329 ///# Usage Notes
21330 ///
21331 ///GPU-side conversion of cooperative vector matrix data between
21332 ///formats or layouts. Converts one or more matrices in a command
21333 ///buffer. Use for repacking weight matrices for neural network
21334 ///inference on the GPU.
21335 ///
21336 ///Requires `VK_NV_cooperative_vector`.
21337 pub unsafe fn cmd_convert_cooperative_vector_matrix_nv(
21338 &self,
21339 command_buffer: CommandBuffer,
21340 p_infos: &[ConvertCooperativeVectorMatrixInfoNV],
21341 ) {
21342 let fp = self
21343 .commands()
21344 .cmd_convert_cooperative_vector_matrix_nv
21345 .expect("vkCmdConvertCooperativeVectorMatrixNV not loaded");
21346 unsafe { fp(command_buffer, p_infos.len() as u32, p_infos.as_ptr()) };
21347 }
21348 ///Wraps [`vkCmdDispatchTileQCOM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDispatchTileQCOM.html).
21349 /**
21350 Provided by **VK_QCOM_tile_shading**.*/
21351 ///
21352 ///# Safety
21353 ///- `commandBuffer` (self) must be valid and not destroyed.
21354 ///
21355 ///# Panics
21356 ///Panics if `vkCmdDispatchTileQCOM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21357 ///
21358 ///# Usage Notes
21359 ///
21360 ///Dispatches compute work within a per-tile execution region on
21361 ///Qualcomm tile-based GPUs. Must be called between
21362 ///`cmd_begin_per_tile_execution_qcom` and
21363 ///`cmd_end_per_tile_execution_qcom`.
21364 ///
21365 ///Requires `VK_QCOM_tile_shading`.
21366 pub unsafe fn cmd_dispatch_tile_qcom(
21367 &self,
21368 command_buffer: CommandBuffer,
21369 p_dispatch_tile_info: &DispatchTileInfoQCOM,
21370 ) {
21371 let fp = self
21372 .commands()
21373 .cmd_dispatch_tile_qcom
21374 .expect("vkCmdDispatchTileQCOM not loaded");
21375 unsafe { fp(command_buffer, p_dispatch_tile_info) };
21376 }
21377 ///Wraps [`vkCmdBeginPerTileExecutionQCOM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginPerTileExecutionQCOM.html).
21378 /**
21379 Provided by **VK_QCOM_tile_shading**.*/
21380 ///
21381 ///# Safety
21382 ///- `commandBuffer` (self) must be valid and not destroyed.
21383 ///
21384 ///# Panics
21385 ///Panics if `vkCmdBeginPerTileExecutionQCOM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21386 ///
21387 ///# Usage Notes
21388 ///
21389 ///Begins a per-tile execution region within a render pass on
21390 ///Qualcomm tile-based GPUs. Commands recorded between this and
21391 ///`cmd_end_per_tile_execution_qcom` are executed once per tile,
21392 ///enabling tile-local compute and shading optimisations.
21393 ///
21394 ///Requires `VK_QCOM_tile_shading`.
21395 pub unsafe fn cmd_begin_per_tile_execution_qcom(
21396 &self,
21397 command_buffer: CommandBuffer,
21398 p_per_tile_begin_info: &PerTileBeginInfoQCOM,
21399 ) {
21400 let fp = self
21401 .commands()
21402 .cmd_begin_per_tile_execution_qcom
21403 .expect("vkCmdBeginPerTileExecutionQCOM not loaded");
21404 unsafe { fp(command_buffer, p_per_tile_begin_info) };
21405 }
21406 ///Wraps [`vkCmdEndPerTileExecutionQCOM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndPerTileExecutionQCOM.html).
21407 /**
21408 Provided by **VK_QCOM_tile_shading**.*/
21409 ///
21410 ///# Safety
21411 ///- `commandBuffer` (self) must be valid and not destroyed.
21412 ///
21413 ///# Panics
21414 ///Panics if `vkCmdEndPerTileExecutionQCOM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21415 ///
21416 ///# Usage Notes
21417 ///
21418 ///Ends a per-tile execution region started by
21419 ///`cmd_begin_per_tile_execution_qcom`. After this call, the
21420 ///command buffer returns to normal (non-tile-local) recording.
21421 ///
21422 ///Requires `VK_QCOM_tile_shading`.
21423 pub unsafe fn cmd_end_per_tile_execution_qcom(
21424 &self,
21425 command_buffer: CommandBuffer,
21426 p_per_tile_end_info: &PerTileEndInfoQCOM,
21427 ) {
21428 let fp = self
21429 .commands()
21430 .cmd_end_per_tile_execution_qcom
21431 .expect("vkCmdEndPerTileExecutionQCOM not loaded");
21432 unsafe { fp(command_buffer, p_per_tile_end_info) };
21433 }
21434 ///Wraps [`vkCreateExternalComputeQueueNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateExternalComputeQueueNV.html).
21435 /**
21436 Provided by **VK_NV_external_compute_queue**.*/
21437 ///
21438 ///# Errors
21439 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21440 ///- `VK_ERROR_TOO_MANY_OBJECTS`
21441 ///- `VK_ERROR_UNKNOWN`
21442 ///- `VK_ERROR_VALIDATION_FAILED`
21443 ///
21444 ///# Safety
21445 ///- `device` (self) must be valid and not destroyed.
21446 ///
21447 ///# Panics
21448 ///Panics if `vkCreateExternalComputeQueueNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21449 ///
21450 ///# Usage Notes
21451 ///
21452 ///Creates an external compute queue that can be used to submit
21453 ///work from outside the Vulkan runtime (e.g., CUDA interop).
21454 ///Destroy with `destroy_external_compute_queue_nv`.
21455 ///
21456 ///Requires `VK_NV_external_compute_queue`.
21457 pub unsafe fn create_external_compute_queue_nv(
21458 &self,
21459 p_create_info: &ExternalComputeQueueCreateInfoNV,
21460 allocator: Option<&AllocationCallbacks>,
21461 ) -> VkResult<ExternalComputeQueueNV> {
21462 let fp = self
21463 .commands()
21464 .create_external_compute_queue_nv
21465 .expect("vkCreateExternalComputeQueueNV not loaded");
21466 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
21467 let mut out = unsafe { core::mem::zeroed() };
21468 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
21469 Ok(out)
21470 }
21471 ///Wraps [`vkDestroyExternalComputeQueueNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyExternalComputeQueueNV.html).
21472 /**
21473 Provided by **VK_NV_external_compute_queue**.*/
21474 ///
21475 ///# Safety
21476 ///- `device` (self) must be valid and not destroyed.
21477 ///
21478 ///# Panics
21479 ///Panics if `vkDestroyExternalComputeQueueNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21480 ///
21481 ///# Usage Notes
21482 ///
21483 ///Destroys an external compute queue created with
21484 ///`create_external_compute_queue_nv`.
21485 ///
21486 ///Requires `VK_NV_external_compute_queue`.
21487 pub unsafe fn destroy_external_compute_queue_nv(
21488 &self,
21489 external_queue: ExternalComputeQueueNV,
21490 allocator: Option<&AllocationCallbacks>,
21491 ) {
21492 let fp = self
21493 .commands()
21494 .destroy_external_compute_queue_nv
21495 .expect("vkDestroyExternalComputeQueueNV not loaded");
21496 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
21497 unsafe { fp(self.handle(), external_queue, alloc_ptr) };
21498 }
21499 ///Wraps [`vkCreateShaderInstrumentationARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateShaderInstrumentationARM.html).
21500 /**
21501 Provided by **VK_ARM_shader_instrumentation**.*/
21502 ///
21503 ///# Errors
21504 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21505 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
21506 ///- `VK_ERROR_UNKNOWN`
21507 ///- `VK_ERROR_VALIDATION_FAILED`
21508 ///
21509 ///# Safety
21510 ///- `device` (self) must be valid and not destroyed.
21511 ///
21512 ///# Panics
21513 ///Panics if `vkCreateShaderInstrumentationARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21514 ///
21515 ///# Usage Notes
21516 ///
21517 ///Creates a shader instrumentation object that configures which
21518 ///metrics to collect during shader execution. The instrumentation
21519 ///is later bound to command buffers with
21520 ///`cmd_begin_shader_instrumentation_arm`.
21521 ///
21522 ///Requires `VK_ARM_shader_instrumentation`.
21523 pub unsafe fn create_shader_instrumentation_arm(
21524 &self,
21525 p_create_info: &ShaderInstrumentationCreateInfoARM,
21526 allocator: Option<&AllocationCallbacks>,
21527 ) -> VkResult<ShaderInstrumentationARM> {
21528 let fp = self
21529 .commands()
21530 .create_shader_instrumentation_arm
21531 .expect("vkCreateShaderInstrumentationARM not loaded");
21532 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
21533 let mut out = unsafe { core::mem::zeroed() };
21534 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
21535 Ok(out)
21536 }
21537 ///Wraps [`vkDestroyShaderInstrumentationARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyShaderInstrumentationARM.html).
21538 /**
21539 Provided by **VK_ARM_shader_instrumentation**.*/
21540 ///
21541 ///# Safety
21542 ///- `device` (self) must be valid and not destroyed.
21543 ///- `instrumentation` must be externally synchronized.
21544 ///
21545 ///# Panics
21546 ///Panics if `vkDestroyShaderInstrumentationARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21547 ///
21548 ///# Usage Notes
21549 ///
21550 ///Destroys a shader instrumentation object. The object must not be
21551 ///in use by any command buffer.
21552 ///
21553 ///Requires `VK_ARM_shader_instrumentation`.
21554 pub unsafe fn destroy_shader_instrumentation_arm(
21555 &self,
21556 instrumentation: ShaderInstrumentationARM,
21557 allocator: Option<&AllocationCallbacks>,
21558 ) {
21559 let fp = self
21560 .commands()
21561 .destroy_shader_instrumentation_arm
21562 .expect("vkDestroyShaderInstrumentationARM not loaded");
21563 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
21564 unsafe { fp(self.handle(), instrumentation, alloc_ptr) };
21565 }
21566 ///Wraps [`vkCmdBeginShaderInstrumentationARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginShaderInstrumentationARM.html).
21567 /**
21568 Provided by **VK_ARM_shader_instrumentation**.*/
21569 ///
21570 ///# Safety
21571 ///- `commandBuffer` (self) must be valid and not destroyed.
21572 ///- `commandBuffer` must be externally synchronized.
21573 ///- `instrumentation` must be externally synchronized.
21574 ///
21575 ///# Panics
21576 ///Panics if `vkCmdBeginShaderInstrumentationARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21577 ///
21578 ///# Usage Notes
21579 ///
21580 ///Begins shader instrumentation collection in a command buffer.
21581 ///All subsequent draw and dispatch commands will collect the
21582 ///metrics configured in the instrumentation object until
21583 ///`cmd_end_shader_instrumentation_arm` is called.
21584 ///
21585 ///Requires `VK_ARM_shader_instrumentation`.
21586 pub unsafe fn cmd_begin_shader_instrumentation_arm(
21587 &self,
21588 command_buffer: CommandBuffer,
21589 instrumentation: ShaderInstrumentationARM,
21590 ) {
21591 let fp = self
21592 .commands()
21593 .cmd_begin_shader_instrumentation_arm
21594 .expect("vkCmdBeginShaderInstrumentationARM not loaded");
21595 unsafe { fp(command_buffer, instrumentation) };
21596 }
21597 ///Wraps [`vkCmdEndShaderInstrumentationARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndShaderInstrumentationARM.html).
21598 /**
21599 Provided by **VK_ARM_shader_instrumentation**.*/
21600 ///
21601 ///# Safety
21602 ///- `commandBuffer` (self) must be valid and not destroyed.
21603 ///- `commandBuffer` must be externally synchronized.
21604 ///
21605 ///# Panics
21606 ///Panics if `vkCmdEndShaderInstrumentationARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21607 ///
21608 ///# Usage Notes
21609 ///
21610 ///Ends shader instrumentation collection in a command buffer.
21611 ///Metrics collected since the matching
21612 ///`cmd_begin_shader_instrumentation_arm` can be retrieved with
21613 ///`get_shader_instrumentation_values_arm` after submission
21614 ///completes.
21615 ///
21616 ///Requires `VK_ARM_shader_instrumentation`.
21617 pub unsafe fn cmd_end_shader_instrumentation_arm(&self, command_buffer: CommandBuffer) {
21618 let fp = self
21619 .commands()
21620 .cmd_end_shader_instrumentation_arm
21621 .expect("vkCmdEndShaderInstrumentationARM not loaded");
21622 unsafe { fp(command_buffer) };
21623 }
21624 ///Wraps [`vkGetShaderInstrumentationValuesARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetShaderInstrumentationValuesARM.html).
21625 /**
21626 Provided by **VK_ARM_shader_instrumentation**.*/
21627 ///
21628 ///# Errors
21629 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21630 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
21631 ///- `VK_ERROR_UNKNOWN`
21632 ///- `VK_ERROR_VALIDATION_FAILED`
21633 ///
21634 ///# Safety
21635 ///- `device` (self) must be valid and not destroyed.
21636 ///
21637 ///# Panics
21638 ///Panics if `vkGetShaderInstrumentationValuesARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21639 ///
21640 ///# Usage Notes
21641 ///
21642 ///Retrieves collected shader instrumentation metric values after
21643 ///instrumented commands have completed execution. Returns metric
21644 ///blocks whose count is written to `p_metric_block_count`. Ensure
21645 ///the instrumented submission has finished before querying.
21646 ///
21647 ///Requires `VK_ARM_shader_instrumentation`.
21648 pub unsafe fn get_shader_instrumentation_values_arm(
21649 &self,
21650 instrumentation: ShaderInstrumentationARM,
21651 p_metric_block_count: *mut u32,
21652 flags: ShaderInstrumentationValuesFlagsARM,
21653 ) -> VkResult<core::ffi::c_void> {
21654 let fp = self
21655 .commands()
21656 .get_shader_instrumentation_values_arm
21657 .expect("vkGetShaderInstrumentationValuesARM not loaded");
21658 let mut out = unsafe { core::mem::zeroed() };
21659 check(unsafe {
21660 fp(
21661 self.handle(),
21662 instrumentation,
21663 p_metric_block_count,
21664 &mut out,
21665 flags,
21666 )
21667 })?;
21668 Ok(out)
21669 }
21670 ///Wraps [`vkClearShaderInstrumentationMetricsARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkClearShaderInstrumentationMetricsARM.html).
21671 /**
21672 Provided by **VK_ARM_shader_instrumentation**.*/
21673 ///
21674 ///# Safety
21675 ///- `device` (self) must be valid and not destroyed.
21676 ///
21677 ///# Panics
21678 ///Panics if `vkClearShaderInstrumentationMetricsARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21679 ///
21680 ///# Usage Notes
21681 ///
21682 ///Resets accumulated metrics for a shader instrumentation object.
21683 ///Call between frames or profiling sessions to start collecting
21684 ///fresh data without destroying and recreating the object.
21685 ///
21686 ///Requires `VK_ARM_shader_instrumentation`.
21687 pub unsafe fn clear_shader_instrumentation_metrics_arm(
21688 &self,
21689 instrumentation: ShaderInstrumentationARM,
21690 ) {
21691 let fp = self
21692 .commands()
21693 .clear_shader_instrumentation_metrics_arm
21694 .expect("vkClearShaderInstrumentationMetricsARM not loaded");
21695 unsafe { fp(self.handle(), instrumentation) };
21696 }
21697 ///Wraps [`vkCreateTensorARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateTensorARM.html).
21698 /**
21699 Provided by **VK_ARM_tensors**.*/
21700 ///
21701 ///# Errors
21702 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21703 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
21704 ///- `VK_ERROR_UNKNOWN`
21705 ///- `VK_ERROR_VALIDATION_FAILED`
21706 ///
21707 ///# Safety
21708 ///- `device` (self) must be valid and not destroyed.
21709 ///
21710 ///# Panics
21711 ///Panics if `vkCreateTensorARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21712 ///
21713 ///# Usage Notes
21714 ///
21715 ///Creates a tensor object for ARM's tensor extension. Tensors are
21716 ///multi-dimensional arrays with a defined format, dimensions, and
21717 ///usage flags. Must be bound to memory before use, similar to
21718 ///images and buffers.
21719 ///
21720 ///Requires `VK_ARM_tensors`.
21721 pub unsafe fn create_tensor_arm(
21722 &self,
21723 p_create_info: &TensorCreateInfoARM,
21724 allocator: Option<&AllocationCallbacks>,
21725 ) -> VkResult<TensorARM> {
21726 let fp = self
21727 .commands()
21728 .create_tensor_arm
21729 .expect("vkCreateTensorARM not loaded");
21730 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
21731 let mut out = unsafe { core::mem::zeroed() };
21732 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
21733 Ok(out)
21734 }
21735 ///Wraps [`vkDestroyTensorARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyTensorARM.html).
21736 /**
21737 Provided by **VK_ARM_tensors**.*/
21738 ///
21739 ///# Safety
21740 ///- `device` (self) must be valid and not destroyed.
21741 ///- `tensor` must be externally synchronized.
21742 ///
21743 ///# Panics
21744 ///Panics if `vkDestroyTensorARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21745 ///
21746 ///# Usage Notes
21747 ///
21748 ///Destroys a tensor object. The tensor must not be in use by any
21749 ///command buffer or referenced by any tensor view.
21750 ///
21751 ///Requires `VK_ARM_tensors`.
21752 pub unsafe fn destroy_tensor_arm(
21753 &self,
21754 tensor: TensorARM,
21755 allocator: Option<&AllocationCallbacks>,
21756 ) {
21757 let fp = self
21758 .commands()
21759 .destroy_tensor_arm
21760 .expect("vkDestroyTensorARM not loaded");
21761 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
21762 unsafe { fp(self.handle(), tensor, alloc_ptr) };
21763 }
21764 ///Wraps [`vkCreateTensorViewARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateTensorViewARM.html).
21765 /**
21766 Provided by **VK_ARM_tensors**.*/
21767 ///
21768 ///# Errors
21769 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21770 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
21771 ///- `VK_ERROR_UNKNOWN`
21772 ///- `VK_ERROR_VALIDATION_FAILED`
21773 ///
21774 ///# Safety
21775 ///- `device` (self) must be valid and not destroyed.
21776 ///
21777 ///# Panics
21778 ///Panics if `vkCreateTensorViewARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21779 ///
21780 ///# Usage Notes
21781 ///
21782 ///Creates a view into a tensor, analogous to image views. A tensor
21783 ///view selects a subset of the tensor's dimensions or reinterprets
21784 ///its format for use in descriptors and shaders.
21785 ///
21786 ///Requires `VK_ARM_tensors`.
21787 pub unsafe fn create_tensor_view_arm(
21788 &self,
21789 p_create_info: &TensorViewCreateInfoARM,
21790 allocator: Option<&AllocationCallbacks>,
21791 ) -> VkResult<TensorViewARM> {
21792 let fp = self
21793 .commands()
21794 .create_tensor_view_arm
21795 .expect("vkCreateTensorViewARM not loaded");
21796 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
21797 let mut out = unsafe { core::mem::zeroed() };
21798 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
21799 Ok(out)
21800 }
21801 ///Wraps [`vkDestroyTensorViewARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyTensorViewARM.html).
21802 /**
21803 Provided by **VK_ARM_tensors**.*/
21804 ///
21805 ///# Safety
21806 ///- `device` (self) must be valid and not destroyed.
21807 ///- `tensorView` must be externally synchronized.
21808 ///
21809 ///# Panics
21810 ///Panics if `vkDestroyTensorViewARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21811 ///
21812 ///# Usage Notes
21813 ///
21814 ///Destroys a tensor view. The view must not be in use by any
21815 ///command buffer or referenced by any descriptor set.
21816 ///
21817 ///Requires `VK_ARM_tensors`.
21818 pub unsafe fn destroy_tensor_view_arm(
21819 &self,
21820 tensor_view: TensorViewARM,
21821 allocator: Option<&AllocationCallbacks>,
21822 ) {
21823 let fp = self
21824 .commands()
21825 .destroy_tensor_view_arm
21826 .expect("vkDestroyTensorViewARM not loaded");
21827 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
21828 unsafe { fp(self.handle(), tensor_view, alloc_ptr) };
21829 }
21830 ///Wraps [`vkGetTensorMemoryRequirementsARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetTensorMemoryRequirementsARM.html).
21831 /**
21832 Provided by **VK_ARM_tensors**.*/
21833 ///
21834 ///# Safety
21835 ///- `device` (self) must be valid and not destroyed.
21836 ///
21837 ///# Panics
21838 ///Panics if `vkGetTensorMemoryRequirementsARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21839 ///
21840 ///# Usage Notes
21841 ///
21842 ///Queries the memory requirements (size, alignment, memory type
21843 ///bits) for an existing tensor object. Call before
21844 ///`bind_tensor_memory_arm` to determine the allocation needed.
21845 ///
21846 ///Requires `VK_ARM_tensors`.
21847 pub unsafe fn get_tensor_memory_requirements_arm(
21848 &self,
21849 p_info: &TensorMemoryRequirementsInfoARM,
21850 p_memory_requirements: &mut MemoryRequirements2,
21851 ) {
21852 let fp = self
21853 .commands()
21854 .get_tensor_memory_requirements_arm
21855 .expect("vkGetTensorMemoryRequirementsARM not loaded");
21856 unsafe { fp(self.handle(), p_info, p_memory_requirements) };
21857 }
21858 ///Wraps [`vkBindTensorMemoryARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBindTensorMemoryARM.html).
21859 /**
21860 Provided by **VK_ARM_tensors**.*/
21861 ///
21862 ///# Errors
21863 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21864 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
21865 ///- `VK_ERROR_UNKNOWN`
21866 ///- `VK_ERROR_VALIDATION_FAILED`
21867 ///
21868 ///# Safety
21869 ///- `device` (self) must be valid and not destroyed.
21870 ///
21871 ///# Panics
21872 ///Panics if `vkBindTensorMemoryARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21873 ///
21874 ///# Usage Notes
21875 ///
21876 ///Binds device memory to one or more tensors. Each bind info
21877 ///specifies the tensor, memory, and offset. Must be called before
21878 ///the tensor is used in any command. Similar to
21879 ///`bind_buffer_memory2` / `bind_image_memory2`.
21880 ///
21881 ///Requires `VK_ARM_tensors`.
21882 pub unsafe fn bind_tensor_memory_arm(
21883 &self,
21884 p_bind_infos: &[BindTensorMemoryInfoARM],
21885 ) -> VkResult<()> {
21886 let fp = self
21887 .commands()
21888 .bind_tensor_memory_arm
21889 .expect("vkBindTensorMemoryARM not loaded");
21890 check(unsafe {
21891 fp(
21892 self.handle(),
21893 p_bind_infos.len() as u32,
21894 p_bind_infos.as_ptr(),
21895 )
21896 })
21897 }
21898 ///Wraps [`vkGetDeviceTensorMemoryRequirementsARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceTensorMemoryRequirementsARM.html).
21899 /**
21900 Provided by **VK_ARM_tensors**.*/
21901 ///
21902 ///# Safety
21903 ///- `device` (self) must be valid and not destroyed.
21904 ///
21905 ///# Panics
21906 ///Panics if `vkGetDeviceTensorMemoryRequirementsARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21907 ///
21908 ///# Usage Notes
21909 ///
21910 ///Queries memory requirements for a tensor described by its create
21911 ///info, without creating the tensor first. Analogous to
21912 ///`get_device_buffer_memory_requirements` /
21913 ///`get_device_image_memory_requirements`.
21914 ///
21915 ///Requires `VK_ARM_tensors`.
21916 pub unsafe fn get_device_tensor_memory_requirements_arm(
21917 &self,
21918 p_info: &DeviceTensorMemoryRequirementsARM,
21919 p_memory_requirements: &mut MemoryRequirements2,
21920 ) {
21921 let fp = self
21922 .commands()
21923 .get_device_tensor_memory_requirements_arm
21924 .expect("vkGetDeviceTensorMemoryRequirementsARM not loaded");
21925 unsafe { fp(self.handle(), p_info, p_memory_requirements) };
21926 }
21927 ///Wraps [`vkCmdCopyTensorARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyTensorARM.html).
21928 /**
21929 Provided by **VK_ARM_tensors**.*/
21930 ///
21931 ///# Safety
21932 ///- `commandBuffer` (self) must be valid and not destroyed.
21933 ///- `commandBuffer` must be externally synchronized.
21934 ///
21935 ///# Panics
21936 ///Panics if `vkCmdCopyTensorARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21937 ///
21938 ///# Usage Notes
21939 ///
21940 ///Copies data between tensors or between a tensor and a buffer.
21941 ///The copy info structure specifies the source and destination
21942 ///regions, similar to `cmd_copy_buffer` or `cmd_copy_image`.
21943 ///
21944 ///Requires `VK_ARM_tensors`.
21945 pub unsafe fn cmd_copy_tensor_arm(
21946 &self,
21947 command_buffer: CommandBuffer,
21948 p_copy_tensor_info: &CopyTensorInfoARM,
21949 ) {
21950 let fp = self
21951 .commands()
21952 .cmd_copy_tensor_arm
21953 .expect("vkCmdCopyTensorARM not loaded");
21954 unsafe { fp(command_buffer, p_copy_tensor_info) };
21955 }
21956 ///Wraps [`vkGetTensorOpaqueCaptureDescriptorDataARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetTensorOpaqueCaptureDescriptorDataARM.html).
21957 /**
21958 Provided by **VK_ARM_tensors**.*/
21959 ///
21960 ///# Errors
21961 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21962 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
21963 ///- `VK_ERROR_UNKNOWN`
21964 ///- `VK_ERROR_VALIDATION_FAILED`
21965 ///
21966 ///# Safety
21967 ///- `device` (self) must be valid and not destroyed.
21968 ///
21969 ///# Panics
21970 ///Panics if `vkGetTensorOpaqueCaptureDescriptorDataARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21971 ///
21972 ///# Usage Notes
21973 ///
21974 ///Retrieves opaque capture data for a tensor's descriptor, used
21975 ///for descriptor buffer capture and replay. The returned data can
21976 ///be stored and replayed to recreate an equivalent descriptor.
21977 ///
21978 ///Requires `VK_ARM_tensors` + `VK_EXT_descriptor_buffer`.
21979 pub unsafe fn get_tensor_opaque_capture_descriptor_data_arm(
21980 &self,
21981 p_info: &TensorCaptureDescriptorDataInfoARM,
21982 ) -> VkResult<core::ffi::c_void> {
21983 let fp = self
21984 .commands()
21985 .get_tensor_opaque_capture_descriptor_data_arm
21986 .expect("vkGetTensorOpaqueCaptureDescriptorDataARM not loaded");
21987 let mut out = unsafe { core::mem::zeroed() };
21988 check(unsafe { fp(self.handle(), p_info, &mut out) })?;
21989 Ok(out)
21990 }
21991 ///Wraps [`vkGetTensorViewOpaqueCaptureDescriptorDataARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetTensorViewOpaqueCaptureDescriptorDataARM.html).
21992 /**
21993 Provided by **VK_ARM_tensors**.*/
21994 ///
21995 ///# Errors
21996 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21997 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
21998 ///- `VK_ERROR_UNKNOWN`
21999 ///- `VK_ERROR_VALIDATION_FAILED`
22000 ///
22001 ///# Safety
22002 ///- `device` (self) must be valid and not destroyed.
22003 ///
22004 ///# Panics
22005 ///Panics if `vkGetTensorViewOpaqueCaptureDescriptorDataARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22006 ///
22007 ///# Usage Notes
22008 ///
22009 ///Retrieves opaque capture data for a tensor view's descriptor,
22010 ///used for descriptor buffer capture and replay. Similar to
22011 ///`get_tensor_opaque_capture_descriptor_data_arm` but for tensor
22012 ///views.
22013 ///
22014 ///Requires `VK_ARM_tensors` + `VK_EXT_descriptor_buffer`.
22015 pub unsafe fn get_tensor_view_opaque_capture_descriptor_data_arm(
22016 &self,
22017 p_info: &TensorViewCaptureDescriptorDataInfoARM,
22018 ) -> VkResult<core::ffi::c_void> {
22019 let fp = self
22020 .commands()
22021 .get_tensor_view_opaque_capture_descriptor_data_arm
22022 .expect("vkGetTensorViewOpaqueCaptureDescriptorDataARM not loaded");
22023 let mut out = unsafe { core::mem::zeroed() };
22024 check(unsafe { fp(self.handle(), p_info, &mut out) })?;
22025 Ok(out)
22026 }
22027 ///Wraps [`vkCreateDataGraphPipelinesARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateDataGraphPipelinesARM.html).
22028 /**
22029 Provided by **VK_ARM_data_graph**.*/
22030 ///
22031 ///# Errors
22032 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22033 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22034 ///- `VK_ERROR_UNKNOWN`
22035 ///- `VK_ERROR_VALIDATION_FAILED`
22036 ///
22037 ///# Safety
22038 ///- `device` (self) must be valid and not destroyed.
22039 ///
22040 ///# Panics
22041 ///Panics if `vkCreateDataGraphPipelinesARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22042 ///
22043 ///# Usage Notes
22044 ///
22045 ///Creates one or more data graph pipelines for ARM's data graph
22046 ///extension. Supports deferred compilation via a
22047 ///`DeferredOperationKHR` handle and pipeline caching. Data graph
22048 ///pipelines define GPU-side data processing graphs.
22049 ///
22050 ///Requires `VK_ARM_data_graph`.
22051 pub unsafe fn create_data_graph_pipelines_arm(
22052 &self,
22053 deferred_operation: DeferredOperationKHR,
22054 pipeline_cache: PipelineCache,
22055 p_create_infos: &[DataGraphPipelineCreateInfoARM],
22056 allocator: Option<&AllocationCallbacks>,
22057 ) -> VkResult<Vec<Pipeline>> {
22058 let fp = self
22059 .commands()
22060 .create_data_graph_pipelines_arm
22061 .expect("vkCreateDataGraphPipelinesARM not loaded");
22062 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
22063 let count = p_create_infos.len();
22064 let mut out = vec![unsafe { core::mem::zeroed() }; count];
22065 check(unsafe {
22066 fp(
22067 self.handle(),
22068 deferred_operation,
22069 pipeline_cache,
22070 p_create_infos.len() as u32,
22071 p_create_infos.as_ptr(),
22072 alloc_ptr,
22073 out.as_mut_ptr(),
22074 )
22075 })?;
22076 Ok(out)
22077 }
22078 ///Wraps [`vkCreateDataGraphPipelineSessionARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateDataGraphPipelineSessionARM.html).
22079 /**
22080 Provided by **VK_ARM_data_graph**.*/
22081 ///
22082 ///# Errors
22083 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22084 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22085 ///- `VK_ERROR_UNKNOWN`
22086 ///- `VK_ERROR_VALIDATION_FAILED`
22087 ///
22088 ///# Safety
22089 ///- `device` (self) must be valid and not destroyed.
22090 ///
22091 ///# Panics
22092 ///Panics if `vkCreateDataGraphPipelineSessionARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22093 ///
22094 ///# Usage Notes
22095 ///
22096 ///Creates a session for executing a data graph pipeline. A session
22097 ///holds the runtime state and memory bindings needed to dispatch
22098 ///the graph. Must be bound to memory before dispatch.
22099 ///
22100 ///Requires `VK_ARM_data_graph`.
22101 pub unsafe fn create_data_graph_pipeline_session_arm(
22102 &self,
22103 p_create_info: &DataGraphPipelineSessionCreateInfoARM,
22104 allocator: Option<&AllocationCallbacks>,
22105 ) -> VkResult<DataGraphPipelineSessionARM> {
22106 let fp = self
22107 .commands()
22108 .create_data_graph_pipeline_session_arm
22109 .expect("vkCreateDataGraphPipelineSessionARM not loaded");
22110 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
22111 let mut out = unsafe { core::mem::zeroed() };
22112 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
22113 Ok(out)
22114 }
22115 ///Wraps [`vkGetDataGraphPipelineSessionBindPointRequirementsARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDataGraphPipelineSessionBindPointRequirementsARM.html).
22116 /**
22117 Provided by **VK_ARM_data_graph**.*/
22118 ///
22119 ///# Errors
22120 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22121 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22122 ///- `VK_ERROR_UNKNOWN`
22123 ///- `VK_ERROR_VALIDATION_FAILED`
22124 ///
22125 ///# Safety
22126 ///- `device` (self) must be valid and not destroyed.
22127 ///
22128 ///# Panics
22129 ///Panics if `vkGetDataGraphPipelineSessionBindPointRequirementsARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22130 ///
22131 ///# Usage Notes
22132 ///
22133 ///Queries the memory bind point requirements for a data graph
22134 ///pipeline session. Uses the two-call idiom. Each returned
22135 ///requirement describes a bind point that must be satisfied with
22136 ///`bind_data_graph_pipeline_session_memory_arm` before dispatch.
22137 ///
22138 ///Requires `VK_ARM_data_graph`.
22139 pub unsafe fn get_data_graph_pipeline_session_bind_point_requirements_arm(
22140 &self,
22141 p_info: &DataGraphPipelineSessionBindPointRequirementsInfoARM,
22142 ) -> VkResult<Vec<DataGraphPipelineSessionBindPointRequirementARM>> {
22143 let fp = self
22144 .commands()
22145 .get_data_graph_pipeline_session_bind_point_requirements_arm
22146 .expect("vkGetDataGraphPipelineSessionBindPointRequirementsARM not loaded");
22147 enumerate_two_call(|count, data| unsafe { fp(self.handle(), p_info, count, data) })
22148 }
22149 ///Wraps [`vkGetDataGraphPipelineSessionMemoryRequirementsARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDataGraphPipelineSessionMemoryRequirementsARM.html).
22150 /**
22151 Provided by **VK_ARM_data_graph**.*/
22152 ///
22153 ///# Safety
22154 ///- `device` (self) must be valid and not destroyed.
22155 ///
22156 ///# Panics
22157 ///Panics if `vkGetDataGraphPipelineSessionMemoryRequirementsARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22158 ///
22159 ///# Usage Notes
22160 ///
22161 ///Queries the memory requirements for a specific bind point within
22162 ///a data graph pipeline session. Returns a `MemoryRequirements2`
22163 ///describing the size, alignment, and compatible memory types.
22164 ///
22165 ///Requires `VK_ARM_data_graph`.
22166 pub unsafe fn get_data_graph_pipeline_session_memory_requirements_arm(
22167 &self,
22168 p_info: &DataGraphPipelineSessionMemoryRequirementsInfoARM,
22169 p_memory_requirements: &mut MemoryRequirements2,
22170 ) {
22171 let fp = self
22172 .commands()
22173 .get_data_graph_pipeline_session_memory_requirements_arm
22174 .expect("vkGetDataGraphPipelineSessionMemoryRequirementsARM not loaded");
22175 unsafe { fp(self.handle(), p_info, p_memory_requirements) };
22176 }
22177 ///Wraps [`vkBindDataGraphPipelineSessionMemoryARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBindDataGraphPipelineSessionMemoryARM.html).
22178 /**
22179 Provided by **VK_ARM_data_graph**.*/
22180 ///
22181 ///# Errors
22182 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22183 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22184 ///- `VK_ERROR_UNKNOWN`
22185 ///- `VK_ERROR_VALIDATION_FAILED`
22186 ///
22187 ///# Safety
22188 ///- `device` (self) must be valid and not destroyed.
22189 ///
22190 ///# Panics
22191 ///Panics if `vkBindDataGraphPipelineSessionMemoryARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22192 ///
22193 ///# Usage Notes
22194 ///
22195 ///Binds device memory to a data graph pipeline session at the bind
22196 ///points returned by
22197 ///`get_data_graph_pipeline_session_bind_point_requirements_arm`.
22198 ///Must be called before dispatching the session.
22199 ///
22200 ///Requires `VK_ARM_data_graph`.
22201 pub unsafe fn bind_data_graph_pipeline_session_memory_arm(
22202 &self,
22203 p_bind_infos: &[BindDataGraphPipelineSessionMemoryInfoARM],
22204 ) -> VkResult<()> {
22205 let fp = self
22206 .commands()
22207 .bind_data_graph_pipeline_session_memory_arm
22208 .expect("vkBindDataGraphPipelineSessionMemoryARM not loaded");
22209 check(unsafe {
22210 fp(
22211 self.handle(),
22212 p_bind_infos.len() as u32,
22213 p_bind_infos.as_ptr(),
22214 )
22215 })
22216 }
22217 ///Wraps [`vkDestroyDataGraphPipelineSessionARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyDataGraphPipelineSessionARM.html).
22218 /**
22219 Provided by **VK_ARM_data_graph**.*/
22220 ///
22221 ///# Safety
22222 ///- `device` (self) must be valid and not destroyed.
22223 ///- `session` must be externally synchronized.
22224 ///
22225 ///# Panics
22226 ///Panics if `vkDestroyDataGraphPipelineSessionARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22227 ///
22228 ///# Usage Notes
22229 ///
22230 ///Destroys a data graph pipeline session and frees associated host
22231 ///resources. The session must not be in use by any command buffer.
22232 ///
22233 ///Requires `VK_ARM_data_graph`.
22234 pub unsafe fn destroy_data_graph_pipeline_session_arm(
22235 &self,
22236 session: DataGraphPipelineSessionARM,
22237 allocator: Option<&AllocationCallbacks>,
22238 ) {
22239 let fp = self
22240 .commands()
22241 .destroy_data_graph_pipeline_session_arm
22242 .expect("vkDestroyDataGraphPipelineSessionARM not loaded");
22243 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
22244 unsafe { fp(self.handle(), session, alloc_ptr) };
22245 }
22246 ///Wraps [`vkCmdDispatchDataGraphARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDispatchDataGraphARM.html).
22247 /**
22248 Provided by **VK_ARM_data_graph**.*/
22249 ///
22250 ///# Safety
22251 ///- `commandBuffer` (self) must be valid and not destroyed.
22252 ///- `commandBuffer` must be externally synchronized.
22253 ///
22254 ///# Panics
22255 ///Panics if `vkCmdDispatchDataGraphARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22256 ///
22257 ///# Usage Notes
22258 ///
22259 ///Records a data graph pipeline dispatch into a command buffer.
22260 ///The session must have been created and bound to memory before
22261 ///dispatch. Optional dispatch info can configure execution
22262 ///parameters.
22263 ///
22264 ///Requires `VK_ARM_data_graph`.
22265 pub unsafe fn cmd_dispatch_data_graph_arm(
22266 &self,
22267 command_buffer: CommandBuffer,
22268 session: DataGraphPipelineSessionARM,
22269 p_info: Option<&DataGraphPipelineDispatchInfoARM>,
22270 ) {
22271 let fp = self
22272 .commands()
22273 .cmd_dispatch_data_graph_arm
22274 .expect("vkCmdDispatchDataGraphARM not loaded");
22275 let p_info_ptr = p_info.map_or(core::ptr::null(), core::ptr::from_ref);
22276 unsafe { fp(command_buffer, session, p_info_ptr) };
22277 }
22278 ///Wraps [`vkGetDataGraphPipelineAvailablePropertiesARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDataGraphPipelineAvailablePropertiesARM.html).
22279 /**
22280 Provided by **VK_ARM_data_graph**.*/
22281 ///
22282 ///# Errors
22283 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22284 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22285 ///- `VK_ERROR_UNKNOWN`
22286 ///- `VK_ERROR_VALIDATION_FAILED`
22287 ///
22288 ///# Safety
22289 ///- `device` (self) must be valid and not destroyed.
22290 ///
22291 ///# Panics
22292 ///Panics if `vkGetDataGraphPipelineAvailablePropertiesARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22293 ///
22294 ///# Usage Notes
22295 ///
22296 ///Enumerates the queryable properties for a data graph pipeline.
22297 ///Uses the two-call idiom. The returned property descriptors can
22298 ///then be queried with `get_data_graph_pipeline_properties_arm`.
22299 ///
22300 ///Requires `VK_ARM_data_graph`.
22301 pub unsafe fn get_data_graph_pipeline_available_properties_arm(
22302 &self,
22303 p_pipeline_info: &DataGraphPipelineInfoARM,
22304 ) -> VkResult<Vec<DataGraphPipelinePropertyARM>> {
22305 let fp = self
22306 .commands()
22307 .get_data_graph_pipeline_available_properties_arm
22308 .expect("vkGetDataGraphPipelineAvailablePropertiesARM not loaded");
22309 enumerate_two_call(|count, data| unsafe { fp(self.handle(), p_pipeline_info, count, data) })
22310 }
22311 ///Wraps [`vkGetDataGraphPipelinePropertiesARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDataGraphPipelinePropertiesARM.html).
22312 /**
22313 Provided by **VK_ARM_data_graph**.*/
22314 ///
22315 ///# Errors
22316 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22317 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22318 ///- `VK_ERROR_UNKNOWN`
22319 ///- `VK_ERROR_VALIDATION_FAILED`
22320 ///
22321 ///# Safety
22322 ///- `device` (self) must be valid and not destroyed.
22323 ///
22324 ///# Panics
22325 ///Panics if `vkGetDataGraphPipelinePropertiesARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22326 ///
22327 ///# Usage Notes
22328 ///
22329 ///Queries specific property values for a data graph pipeline.
22330 ///First enumerate available properties with
22331 ///`get_data_graph_pipeline_available_properties_arm`, then query
22332 ///the ones you need.
22333 ///
22334 ///Requires `VK_ARM_data_graph`.
22335 pub unsafe fn get_data_graph_pipeline_properties_arm(
22336 &self,
22337 p_pipeline_info: &DataGraphPipelineInfoARM,
22338 properties_count: u32,
22339 p_properties: *mut DataGraphPipelinePropertyQueryResultARM,
22340 ) -> VkResult<()> {
22341 let fp = self
22342 .commands()
22343 .get_data_graph_pipeline_properties_arm
22344 .expect("vkGetDataGraphPipelinePropertiesARM not loaded");
22345 check(unsafe {
22346 fp(
22347 self.handle(),
22348 p_pipeline_info,
22349 properties_count,
22350 p_properties,
22351 )
22352 })
22353 }
22354 ///Wraps [`vkGetNativeBufferPropertiesOHOS`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetNativeBufferPropertiesOHOS.html).
22355 /**
22356 Provided by **VK_OHOS_external_memory**.*/
22357 ///
22358 ///# Errors
22359 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22360 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR`
22361 ///- `VK_ERROR_UNKNOWN`
22362 ///- `VK_ERROR_VALIDATION_FAILED`
22363 ///
22364 ///# Safety
22365 ///- `device` (self) must be valid and not destroyed.
22366 ///
22367 ///# Panics
22368 ///Panics if `vkGetNativeBufferPropertiesOHOS` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22369 ///
22370 ///# Usage Notes
22371 ///
22372 ///Queries Vulkan memory properties (memory type bits, size) for
22373 ///an OHOS native buffer. Use before importing external memory to
22374 ///determine compatible memory types. OHOS only.
22375 ///
22376 ///Requires `VK_OHOS_external_memory`.
22377 pub unsafe fn get_native_buffer_properties_ohos(
22378 &self,
22379 buffer: *const core::ffi::c_void,
22380 p_properties: &mut NativeBufferPropertiesOHOS,
22381 ) -> VkResult<()> {
22382 let fp = self
22383 .commands()
22384 .get_native_buffer_properties_ohos
22385 .expect("vkGetNativeBufferPropertiesOHOS not loaded");
22386 check(unsafe { fp(self.handle(), buffer, p_properties) })
22387 }
22388 ///Wraps [`vkGetMemoryNativeBufferOHOS`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryNativeBufferOHOS.html).
22389 /**
22390 Provided by **VK_OHOS_external_memory**.*/
22391 ///
22392 ///# Errors
22393 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22394 ///- `VK_ERROR_UNKNOWN`
22395 ///- `VK_ERROR_VALIDATION_FAILED`
22396 ///
22397 ///# Safety
22398 ///- `device` (self) must be valid and not destroyed.
22399 ///
22400 ///# Panics
22401 ///Panics if `vkGetMemoryNativeBufferOHOS` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22402 ///
22403 ///# Usage Notes
22404 ///
22405 ///Exports a Vulkan device memory allocation as an OHOS native
22406 ///buffer handle for sharing with other OpenHarmony services.
22407 ///OHOS only.
22408 ///
22409 ///Requires `VK_OHOS_external_memory`.
22410 pub unsafe fn get_memory_native_buffer_ohos(
22411 &self,
22412 p_info: &MemoryGetNativeBufferInfoOHOS,
22413 p_buffer: *mut *mut core::ffi::c_void,
22414 ) -> VkResult<()> {
22415 let fp = self
22416 .commands()
22417 .get_memory_native_buffer_ohos
22418 .expect("vkGetMemoryNativeBufferOHOS not loaded");
22419 check(unsafe { fp(self.handle(), p_info, p_buffer) })
22420 }
22421 ///Wraps [`vkGetSwapchainGrallocUsageOHOS`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSwapchainGrallocUsageOHOS.html).
22422 ///
22423 ///# Errors
22424 ///- `VK_ERROR_INITIALIZATION_FAILED`
22425 ///- `VK_ERROR_UNKNOWN`
22426 ///- `VK_ERROR_VALIDATION_FAILED`
22427 ///
22428 ///# Safety
22429 ///- `device` (self) must be valid and not destroyed.
22430 ///
22431 ///# Panics
22432 ///Panics if `vkGetSwapchainGrallocUsageOHOS` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22433 ///
22434 ///# Usage Notes
22435 ///
22436 ///Queries the OHOS gralloc usage flags needed for swapchain images
22437 ///with the given format and Vulkan image usage. Used internally by
22438 ///the OHOS WSI implementation. OHOS only.
22439 ///
22440 ///Requires `VK_OHOS_native_buffer`.
22441 pub unsafe fn get_swapchain_gralloc_usage_ohos(
22442 &self,
22443 format: Format,
22444 image_usage: ImageUsageFlags,
22445 ) -> VkResult<u64> {
22446 let fp = self
22447 .commands()
22448 .get_swapchain_gralloc_usage_ohos
22449 .expect("vkGetSwapchainGrallocUsageOHOS not loaded");
22450 let mut out = unsafe { core::mem::zeroed() };
22451 check(unsafe { fp(self.handle(), format, image_usage, &mut out) })?;
22452 Ok(out)
22453 }
22454 ///Wraps [`vkAcquireImageOHOS`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAcquireImageOHOS.html).
22455 ///
22456 ///# Errors
22457 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22458 ///- `VK_ERROR_UNKNOWN`
22459 ///- `VK_ERROR_VALIDATION_FAILED`
22460 ///
22461 ///# Safety
22462 ///- `device` (self) must be valid and not destroyed.
22463 ///
22464 ///# Panics
22465 ///Panics if `vkAcquireImageOHOS` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22466 ///
22467 ///# Usage Notes
22468 ///
22469 ///Acquires ownership of a swapchain image on OpenHarmony OS.
22470 ///Takes a native fence file descriptor for synchronisation and
22471 ///can signal a Vulkan semaphore or fence on completion. OHOS only.
22472 ///
22473 ///Requires `VK_OHOS_native_buffer`.
22474 pub unsafe fn acquire_image_ohos(
22475 &self,
22476 image: Image,
22477 native_fence_fd: i32,
22478 semaphore: Semaphore,
22479 fence: Fence,
22480 ) -> VkResult<()> {
22481 let fp = self
22482 .commands()
22483 .acquire_image_ohos
22484 .expect("vkAcquireImageOHOS not loaded");
22485 check(unsafe { fp(self.handle(), image, native_fence_fd, semaphore, fence) })
22486 }
22487 ///Wraps [`vkQueueSignalReleaseImageOHOS`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueSignalReleaseImageOHOS.html).
22488 ///
22489 ///# Errors
22490 ///- `VK_ERROR_INITIALIZATION_FAILED`
22491 ///- `VK_ERROR_UNKNOWN`
22492 ///- `VK_ERROR_VALIDATION_FAILED`
22493 ///
22494 ///# Safety
22495 ///- `queue` (self) must be valid and not destroyed.
22496 ///
22497 ///# Panics
22498 ///Panics if `vkQueueSignalReleaseImageOHOS` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22499 ///
22500 ///# Usage Notes
22501 ///
22502 ///Releases a swapchain image back to the OHOS compositor after
22503 ///rendering. Waits on the given semaphores and returns a native
22504 ///fence FD for external synchronisation. OHOS only.
22505 ///
22506 ///Requires `VK_OHOS_native_buffer`.
22507 pub unsafe fn queue_signal_release_image_ohos(
22508 &self,
22509 queue: Queue,
22510 p_wait_semaphores: &[Semaphore],
22511 image: Image,
22512 ) -> VkResult<i32> {
22513 let fp = self
22514 .commands()
22515 .queue_signal_release_image_ohos
22516 .expect("vkQueueSignalReleaseImageOHOS not loaded");
22517 let mut out = unsafe { core::mem::zeroed() };
22518 check(unsafe {
22519 fp(
22520 queue,
22521 p_wait_semaphores.len() as u32,
22522 p_wait_semaphores.as_ptr(),
22523 image,
22524 &mut out,
22525 )
22526 })?;
22527 Ok(out)
22528 }
22529 ///Wraps [`vkCmdSetComputeOccupancyPriorityNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetComputeOccupancyPriorityNV.html).
22530 /**
22531 Provided by **VK_NV_compute_occupancy_priority**.*/
22532 ///
22533 ///# Safety
22534 ///- `commandBuffer` (self) must be valid and not destroyed.
22535 ///
22536 ///# Panics
22537 ///Panics if `vkCmdSetComputeOccupancyPriorityNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22538 ///
22539 ///# Usage Notes
22540 ///
22541 ///Sets the compute occupancy priority for subsequent dispatch
22542 ///commands. Higher priority may increase the number of warps
22543 ///resident on an SM, trading off per-warp resources for greater
22544 ///parallelism.
22545 ///
22546 ///Requires `VK_NV_compute_occupancy_priority`.
22547 pub unsafe fn cmd_set_compute_occupancy_priority_nv(
22548 &self,
22549 command_buffer: CommandBuffer,
22550 p_parameters: &ComputeOccupancyPriorityParametersNV,
22551 ) {
22552 let fp = self
22553 .commands()
22554 .cmd_set_compute_occupancy_priority_nv
22555 .expect("vkCmdSetComputeOccupancyPriorityNV not loaded");
22556 unsafe { fp(command_buffer, p_parameters) };
22557 }
22558 ///Wraps [`vkWriteSamplerDescriptorsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkWriteSamplerDescriptorsEXT.html).
22559 /**
22560 Provided by **VK_EXT_descriptor_heap**.*/
22561 ///
22562 ///# Errors
22563 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22564 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22565 ///- `VK_ERROR_UNKNOWN`
22566 ///- `VK_ERROR_VALIDATION_FAILED`
22567 ///
22568 ///# Safety
22569 ///- `device` (self) must be valid and not destroyed.
22570 ///
22571 ///# Panics
22572 ///Panics if `vkWriteSamplerDescriptorsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22573 ///
22574 ///# Usage Notes
22575 ///
22576 ///Writes sampler descriptors to host-visible memory. This is the
22577 ///descriptor heap equivalent for sampler descriptors, instead of
22578 ///using descriptor sets, samplers are written directly to heap
22579 ///memory.
22580 ///
22581 ///Provided by `VK_EXT_descriptor_heap`.
22582 pub unsafe fn write_sampler_descriptors_ext(
22583 &self,
22584 p_samplers: &[SamplerCreateInfo],
22585 p_descriptors: &[HostAddressRangeEXT],
22586 ) -> VkResult<()> {
22587 let fp = self
22588 .commands()
22589 .write_sampler_descriptors_ext
22590 .expect("vkWriteSamplerDescriptorsEXT not loaded");
22591 check(unsafe {
22592 fp(
22593 self.handle(),
22594 p_samplers.len() as u32,
22595 p_samplers.as_ptr(),
22596 p_descriptors.as_ptr(),
22597 )
22598 })
22599 }
22600 ///Wraps [`vkWriteResourceDescriptorsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkWriteResourceDescriptorsEXT.html).
22601 /**
22602 Provided by **VK_EXT_descriptor_heap**.*/
22603 ///
22604 ///# Errors
22605 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22606 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22607 ///- `VK_ERROR_UNKNOWN`
22608 ///- `VK_ERROR_VALIDATION_FAILED`
22609 ///
22610 ///# Safety
22611 ///- `device` (self) must be valid and not destroyed.
22612 ///
22613 ///# Panics
22614 ///Panics if `vkWriteResourceDescriptorsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22615 ///
22616 ///# Usage Notes
22617 ///
22618 ///Writes resource descriptors (buffers, images, acceleration
22619 ///structures) to host-visible memory. This is the descriptor heap
22620 ///equivalent of writing descriptors, instead of using descriptor
22621 ///sets, descriptors are written directly to heap memory.
22622 ///
22623 ///Provided by `VK_EXT_descriptor_heap`.
22624 pub unsafe fn write_resource_descriptors_ext(
22625 &self,
22626 p_resources: &[ResourceDescriptorInfoEXT],
22627 p_descriptors: &[HostAddressRangeEXT],
22628 ) -> VkResult<()> {
22629 let fp = self
22630 .commands()
22631 .write_resource_descriptors_ext
22632 .expect("vkWriteResourceDescriptorsEXT not loaded");
22633 check(unsafe {
22634 fp(
22635 self.handle(),
22636 p_resources.len() as u32,
22637 p_resources.as_ptr(),
22638 p_descriptors.as_ptr(),
22639 )
22640 })
22641 }
22642 ///Wraps [`vkCmdBindSamplerHeapEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindSamplerHeapEXT.html).
22643 /**
22644 Provided by **VK_EXT_descriptor_heap**.*/
22645 ///
22646 ///# Safety
22647 ///- `commandBuffer` (self) must be valid and not destroyed.
22648 ///- `commandBuffer` must be externally synchronized.
22649 ///
22650 ///# Panics
22651 ///Panics if `vkCmdBindSamplerHeapEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22652 ///
22653 ///# Usage Notes
22654 ///
22655 ///Binds a sampler descriptor heap for use in subsequent draw and
22656 ///dispatch commands. The `BindHeapInfoEXT` specifies the heap to
22657 ///bind.
22658 ///
22659 ///Sampler heaps hold sampler descriptors. Resource descriptors are
22660 ///bound separately with `cmd_bind_resource_heap_ext`.
22661 ///
22662 ///Provided by `VK_EXT_descriptor_heap`.
22663 pub unsafe fn cmd_bind_sampler_heap_ext(
22664 &self,
22665 command_buffer: CommandBuffer,
22666 p_bind_info: &BindHeapInfoEXT,
22667 ) {
22668 let fp = self
22669 .commands()
22670 .cmd_bind_sampler_heap_ext
22671 .expect("vkCmdBindSamplerHeapEXT not loaded");
22672 unsafe { fp(command_buffer, p_bind_info) };
22673 }
22674 ///Wraps [`vkCmdBindResourceHeapEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindResourceHeapEXT.html).
22675 /**
22676 Provided by **VK_EXT_descriptor_heap**.*/
22677 ///
22678 ///# Safety
22679 ///- `commandBuffer` (self) must be valid and not destroyed.
22680 ///- `commandBuffer` must be externally synchronized.
22681 ///
22682 ///# Panics
22683 ///Panics if `vkCmdBindResourceHeapEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22684 ///
22685 ///# Usage Notes
22686 ///
22687 ///Binds a resource descriptor heap for use in subsequent draw and
22688 ///dispatch commands. The `BindHeapInfoEXT` specifies the heap to
22689 ///bind.
22690 ///
22691 ///Resource heaps hold descriptors for buffers, images, and
22692 ///acceleration structures. Samplers are bound separately with
22693 ///`cmd_bind_sampler_heap_ext`.
22694 ///
22695 ///Provided by `VK_EXT_descriptor_heap`.
22696 pub unsafe fn cmd_bind_resource_heap_ext(
22697 &self,
22698 command_buffer: CommandBuffer,
22699 p_bind_info: &BindHeapInfoEXT,
22700 ) {
22701 let fp = self
22702 .commands()
22703 .cmd_bind_resource_heap_ext
22704 .expect("vkCmdBindResourceHeapEXT not loaded");
22705 unsafe { fp(command_buffer, p_bind_info) };
22706 }
22707 ///Wraps [`vkCmdPushDataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPushDataEXT.html).
22708 /**
22709 Provided by **VK_EXT_descriptor_heap**.*/
22710 ///
22711 ///# Safety
22712 ///- `commandBuffer` (self) must be valid and not destroyed.
22713 ///- `commandBuffer` must be externally synchronized.
22714 ///
22715 ///# Panics
22716 ///Panics if `vkCmdPushDataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22717 ///
22718 ///# Usage Notes
22719 ///
22720 ///Pushes inline data to the command buffer for use in shaders. The
22721 ///`PushDataInfoEXT` specifies the pipeline layout, stage flags,
22722 ///offset, and data bytes.
22723 ///
22724 ///Similar to push constants but used with the descriptor heap
22725 ///model. Data is accessible in shaders via the push data mechanism.
22726 ///
22727 ///Provided by `VK_EXT_descriptor_heap`.
22728 pub unsafe fn cmd_push_data_ext(
22729 &self,
22730 command_buffer: CommandBuffer,
22731 p_push_data_info: &PushDataInfoEXT,
22732 ) {
22733 let fp = self
22734 .commands()
22735 .cmd_push_data_ext
22736 .expect("vkCmdPushDataEXT not loaded");
22737 unsafe { fp(command_buffer, p_push_data_info) };
22738 }
22739 ///Wraps [`vkRegisterCustomBorderColorEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkRegisterCustomBorderColorEXT.html).
22740 /**
22741 Provided by **VK_EXT_descriptor_heap**.*/
22742 ///
22743 ///# Errors
22744 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22745 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22746 ///- `VK_ERROR_TOO_MANY_OBJECTS`
22747 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS`
22748 ///- `VK_ERROR_UNKNOWN`
22749 ///- `VK_ERROR_VALIDATION_FAILED`
22750 ///
22751 ///# Safety
22752 ///- `device` (self) must be valid and not destroyed.
22753 ///
22754 ///# Panics
22755 ///Panics if `vkRegisterCustomBorderColorEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22756 ///
22757 ///# Usage Notes
22758 ///
22759 ///Registers a custom border color for use with samplers. Returns a
22760 ///handle that can be referenced when creating samplers with
22761 ///`BORDER_COLOR_CUSTOM` modes.
22762 ///
22763 ///The device has a limited number of custom border color slots
22764 ///(query `maxCustomBorderColors`).
22765 ///
22766 ///Unregister with `unregister_custom_border_color_ext` when no
22767 ///longer needed.
22768 ///
22769 ///Provided by `VK_EXT_descriptor_heap`.
22770 pub unsafe fn register_custom_border_color_ext(
22771 &self,
22772 p_border_color: &SamplerCustomBorderColorCreateInfoEXT,
22773 request_index: bool,
22774 ) -> VkResult<u32> {
22775 let fp = self
22776 .commands()
22777 .register_custom_border_color_ext
22778 .expect("vkRegisterCustomBorderColorEXT not loaded");
22779 let mut out = unsafe { core::mem::zeroed() };
22780 check(unsafe {
22781 fp(
22782 self.handle(),
22783 p_border_color,
22784 request_index as u32,
22785 &mut out,
22786 )
22787 })?;
22788 Ok(out)
22789 }
22790 ///Wraps [`vkUnregisterCustomBorderColorEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkUnregisterCustomBorderColorEXT.html).
22791 /**
22792 Provided by **VK_EXT_descriptor_heap**.*/
22793 ///
22794 ///# Safety
22795 ///- `device` (self) must be valid and not destroyed.
22796 ///
22797 ///# Panics
22798 ///Panics if `vkUnregisterCustomBorderColorEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22799 ///
22800 ///# Usage Notes
22801 ///
22802 ///Unregisters a custom border color previously registered with
22803 ///`register_custom_border_color_ext`, freeing the slot for reuse.
22804 ///
22805 ///Ensure no samplers referencing this border color are in use
22806 ///before unregistering.
22807 ///
22808 ///Provided by `VK_EXT_descriptor_heap`.
22809 pub unsafe fn unregister_custom_border_color_ext(&self, index: u32) {
22810 let fp = self
22811 .commands()
22812 .unregister_custom_border_color_ext
22813 .expect("vkUnregisterCustomBorderColorEXT not loaded");
22814 unsafe { fp(self.handle(), index) };
22815 }
22816 ///Wraps [`vkGetImageOpaqueCaptureDataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageOpaqueCaptureDataEXT.html).
22817 /**
22818 Provided by **VK_EXT_descriptor_heap**.*/
22819 ///
22820 ///# Errors
22821 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22822 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22823 ///- `VK_ERROR_UNKNOWN`
22824 ///- `VK_ERROR_VALIDATION_FAILED`
22825 ///
22826 ///# Safety
22827 ///- `device` (self) must be valid and not destroyed.
22828 ///
22829 ///# Panics
22830 ///Panics if `vkGetImageOpaqueCaptureDataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22831 ///
22832 ///# Usage Notes
22833 ///
22834 ///Retrieves opaque capture data for one or more images. The returned
22835 ///`HostAddressRangeEXT` data can be used to reconstruct image
22836 ///resource bindings during capture/replay.
22837 ///
22838 ///Provided by `VK_EXT_descriptor_heap`.
22839 pub unsafe fn get_image_opaque_capture_data_ext(
22840 &self,
22841 p_images: &[Image],
22842 ) -> VkResult<Vec<HostAddressRangeEXT>> {
22843 let fp = self
22844 .commands()
22845 .get_image_opaque_capture_data_ext
22846 .expect("vkGetImageOpaqueCaptureDataEXT not loaded");
22847 let count = p_images.len();
22848 let mut out = vec![unsafe { core::mem::zeroed() }; count];
22849 check(unsafe {
22850 fp(
22851 self.handle(),
22852 p_images.len() as u32,
22853 p_images.as_ptr(),
22854 out.as_mut_ptr(),
22855 )
22856 })?;
22857 Ok(out)
22858 }
22859 ///Wraps [`vkGetTensorOpaqueCaptureDataARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetTensorOpaqueCaptureDataARM.html).
22860 /**
22861 Provided by **VK_EXT_descriptor_heap**.*/
22862 ///
22863 ///# Errors
22864 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22865 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22866 ///- `VK_ERROR_UNKNOWN`
22867 ///- `VK_ERROR_VALIDATION_FAILED`
22868 ///
22869 ///# Safety
22870 ///- `device` (self) must be valid and not destroyed.
22871 ///
22872 ///# Panics
22873 ///Panics if `vkGetTensorOpaqueCaptureDataARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22874 ///
22875 ///# Usage Notes
22876 ///
22877 ///Retrieves opaque capture data for one or more ARM tensors. The
22878 ///returned data can be used to reconstruct tensor resource bindings
22879 ///during capture/replay.
22880 ///
22881 ///Provided by `VK_ARM_tensors`.
22882 pub unsafe fn get_tensor_opaque_capture_data_arm(
22883 &self,
22884 p_tensors: &[TensorARM],
22885 ) -> VkResult<Vec<HostAddressRangeEXT>> {
22886 let fp = self
22887 .commands()
22888 .get_tensor_opaque_capture_data_arm
22889 .expect("vkGetTensorOpaqueCaptureDataARM not loaded");
22890 let count = p_tensors.len();
22891 let mut out = vec![unsafe { core::mem::zeroed() }; count];
22892 check(unsafe {
22893 fp(
22894 self.handle(),
22895 p_tensors.len() as u32,
22896 p_tensors.as_ptr(),
22897 out.as_mut_ptr(),
22898 )
22899 })?;
22900 Ok(out)
22901 }
22902 ///Wraps [`vkCmdCopyMemoryKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMemoryKHR.html).
22903 /**
22904 Provided by **VK_KHR_device_address_commands**.*/
22905 ///
22906 ///# Safety
22907 ///- `commandBuffer` (self) must be valid and not destroyed.
22908 ///- `commandBuffer` must be externally synchronized.
22909 ///
22910 ///# Panics
22911 ///Panics if `vkCmdCopyMemoryKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22912 ///
22913 ///# Usage Notes
22914 ///
22915 ///Copies data between two device address ranges on the GPU. This is
22916 ///the device-address equivalent of `cmd_copy_buffer`, instead of
22917 ///buffer handles, source and destination are specified as device
22918 ///addresses in `CopyDeviceMemoryInfoKHR`.
22919 ///
22920 ///Useful for copying data between arbitrary device memory locations
22921 ///without needing buffer objects.
22922 ///
22923 ///Requires `VK_KHR_device_address_commands`.
22924 pub unsafe fn cmd_copy_memory_khr(
22925 &self,
22926 command_buffer: CommandBuffer,
22927 p_copy_memory_info: Option<&CopyDeviceMemoryInfoKHR>,
22928 ) {
22929 let fp = self
22930 .commands()
22931 .cmd_copy_memory_khr
22932 .expect("vkCmdCopyMemoryKHR not loaded");
22933 let p_copy_memory_info_ptr =
22934 p_copy_memory_info.map_or(core::ptr::null(), core::ptr::from_ref);
22935 unsafe { fp(command_buffer, p_copy_memory_info_ptr) };
22936 }
22937 ///Wraps [`vkCmdCopyMemoryToImageKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMemoryToImageKHR.html).
22938 /**
22939 Provided by **VK_KHR_device_address_commands**.*/
22940 ///
22941 ///# Safety
22942 ///- `commandBuffer` (self) must be valid and not destroyed.
22943 ///- `commandBuffer` must be externally synchronized.
22944 ///
22945 ///# Panics
22946 ///Panics if `vkCmdCopyMemoryToImageKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22947 ///
22948 ///# Usage Notes
22949 ///
22950 ///Device-address variant of `cmd_copy_buffer_to_image`. Copies data
22951 ///from a device address range into an image, instead of reading from
22952 ///a buffer handle.
22953 ///
22954 ///The `CopyDeviceMemoryImageInfoKHR` struct specifies the source
22955 ///device address, destination image, and region descriptions.
22956 ///
22957 ///This is the device-address counterpart, for the host-side
22958 ///equivalent, see `copy_memory_to_image` (core 1.4).
22959 ///
22960 ///Requires `VK_KHR_device_address_commands`.
22961 pub unsafe fn cmd_copy_memory_to_image_khr(
22962 &self,
22963 command_buffer: CommandBuffer,
22964 p_copy_memory_info: Option<&CopyDeviceMemoryImageInfoKHR>,
22965 ) {
22966 let fp = self
22967 .commands()
22968 .cmd_copy_memory_to_image_khr
22969 .expect("vkCmdCopyMemoryToImageKHR not loaded");
22970 let p_copy_memory_info_ptr =
22971 p_copy_memory_info.map_or(core::ptr::null(), core::ptr::from_ref);
22972 unsafe { fp(command_buffer, p_copy_memory_info_ptr) };
22973 }
22974 ///Wraps [`vkCmdCopyImageToMemoryKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyImageToMemoryKHR.html).
22975 /**
22976 Provided by **VK_KHR_device_address_commands**.*/
22977 ///
22978 ///# Safety
22979 ///- `commandBuffer` (self) must be valid and not destroyed.
22980 ///- `commandBuffer` must be externally synchronized.
22981 ///
22982 ///# Panics
22983 ///Panics if `vkCmdCopyImageToMemoryKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22984 ///
22985 ///# Usage Notes
22986 ///
22987 ///Device-address variant of `cmd_copy_image_to_buffer`. Copies image
22988 ///texel data to a device address range instead of a buffer handle.
22989 ///
22990 ///The `CopyDeviceMemoryImageInfoKHR` struct specifies the source
22991 ///image, destination device address, and region descriptions.
22992 ///
22993 ///This is the device-address counterpart, for the host-side
22994 ///equivalent, see `copy_image_to_memory` (core 1.4).
22995 ///
22996 ///Requires `VK_KHR_device_address_commands`.
22997 pub unsafe fn cmd_copy_image_to_memory_khr(
22998 &self,
22999 command_buffer: CommandBuffer,
23000 p_copy_memory_info: Option<&CopyDeviceMemoryImageInfoKHR>,
23001 ) {
23002 let fp = self
23003 .commands()
23004 .cmd_copy_image_to_memory_khr
23005 .expect("vkCmdCopyImageToMemoryKHR not loaded");
23006 let p_copy_memory_info_ptr =
23007 p_copy_memory_info.map_or(core::ptr::null(), core::ptr::from_ref);
23008 unsafe { fp(command_buffer, p_copy_memory_info_ptr) };
23009 }
23010 ///Wraps [`vkCmdUpdateMemoryKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdUpdateMemoryKHR.html).
23011 /**
23012 Provided by **VK_KHR_device_address_commands**.*/
23013 ///
23014 ///# Safety
23015 ///- `commandBuffer` (self) must be valid and not destroyed.
23016 ///- `commandBuffer` must be externally synchronized.
23017 ///
23018 ///# Panics
23019 ///Panics if `vkCmdUpdateMemoryKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23020 ///
23021 ///# Usage Notes
23022 ///
23023 ///Device-address variant of `cmd_update_buffer`. Writes a small
23024 ///amount of inline data to a device address range, instead of
23025 ///targeting a buffer handle.
23026 ///
23027 ///`data_size` must be ≤ 65536 bytes and a multiple of 4. For
23028 ///larger transfers, use `cmd_copy_memory_khr`.
23029 ///
23030 ///The `DeviceAddressRangeKHR` specifies the destination address.
23031 ///
23032 ///Requires `VK_KHR_device_address_commands`.
23033 pub unsafe fn cmd_update_memory_khr(
23034 &self,
23035 command_buffer: CommandBuffer,
23036 p_dst_range: &DeviceAddressRangeKHR,
23037 dst_flags: AddressCommandFlagsKHR,
23038 data_size: u64,
23039 p_data: *const core::ffi::c_void,
23040 ) {
23041 let fp = self
23042 .commands()
23043 .cmd_update_memory_khr
23044 .expect("vkCmdUpdateMemoryKHR not loaded");
23045 unsafe { fp(command_buffer, p_dst_range, dst_flags, data_size, p_data) };
23046 }
23047 ///Wraps [`vkCmdFillMemoryKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdFillMemoryKHR.html).
23048 /**
23049 Provided by **VK_KHR_device_address_commands**.*/
23050 ///
23051 ///# Safety
23052 ///- `commandBuffer` (self) must be valid and not destroyed.
23053 ///- `commandBuffer` must be externally synchronized.
23054 ///
23055 ///# Panics
23056 ///Panics if `vkCmdFillMemoryKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23057 ///
23058 ///# Usage Notes
23059 ///
23060 ///Device-address variant of `cmd_fill_buffer`. Fills a device
23061 ///address range with a repeating 32-bit `data` value, instead of
23062 ///targeting a buffer handle.
23063 ///
23064 ///The `DeviceAddressRangeKHR` specifies the destination address
23065 ///and size. The fill size must be a multiple of 4 bytes.
23066 ///
23067 ///Requires `VK_KHR_device_address_commands`.
23068 pub unsafe fn cmd_fill_memory_khr(
23069 &self,
23070 command_buffer: CommandBuffer,
23071 p_dst_range: &DeviceAddressRangeKHR,
23072 dst_flags: AddressCommandFlagsKHR,
23073 data: u32,
23074 ) {
23075 let fp = self
23076 .commands()
23077 .cmd_fill_memory_khr
23078 .expect("vkCmdFillMemoryKHR not loaded");
23079 unsafe { fp(command_buffer, p_dst_range, dst_flags, data) };
23080 }
23081 ///Wraps [`vkCmdCopyQueryPoolResultsToMemoryKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyQueryPoolResultsToMemoryKHR.html).
23082 /**
23083 Provided by **VK_KHR_device_address_commands**.*/
23084 ///
23085 ///# Safety
23086 ///- `commandBuffer` (self) must be valid and not destroyed.
23087 ///- `commandBuffer` must be externally synchronized.
23088 ///
23089 ///# Panics
23090 ///Panics if `vkCmdCopyQueryPoolResultsToMemoryKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23091 ///
23092 ///# Usage Notes
23093 ///
23094 ///Device-address variant of `cmd_copy_query_pool_results`. Copies
23095 ///query results directly to a device address range instead of a
23096 ///buffer handle.
23097 ///
23098 ///`first_query` and `query_count` select which queries to copy.
23099 ///`query_result_flags` controls formatting (`_64_BIT`, `WAIT`,
23100 ///`WITH_AVAILABILITY`, `PARTIAL`).
23101 ///
23102 ///The `StridedDeviceAddressRangeKHR` specifies the destination
23103 ///address and stride between results.
23104 ///
23105 ///Requires `VK_KHR_device_address_commands`.
23106 pub unsafe fn cmd_copy_query_pool_results_to_memory_khr(
23107 &self,
23108 command_buffer: CommandBuffer,
23109 query_pool: QueryPool,
23110 first_query: u32,
23111 query_count: u32,
23112 p_dst_range: &StridedDeviceAddressRangeKHR,
23113 dst_flags: AddressCommandFlagsKHR,
23114 query_result_flags: QueryResultFlags,
23115 ) {
23116 let fp = self
23117 .commands()
23118 .cmd_copy_query_pool_results_to_memory_khr
23119 .expect("vkCmdCopyQueryPoolResultsToMemoryKHR not loaded");
23120 unsafe {
23121 fp(
23122 command_buffer,
23123 query_pool,
23124 first_query,
23125 query_count,
23126 p_dst_range,
23127 dst_flags,
23128 query_result_flags,
23129 )
23130 };
23131 }
23132 ///Wraps [`vkCmdBeginConditionalRendering2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginConditionalRendering2EXT.html).
23133 /**
23134 Provided by **VK_KHR_device_address_commands**.*/
23135 ///
23136 ///# Safety
23137 ///- `commandBuffer` (self) must be valid and not destroyed.
23138 ///- `commandBuffer` must be externally synchronized.
23139 ///
23140 ///# Panics
23141 ///Panics if `vkCmdBeginConditionalRendering2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23142 ///
23143 ///# Usage Notes
23144 ///
23145 ///Device-address variant of `cmd_begin_conditional_rendering_ext`.
23146 ///Instead of a buffer handle + offset, the condition is read from a
23147 ///`DeviceAddress` specified in `ConditionalRenderingBeginInfo2EXT`.
23148 ///
23149 ///When the 32-bit value at the address is zero, subsequent rendering
23150 ///and dispatch commands are discarded (or the inverse, if
23151 ///`INVERTED` is set). End the conditional block with
23152 ///`cmd_end_conditional_rendering_ext`.
23153 ///
23154 ///Requires `VK_KHR_device_address_commands` and
23155 ///`VK_EXT_conditional_rendering`.
23156 pub unsafe fn cmd_begin_conditional_rendering2_ext(
23157 &self,
23158 command_buffer: CommandBuffer,
23159 p_conditional_rendering_begin: &ConditionalRenderingBeginInfo2EXT,
23160 ) {
23161 let fp = self
23162 .commands()
23163 .cmd_begin_conditional_rendering2_ext
23164 .expect("vkCmdBeginConditionalRendering2EXT not loaded");
23165 unsafe { fp(command_buffer, p_conditional_rendering_begin) };
23166 }
23167 ///Wraps [`vkCmdBindTransformFeedbackBuffers2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindTransformFeedbackBuffers2EXT.html).
23168 /**
23169 Provided by **VK_KHR_device_address_commands**.*/
23170 ///
23171 ///# Safety
23172 ///- `commandBuffer` (self) must be valid and not destroyed.
23173 ///- `commandBuffer` must be externally synchronized.
23174 ///
23175 ///# Panics
23176 ///Panics if `vkCmdBindTransformFeedbackBuffers2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23177 ///
23178 ///# Usage Notes
23179 ///
23180 ///Device-address variant of `cmd_bind_transform_feedback_buffers_ext`.
23181 ///Binds transform feedback output buffers using device addresses
23182 ///instead of buffer handles.
23183 ///
23184 ///Each `BindTransformFeedbackBuffer2InfoEXT` specifies a device
23185 ///address and size for one binding slot starting at `first_binding`.
23186 ///
23187 ///Requires `VK_KHR_device_address_commands` and
23188 ///`VK_EXT_transform_feedback`.
23189 pub unsafe fn cmd_bind_transform_feedback_buffers2_ext(
23190 &self,
23191 command_buffer: CommandBuffer,
23192 first_binding: u32,
23193 p_binding_infos: &[BindTransformFeedbackBuffer2InfoEXT],
23194 ) {
23195 let fp = self
23196 .commands()
23197 .cmd_bind_transform_feedback_buffers2_ext
23198 .expect("vkCmdBindTransformFeedbackBuffers2EXT not loaded");
23199 unsafe {
23200 fp(
23201 command_buffer,
23202 first_binding,
23203 p_binding_infos.len() as u32,
23204 p_binding_infos.as_ptr(),
23205 )
23206 };
23207 }
23208 ///Wraps [`vkCmdBeginTransformFeedback2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginTransformFeedback2EXT.html).
23209 /**
23210 Provided by **VK_KHR_device_address_commands**.*/
23211 ///
23212 ///# Safety
23213 ///- `commandBuffer` (self) must be valid and not destroyed.
23214 ///- `commandBuffer` must be externally synchronized.
23215 ///
23216 ///# Panics
23217 ///Panics if `vkCmdBeginTransformFeedback2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23218 ///
23219 ///# Usage Notes
23220 ///
23221 ///Device-address variant of `cmd_begin_transform_feedback_ext`.
23222 ///Activates transform feedback using counter buffers specified via
23223 ///device addresses in `BindTransformFeedbackBuffer2InfoEXT` rather
23224 ///than buffer handles.
23225 ///
23226 ///`first_counter_range` and the info array identify which transform
23227 ///feedback counter ranges to resume from. Pass empty counter infos
23228 ///to start from offset zero.
23229 ///
23230 ///End the transform feedback pass with
23231 ///`cmd_end_transform_feedback2_ext`.
23232 ///
23233 ///Requires `VK_KHR_device_address_commands` and
23234 ///`VK_EXT_transform_feedback`.
23235 pub unsafe fn cmd_begin_transform_feedback2_ext(
23236 &self,
23237 command_buffer: CommandBuffer,
23238 first_counter_range: u32,
23239 p_counter_infos: &[BindTransformFeedbackBuffer2InfoEXT],
23240 ) {
23241 let fp = self
23242 .commands()
23243 .cmd_begin_transform_feedback2_ext
23244 .expect("vkCmdBeginTransformFeedback2EXT not loaded");
23245 unsafe {
23246 fp(
23247 command_buffer,
23248 first_counter_range,
23249 p_counter_infos.len() as u32,
23250 p_counter_infos.as_ptr(),
23251 )
23252 };
23253 }
23254 ///Wraps [`vkCmdEndTransformFeedback2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndTransformFeedback2EXT.html).
23255 /**
23256 Provided by **VK_KHR_device_address_commands**.*/
23257 ///
23258 ///# Safety
23259 ///- `commandBuffer` (self) must be valid and not destroyed.
23260 ///- `commandBuffer` must be externally synchronized.
23261 ///
23262 ///# Panics
23263 ///Panics if `vkCmdEndTransformFeedback2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23264 ///
23265 ///# Usage Notes
23266 ///
23267 ///Device-address variant of `cmd_end_transform_feedback_ext`.
23268 ///Stops transform feedback and writes counter values to device
23269 ///addresses specified in `BindTransformFeedbackBuffer2InfoEXT`.
23270 ///
23271 ///These saved counter values can be passed to
23272 ///`cmd_begin_transform_feedback2_ext` to resume feedback in a
23273 ///later render pass.
23274 ///
23275 ///Requires `VK_KHR_device_address_commands` and
23276 ///`VK_EXT_transform_feedback`.
23277 pub unsafe fn cmd_end_transform_feedback2_ext(
23278 &self,
23279 command_buffer: CommandBuffer,
23280 first_counter_range: u32,
23281 p_counter_infos: &[BindTransformFeedbackBuffer2InfoEXT],
23282 ) {
23283 let fp = self
23284 .commands()
23285 .cmd_end_transform_feedback2_ext
23286 .expect("vkCmdEndTransformFeedback2EXT not loaded");
23287 unsafe {
23288 fp(
23289 command_buffer,
23290 first_counter_range,
23291 p_counter_infos.len() as u32,
23292 p_counter_infos.as_ptr(),
23293 )
23294 };
23295 }
23296 ///Wraps [`vkCmdDrawIndirectByteCount2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndirectByteCount2EXT.html).
23297 /**
23298 Provided by **VK_KHR_device_address_commands**.*/
23299 ///
23300 ///# Safety
23301 ///- `commandBuffer` (self) must be valid and not destroyed.
23302 ///- `commandBuffer` must be externally synchronized.
23303 ///
23304 ///# Panics
23305 ///Panics if `vkCmdDrawIndirectByteCount2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23306 ///
23307 ///# Usage Notes
23308 ///
23309 ///Device-address variant of `cmd_draw_indirect_byte_count_ext`.
23310 ///Draws vertices using a byte count from a transform feedback
23311 ///counter, with the counter buffer specified via device address
23312 ///instead of a buffer handle.
23313 ///
23314 ///`counter_offset` is the byte offset within the counter value
23315 ///to account for any header. `vertex_stride` determines how many
23316 ///bytes each vertex consumes.
23317 ///
23318 ///Requires `VK_KHR_device_address_commands` and
23319 ///`VK_EXT_transform_feedback`.
23320 pub unsafe fn cmd_draw_indirect_byte_count2_ext(
23321 &self,
23322 command_buffer: CommandBuffer,
23323 instance_count: u32,
23324 first_instance: u32,
23325 p_counter_info: &BindTransformFeedbackBuffer2InfoEXT,
23326 counter_offset: u32,
23327 vertex_stride: u32,
23328 ) {
23329 let fp = self
23330 .commands()
23331 .cmd_draw_indirect_byte_count2_ext
23332 .expect("vkCmdDrawIndirectByteCount2EXT not loaded");
23333 unsafe {
23334 fp(
23335 command_buffer,
23336 instance_count,
23337 first_instance,
23338 p_counter_info,
23339 counter_offset,
23340 vertex_stride,
23341 )
23342 };
23343 }
23344 ///Wraps [`vkCmdWriteMarkerToMemoryAMD`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWriteMarkerToMemoryAMD.html).
23345 /**
23346 Provided by **VK_KHR_device_address_commands**.*/
23347 ///
23348 ///# Safety
23349 ///- `commandBuffer` (self) must be valid and not destroyed.
23350 ///- `commandBuffer` must be externally synchronized.
23351 ///
23352 ///# Panics
23353 ///Panics if `vkCmdWriteMarkerToMemoryAMD` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23354 ///
23355 ///# Usage Notes
23356 ///
23357 ///Device-address variant of the AMD buffer marker extension. Writes
23358 ///a 32-bit marker value to a device address at a specific pipeline
23359 ///stage.
23360 ///
23361 ///The `MemoryMarkerInfoAMD` specifies the pipeline stage, device
23362 ///address, and marker value. Useful for GPU crash debugging,
23363 ///markers that were written indicate how far the GPU progressed
23364 ///before a fault.
23365 ///
23366 ///Requires `VK_KHR_device_address_commands`. This is the
23367 ///device-address counterpart of `cmd_write_buffer_marker_amd`.
23368 pub unsafe fn cmd_write_marker_to_memory_amd(
23369 &self,
23370 command_buffer: CommandBuffer,
23371 p_info: &MemoryMarkerInfoAMD,
23372 ) {
23373 let fp = self
23374 .commands()
23375 .cmd_write_marker_to_memory_amd
23376 .expect("vkCmdWriteMarkerToMemoryAMD not loaded");
23377 unsafe { fp(command_buffer, p_info) };
23378 }
23379 ///Wraps [`vkCmdBindIndexBuffer3KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindIndexBuffer3KHR.html).
23380 /**
23381 Provided by **VK_KHR_device_address_commands**.*/
23382 ///
23383 ///# Safety
23384 ///- `commandBuffer` (self) must be valid and not destroyed.
23385 ///- `commandBuffer` must be externally synchronized.
23386 ///
23387 ///# Panics
23388 ///Panics if `vkCmdBindIndexBuffer3KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23389 ///
23390 ///# Usage Notes
23391 ///
23392 ///Device-address variant of `cmd_bind_index_buffer`. Binds an index
23393 ///buffer for subsequent indexed draw commands using a device address
23394 ///instead of a buffer handle.
23395 ///
23396 ///The `BindIndexBuffer3InfoKHR` struct specifies the device address,
23397 ///size, and index type (`UINT16`, `UINT32`, or `UINT8` if enabled).
23398 ///
23399 ///Supersedes `cmd_bind_index_buffer` and `cmd_bind_index_buffer2`
23400 ///when using `VK_KHR_device_address_commands`.
23401 pub unsafe fn cmd_bind_index_buffer3_khr(
23402 &self,
23403 command_buffer: CommandBuffer,
23404 p_info: &BindIndexBuffer3InfoKHR,
23405 ) {
23406 let fp = self
23407 .commands()
23408 .cmd_bind_index_buffer3_khr
23409 .expect("vkCmdBindIndexBuffer3KHR not loaded");
23410 unsafe { fp(command_buffer, p_info) };
23411 }
23412 ///Wraps [`vkCmdBindVertexBuffers3KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindVertexBuffers3KHR.html).
23413 /**
23414 Provided by **VK_KHR_device_address_commands**.*/
23415 ///
23416 ///# Safety
23417 ///- `commandBuffer` (self) must be valid and not destroyed.
23418 ///- `commandBuffer` must be externally synchronized.
23419 ///
23420 ///# Panics
23421 ///Panics if `vkCmdBindVertexBuffers3KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23422 ///
23423 ///# Usage Notes
23424 ///
23425 ///Device-address variant of `cmd_bind_vertex_buffers`. Binds vertex
23426 ///buffers for subsequent draw commands using device addresses instead
23427 ///of buffer handles.
23428 ///
23429 ///Each `BindVertexBuffer3InfoKHR` specifies a device address, size,
23430 ///and stride for one binding slot starting at `first_binding`.
23431 ///
23432 ///Supersedes `cmd_bind_vertex_buffers`, `cmd_bind_vertex_buffers2`,
23433 ///and the core 1.4 equivalent when using
23434 ///`VK_KHR_device_address_commands`.
23435 pub unsafe fn cmd_bind_vertex_buffers3_khr(
23436 &self,
23437 command_buffer: CommandBuffer,
23438 first_binding: u32,
23439 p_binding_infos: &[BindVertexBuffer3InfoKHR],
23440 ) {
23441 let fp = self
23442 .commands()
23443 .cmd_bind_vertex_buffers3_khr
23444 .expect("vkCmdBindVertexBuffers3KHR not loaded");
23445 unsafe {
23446 fp(
23447 command_buffer,
23448 first_binding,
23449 p_binding_infos.len() as u32,
23450 p_binding_infos.as_ptr(),
23451 )
23452 };
23453 }
23454 ///Wraps [`vkCmdDrawIndirect2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndirect2KHR.html).
23455 /**
23456 Provided by **VK_KHR_device_address_commands**.*/
23457 ///
23458 ///# Safety
23459 ///- `commandBuffer` (self) must be valid and not destroyed.
23460 ///- `commandBuffer` must be externally synchronized.
23461 ///
23462 ///# Panics
23463 ///Panics if `vkCmdDrawIndirect2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23464 ///
23465 ///# Usage Notes
23466 ///
23467 ///Device-address variant of `cmd_draw_indirect`. Reads non-indexed
23468 ///draw parameters from a device address instead of a buffer handle
23469 ///+ offset.
23470 ///
23471 ///The `DrawIndirect2InfoKHR` specifies the device address, draw
23472 ///count, and stride.
23473 ///
23474 ///Requires `VK_KHR_device_address_commands`.
23475 pub unsafe fn cmd_draw_indirect2_khr(
23476 &self,
23477 command_buffer: CommandBuffer,
23478 p_info: &DrawIndirect2InfoKHR,
23479 ) {
23480 let fp = self
23481 .commands()
23482 .cmd_draw_indirect2_khr
23483 .expect("vkCmdDrawIndirect2KHR not loaded");
23484 unsafe { fp(command_buffer, p_info) };
23485 }
23486 ///Wraps [`vkCmdDrawIndexedIndirect2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndexedIndirect2KHR.html).
23487 /**
23488 Provided by **VK_KHR_device_address_commands**.*/
23489 ///
23490 ///# Safety
23491 ///- `commandBuffer` (self) must be valid and not destroyed.
23492 ///- `commandBuffer` must be externally synchronized.
23493 ///
23494 ///# Panics
23495 ///Panics if `vkCmdDrawIndexedIndirect2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23496 ///
23497 ///# Usage Notes
23498 ///
23499 ///Device-address variant of `cmd_draw_indexed_indirect`. Reads
23500 ///indexed draw parameters from a device address instead of a buffer
23501 ///handle + offset.
23502 ///
23503 ///The `DrawIndirect2InfoKHR` specifies the device address, draw
23504 ///count, and stride.
23505 ///
23506 ///Requires `VK_KHR_device_address_commands`.
23507 pub unsafe fn cmd_draw_indexed_indirect2_khr(
23508 &self,
23509 command_buffer: CommandBuffer,
23510 p_info: &DrawIndirect2InfoKHR,
23511 ) {
23512 let fp = self
23513 .commands()
23514 .cmd_draw_indexed_indirect2_khr
23515 .expect("vkCmdDrawIndexedIndirect2KHR not loaded");
23516 unsafe { fp(command_buffer, p_info) };
23517 }
23518 ///Wraps [`vkCmdDrawIndirectCount2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndirectCount2KHR.html).
23519 /**
23520 Provided by **VK_KHR_device_address_commands**.*/
23521 ///
23522 ///# Safety
23523 ///- `commandBuffer` (self) must be valid and not destroyed.
23524 ///- `commandBuffer` must be externally synchronized.
23525 ///
23526 ///# Panics
23527 ///Panics if `vkCmdDrawIndirectCount2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23528 ///
23529 ///# Usage Notes
23530 ///
23531 ///Device-address variant of `cmd_draw_indirect_count`. Reads
23532 ///non-indexed draw parameters and the draw count from device
23533 ///addresses instead of buffer handles.
23534 ///
23535 ///The `DrawIndirectCount2InfoKHR` specifies both the draw parameter
23536 ///address and the count address, along with `max_draw_count` and
23537 ///stride.
23538 ///
23539 ///Requires `VK_KHR_device_address_commands`.
23540 pub unsafe fn cmd_draw_indirect_count2_khr(
23541 &self,
23542 command_buffer: CommandBuffer,
23543 p_info: &DrawIndirectCount2InfoKHR,
23544 ) {
23545 let fp = self
23546 .commands()
23547 .cmd_draw_indirect_count2_khr
23548 .expect("vkCmdDrawIndirectCount2KHR not loaded");
23549 unsafe { fp(command_buffer, p_info) };
23550 }
23551 ///Wraps [`vkCmdDrawIndexedIndirectCount2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndexedIndirectCount2KHR.html).
23552 /**
23553 Provided by **VK_KHR_device_address_commands**.*/
23554 ///
23555 ///# Safety
23556 ///- `commandBuffer` (self) must be valid and not destroyed.
23557 ///- `commandBuffer` must be externally synchronized.
23558 ///
23559 ///# Panics
23560 ///Panics if `vkCmdDrawIndexedIndirectCount2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23561 ///
23562 ///# Usage Notes
23563 ///
23564 ///Device-address variant of `cmd_draw_indexed_indirect_count`. Reads
23565 ///indexed draw parameters and the draw count from device addresses
23566 ///instead of buffer handles.
23567 ///
23568 ///The `DrawIndirectCount2InfoKHR` specifies both the draw parameter
23569 ///address and the count address, along with `max_draw_count` and
23570 ///stride.
23571 ///
23572 ///Requires `VK_KHR_device_address_commands`.
23573 pub unsafe fn cmd_draw_indexed_indirect_count2_khr(
23574 &self,
23575 command_buffer: CommandBuffer,
23576 p_info: &DrawIndirectCount2InfoKHR,
23577 ) {
23578 let fp = self
23579 .commands()
23580 .cmd_draw_indexed_indirect_count2_khr
23581 .expect("vkCmdDrawIndexedIndirectCount2KHR not loaded");
23582 unsafe { fp(command_buffer, p_info) };
23583 }
23584 ///Wraps [`vkCmdDrawMeshTasksIndirect2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMeshTasksIndirect2EXT.html).
23585 /**
23586 Provided by **VK_KHR_device_address_commands**.*/
23587 ///
23588 ///# Safety
23589 ///- `commandBuffer` (self) must be valid and not destroyed.
23590 ///- `commandBuffer` must be externally synchronized.
23591 ///
23592 ///# Panics
23593 ///Panics if `vkCmdDrawMeshTasksIndirect2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23594 ///
23595 ///# Usage Notes
23596 ///
23597 ///Device-address variant of `cmd_draw_mesh_tasks_indirect_ext`.
23598 ///Reads mesh shader dispatch parameters from a device address
23599 ///instead of a buffer handle.
23600 ///
23601 ///The `DrawIndirect2InfoKHR` specifies the device address, draw
23602 ///count, and stride.
23603 ///
23604 ///Requires `VK_KHR_device_address_commands` and
23605 ///`VK_EXT_mesh_shader`.
23606 pub unsafe fn cmd_draw_mesh_tasks_indirect2_ext(
23607 &self,
23608 command_buffer: CommandBuffer,
23609 p_info: &DrawIndirect2InfoKHR,
23610 ) {
23611 let fp = self
23612 .commands()
23613 .cmd_draw_mesh_tasks_indirect2_ext
23614 .expect("vkCmdDrawMeshTasksIndirect2EXT not loaded");
23615 unsafe { fp(command_buffer, p_info) };
23616 }
23617 ///Wraps [`vkCmdDrawMeshTasksIndirectCount2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMeshTasksIndirectCount2EXT.html).
23618 /**
23619 Provided by **VK_KHR_device_address_commands**.*/
23620 ///
23621 ///# Safety
23622 ///- `commandBuffer` (self) must be valid and not destroyed.
23623 ///- `commandBuffer` must be externally synchronized.
23624 ///
23625 ///# Panics
23626 ///Panics if `vkCmdDrawMeshTasksIndirectCount2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23627 ///
23628 ///# Usage Notes
23629 ///
23630 ///Device-address variant of `cmd_draw_mesh_tasks_indirect_count_ext`.
23631 ///Reads mesh shader dispatch parameters and the draw count from
23632 ///device addresses instead of buffer handles.
23633 ///
23634 ///The `DrawIndirectCount2InfoKHR` specifies both the draw parameter
23635 ///address and the count address, along with `max_draw_count` and
23636 ///stride.
23637 ///
23638 ///Requires `VK_KHR_device_address_commands` and
23639 ///`VK_EXT_mesh_shader`.
23640 pub unsafe fn cmd_draw_mesh_tasks_indirect_count2_ext(
23641 &self,
23642 command_buffer: CommandBuffer,
23643 p_info: &DrawIndirectCount2InfoKHR,
23644 ) {
23645 let fp = self
23646 .commands()
23647 .cmd_draw_mesh_tasks_indirect_count2_ext
23648 .expect("vkCmdDrawMeshTasksIndirectCount2EXT not loaded");
23649 unsafe { fp(command_buffer, p_info) };
23650 }
23651 ///Wraps [`vkCmdDispatchIndirect2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDispatchIndirect2KHR.html).
23652 /**
23653 Provided by **VK_KHR_device_address_commands**.*/
23654 ///
23655 ///# Safety
23656 ///- `commandBuffer` (self) must be valid and not destroyed.
23657 ///- `commandBuffer` must be externally synchronized.
23658 ///
23659 ///# Panics
23660 ///Panics if `vkCmdDispatchIndirect2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23661 ///
23662 ///# Usage Notes
23663 ///
23664 ///Device-address variant of `cmd_dispatch_indirect`. Reads the
23665 ///dispatch parameters (group counts) from a device address instead
23666 ///of a buffer handle + offset.
23667 ///
23668 ///The `DispatchIndirect2InfoKHR` specifies the device address where
23669 ///the `DispatchIndirectCommand` struct resides.
23670 ///
23671 ///Requires `VK_KHR_device_address_commands`.
23672 pub unsafe fn cmd_dispatch_indirect2_khr(
23673 &self,
23674 command_buffer: CommandBuffer,
23675 p_info: &DispatchIndirect2InfoKHR,
23676 ) {
23677 let fp = self
23678 .commands()
23679 .cmd_dispatch_indirect2_khr
23680 .expect("vkCmdDispatchIndirect2KHR not loaded");
23681 unsafe { fp(command_buffer, p_info) };
23682 }
23683 ///Wraps [`vkCreateAccelerationStructure2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateAccelerationStructure2KHR.html).
23684 /**
23685 Provided by **VK_KHR_device_address_commands**.*/
23686 ///
23687 ///# Errors
23688 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
23689 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
23690 ///- `VK_ERROR_VALIDATION_FAILED`
23691 ///- `VK_ERROR_UNKNOWN`
23692 ///
23693 ///# Safety
23694 ///- `device` (self) must be valid and not destroyed.
23695 ///
23696 ///# Panics
23697 ///Panics if `vkCreateAccelerationStructure2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23698 ///
23699 ///# Usage Notes
23700 ///
23701 ///Device-address variant of `create_acceleration_structure_khr`.
23702 ///Creates a ray tracing acceleration structure backed by a device
23703 ///address range instead of a buffer handle.
23704 ///
23705 ///The `AccelerationStructureCreateInfo2KHR` specifies the device
23706 ///address, size, type (top-level or bottom-level), and optional
23707 ///capture/replay address.
23708 ///
23709 ///Destroy with `destroy_acceleration_structure_khr`.
23710 ///
23711 ///Requires `VK_KHR_device_address_commands` and
23712 ///`VK_KHR_acceleration_structure`.
23713 pub unsafe fn create_acceleration_structure2_khr(
23714 &self,
23715 p_create_info: &AccelerationStructureCreateInfo2KHR,
23716 allocator: Option<&AllocationCallbacks>,
23717 ) -> VkResult<AccelerationStructureKHR> {
23718 let fp = self
23719 .commands()
23720 .create_acceleration_structure2_khr
23721 .expect("vkCreateAccelerationStructure2KHR not loaded");
23722 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
23723 let mut out = unsafe { core::mem::zeroed() };
23724 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
23725 Ok(out)
23726 }
23727}