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(&self, p_name: *const core::ffi::c_char) {
32 let fp = self
33 .commands()
34 .get_device_proc_addr
35 .expect("vkGetDeviceProcAddr not loaded");
36 unsafe { fp(self.handle(), p_name) };
37 }
38 ///Wraps [`vkDestroyDevice`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyDevice.html).
39 /**
40 Provided by **VK_BASE_VERSION_1_0**.*/
41 ///
42 ///# Safety
43 ///- `device` (self) must be valid and not destroyed.
44 ///- `device` must be externally synchronized.
45 ///
46 ///# Panics
47 ///Panics if `vkDestroyDevice` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
48 ///
49 ///# Usage Notes
50 ///
51 ///Destroys a logical device and frees its resources. All objects
52 ///created from this device (buffers, images, pipelines, command pools,
53 ///etc.) **must** be destroyed before calling this.
54 ///
55 ///A safe teardown order:
56 ///
57 ///1. `device_wait_idle`, ensure no GPU work is in flight.
58 ///2. Destroy all device-child objects (pipelines, buffers, images,
59 /// views, descriptor pools, command pools, fences, semaphores, etc.).
60 ///3. `free_memory` for all device memory allocations.
61 ///4. `destroy_device`.
62 ///
63 ///After this call the `Device` handle is invalid. Do not use it or any
64 ///object created from it.
65 ///
66 ///# Guide
67 ///
68 ///See [The Vulkan Object Model](https://hiddentale.github.io/vulkan_rust/concepts/object-model.html) in the vulkan_rust guide.
69 pub unsafe fn destroy_device(&self, allocator: Option<&AllocationCallbacks>) {
70 let fp = self
71 .commands()
72 .destroy_device
73 .expect("vkDestroyDevice not loaded");
74 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
75 unsafe { fp(self.handle(), alloc_ptr) };
76 }
77 ///Wraps [`vkGetDeviceQueue`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceQueue.html).
78 /**
79 Provided by **VK_BASE_VERSION_1_0**.*/
80 ///
81 ///# Safety
82 ///- `device` (self) must be valid and not destroyed.
83 ///
84 ///# Panics
85 ///Panics if `vkGetDeviceQueue` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
86 ///
87 ///# Usage Notes
88 ///
89 ///Retrieves a queue handle for a queue that was requested at device
90 ///creation time. The `queue_family_index` and `queue_index` must match
91 ///a family and index that was included in the `DeviceCreateInfo`'s
92 ///`queue_create_infos`.
93 ///
94 ///Queue handles are implicitly owned by the device, they do not need
95 ///to be destroyed and become invalid when the device is destroyed.
96 ///
97 ///Queues retrieved this way have no special flags. If you created
98 ///queues with `DeviceQueueCreateFlags` (e.g. protected queues), use
99 ///`get_device_queue2` instead.
100 ///
101 ///It is common to retrieve queues once after device creation and store
102 ///them for the lifetime of the device.
103 ///
104 ///# Guide
105 ///
106 ///See [Hello Triangle, Part 1](https://hiddentale.github.io/vulkan_rust/getting-started/hello-triangle-1.html) in the vulkan_rust guide.
107 pub unsafe fn get_device_queue(&self, queue_family_index: u32, queue_index: u32) -> Queue {
108 let fp = self
109 .commands()
110 .get_device_queue
111 .expect("vkGetDeviceQueue not loaded");
112 let mut out = unsafe { core::mem::zeroed() };
113 unsafe { fp(self.handle(), queue_family_index, queue_index, &mut out) };
114 out
115 }
116 ///Wraps [`vkQueueSubmit`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueSubmit.html).
117 /**
118 Provided by **VK_BASE_VERSION_1_0**.*/
119 ///
120 ///# Errors
121 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
122 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
123 ///- `VK_ERROR_DEVICE_LOST`
124 ///- `VK_ERROR_UNKNOWN`
125 ///- `VK_ERROR_VALIDATION_FAILED`
126 ///
127 ///# Safety
128 ///- `queue` (self) must be valid and not destroyed.
129 ///- `queue` must be externally synchronized.
130 ///- `fence` must be externally synchronized.
131 ///
132 ///# Panics
133 ///Panics if `vkQueueSubmit` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
134 ///
135 ///# Usage Notes
136 ///
137 ///`queue_submit` is the primary way to send recorded command buffers
138 ///to the GPU. Each `SubmitInfo` specifies:
139 ///
140 ///- **Wait semaphores + stage masks**: the submission waits on these
141 /// semaphores at the given pipeline stages before executing.
142 ///- **Command buffers**: executed in array order within the submission.
143 ///- **Signal semaphores**: signalled when all command buffers complete.
144 ///
145 ///**Fence**: pass a fence to know when the *entire batch* of submissions
146 ///completes on the CPU side. Passing `Fence::null()` means there is no
147 ///CPU-visible signal, you must use semaphores or `queue_wait_idle`
148 ///instead.
149 ///
150 ///Minimize `queue_submit` calls. Each call has driver overhead; batching
151 ///multiple `SubmitInfo` entries into one call is cheaper than separate
152 ///calls.
153 ///
154 ///**Thread safety**: a `Queue` must be externally synchronized. If
155 ///multiple threads submit to the same queue, you need a mutex.
156 ///
157 ///# Guide
158 ///
159 ///See [Synchronization](https://hiddentale.github.io/vulkan_rust/concepts/synchronization.html) in the vulkan_rust guide.
160 pub unsafe fn queue_submit(
161 &self,
162 queue: Queue,
163 p_submits: &[SubmitInfo],
164 fence: Fence,
165 ) -> VkResult<()> {
166 let fp = self
167 .commands()
168 .queue_submit
169 .expect("vkQueueSubmit not loaded");
170 check(unsafe { fp(queue, p_submits.len() as u32, p_submits.as_ptr(), fence) })
171 }
172 ///Wraps [`vkQueueWaitIdle`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueWaitIdle.html).
173 /**
174 Provided by **VK_BASE_VERSION_1_0**.*/
175 ///
176 ///# Errors
177 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
178 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
179 ///- `VK_ERROR_DEVICE_LOST`
180 ///- `VK_ERROR_UNKNOWN`
181 ///- `VK_ERROR_VALIDATION_FAILED`
182 ///
183 ///# Safety
184 ///- `queue` (self) must be valid and not destroyed.
185 ///- `queue` must be externally synchronized.
186 ///
187 ///# Panics
188 ///Panics if `vkQueueWaitIdle` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
189 ///
190 ///# Usage Notes
191 ///
192 ///Blocks the calling thread until all commands submitted to this queue
193 ///have completed. Equivalent to submitting a fence and immediately
194 ///waiting on it, but simpler.
195 ///
196 ///Use this for quick synchronization in non-performance-critical paths
197 ///(e.g. during teardown or after a one-shot transfer). In a render
198 ///loop, prefer fences or timeline semaphores for finer-grained
199 ///control, `queue_wait_idle` stalls the CPU and prevents overlap
200 ///between CPU and GPU work.
201 ///
202 ///The queue must be externally synchronized: do not call this while
203 ///another thread is submitting to the same queue.
204 pub unsafe fn queue_wait_idle(&self, queue: Queue) -> VkResult<()> {
205 let fp = self
206 .commands()
207 .queue_wait_idle
208 .expect("vkQueueWaitIdle not loaded");
209 check(unsafe { fp(queue) })
210 }
211 ///Wraps [`vkDeviceWaitIdle`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDeviceWaitIdle.html).
212 /**
213 Provided by **VK_BASE_VERSION_1_0**.*/
214 ///
215 ///# Errors
216 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
217 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
218 ///- `VK_ERROR_DEVICE_LOST`
219 ///- `VK_ERROR_UNKNOWN`
220 ///- `VK_ERROR_VALIDATION_FAILED`
221 ///
222 ///# Safety
223 ///- `device` (self) must be valid and not destroyed.
224 ///
225 ///# Panics
226 ///Panics if `vkDeviceWaitIdle` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
227 ///
228 ///# Usage Notes
229 ///
230 ///Blocks the calling thread until **all** queues on this device are
231 ///idle. This is the nuclear option for synchronization, it drains
232 ///every queue completely.
233 ///
234 ///Typical uses:
235 ///
236 ///- **Before destroying the device**: ensures no GPU work is in flight
237 /// before you start tearing down resources.
238 ///- **Before a swapchain resize**: guarantees all frames are done so
239 /// image views and framebuffers can be safely recreated.
240 ///
241 ///Avoid calling this in a render loop. It forces a full CPU–GPU
242 ///round-trip and prevents any overlap. Use per-frame fences or
243 ///timeline semaphores instead.
244 pub unsafe fn device_wait_idle(&self) -> VkResult<()> {
245 let fp = self
246 .commands()
247 .device_wait_idle
248 .expect("vkDeviceWaitIdle not loaded");
249 check(unsafe { fp(self.handle()) })
250 }
251 ///Wraps [`vkAllocateMemory`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAllocateMemory.html).
252 /**
253 Provided by **VK_BASE_VERSION_1_0**.*/
254 ///
255 ///# Errors
256 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
257 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
258 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
259 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
260 ///- `VK_ERROR_UNKNOWN`
261 ///- `VK_ERROR_VALIDATION_FAILED`
262 ///
263 ///# Safety
264 ///- `device` (self) must be valid and not destroyed.
265 ///
266 ///# Panics
267 ///Panics if `vkAllocateMemory` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
268 ///
269 ///# Usage Notes
270 ///
271 ///Memory allocation in Vulkan is expensive. Prefer sub-allocating from
272 ///large blocks using a memory allocator (e.g., `gpu-allocator`) rather
273 ///than calling this for every buffer or image.
274 ///
275 ///The returned `DeviceMemory` must be freed with `free_memory` when no
276 ///longer needed. Vulkan does not garbage-collect device memory.
277 ///
278 ///# Guide
279 ///
280 ///See [Memory Management](https://hiddentale.github.io/vulkan_rust/concepts/memory.html) in the vulkan_rust guide.
281 pub unsafe fn allocate_memory(
282 &self,
283 p_allocate_info: &MemoryAllocateInfo,
284 allocator: Option<&AllocationCallbacks>,
285 ) -> VkResult<DeviceMemory> {
286 let fp = self
287 .commands()
288 .allocate_memory
289 .expect("vkAllocateMemory not loaded");
290 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
291 let mut out = unsafe { core::mem::zeroed() };
292 check(unsafe { fp(self.handle(), p_allocate_info, alloc_ptr, &mut out) })?;
293 Ok(out)
294 }
295 ///Wraps [`vkFreeMemory`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkFreeMemory.html).
296 /**
297 Provided by **VK_BASE_VERSION_1_0**.*/
298 ///
299 ///# Safety
300 ///- `device` (self) must be valid and not destroyed.
301 ///- `memory` must be externally synchronized.
302 ///
303 ///# Panics
304 ///Panics if `vkFreeMemory` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
305 ///
306 ///# Usage Notes
307 ///
308 ///Frees a device memory allocation. All buffers and images bound to
309 ///this memory must already be destroyed, freeing memory while objects
310 ///are still bound is undefined behaviour.
311 ///
312 ///If the memory is currently mapped, it is implicitly unmapped before
313 ///being freed. You do not need to call `unmap_memory` first, although
314 ///doing so explicitly is a common defensive practice.
315 ///
316 ///Vulkan has a per-device allocation limit
317 ///(`max_memory_allocation_count`, often 4096). Sub-allocating from
318 ///large blocks and freeing them as a group keeps you well within this
319 ///limit.
320 pub unsafe fn free_memory(
321 &self,
322 memory: DeviceMemory,
323 allocator: Option<&AllocationCallbacks>,
324 ) {
325 let fp = self
326 .commands()
327 .free_memory
328 .expect("vkFreeMemory not loaded");
329 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
330 unsafe { fp(self.handle(), memory, alloc_ptr) };
331 }
332 ///Wraps [`vkUnmapMemory`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkUnmapMemory.html).
333 /**
334 Provided by **VK_BASE_VERSION_1_0**.*/
335 ///
336 ///# Safety
337 ///- `device` (self) must be valid and not destroyed.
338 ///- `memory` must be externally synchronized.
339 ///
340 ///# Panics
341 ///Panics if `vkUnmapMemory` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
342 ///
343 ///# Usage Notes
344 ///
345 ///Unmaps a previously mapped device memory region. After this call the
346 ///host pointer returned by `map_memory` is invalid.
347 ///
348 ///Unmapping is only strictly necessary before `free_memory` if you
349 ///want to be explicit. Freeing memory implicitly unmaps it.
350 ///
351 ///For persistently mapped memory (the recommended pattern), you
352 ///typically map once after allocation and unmap only during teardown.
353 ///There is no performance penalty for keeping memory mapped.
354 ///
355 ///If the memory type is not `HOST_COHERENT`, make sure to call
356 ///`flush_mapped_memory_ranges` after your final writes before
357 ///unmapping, to ensure the GPU sees the latest data.
358 pub unsafe fn unmap_memory(&self, memory: DeviceMemory) {
359 let fp = self
360 .commands()
361 .unmap_memory
362 .expect("vkUnmapMemory not loaded");
363 unsafe { fp(self.handle(), memory) };
364 }
365 ///Wraps [`vkFlushMappedMemoryRanges`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkFlushMappedMemoryRanges.html).
366 /**
367 Provided by **VK_BASE_VERSION_1_0**.*/
368 ///
369 ///# Errors
370 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
371 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
372 ///- `VK_ERROR_UNKNOWN`
373 ///- `VK_ERROR_VALIDATION_FAILED`
374 ///
375 ///# Safety
376 ///- `device` (self) must be valid and not destroyed.
377 ///
378 ///# Panics
379 ///Panics if `vkFlushMappedMemoryRanges` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
380 ///
381 ///# Usage Notes
382 ///
383 ///Flushes CPU writes to mapped non-coherent memory so the GPU can see
384 ///them. Only needed when the memory type does **not** include
385 ///`MEMORY_PROPERTY_HOST_COHERENT`.
386 ///
387 ///Call this **after** writing data through the mapped pointer and
388 ///**before** the GPU reads it (i.e. before the relevant
389 ///`queue_submit`).
390 ///
391 ///**Alignment**: the `offset` and `size` of each range must be
392 ///multiples of `non_coherent_atom_size` (from physical device limits),
393 ///or `offset` must be zero and `size` must be `VK_WHOLE_SIZE`. Failing
394 ///to align causes undefined behaviour on some implementations.
395 ///
396 ///Multiple ranges can be flushed in a single call. Batch them when
397 ///updating several sub-allocations within the same memory object.
398 ///
399 ///If you are using host-coherent memory, this call is unnecessary and
400 ///can be skipped entirely.
401 pub unsafe fn flush_mapped_memory_ranges(
402 &self,
403 p_memory_ranges: &[MappedMemoryRange],
404 ) -> VkResult<()> {
405 let fp = self
406 .commands()
407 .flush_mapped_memory_ranges
408 .expect("vkFlushMappedMemoryRanges not loaded");
409 check(unsafe {
410 fp(
411 self.handle(),
412 p_memory_ranges.len() as u32,
413 p_memory_ranges.as_ptr(),
414 )
415 })
416 }
417 ///Wraps [`vkInvalidateMappedMemoryRanges`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkInvalidateMappedMemoryRanges.html).
418 /**
419 Provided by **VK_BASE_VERSION_1_0**.*/
420 ///
421 ///# Errors
422 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
423 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
424 ///- `VK_ERROR_UNKNOWN`
425 ///- `VK_ERROR_VALIDATION_FAILED`
426 ///
427 ///# Safety
428 ///- `device` (self) must be valid and not destroyed.
429 ///
430 ///# Panics
431 ///Panics if `vkInvalidateMappedMemoryRanges` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
432 ///
433 ///# Usage Notes
434 ///
435 ///Invalidates CPU caches for mapped non-coherent memory so the CPU
436 ///can see data written by the GPU. The counterpart to
437 ///`flush_mapped_memory_ranges`.
438 ///
439 ///Call this **after** the GPU has finished writing (e.g. after
440 ///`wait_for_fences` on the relevant submission) and **before** reading
441 ///the data through the mapped pointer.
442 ///
443 ///The same alignment rules apply: `offset` and `size` must be
444 ///multiples of `non_coherent_atom_size`, or use offset zero with
445 ///`VK_WHOLE_SIZE`.
446 ///
447 ///If you are using host-coherent memory, this call is unnecessary,
448 ///GPU writes are automatically visible to the CPU. Most desktop GPUs
449 ///offer host-coherent memory types for host-visible heaps.
450 pub unsafe fn invalidate_mapped_memory_ranges(
451 &self,
452 p_memory_ranges: &[MappedMemoryRange],
453 ) -> VkResult<()> {
454 let fp = self
455 .commands()
456 .invalidate_mapped_memory_ranges
457 .expect("vkInvalidateMappedMemoryRanges not loaded");
458 check(unsafe {
459 fp(
460 self.handle(),
461 p_memory_ranges.len() as u32,
462 p_memory_ranges.as_ptr(),
463 )
464 })
465 }
466 ///Wraps [`vkGetDeviceMemoryCommitment`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceMemoryCommitment.html).
467 /**
468 Provided by **VK_BASE_VERSION_1_0**.*/
469 ///
470 ///# Safety
471 ///- `device` (self) must be valid and not destroyed.
472 ///
473 ///# Panics
474 ///Panics if `vkGetDeviceMemoryCommitment` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
475 ///
476 ///# Usage Notes
477 ///
478 ///Queries how many bytes of a lazily-allocated memory object are
479 ///currently backed by physical storage. Only meaningful for memory
480 ///allocated with `MEMORY_PROPERTY_LAZILY_ALLOCATED`.
481 ///
482 ///Lazily-allocated memory is primarily used for transient framebuffer
483 ///attachments on tile-based GPUs (mobile). The driver may not back the
484 ///full allocation with physical memory until tiles actually need it.
485 ///
486 ///On desktop GPUs this typically returns the full allocation size since
487 ///lazy allocation is rarely supported. Check
488 ///`memory_properties.memory_types` for the `LAZILY_ALLOCATED` flag
489 ///before relying on this.
490 pub unsafe fn get_device_memory_commitment(&self, memory: DeviceMemory) -> u64 {
491 let fp = self
492 .commands()
493 .get_device_memory_commitment
494 .expect("vkGetDeviceMemoryCommitment not loaded");
495 let mut out = unsafe { core::mem::zeroed() };
496 unsafe { fp(self.handle(), memory, &mut out) };
497 out
498 }
499 ///Wraps [`vkGetBufferMemoryRequirements`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetBufferMemoryRequirements.html).
500 /**
501 Provided by **VK_BASE_VERSION_1_0**.*/
502 ///
503 ///# Safety
504 ///- `device` (self) must be valid and not destroyed.
505 ///
506 ///# Panics
507 ///Panics if `vkGetBufferMemoryRequirements` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
508 ///
509 ///# Usage Notes
510 ///
511 ///Returns the memory requirements (size, alignment, compatible memory
512 ///type bits) for a buffer. Must be called before `bind_buffer_memory`.
513 ///
514 ///The returned `memory_type_bits` is a bitmask where bit *i* is set if
515 ///memory type *i* (from `get_physical_device_memory_properties`) is
516 ///compatible. Pick a type that satisfies both this mask and your
517 ///desired properties (`HOST_VISIBLE`, `DEVICE_LOCAL`, etc.).
518 ///
519 ///The `alignment` value must be respected when sub-allocating: the
520 ///offset passed to `bind_buffer_memory` must be a multiple of it.
521 ///
522 ///For Vulkan 1.1+, prefer `get_buffer_memory_requirements2` which
523 ///supports dedicated allocation queries via
524 ///`MemoryDedicatedRequirements`.
525 pub unsafe fn get_buffer_memory_requirements(&self, buffer: Buffer) -> MemoryRequirements {
526 let fp = self
527 .commands()
528 .get_buffer_memory_requirements
529 .expect("vkGetBufferMemoryRequirements not loaded");
530 let mut out = unsafe { core::mem::zeroed() };
531 unsafe { fp(self.handle(), buffer, &mut out) };
532 out
533 }
534 ///Wraps [`vkBindBufferMemory`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBindBufferMemory.html).
535 /**
536 Provided by **VK_BASE_VERSION_1_0**.*/
537 ///
538 ///# Errors
539 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
540 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
541 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
542 ///- `VK_ERROR_UNKNOWN`
543 ///- `VK_ERROR_VALIDATION_FAILED`
544 ///
545 ///# Safety
546 ///- `device` (self) must be valid and not destroyed.
547 ///- `buffer` must be externally synchronized.
548 ///
549 ///# Panics
550 ///Panics if `vkBindBufferMemory` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
551 ///
552 ///# Usage Notes
553 ///
554 ///Binds a `DeviceMemory` allocation (or a region of one) to a buffer.
555 ///Must be called before the buffer is used in any command.
556 ///
557 ///**Requirements**:
558 ///
559 ///1. Call `get_buffer_memory_requirements` first.
560 ///2. The `memory_type_index` used for allocation must have a bit set
561 /// in the returned `memory_type_bits` mask.
562 ///3. `memory_offset` must be a multiple of the returned `alignment`.
563 ///4. `memory_offset + size` must not exceed the allocation size.
564 ///
565 ///**Sub-allocation**: multiple buffers can share one `DeviceMemory`
566 ///allocation at different offsets. This is strongly recommended,
567 ///drivers have a per-allocation limit (`max_memory_allocation_count`,
568 ///often 4096) and each allocation has overhead.
569 ///
570 ///Once bound, the memory binding cannot be changed for the lifetime of
571 ///the buffer. Destroy the buffer before freeing its backing memory.
572 pub unsafe fn bind_buffer_memory(
573 &self,
574 buffer: Buffer,
575 memory: DeviceMemory,
576 memory_offset: u64,
577 ) -> VkResult<()> {
578 let fp = self
579 .commands()
580 .bind_buffer_memory
581 .expect("vkBindBufferMemory not loaded");
582 check(unsafe { fp(self.handle(), buffer, memory, memory_offset) })
583 }
584 ///Wraps [`vkGetImageMemoryRequirements`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageMemoryRequirements.html).
585 /**
586 Provided by **VK_BASE_VERSION_1_0**.*/
587 ///
588 ///# Safety
589 ///- `device` (self) must be valid and not destroyed.
590 ///
591 ///# Panics
592 ///Panics if `vkGetImageMemoryRequirements` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
593 ///
594 ///# Usage Notes
595 ///
596 ///Returns the memory requirements (size, alignment, compatible memory
597 ///type bits) for an image. Must be called before `bind_image_memory`.
598 ///
599 ///Image memory requirements can differ significantly based on tiling,
600 ///format, and usage flags. An `IMAGE_TILING_OPTIMAL` image typically
601 ///requires `DEVICE_LOCAL` memory and has stricter alignment than a
602 ///linear image.
603 ///
604 ///When sub-allocating linear and optimal images from the same memory
605 ///object, the `buffer_image_granularity` device limit applies. You may
606 ///need extra padding between the two to satisfy this constraint.
607 ///
608 ///For Vulkan 1.1+, prefer `get_image_memory_requirements2` which
609 ///supports dedicated allocation queries.
610 pub unsafe fn get_image_memory_requirements(&self, image: Image) -> MemoryRequirements {
611 let fp = self
612 .commands()
613 .get_image_memory_requirements
614 .expect("vkGetImageMemoryRequirements not loaded");
615 let mut out = unsafe { core::mem::zeroed() };
616 unsafe { fp(self.handle(), image, &mut out) };
617 out
618 }
619 ///Wraps [`vkBindImageMemory`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBindImageMemory.html).
620 /**
621 Provided by **VK_BASE_VERSION_1_0**.*/
622 ///
623 ///# Errors
624 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
625 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
626 ///- `VK_ERROR_UNKNOWN`
627 ///- `VK_ERROR_VALIDATION_FAILED`
628 ///
629 ///# Safety
630 ///- `device` (self) must be valid and not destroyed.
631 ///- `image` must be externally synchronized.
632 ///
633 ///# Panics
634 ///Panics if `vkBindImageMemory` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
635 ///
636 ///# Usage Notes
637 ///
638 ///Binds a `DeviceMemory` allocation (or a region of one) to an image.
639 ///Must be called after `create_image` and before the image is used.
640 ///
641 ///**Requirements**:
642 ///
643 ///1. Call `get_image_memory_requirements` first.
644 ///2. The `memory_type_index` used for allocation must have a bit set
645 /// in the returned `memory_type_bits` mask.
646 ///3. `memory_offset` must be a multiple of the returned `alignment`.
647 ///
648 ///**Dedicated allocations**: some drivers perform better when certain
649 ///images (especially swapchain-sized color or depth targets) have their
650 ///own allocation. Query `get_image_memory_requirements2` with
651 ///`MemoryDedicatedRequirements` to check whether the driver prefers or
652 ///requires a dedicated allocation.
653 ///
654 ///**Sub-allocation**: like buffers, multiple images can share one
655 ///allocation at different offsets. Respect alignment from the memory
656 ///requirements, and note that linear and optimal-tiling images may
657 ///need `buffer_image_granularity` spacing between them.
658 ///
659 ///Once bound, the memory binding is permanent. Destroy the image
660 ///before freeing its backing memory.
661 pub unsafe fn bind_image_memory(
662 &self,
663 image: Image,
664 memory: DeviceMemory,
665 memory_offset: u64,
666 ) -> VkResult<()> {
667 let fp = self
668 .commands()
669 .bind_image_memory
670 .expect("vkBindImageMemory not loaded");
671 check(unsafe { fp(self.handle(), image, memory, memory_offset) })
672 }
673 ///Wraps [`vkGetImageSparseMemoryRequirements`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageSparseMemoryRequirements.html).
674 /**
675 Provided by **VK_BASE_VERSION_1_0**.*/
676 ///
677 ///# Safety
678 ///- `device` (self) must be valid and not destroyed.
679 ///
680 ///# Panics
681 ///Panics if `vkGetImageSparseMemoryRequirements` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
682 ///
683 ///# Usage Notes
684 ///
685 ///Queries the sparse memory requirements for an image created with
686 ///one of the `IMAGE_CREATE_SPARSE_*` flags. Returns a list of sparse
687 ///image format properties describing the memory layout for each
688 ///image aspect (color, depth, stencil, metadata).
689 ///
690 ///Sparse resources allow partially-resident textures where only some
691 ///mip levels or regions are backed by physical memory. This is an
692 ///advanced feature primarily used for virtual texturing and terrain
693 ///streaming.
694 ///
695 ///If the image was not created with sparse flags, this returns an
696 ///empty list. Check `physical_device_features.sparse_binding` before
697 ///using sparse resources.
698 pub unsafe fn get_image_sparse_memory_requirements(
699 &self,
700 image: Image,
701 ) -> Vec<SparseImageMemoryRequirements> {
702 let fp = self
703 .commands()
704 .get_image_sparse_memory_requirements
705 .expect("vkGetImageSparseMemoryRequirements not loaded");
706 fill_two_call(|count, data| unsafe { fp(self.handle(), image, count, data) })
707 }
708 ///Wraps [`vkQueueBindSparse`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueBindSparse.html).
709 /**
710 Provided by **VK_BASE_VERSION_1_0**.*/
711 ///
712 ///# Errors
713 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
714 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
715 ///- `VK_ERROR_DEVICE_LOST`
716 ///- `VK_ERROR_UNKNOWN`
717 ///- `VK_ERROR_VALIDATION_FAILED`
718 ///
719 ///# Safety
720 ///- `queue` (self) must be valid and not destroyed.
721 ///- `queue` must be externally synchronized.
722 ///- `fence` must be externally synchronized.
723 ///
724 ///# Panics
725 ///Panics if `vkQueueBindSparse` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
726 ///
727 ///# Usage Notes
728 ///
729 ///Binds sparse memory regions to sparse resources (buffers or images).
730 ///This is the only way to change the memory backing of a sparse
731 ///resource after creation.
732 ///
733 ///Sparse binding supports:
734 ///
735 ///- **Partial residency**: bind memory to individual mip tail regions
736 /// or image tiles, leaving others unbound.
737 ///- **Aliasing**: multiple sparse resources can alias the same memory
738 /// region (with `IMAGE_CREATE_SPARSE_ALIASED`).
739 ///- **Dynamic re-binding**: swap memory pages at runtime for virtual
740 /// texturing or streaming.
741 ///
742 ///The bind operation is asynchronous and can synchronize with
743 ///semaphores, similar to `queue_submit`. The queue must support sparse
744 ///binding (check `QUEUE_SPARSE_BINDING`).
745 ///
746 ///This is an advanced feature. Most applications use fully-bound
747 ///resources with `bind_buffer_memory` / `bind_image_memory` instead.
748 pub unsafe fn queue_bind_sparse(
749 &self,
750 queue: Queue,
751 p_bind_info: &[BindSparseInfo],
752 fence: Fence,
753 ) -> VkResult<()> {
754 let fp = self
755 .commands()
756 .queue_bind_sparse
757 .expect("vkQueueBindSparse not loaded");
758 check(unsafe { fp(queue, p_bind_info.len() as u32, p_bind_info.as_ptr(), fence) })
759 }
760 ///Wraps [`vkCreateFence`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateFence.html).
761 /**
762 Provided by **VK_BASE_VERSION_1_0**.*/
763 ///
764 ///# Errors
765 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
766 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
767 ///- `VK_ERROR_UNKNOWN`
768 ///- `VK_ERROR_VALIDATION_FAILED`
769 ///
770 ///# Safety
771 ///- `device` (self) must be valid and not destroyed.
772 ///
773 ///# Panics
774 ///Panics if `vkCreateFence` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
775 ///
776 ///# Usage Notes
777 ///
778 ///Fences are the primary CPU–GPU synchronization primitive. The CPU
779 ///blocks on `wait_for_fences` until the GPU signals the fence.
780 ///
781 ///**Initial state**: create with `FENCE_CREATE_SIGNALED` when the
782 ///fence is used in a frame loop that waits before the first submit.
783 ///Without this flag the first `wait_for_fences` would block forever.
784 ///
785 ///**Typical frame loop pattern**:
786 ///
787 ///1. `wait_for_fences`, block until the previous frame's GPU work
788 /// completes.
789 ///2. `reset_fences`, reset back to unsignaled.
790 ///3. Record and submit commands, passing the fence to `queue_submit`.
791 ///
792 ///A fence can only be associated with one submission at a time.
793 ///Submitting with a fence that is already pending is an error.
794 ///
795 ///For GPU–GPU synchronization (between queue submissions) use
796 ///semaphores instead. Fences are strictly for CPU-visible signalling.
797 ///
798 ///# Guide
799 ///
800 ///See [Synchronization](https://hiddentale.github.io/vulkan_rust/concepts/synchronization.html) in the vulkan_rust guide.
801 pub unsafe fn create_fence(
802 &self,
803 p_create_info: &FenceCreateInfo,
804 allocator: Option<&AllocationCallbacks>,
805 ) -> VkResult<Fence> {
806 let fp = self
807 .commands()
808 .create_fence
809 .expect("vkCreateFence not loaded");
810 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
811 let mut out = unsafe { core::mem::zeroed() };
812 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
813 Ok(out)
814 }
815 ///Wraps [`vkDestroyFence`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyFence.html).
816 /**
817 Provided by **VK_BASE_VERSION_1_0**.*/
818 ///
819 ///# Safety
820 ///- `device` (self) must be valid and not destroyed.
821 ///- `fence` must be externally synchronized.
822 ///
823 ///# Panics
824 ///Panics if `vkDestroyFence` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
825 ///
826 ///# Usage Notes
827 ///
828 ///Destroys a fence object. The fence must not be in use by any
829 ///pending `queue_submit` call, wait on it or call `device_wait_idle`
830 ///before destroying.
831 ///
832 ///Fences are lightweight objects but are still tracked by the driver.
833 ///Destroy them during teardown or when they are no longer part of your
834 ///synchronization scheme.
835 pub unsafe fn destroy_fence(&self, fence: Fence, allocator: Option<&AllocationCallbacks>) {
836 let fp = self
837 .commands()
838 .destroy_fence
839 .expect("vkDestroyFence not loaded");
840 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
841 unsafe { fp(self.handle(), fence, alloc_ptr) };
842 }
843 ///Wraps [`vkResetFences`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkResetFences.html).
844 /**
845 Provided by **VK_BASE_VERSION_1_0**.*/
846 ///
847 ///# Errors
848 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
849 ///- `VK_ERROR_UNKNOWN`
850 ///- `VK_ERROR_VALIDATION_FAILED`
851 ///
852 ///# Safety
853 ///- `device` (self) must be valid and not destroyed.
854 ///- `pFences` must be externally synchronized.
855 ///
856 ///# Panics
857 ///Panics if `vkResetFences` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
858 ///
859 ///# Usage Notes
860 ///
861 ///Resets one or more fences to the unsignaled state. Must be called
862 ///before reusing a fence in a new `queue_submit` call.
863 ///
864 ///The fence must not be currently waited on by `wait_for_fences` from
865 ///another thread. A common safe pattern:
866 ///
867 ///1. `wait_for_fences`, blocks until signaled.
868 ///2. `reset_fences`, immediately reset after the wait returns.
869 ///3. Submit new work with the fence.
870 ///
871 ///Resetting a fence that is already unsignaled is valid but wasteful.
872 ///Resetting a fence that is pending (submitted but not yet signaled)
873 ///is an error.
874 pub unsafe fn reset_fences(&self, p_fences: &[Fence]) -> VkResult<()> {
875 let fp = self
876 .commands()
877 .reset_fences
878 .expect("vkResetFences not loaded");
879 check(unsafe { fp(self.handle(), p_fences.len() as u32, p_fences.as_ptr()) })
880 }
881 ///Wraps [`vkGetFenceStatus`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetFenceStatus.html).
882 /**
883 Provided by **VK_BASE_VERSION_1_0**.*/
884 ///
885 ///# Errors
886 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
887 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
888 ///- `VK_ERROR_DEVICE_LOST`
889 ///- `VK_ERROR_UNKNOWN`
890 ///- `VK_ERROR_VALIDATION_FAILED`
891 ///
892 ///# Safety
893 ///- `device` (self) must be valid and not destroyed.
894 ///
895 ///# Panics
896 ///Panics if `vkGetFenceStatus` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
897 ///
898 ///# Usage Notes
899 ///
900 ///Non-blocking check of whether a fence is signaled. Returns
901 ///`VK_SUCCESS` if signaled, `VK_NOT_READY` if still pending.
902 ///
903 ///Use this for polling patterns where you want to do other work while
904 ///waiting:
905 ///
906 ///```text
907 ///loop {
908 /// if get_fence_status(fence) == VK_SUCCESS { break; }
909 /// // do other work...
910 ///}
911 ///```
912 ///
913 ///For blocking waits, prefer `wait_for_fences` which is more efficient
914 ///than a spin loop, it lets the CPU sleep until the driver signals.
915 ///
916 ///This call can also return device-lost errors, so check the result
917 ///even in non-error paths.
918 pub unsafe fn get_fence_status(&self, fence: Fence) -> VkResult<()> {
919 let fp = self
920 .commands()
921 .get_fence_status
922 .expect("vkGetFenceStatus not loaded");
923 check(unsafe { fp(self.handle(), fence) })
924 }
925 ///Wraps [`vkWaitForFences`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkWaitForFences.html).
926 /**
927 Provided by **VK_BASE_VERSION_1_0**.*/
928 ///
929 ///# Errors
930 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
931 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
932 ///- `VK_ERROR_DEVICE_LOST`
933 ///- `VK_ERROR_UNKNOWN`
934 ///- `VK_ERROR_VALIDATION_FAILED`
935 ///
936 ///# Safety
937 ///- `device` (self) must be valid and not destroyed.
938 ///
939 ///# Panics
940 ///Panics if `vkWaitForFences` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
941 ///
942 ///# Usage Notes
943 ///
944 ///Blocks the calling thread until one or all of the given fences are
945 ///signaled, or until the timeout expires.
946 ///
947 ///**`wait_all`**: when `true`, the call returns only after *every*
948 ///fence in the list is signaled. When `false`, it returns as soon as
949 ///*any* one fence is signaled.
950 ///
951 ///**Timeout**: specified in nanoseconds. `u64::MAX` means wait
952 ///indefinitely. A timeout of zero performs a non-blocking check
953 ///(equivalent to polling `get_fence_status` on each fence).
954 ///
955 ///Returns `VK_TIMEOUT` if the timeout expires before the condition is
956 ///met. This is not an error, check the return value and handle it
957 ///(e.g. log a warning or retry).
958 ///
959 ///**Typical frame loop**:
960 ///
961 ///```text
962 ///wait_for_fences(&[frame_fence], true, u64::MAX)
963 ///reset_fences(&[frame_fence])
964 #[doc = "// record and submit..."]
965 ///```
966 ///
967 ///After `wait_for_fences` returns successfully, all GPU work
968 ///associated with those fences is complete and the resources are safe
969 ///to reuse.
970 pub unsafe fn wait_for_fences(
971 &self,
972 p_fences: &[Fence],
973 wait_all: bool,
974 timeout: u64,
975 ) -> VkResult<()> {
976 let fp = self
977 .commands()
978 .wait_for_fences
979 .expect("vkWaitForFences not loaded");
980 check(unsafe {
981 fp(
982 self.handle(),
983 p_fences.len() as u32,
984 p_fences.as_ptr(),
985 wait_all as u32,
986 timeout,
987 )
988 })
989 }
990 ///Wraps [`vkCreateSemaphore`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateSemaphore.html).
991 /**
992 Provided by **VK_BASE_VERSION_1_0**.*/
993 ///
994 ///# Errors
995 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
996 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
997 ///- `VK_ERROR_UNKNOWN`
998 ///- `VK_ERROR_VALIDATION_FAILED`
999 ///
1000 ///# Safety
1001 ///- `device` (self) must be valid and not destroyed.
1002 ///
1003 ///# Panics
1004 ///Panics if `vkCreateSemaphore` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1005 ///
1006 ///# Usage Notes
1007 ///
1008 ///Creates a semaphore for GPU–GPU synchronization between queue
1009 ///submissions. Unlike fences (CPU–GPU), semaphores are invisible to
1010 ///the CPU, they are signaled and waited on entirely within
1011 ///`queue_submit` or `queue_present_khr`.
1012 ///
1013 ///**Binary semaphores** (the default) have two states: signaled and
1014 ///unsignaled. A submission signals the semaphore, and a later
1015 ///submission waits on it, which also resets it to unsignaled.
1016 ///
1017 ///**Timeline semaphores** (Vulkan 1.2+) have a monotonically
1018 ///increasing 64-bit counter. Create one by chaining
1019 ///`SemaphoreTypeCreateInfo` with `SEMAPHORE_TYPE_TIMELINE`. Timeline
1020 ///semaphores can be waited on and signaled from the CPU as well via
1021 ///`wait_semaphores` and `signal_semaphore`.
1022 ///
1023 ///Common uses:
1024 ///
1025 ///- Synchronize between a graphics queue submit and a present.
1026 ///- Order a transfer upload before a render pass that consumes it.
1027 ///- Coordinate work across different queue families.
1028 ///
1029 ///# Guide
1030 ///
1031 ///See [Synchronization](https://hiddentale.github.io/vulkan_rust/concepts/synchronization.html) in the vulkan_rust guide.
1032 pub unsafe fn create_semaphore(
1033 &self,
1034 p_create_info: &SemaphoreCreateInfo,
1035 allocator: Option<&AllocationCallbacks>,
1036 ) -> VkResult<Semaphore> {
1037 let fp = self
1038 .commands()
1039 .create_semaphore
1040 .expect("vkCreateSemaphore not loaded");
1041 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1042 let mut out = unsafe { core::mem::zeroed() };
1043 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1044 Ok(out)
1045 }
1046 ///Wraps [`vkDestroySemaphore`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroySemaphore.html).
1047 /**
1048 Provided by **VK_BASE_VERSION_1_0**.*/
1049 ///
1050 ///# Safety
1051 ///- `device` (self) must be valid and not destroyed.
1052 ///- `semaphore` must be externally synchronized.
1053 ///
1054 ///# Panics
1055 ///Panics if `vkDestroySemaphore` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1056 ///
1057 ///# Usage Notes
1058 ///
1059 ///Destroys a semaphore. The semaphore must not be referenced by any
1060 ///pending queue submission, either as a wait or signal semaphore.
1061 ///
1062 ///Wait for all submissions that use this semaphore to complete (via
1063 ///fences or `device_wait_idle`) before destroying it.
1064 pub unsafe fn destroy_semaphore(
1065 &self,
1066 semaphore: Semaphore,
1067 allocator: Option<&AllocationCallbacks>,
1068 ) {
1069 let fp = self
1070 .commands()
1071 .destroy_semaphore
1072 .expect("vkDestroySemaphore not loaded");
1073 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1074 unsafe { fp(self.handle(), semaphore, alloc_ptr) };
1075 }
1076 ///Wraps [`vkCreateEvent`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateEvent.html).
1077 /**
1078 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1079 ///
1080 ///# Errors
1081 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1082 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1083 ///- `VK_ERROR_UNKNOWN`
1084 ///- `VK_ERROR_VALIDATION_FAILED`
1085 ///
1086 ///# Safety
1087 ///- `device` (self) must be valid and not destroyed.
1088 ///
1089 ///# Panics
1090 ///Panics if `vkCreateEvent` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1091 ///
1092 ///# Usage Notes
1093 ///
1094 ///Creates an event, a fine-grained synchronisation primitive that
1095 ///can be signaled and waited on from both the host (CPU) and the
1096 ///device (GPU).
1097 ///
1098 ///Events are most useful for split barriers: signal an event at one
1099 ///point in a command buffer, do other work, then wait on it later.
1100 ///This gives the GPU more flexibility to overlap execution compared to
1101 ///a single `cmd_pipeline_barrier`.
1102 ///
1103 ///**Host-side usage**: `set_event` and `reset_event` signal and reset
1104 ///from the CPU. `get_event_status` polls the current state. However,
1105 ///host-signaled events cannot be reliably waited on by the GPU on all
1106 ///implementations, use them primarily for GPU–GPU sync within a
1107 ///queue.
1108 ///
1109 ///Events are lightweight and cheap to create.
1110 pub unsafe fn create_event(
1111 &self,
1112 p_create_info: &EventCreateInfo,
1113 allocator: Option<&AllocationCallbacks>,
1114 ) -> VkResult<Event> {
1115 let fp = self
1116 .commands()
1117 .create_event
1118 .expect("vkCreateEvent not loaded");
1119 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1120 let mut out = unsafe { core::mem::zeroed() };
1121 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1122 Ok(out)
1123 }
1124 ///Wraps [`vkDestroyEvent`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyEvent.html).
1125 /**
1126 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1127 ///
1128 ///# Safety
1129 ///- `device` (self) must be valid and not destroyed.
1130 ///- `event` must be externally synchronized.
1131 ///
1132 ///# Panics
1133 ///Panics if `vkDestroyEvent` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1134 ///
1135 ///# Usage Notes
1136 ///
1137 ///Destroys an event. The event must not be referenced by any pending
1138 ///command buffer. Wait for all relevant submissions to complete before
1139 ///destroying.
1140 pub unsafe fn destroy_event(&self, event: Event, allocator: Option<&AllocationCallbacks>) {
1141 let fp = self
1142 .commands()
1143 .destroy_event
1144 .expect("vkDestroyEvent not loaded");
1145 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1146 unsafe { fp(self.handle(), event, alloc_ptr) };
1147 }
1148 ///Wraps [`vkGetEventStatus`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetEventStatus.html).
1149 /**
1150 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1151 ///
1152 ///# Errors
1153 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1154 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1155 ///- `VK_ERROR_DEVICE_LOST`
1156 ///- `VK_ERROR_UNKNOWN`
1157 ///- `VK_ERROR_VALIDATION_FAILED`
1158 ///
1159 ///# Safety
1160 ///- `device` (self) must be valid and not destroyed.
1161 ///
1162 ///# Panics
1163 ///Panics if `vkGetEventStatus` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1164 ///
1165 ///# Usage Notes
1166 ///
1167 ///Returns whether an event is currently signaled or unsignaled.
1168 ///Returns `VK_EVENT_SET` if signaled, `VK_EVENT_RESET` if not.
1169 ///
1170 ///This is a non-blocking host-side query. Use it to poll for
1171 ///GPU-signaled events when you need to know the result without
1172 ///blocking. For blocking synchronisation, use fences instead.
1173 pub unsafe fn get_event_status(&self, event: Event) -> VkResult<()> {
1174 let fp = self
1175 .commands()
1176 .get_event_status
1177 .expect("vkGetEventStatus not loaded");
1178 check(unsafe { fp(self.handle(), event) })
1179 }
1180 ///Wraps [`vkSetEvent`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetEvent.html).
1181 /**
1182 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1183 ///
1184 ///# Errors
1185 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1186 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1187 ///- `VK_ERROR_UNKNOWN`
1188 ///- `VK_ERROR_VALIDATION_FAILED`
1189 ///
1190 ///# Safety
1191 ///- `device` (self) must be valid and not destroyed.
1192 ///- `event` must be externally synchronized.
1193 ///
1194 ///# Panics
1195 ///Panics if `vkSetEvent` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1196 ///
1197 ///# Usage Notes
1198 ///
1199 ///Signals an event from the host (CPU). After this call,
1200 ///`get_event_status` returns `VK_EVENT_SET`.
1201 ///
1202 ///Host-signaled events are primarily useful for host–host
1203 ///synchronisation or as a manual control mechanism. For GPU–GPU
1204 ///synchronisation, prefer `cmd_set_event` recorded in a command
1205 ///buffer.
1206 pub unsafe fn set_event(&self, event: Event) -> VkResult<()> {
1207 let fp = self.commands().set_event.expect("vkSetEvent not loaded");
1208 check(unsafe { fp(self.handle(), event) })
1209 }
1210 ///Wraps [`vkResetEvent`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkResetEvent.html).
1211 /**
1212 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1213 ///
1214 ///# Errors
1215 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1216 ///- `VK_ERROR_UNKNOWN`
1217 ///- `VK_ERROR_VALIDATION_FAILED`
1218 ///
1219 ///# Safety
1220 ///- `device` (self) must be valid and not destroyed.
1221 ///- `event` must be externally synchronized.
1222 ///
1223 ///# Panics
1224 ///Panics if `vkResetEvent` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1225 ///
1226 ///# Usage Notes
1227 ///
1228 ///Resets an event to the unsignaled state from the host (CPU). The
1229 ///event must not be waited on by any pending `cmd_wait_events` call.
1230 ///
1231 ///After resetting, the event can be signaled again by `set_event` or
1232 ///`cmd_set_event`.
1233 pub unsafe fn reset_event(&self, event: Event) -> VkResult<()> {
1234 let fp = self
1235 .commands()
1236 .reset_event
1237 .expect("vkResetEvent not loaded");
1238 check(unsafe { fp(self.handle(), event) })
1239 }
1240 ///Wraps [`vkCreateQueryPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateQueryPool.html).
1241 /**
1242 Provided by **VK_BASE_VERSION_1_0**.*/
1243 ///
1244 ///# Errors
1245 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1246 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1247 ///- `VK_ERROR_UNKNOWN`
1248 ///- `VK_ERROR_VALIDATION_FAILED`
1249 ///
1250 ///# Safety
1251 ///- `device` (self) must be valid and not destroyed.
1252 ///
1253 ///# Panics
1254 ///Panics if `vkCreateQueryPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1255 ///
1256 ///# Usage Notes
1257 ///
1258 ///Creates a pool of query slots. Queries let you measure GPU
1259 ///performance and gather statistics without stalling the pipeline.
1260 ///
1261 ///**Query types**:
1262 ///
1263 ///- `OCCLUSION`: counts how many samples pass the depth test. Useful
1264 /// for visibility culling, render a bounding box, check the count.
1265 ///- `PIPELINE_STATISTICS`: counts shader invocations, primitives,
1266 /// clipping, etc. Must be enabled via
1267 /// `pipeline_statistics_query` device feature.
1268 ///- `TIMESTAMP`: records a GPU timestamp. Use two timestamps and the
1269 /// `timestamp_period` device property to measure elapsed time.
1270 ///
1271 ///Queries must be reset before use with `cmd_reset_query_pool` (or
1272 ///`reset_query_pool` on Vulkan 1.2+). Results are retrieved with
1273 ///`get_query_pool_results` or copied into a buffer with
1274 ///`cmd_copy_query_pool_results`.
1275 pub unsafe fn create_query_pool(
1276 &self,
1277 p_create_info: &QueryPoolCreateInfo,
1278 allocator: Option<&AllocationCallbacks>,
1279 ) -> VkResult<QueryPool> {
1280 let fp = self
1281 .commands()
1282 .create_query_pool
1283 .expect("vkCreateQueryPool not loaded");
1284 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1285 let mut out = unsafe { core::mem::zeroed() };
1286 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1287 Ok(out)
1288 }
1289 ///Wraps [`vkDestroyQueryPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyQueryPool.html).
1290 /**
1291 Provided by **VK_BASE_VERSION_1_0**.*/
1292 ///
1293 ///# Safety
1294 ///- `device` (self) must be valid and not destroyed.
1295 ///- `queryPool` must be externally synchronized.
1296 ///
1297 ///# Panics
1298 ///Panics if `vkDestroyQueryPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1299 ///
1300 ///# Usage Notes
1301 ///
1302 ///Destroys a query pool and frees its resources. All command buffers
1303 ///that reference this pool must have completed execution before
1304 ///destroying it.
1305 pub unsafe fn destroy_query_pool(
1306 &self,
1307 query_pool: QueryPool,
1308 allocator: Option<&AllocationCallbacks>,
1309 ) {
1310 let fp = self
1311 .commands()
1312 .destroy_query_pool
1313 .expect("vkDestroyQueryPool not loaded");
1314 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1315 unsafe { fp(self.handle(), query_pool, alloc_ptr) };
1316 }
1317 ///Wraps [`vkGetQueryPoolResults`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetQueryPoolResults.html).
1318 /**
1319 Provided by **VK_BASE_VERSION_1_0**.*/
1320 ///
1321 ///# Errors
1322 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1323 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1324 ///- `VK_ERROR_DEVICE_LOST`
1325 ///- `VK_ERROR_UNKNOWN`
1326 ///- `VK_ERROR_VALIDATION_FAILED`
1327 ///
1328 ///# Safety
1329 ///- `device` (self) must be valid and not destroyed.
1330 ///
1331 ///# Panics
1332 ///Panics if `vkGetQueryPoolResults` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1333 ///
1334 ///# Usage Notes
1335 ///
1336 ///Reads query results from a query pool into a host buffer. This is
1337 ///the CPU-side retrieval path, for GPU-side copies into a device
1338 ///buffer, use `cmd_copy_query_pool_results` instead.
1339 ///
1340 ///**Key flags**:
1341 ///
1342 ///- `QUERY_RESULT_64`: return 64-bit results. Always use this for
1343 /// timestamp and pipeline statistics queries to avoid overflow.
1344 ///- `QUERY_RESULT_WAIT`: block until all requested queries are
1345 /// available. Without this flag, unavailable queries return
1346 /// `VK_NOT_READY` and their slots are left untouched.
1347 ///- `QUERY_RESULT_WITH_AVAILABILITY`: append an availability value
1348 /// after each result (non-zero if available). Useful for polling
1349 /// without blocking.
1350 ///- `QUERY_RESULT_PARTIAL`: return whatever data is available even
1351 /// for incomplete queries. Only meaningful for occlusion queries.
1352 ///
1353 ///**Stride**: the `stride` parameter is the byte distance between
1354 ///successive query results in your output buffer. It must be at least
1355 ///large enough to hold the result plus the optional availability value.
1356 ///
1357 ///Queries that have not been started or not yet completed return
1358 ///`VK_NOT_READY` unless `QUERY_RESULT_WAIT` is set.
1359 pub unsafe fn get_query_pool_results(
1360 &self,
1361 query_pool: QueryPool,
1362 first_query: u32,
1363 query_count: u32,
1364 data_size: usize,
1365 p_data: *mut core::ffi::c_void,
1366 stride: u64,
1367 flags: QueryResultFlags,
1368 ) -> VkResult<()> {
1369 let fp = self
1370 .commands()
1371 .get_query_pool_results
1372 .expect("vkGetQueryPoolResults not loaded");
1373 check(unsafe {
1374 fp(
1375 self.handle(),
1376 query_pool,
1377 first_query,
1378 query_count,
1379 data_size,
1380 p_data,
1381 stride,
1382 flags,
1383 )
1384 })
1385 }
1386 ///Wraps [`vkResetQueryPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkResetQueryPool.html).
1387 /**
1388 Provided by **VK_BASE_VERSION_1_2**.*/
1389 ///
1390 ///# Safety
1391 ///- `device` (self) must be valid and not destroyed.
1392 ///
1393 ///# Panics
1394 ///Panics if `vkResetQueryPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1395 ///
1396 ///# Usage Notes
1397 ///
1398 ///Resets a range of queries in a pool from the host (CPU). This is the
1399 ///Vulkan 1.2 host-side alternative to `cmd_reset_query_pool`, which
1400 ///resets queries from a command buffer.
1401 ///
1402 ///Host-side reset is simpler, call it directly without recording a
1403 ///command buffer. Requires the `host_query_reset` feature (core in
1404 ///Vulkan 1.2).
1405 ///
1406 ///Queries must be reset before use. Resetting a query that is in use
1407 ///by a pending command buffer is an error.
1408 pub unsafe fn reset_query_pool(
1409 &self,
1410 query_pool: QueryPool,
1411 first_query: u32,
1412 query_count: u32,
1413 ) {
1414 let fp = self
1415 .commands()
1416 .reset_query_pool
1417 .expect("vkResetQueryPool not loaded");
1418 unsafe { fp(self.handle(), query_pool, first_query, query_count) };
1419 }
1420 ///Wraps [`vkCreateBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateBuffer.html).
1421 /**
1422 Provided by **VK_BASE_VERSION_1_0**.*/
1423 ///
1424 ///# Errors
1425 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1426 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1427 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
1428 ///- `VK_ERROR_UNKNOWN`
1429 ///- `VK_ERROR_VALIDATION_FAILED`
1430 ///
1431 ///# Safety
1432 ///- `device` (self) must be valid and not destroyed.
1433 ///
1434 ///# Panics
1435 ///Panics if `vkCreateBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1436 ///
1437 ///# Examples
1438 ///
1439 ///```no_run
1440 ///# let (_, instance) = vulkan_rust::test_helpers::create_test_instance().expect("test setup");
1441 ///# let phys = unsafe { instance.enumerate_physical_devices() }.expect("no devices");
1442 ///# let p = [1.0f32];
1443 ///# let qi = vulkan_rust::vk::DeviceQueueCreateInfo::builder().queue_priorities(&p);
1444 ///# let qis = [*qi];
1445 ///# let di = vulkan_rust::vk::DeviceCreateInfo::builder().queue_create_infos(&qis);
1446 ///# let device = unsafe { instance.create_device(phys[0], &di, None) }.expect("device creation");
1447 ///use vulkan_rust::vk::*;
1448 ///
1449 ///let info = BufferCreateInfo::builder()
1450 /// .size(1024)
1451 /// .usage(BufferUsageFlagBits::VERTEX_BUFFER)
1452 /// .sharing_mode(vulkan_rust::vk::SharingMode::EXCLUSIVE);
1453 ///let buffer = unsafe { device.create_buffer(&info, None) }
1454 /// .expect("buffer creation failed");
1455 #[doc = "// Use buffer..."]
1456 ///unsafe { device.destroy_buffer(buffer, None) };
1457 ///# unsafe { device.destroy_device(None) };
1458 ///# unsafe { instance.destroy_instance(None) };
1459 ///```
1460 ///
1461 ///# Guide
1462 ///
1463 ///See [Memory Management](https://hiddentale.github.io/vulkan_rust/concepts/memory.html) in the vulkan_rust guide.
1464 pub unsafe fn create_buffer(
1465 &self,
1466 p_create_info: &BufferCreateInfo,
1467 allocator: Option<&AllocationCallbacks>,
1468 ) -> VkResult<Buffer> {
1469 let fp = self
1470 .commands()
1471 .create_buffer
1472 .expect("vkCreateBuffer not loaded");
1473 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1474 let mut out = unsafe { core::mem::zeroed() };
1475 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1476 Ok(out)
1477 }
1478 ///Wraps [`vkDestroyBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyBuffer.html).
1479 /**
1480 Provided by **VK_BASE_VERSION_1_0**.*/
1481 ///
1482 ///# Safety
1483 ///- `device` (self) must be valid and not destroyed.
1484 ///- `buffer` must be externally synchronized.
1485 ///
1486 ///# Panics
1487 ///Panics if `vkDestroyBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1488 ///
1489 ///# Usage Notes
1490 ///
1491 ///Destroys a buffer object. The buffer must not be in use by any
1492 ///pending GPU work, wait on the relevant fences or call
1493 ///`device_wait_idle` before destroying.
1494 ///
1495 ///Destroying a buffer does **not** free its backing memory. Call
1496 ///`free_memory` separately (or let your sub-allocator reclaim the
1497 ///region).
1498 ///
1499 ///Destroy order: destroy the buffer first, then free the memory. Not
1500 ///the reverse, freeing memory while a buffer is still bound to it is
1501 ///undefined behaviour.
1502 pub unsafe fn destroy_buffer(&self, buffer: Buffer, allocator: Option<&AllocationCallbacks>) {
1503 let fp = self
1504 .commands()
1505 .destroy_buffer
1506 .expect("vkDestroyBuffer not loaded");
1507 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1508 unsafe { fp(self.handle(), buffer, alloc_ptr) };
1509 }
1510 ///Wraps [`vkCreateBufferView`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateBufferView.html).
1511 /**
1512 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1513 ///
1514 ///# Errors
1515 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1516 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1517 ///- `VK_ERROR_UNKNOWN`
1518 ///- `VK_ERROR_VALIDATION_FAILED`
1519 ///
1520 ///# Safety
1521 ///- `device` (self) must be valid and not destroyed.
1522 ///
1523 ///# Panics
1524 ///Panics if `vkCreateBufferView` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1525 ///
1526 ///# Usage Notes
1527 ///
1528 ///Creates a view into a buffer that interprets its contents as a
1529 ///typed array of texels. Buffer views are used with:
1530 ///
1531 ///- **Uniform texel buffers** (`BUFFER_USAGE_UNIFORM_TEXEL_BUFFER`):
1532 /// read-only typed access from shaders via `samplerBuffer` /
1533 /// `textureBuffer` in GLSL.
1534 ///- **Storage texel buffers** (`BUFFER_USAGE_STORAGE_TEXEL_BUFFER`):
1535 /// read-write typed access from shaders via `imageBuffer` in GLSL.
1536 ///
1537 ///The format, offset, and range define the view window into the
1538 ///buffer. The format must be supported for the buffer view usage,
1539 ///check `format_properties.buffer_features`.
1540 ///
1541 ///Buffer views are less common than image views. They are mainly used
1542 ///for large, flat data arrays (e.g. particle attributes, lookup
1543 ///tables) that benefit from format conversion on read.
1544 pub unsafe fn create_buffer_view(
1545 &self,
1546 p_create_info: &BufferViewCreateInfo,
1547 allocator: Option<&AllocationCallbacks>,
1548 ) -> VkResult<BufferView> {
1549 let fp = self
1550 .commands()
1551 .create_buffer_view
1552 .expect("vkCreateBufferView not loaded");
1553 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1554 let mut out = unsafe { core::mem::zeroed() };
1555 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1556 Ok(out)
1557 }
1558 ///Wraps [`vkDestroyBufferView`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyBufferView.html).
1559 /**
1560 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1561 ///
1562 ///# Safety
1563 ///- `device` (self) must be valid and not destroyed.
1564 ///- `bufferView` must be externally synchronized.
1565 ///
1566 ///# Panics
1567 ///Panics if `vkDestroyBufferView` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1568 ///
1569 ///# Usage Notes
1570 ///
1571 ///Destroys a buffer view. The view must not be referenced by any
1572 ///descriptor set that is bound in a pending command buffer.
1573 ///
1574 ///Destroy buffer views before the underlying buffer.
1575 pub unsafe fn destroy_buffer_view(
1576 &self,
1577 buffer_view: BufferView,
1578 allocator: Option<&AllocationCallbacks>,
1579 ) {
1580 let fp = self
1581 .commands()
1582 .destroy_buffer_view
1583 .expect("vkDestroyBufferView not loaded");
1584 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1585 unsafe { fp(self.handle(), buffer_view, alloc_ptr) };
1586 }
1587 ///Wraps [`vkCreateImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateImage.html).
1588 /**
1589 Provided by **VK_BASE_VERSION_1_0**.*/
1590 ///
1591 ///# Errors
1592 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1593 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1594 ///- `VK_ERROR_COMPRESSION_EXHAUSTED_EXT`
1595 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
1596 ///- `VK_ERROR_UNKNOWN`
1597 ///- `VK_ERROR_VALIDATION_FAILED`
1598 ///
1599 ///# Safety
1600 ///- `device` (self) must be valid and not destroyed.
1601 ///
1602 ///# Panics
1603 ///Panics if `vkCreateImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1604 ///
1605 ///# Usage Notes
1606 ///
1607 ///After creating an image you must bind memory to it before use:
1608 ///
1609 ///1. Query requirements with `get_image_memory_requirements`.
1610 ///2. Allocate from a compatible memory type with `allocate_memory`.
1611 ///3. Bind with `bind_image_memory`.
1612 ///
1613 ///Choose `IMAGE_TILING_OPTIMAL` for GPU-side textures and render targets.
1614 ///Use `IMAGE_TILING_LINEAR` only when you need direct CPU access to the
1615 ///texel layout (e.g. CPU readback), and check format support first with
1616 ///`get_physical_device_image_format_properties`.
1617 ///
1618 ///The `initial_layout` must be `UNDEFINED` or `PREINITIALIZED`.
1619 ///Most applications use `UNDEFINED` and transition via a pipeline barrier.
1620 ///
1621 ///Destroy with `destroy_image` when no longer needed. Do not destroy an
1622 ///image that is still referenced by a framebuffer or image view.
1623 pub unsafe fn create_image(
1624 &self,
1625 p_create_info: &ImageCreateInfo,
1626 allocator: Option<&AllocationCallbacks>,
1627 ) -> VkResult<Image> {
1628 let fp = self
1629 .commands()
1630 .create_image
1631 .expect("vkCreateImage not loaded");
1632 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1633 let mut out = unsafe { core::mem::zeroed() };
1634 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1635 Ok(out)
1636 }
1637 ///Wraps [`vkDestroyImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyImage.html).
1638 /**
1639 Provided by **VK_BASE_VERSION_1_0**.*/
1640 ///
1641 ///# Safety
1642 ///- `device` (self) must be valid and not destroyed.
1643 ///- `image` must be externally synchronized.
1644 ///
1645 ///# Panics
1646 ///Panics if `vkDestroyImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1647 ///
1648 ///# Usage Notes
1649 ///
1650 ///Destroys an image object. The image must not be in use by any
1651 ///pending GPU work, and all image views referencing this image must
1652 ///already be destroyed.
1653 ///
1654 ///Destroying an image does **not** free its backing memory. Call
1655 ///`free_memory` separately after destroying the image.
1656 ///
1657 ///Safe teardown order for an image:
1658 ///
1659 ///1. Wait for all GPU work using the image to complete.
1660 ///2. Destroy all `ImageView` objects referencing the image.
1661 ///3. Destroy any `Framebuffer` objects that included those views.
1662 ///4. `destroy_image`.
1663 ///5. Free or reclaim the backing memory.
1664 pub unsafe fn destroy_image(&self, image: Image, allocator: Option<&AllocationCallbacks>) {
1665 let fp = self
1666 .commands()
1667 .destroy_image
1668 .expect("vkDestroyImage not loaded");
1669 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1670 unsafe { fp(self.handle(), image, alloc_ptr) };
1671 }
1672 ///Wraps [`vkGetImageSubresourceLayout`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageSubresourceLayout.html).
1673 /**
1674 Provided by **VK_BASE_VERSION_1_0**.*/
1675 ///
1676 ///# Safety
1677 ///- `device` (self) must be valid and not destroyed.
1678 ///
1679 ///# Panics
1680 ///Panics if `vkGetImageSubresourceLayout` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1681 ///
1682 ///# Usage Notes
1683 ///
1684 ///Queries the memory layout (offset, size, row pitch, array pitch,
1685 ///depth pitch) of a specific subresource within a linear-tiling
1686 ///image. Only valid for images created with `IMAGE_TILING_LINEAR`.
1687 ///For optimal-tiling images, use `get_image_subresource_layout2`.
1688 pub unsafe fn get_image_subresource_layout(
1689 &self,
1690 image: Image,
1691 p_subresource: &ImageSubresource,
1692 ) -> SubresourceLayout {
1693 let fp = self
1694 .commands()
1695 .get_image_subresource_layout
1696 .expect("vkGetImageSubresourceLayout not loaded");
1697 let mut out = unsafe { core::mem::zeroed() };
1698 unsafe { fp(self.handle(), image, p_subresource, &mut out) };
1699 out
1700 }
1701 ///Wraps [`vkCreateImageView`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateImageView.html).
1702 /**
1703 Provided by **VK_BASE_VERSION_1_0**.*/
1704 ///
1705 ///# Errors
1706 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1707 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1708 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
1709 ///- `VK_ERROR_UNKNOWN`
1710 ///- `VK_ERROR_VALIDATION_FAILED`
1711 ///
1712 ///# Safety
1713 ///- `device` (self) must be valid and not destroyed.
1714 ///
1715 ///# Panics
1716 ///Panics if `vkCreateImageView` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1717 ///
1718 ///# Usage Notes
1719 ///
1720 ///An image view selects a subset of an image's subresources and
1721 ///reinterprets them for a specific use (sampling, color attachment, etc.).
1722 ///
1723 ///Common pitfalls:
1724 ///
1725 ///- **Aspect mask**: use `COLOR` for color formats, `DEPTH` and/or
1726 /// `STENCIL` for depth/stencil formats. Getting this wrong causes
1727 /// validation errors that are not always obvious.
1728 ///- **Format compatibility**: the view format must be compatible with the
1729 /// image's format. Using `IMAGE_CREATE_MUTABLE_FORMAT` on the image
1730 /// relaxes this to any format in the same size-compatibility class.
1731 ///- **View type vs image type**: a 2D image can back a `VIEW_TYPE_2D` or
1732 /// `VIEW_TYPE_2D_ARRAY`. A 3D image cannot be viewed as 2D without
1733 /// `VK_EXT_image_2d_view_of_3d`.
1734 ///
1735 ///Destroy with `destroy_image_view` when no longer needed. Destroy image
1736 ///views *before* destroying the underlying image.
1737 pub unsafe fn create_image_view(
1738 &self,
1739 p_create_info: &ImageViewCreateInfo,
1740 allocator: Option<&AllocationCallbacks>,
1741 ) -> VkResult<ImageView> {
1742 let fp = self
1743 .commands()
1744 .create_image_view
1745 .expect("vkCreateImageView not loaded");
1746 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1747 let mut out = unsafe { core::mem::zeroed() };
1748 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1749 Ok(out)
1750 }
1751 ///Wraps [`vkDestroyImageView`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyImageView.html).
1752 /**
1753 Provided by **VK_BASE_VERSION_1_0**.*/
1754 ///
1755 ///# Safety
1756 ///- `device` (self) must be valid and not destroyed.
1757 ///- `imageView` must be externally synchronized.
1758 ///
1759 ///# Panics
1760 ///Panics if `vkDestroyImageView` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1761 ///
1762 ///# Usage Notes
1763 ///
1764 ///Destroys an image view. The view must not be referenced by any
1765 ///pending GPU work or by any framebuffer that is still in use.
1766 ///
1767 ///Destroy image views **before** the underlying image. Destroy any
1768 ///framebuffers that reference the view before destroying the view
1769 ///itself.
1770 pub unsafe fn destroy_image_view(
1771 &self,
1772 image_view: ImageView,
1773 allocator: Option<&AllocationCallbacks>,
1774 ) {
1775 let fp = self
1776 .commands()
1777 .destroy_image_view
1778 .expect("vkDestroyImageView not loaded");
1779 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1780 unsafe { fp(self.handle(), image_view, alloc_ptr) };
1781 }
1782 ///Wraps [`vkCreateShaderModule`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateShaderModule.html).
1783 /**
1784 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1785 ///
1786 ///# Errors
1787 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1788 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1789 ///- `VK_ERROR_INVALID_SHADER_NV`
1790 ///- `VK_ERROR_UNKNOWN`
1791 ///- `VK_ERROR_VALIDATION_FAILED`
1792 ///
1793 ///# Safety
1794 ///- `device` (self) must be valid and not destroyed.
1795 ///
1796 ///# Panics
1797 ///Panics if `vkCreateShaderModule` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1798 ///
1799 ///# Usage Notes
1800 ///
1801 ///The input must be valid SPIR-V bytecode. The `code` slice is `&[u32]`
1802 ///and must be aligned to 4 bytes, which Rust's `&[u32]` guarantees.
1803 ///
1804 ///Use the `bytecode::read_spv` helper to load a `.spv` file from disk
1805 ///with correct alignment.
1806 ///
1807 ///Shader modules can be destroyed immediately after pipeline creation;
1808 ///the driver copies what it needs during `create_graphics_pipelines` or
1809 ///`create_compute_pipelines`. Destroying early keeps the handle count
1810 ///low.
1811 ///
1812 ///# Guide
1813 ///
1814 ///See [Pipelines](https://hiddentale.github.io/vulkan_rust/concepts/pipelines.html) in the vulkan_rust guide.
1815 pub unsafe fn create_shader_module(
1816 &self,
1817 p_create_info: &ShaderModuleCreateInfo,
1818 allocator: Option<&AllocationCallbacks>,
1819 ) -> VkResult<ShaderModule> {
1820 let fp = self
1821 .commands()
1822 .create_shader_module
1823 .expect("vkCreateShaderModule not loaded");
1824 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1825 let mut out = unsafe { core::mem::zeroed() };
1826 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1827 Ok(out)
1828 }
1829 ///Wraps [`vkDestroyShaderModule`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyShaderModule.html).
1830 /**
1831 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1832 ///
1833 ///# Safety
1834 ///- `device` (self) must be valid and not destroyed.
1835 ///- `shaderModule` must be externally synchronized.
1836 ///
1837 ///# Panics
1838 ///Panics if `vkDestroyShaderModule` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1839 ///
1840 ///# Usage Notes
1841 ///
1842 ///Destroys a shader module. The module must not be in use by any
1843 ///pipeline. Shader modules can be safely destroyed after pipeline
1844 ///creation since the driver copies the SPIR-V at creation time.
1845 pub unsafe fn destroy_shader_module(
1846 &self,
1847 shader_module: ShaderModule,
1848 allocator: Option<&AllocationCallbacks>,
1849 ) {
1850 let fp = self
1851 .commands()
1852 .destroy_shader_module
1853 .expect("vkDestroyShaderModule not loaded");
1854 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1855 unsafe { fp(self.handle(), shader_module, alloc_ptr) };
1856 }
1857 ///Wraps [`vkCreatePipelineCache`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreatePipelineCache.html).
1858 /**
1859 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1860 ///
1861 ///# Errors
1862 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1863 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1864 ///- `VK_ERROR_UNKNOWN`
1865 ///- `VK_ERROR_VALIDATION_FAILED`
1866 ///
1867 ///# Safety
1868 ///- `device` (self) must be valid and not destroyed.
1869 ///
1870 ///# Panics
1871 ///Panics if `vkCreatePipelineCache` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1872 ///
1873 ///# Usage Notes
1874 ///
1875 ///Creates a pipeline cache that stores compiled pipeline state to
1876 ///speed up future pipeline creation.
1877 ///
1878 ///**Initial data**: pass previously serialized cache data (from
1879 ///`get_pipeline_cache_data`) to warm the cache on startup. The driver
1880 ///validates the header and silently ignores data from incompatible
1881 ///driver versions or hardware, it is always safe to pass stale data.
1882 ///
1883 ///A single cache can be shared across all pipeline creation calls in
1884 ///the application. Multiple threads can use the same cache
1885 ///concurrently, the driver handles internal synchronization.
1886 ///
1887 ///**Recommended workflow**:
1888 ///
1889 ///1. On startup, load cache data from disk and create the cache.
1890 ///2. Pass the cache to every `create_graphics_pipelines` and
1891 /// `create_compute_pipelines` call.
1892 ///3. On shutdown, serialize with `get_pipeline_cache_data` and write
1893 /// to disk.
1894 pub unsafe fn create_pipeline_cache(
1895 &self,
1896 p_create_info: &PipelineCacheCreateInfo,
1897 allocator: Option<&AllocationCallbacks>,
1898 ) -> VkResult<PipelineCache> {
1899 let fp = self
1900 .commands()
1901 .create_pipeline_cache
1902 .expect("vkCreatePipelineCache not loaded");
1903 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1904 let mut out = unsafe { core::mem::zeroed() };
1905 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
1906 Ok(out)
1907 }
1908 ///Wraps [`vkDestroyPipelineCache`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyPipelineCache.html).
1909 /**
1910 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1911 ///
1912 ///# Safety
1913 ///- `device` (self) must be valid and not destroyed.
1914 ///- `pipelineCache` must be externally synchronized.
1915 ///
1916 ///# Panics
1917 ///Panics if `vkDestroyPipelineCache` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1918 ///
1919 ///# Usage Notes
1920 ///
1921 ///Destroys a pipeline cache. Pipelines that were created using this
1922 ///cache remain valid, the cache is only needed during creation, not
1923 ///at runtime.
1924 ///
1925 ///Serialize the cache with `get_pipeline_cache_data` before destroying
1926 ///if you want to persist it to disk for the next session.
1927 pub unsafe fn destroy_pipeline_cache(
1928 &self,
1929 pipeline_cache: PipelineCache,
1930 allocator: Option<&AllocationCallbacks>,
1931 ) {
1932 let fp = self
1933 .commands()
1934 .destroy_pipeline_cache
1935 .expect("vkDestroyPipelineCache not loaded");
1936 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
1937 unsafe { fp(self.handle(), pipeline_cache, alloc_ptr) };
1938 }
1939 ///Wraps [`vkGetPipelineCacheData`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPipelineCacheData.html).
1940 /**
1941 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1942 ///
1943 ///# Errors
1944 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1945 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1946 ///- `VK_ERROR_UNKNOWN`
1947 ///- `VK_ERROR_VALIDATION_FAILED`
1948 ///
1949 ///# Safety
1950 ///- `device` (self) must be valid and not destroyed.
1951 ///
1952 ///# Panics
1953 ///Panics if `vkGetPipelineCacheData` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
1954 ///
1955 ///# Usage Notes
1956 ///
1957 ///Serializes the contents of a pipeline cache into a byte buffer for
1958 ///storage on disk. The data includes a vendor-specific header that the
1959 ///driver uses to validate compatibility on reload.
1960 ///
1961 ///Call this with a null data pointer first to query the required buffer
1962 ///size, then allocate and call again. The wrapper handles this
1963 ///two-call pattern for you.
1964 ///
1965 ///The cache data is **not portable** across different GPU vendors,
1966 ///driver versions, or pipeline cache UUIDs. Always check the header
1967 ///or let the driver reject incompatible data silently on reload via
1968 ///`create_pipeline_cache`.
1969 ///
1970 ///Write the data to a file (e.g. `pipeline_cache.bin`) and load it on
1971 ///the next application start to avoid redundant shader compilation.
1972 pub unsafe fn get_pipeline_cache_data(
1973 &self,
1974 pipeline_cache: PipelineCache,
1975 p_data: *mut core::ffi::c_void,
1976 ) -> VkResult<usize> {
1977 let fp = self
1978 .commands()
1979 .get_pipeline_cache_data
1980 .expect("vkGetPipelineCacheData not loaded");
1981 let mut out = unsafe { core::mem::zeroed() };
1982 check(unsafe { fp(self.handle(), pipeline_cache, &mut out, p_data) })?;
1983 Ok(out)
1984 }
1985 ///Wraps [`vkMergePipelineCaches`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkMergePipelineCaches.html).
1986 /**
1987 Provided by **VK_COMPUTE_VERSION_1_0**.*/
1988 ///
1989 ///# Errors
1990 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
1991 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
1992 ///- `VK_ERROR_UNKNOWN`
1993 ///- `VK_ERROR_VALIDATION_FAILED`
1994 ///
1995 ///# Safety
1996 ///- `device` (self) must be valid and not destroyed.
1997 ///- `dstCache` must be externally synchronized.
1998 ///
1999 ///# Panics
2000 ///Panics if `vkMergePipelineCaches` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2001 ///
2002 ///# Usage Notes
2003 ///
2004 ///Merges one or more source caches into a destination cache. Useful
2005 ///when multiple threads each use their own cache during parallel
2006 ///pipeline creation, merge them into a single cache before
2007 ///serializing to disk.
2008 ///
2009 ///The source caches are not modified or destroyed by this call. The
2010 ///destination cache receives all entries from the sources that it does
2011 ///not already contain. Duplicate entries are ignored.
2012 ///
2013 ///After merging, you can destroy the source caches if they are no
2014 ///longer needed.
2015 pub unsafe fn merge_pipeline_caches(
2016 &self,
2017 dst_cache: PipelineCache,
2018 p_src_caches: &[PipelineCache],
2019 ) -> VkResult<()> {
2020 let fp = self
2021 .commands()
2022 .merge_pipeline_caches
2023 .expect("vkMergePipelineCaches not loaded");
2024 check(unsafe {
2025 fp(
2026 self.handle(),
2027 dst_cache,
2028 p_src_caches.len() as u32,
2029 p_src_caches.as_ptr(),
2030 )
2031 })
2032 }
2033 ///Wraps [`vkCreatePipelineBinariesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreatePipelineBinariesKHR.html).
2034 /**
2035 Provided by **VK_KHR_pipeline_binary**.*/
2036 ///
2037 ///# Errors
2038 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2039 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2040 ///- `VK_ERROR_INITIALIZATION_FAILED`
2041 ///- `VK_ERROR_UNKNOWN`
2042 ///- `VK_ERROR_VALIDATION_FAILED`
2043 ///
2044 ///# Safety
2045 ///- `device` (self) must be valid and not destroyed.
2046 ///
2047 ///# Panics
2048 ///Panics if `vkCreatePipelineBinariesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2049 ///
2050 ///# Usage Notes
2051 ///
2052 ///Creates pipeline binary objects from either a pipeline create info
2053 ///or previously serialized binary data. Pipeline binaries capture
2054 ///compiled shader code in a device-specific format, enabling fast
2055 ///pipeline recreation without recompilation.
2056 ///
2057 ///Two creation paths via `PipelineBinaryCreateInfoKHR`:
2058 ///
2059 ///- **From pipeline create info + key**: compiles shaders and
2060 /// produces binaries. Use `get_pipeline_key_khr` to obtain the
2061 /// key first.
2062 ///- **From serialized data**: restores binaries saved with
2063 /// `get_pipeline_binary_data_khr` from a prior run. This skips
2064 /// compilation entirely.
2065 ///
2066 ///The output is written to `PipelineBinaryHandlesInfoKHR`. Call
2067 ///once with a null `pipelines` pointer to query the count, then
2068 ///again with an allocated array.
2069 ///
2070 ///Pipeline binaries are more portable than pipeline caches, they
2071 ///can be validated, versioned, and stored in application-managed
2072 ///files rather than opaque blobs.
2073 pub unsafe fn create_pipeline_binaries_khr(
2074 &self,
2075 p_create_info: &PipelineBinaryCreateInfoKHR,
2076 allocator: Option<&AllocationCallbacks>,
2077 p_binaries: &mut PipelineBinaryHandlesInfoKHR,
2078 ) -> VkResult<()> {
2079 let fp = self
2080 .commands()
2081 .create_pipeline_binaries_khr
2082 .expect("vkCreatePipelineBinariesKHR not loaded");
2083 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2084 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, p_binaries) })
2085 }
2086 ///Wraps [`vkDestroyPipelineBinaryKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyPipelineBinaryKHR.html).
2087 /**
2088 Provided by **VK_KHR_pipeline_binary**.*/
2089 ///
2090 ///# Safety
2091 ///- `device` (self) must be valid and not destroyed.
2092 ///- `pipelineBinary` must be externally synchronized.
2093 ///
2094 ///# Panics
2095 ///Panics if `vkDestroyPipelineBinaryKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2096 ///
2097 ///# Usage Notes
2098 ///
2099 ///Destroys a pipeline binary handle. After destruction, the binary
2100 ///cannot be used to create pipelines or retrieve data.
2101 ///
2102 ///Pipeline binaries are independent of the pipelines created from
2103 ///them, destroying a binary does not affect any pipeline that was
2104 ///already created using it.
2105 pub unsafe fn destroy_pipeline_binary_khr(
2106 &self,
2107 pipeline_binary: PipelineBinaryKHR,
2108 allocator: Option<&AllocationCallbacks>,
2109 ) {
2110 let fp = self
2111 .commands()
2112 .destroy_pipeline_binary_khr
2113 .expect("vkDestroyPipelineBinaryKHR not loaded");
2114 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2115 unsafe { fp(self.handle(), pipeline_binary, alloc_ptr) };
2116 }
2117 ///Wraps [`vkGetPipelineKeyKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPipelineKeyKHR.html).
2118 /**
2119 Provided by **VK_KHR_pipeline_binary**.*/
2120 ///
2121 ///# Errors
2122 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2123 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2124 ///- `VK_ERROR_UNKNOWN`
2125 ///- `VK_ERROR_VALIDATION_FAILED`
2126 ///
2127 ///# Safety
2128 ///- `device` (self) must be valid and not destroyed.
2129 ///
2130 ///# Panics
2131 ///Panics if `vkGetPipelineKeyKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2132 ///
2133 ///# Usage Notes
2134 ///
2135 ///Computes a pipeline key that identifies the pipeline configuration
2136 ///for use with pipeline binaries. The key is a hash of the pipeline
2137 ///create info that lets you look up previously cached binaries.
2138 ///
2139 ///Pass a `PipelineCreateInfoKHR` referencing the pipeline create
2140 ///info (graphics, compute, or ray tracing) to get its key. Pass
2141 ///`None` to get an empty key structure for use as an output
2142 ///parameter.
2143 ///
2144 ///Store the key alongside serialized binary data from
2145 ///`get_pipeline_binary_data_khr`. On subsequent runs, compute the
2146 ///key for the current pipeline configuration and check if a matching
2147 ///binary exists before falling back to full compilation.
2148 pub unsafe fn get_pipeline_key_khr(
2149 &self,
2150 p_pipeline_create_info: Option<&PipelineCreateInfoKHR>,
2151 p_pipeline_key: &mut PipelineBinaryKeyKHR,
2152 ) -> VkResult<()> {
2153 let fp = self
2154 .commands()
2155 .get_pipeline_key_khr
2156 .expect("vkGetPipelineKeyKHR not loaded");
2157 let p_pipeline_create_info_ptr =
2158 p_pipeline_create_info.map_or(core::ptr::null(), core::ptr::from_ref);
2159 check(unsafe { fp(self.handle(), p_pipeline_create_info_ptr, p_pipeline_key) })
2160 }
2161 ///Wraps [`vkGetPipelineBinaryDataKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPipelineBinaryDataKHR.html).
2162 /**
2163 Provided by **VK_KHR_pipeline_binary**.*/
2164 ///
2165 ///# Errors
2166 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2167 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2168 ///- `VK_ERROR_NOT_ENOUGH_SPACE_KHR`
2169 ///- `VK_ERROR_UNKNOWN`
2170 ///- `VK_ERROR_VALIDATION_FAILED`
2171 ///
2172 ///# Safety
2173 ///- `device` (self) must be valid and not destroyed.
2174 ///
2175 ///# Panics
2176 ///Panics if `vkGetPipelineBinaryDataKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2177 ///
2178 ///# Usage Notes
2179 ///
2180 ///Serializes a pipeline binary into a byte buffer for offline
2181 ///storage. The data can be saved to disk and later passed to
2182 ///`create_pipeline_binaries_khr` to skip shader compilation on
2183 ///subsequent application launches.
2184 ///
2185 ///Uses the two-call pattern: call with a null `p_pipeline_binary_data`
2186 ///to query the required `data_size`, allocate a buffer, then call
2187 ///again to fill it.
2188 ///
2189 ///The output also includes a `PipelineBinaryKeyKHR` that identifies
2190 ///the binary. Store the key alongside the data, it is required
2191 ///when recreating the binary.
2192 ///
2193 ///Serialized data is device-specific and may become invalid after
2194 ///driver updates. Applications should handle creation failure
2195 ///gracefully by falling back to full recompilation.
2196 pub unsafe fn get_pipeline_binary_data_khr(
2197 &self,
2198 p_info: &PipelineBinaryDataInfoKHR,
2199 p_pipeline_binary_key: &mut PipelineBinaryKeyKHR,
2200 p_pipeline_binary_data: *mut core::ffi::c_void,
2201 ) -> VkResult<usize> {
2202 let fp = self
2203 .commands()
2204 .get_pipeline_binary_data_khr
2205 .expect("vkGetPipelineBinaryDataKHR not loaded");
2206 let mut out = unsafe { core::mem::zeroed() };
2207 check(unsafe {
2208 fp(
2209 self.handle(),
2210 p_info,
2211 p_pipeline_binary_key,
2212 &mut out,
2213 p_pipeline_binary_data,
2214 )
2215 })?;
2216 Ok(out)
2217 }
2218 ///Wraps [`vkReleaseCapturedPipelineDataKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkReleaseCapturedPipelineDataKHR.html).
2219 /**
2220 Provided by **VK_KHR_pipeline_binary**.*/
2221 ///
2222 ///# Errors
2223 ///- `VK_ERROR_UNKNOWN`
2224 ///- `VK_ERROR_VALIDATION_FAILED`
2225 ///
2226 ///# Safety
2227 ///- `device` (self) must be valid and not destroyed.
2228 ///
2229 ///# Panics
2230 ///Panics if `vkReleaseCapturedPipelineDataKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2231 ///
2232 ///# Usage Notes
2233 ///
2234 ///Releases internal data captured during pipeline creation that was
2235 ///retained for binary extraction. Call this after you have finished
2236 ///calling `create_pipeline_binaries_khr` for a pipeline created
2237 ///with `PIPELINE_CREATE_CAPTURE_DATA`.
2238 ///
2239 ///The pipeline itself remains valid after this call, only the
2240 ///captured internal data is freed. This reduces memory usage when
2241 ///you no longer need to extract binaries from the pipeline.
2242 pub unsafe fn release_captured_pipeline_data_khr(
2243 &self,
2244 p_info: &ReleaseCapturedPipelineDataInfoKHR,
2245 allocator: Option<&AllocationCallbacks>,
2246 ) -> VkResult<()> {
2247 let fp = self
2248 .commands()
2249 .release_captured_pipeline_data_khr
2250 .expect("vkReleaseCapturedPipelineDataKHR not loaded");
2251 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2252 check(unsafe { fp(self.handle(), p_info, alloc_ptr) })
2253 }
2254 ///Wraps [`vkCreateGraphicsPipelines`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateGraphicsPipelines.html).
2255 /**
2256 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
2257 ///
2258 ///# Errors
2259 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2260 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2261 ///- `VK_ERROR_INVALID_SHADER_NV`
2262 ///- `VK_ERROR_UNKNOWN`
2263 ///- `VK_ERROR_VALIDATION_FAILED`
2264 ///
2265 ///# Safety
2266 ///- `device` (self) must be valid and not destroyed.
2267 ///- `pipelineCache` must be externally synchronized.
2268 ///
2269 ///# Panics
2270 ///Panics if `vkCreateGraphicsPipelines` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2271 ///
2272 ///# Usage Notes
2273 ///
2274 ///Graphics pipeline creation is the most expensive Vulkan object creation
2275 ///call. Batch multiple pipelines into a single call when possible,the
2276 ///driver can often parallelise compilation internally.
2277 ///
2278 ///**Pipeline cache**: always pass a `PipelineCache`. Even an empty cache
2279 ///helps on the first run; on subsequent runs it avoids redundant shader
2280 ///compilation entirely. Serialize the cache to disk between application
2281 ///sessions with `get_pipeline_cache_data`.
2282 ///
2283 ///**Dynamic state**: mark states like viewport, scissor, and blend
2284 ///constants as dynamic to reduce the number of pipeline permutations.
2285 ///Vulkan 1.3 makes viewport and scissor dynamic by default via
2286 ///`VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT` and
2287 ///`VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT`.
2288 ///
2289 ///If creation fails for one pipeline in a batch, the call returns an
2290 ///error but may still populate some output handles. Check
2291 ///`VK_PIPELINE_COMPILE_REQUIRED` when using
2292 ///`VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT`.
2293 ///
2294 ///# Guide
2295 ///
2296 ///See [Pipelines](https://hiddentale.github.io/vulkan_rust/concepts/pipelines.html) in the vulkan_rust guide.
2297 pub unsafe fn create_graphics_pipelines(
2298 &self,
2299 pipeline_cache: PipelineCache,
2300 p_create_infos: &[GraphicsPipelineCreateInfo],
2301 allocator: Option<&AllocationCallbacks>,
2302 ) -> VkResult<Vec<Pipeline>> {
2303 let fp = self
2304 .commands()
2305 .create_graphics_pipelines
2306 .expect("vkCreateGraphicsPipelines not loaded");
2307 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2308 let count = p_create_infos.len();
2309 let mut out = vec![unsafe { core::mem::zeroed() }; count];
2310 check(unsafe {
2311 fp(
2312 self.handle(),
2313 pipeline_cache,
2314 p_create_infos.len() as u32,
2315 p_create_infos.as_ptr(),
2316 alloc_ptr,
2317 out.as_mut_ptr(),
2318 )
2319 })?;
2320 Ok(out)
2321 }
2322 ///Wraps [`vkCreateComputePipelines`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateComputePipelines.html).
2323 /**
2324 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2325 ///
2326 ///# Errors
2327 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2328 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2329 ///- `VK_ERROR_INVALID_SHADER_NV`
2330 ///- `VK_ERROR_UNKNOWN`
2331 ///- `VK_ERROR_VALIDATION_FAILED`
2332 ///
2333 ///# Safety
2334 ///- `device` (self) must be valid and not destroyed.
2335 ///- `pipelineCache` must be externally synchronized.
2336 ///
2337 ///# Panics
2338 ///Panics if `vkCreateComputePipelines` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2339 ///
2340 ///# Usage Notes
2341 ///
2342 ///Creates one or more compute pipelines. Compute pipelines are simpler
2343 ///than graphics pipelines, they only need a single shader stage and a
2344 ///pipeline layout.
2345 ///
2346 ///**Pipeline cache**: pass a `PipelineCache` to speed up creation, the
2347 ///same way as with graphics pipelines. The cache is shared across both
2348 ///pipeline types.
2349 ///
2350 ///**Specialisation constants**: use `SpecializationInfo` on the shader
2351 ///stage to bake compile-time constants into the shader (e.g. workgroup
2352 ///size, algorithm variant). This produces optimised code without
2353 ///duplicating shader source.
2354 ///
2355 ///Batch multiple compute pipelines in a single call when possible.
2356 ///
2357 ///Compute pipelines can be created at any time and are not tied to a
2358 ///render pass. They are bound with `cmd_bind_pipeline` using
2359 ///`PIPELINE_BIND_POINT_COMPUTE` and dispatched with `cmd_dispatch`.
2360 pub unsafe fn create_compute_pipelines(
2361 &self,
2362 pipeline_cache: PipelineCache,
2363 p_create_infos: &[ComputePipelineCreateInfo],
2364 allocator: Option<&AllocationCallbacks>,
2365 ) -> VkResult<Vec<Pipeline>> {
2366 let fp = self
2367 .commands()
2368 .create_compute_pipelines
2369 .expect("vkCreateComputePipelines not loaded");
2370 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2371 let count = p_create_infos.len();
2372 let mut out = vec![unsafe { core::mem::zeroed() }; count];
2373 check(unsafe {
2374 fp(
2375 self.handle(),
2376 pipeline_cache,
2377 p_create_infos.len() as u32,
2378 p_create_infos.as_ptr(),
2379 alloc_ptr,
2380 out.as_mut_ptr(),
2381 )
2382 })?;
2383 Ok(out)
2384 }
2385 ///Wraps [`vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI.html).
2386 /**
2387 Provided by **VK_HUAWEI_subpass_shading**.*/
2388 ///
2389 ///# Errors
2390 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2391 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2392 ///- `VK_ERROR_SURFACE_LOST_KHR`
2393 ///- `VK_ERROR_UNKNOWN`
2394 ///- `VK_ERROR_VALIDATION_FAILED`
2395 ///
2396 ///# Safety
2397 ///- `device` (self) must be valid and not destroyed.
2398 ///
2399 ///# Panics
2400 ///Panics if `vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2401 ///
2402 ///# Usage Notes
2403 ///
2404 ///Queries the maximum workgroup size supported for subpass shading
2405 ///on the given render pass. Returns an `Extent2D` with the max
2406 ///width and height. Use this to configure subpass shading dispatch
2407 ///parameters.
2408 ///
2409 ///Requires `VK_HUAWEI_subpass_shading`.
2410 pub unsafe fn get_device_subpass_shading_max_workgroup_size_huawei(
2411 &self,
2412 renderpass: RenderPass,
2413 p_max_workgroup_size: *mut Extent2D,
2414 ) -> VkResult<()> {
2415 let fp = self
2416 .commands()
2417 .get_device_subpass_shading_max_workgroup_size_huawei
2418 .expect("vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI not loaded");
2419 check(unsafe { fp(self.handle(), renderpass, p_max_workgroup_size) })
2420 }
2421 ///Wraps [`vkDestroyPipeline`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyPipeline.html).
2422 /**
2423 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2424 ///
2425 ///# Safety
2426 ///- `device` (self) must be valid and not destroyed.
2427 ///- `pipeline` must be externally synchronized.
2428 ///
2429 ///# Panics
2430 ///Panics if `vkDestroyPipeline` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2431 ///
2432 ///# Usage Notes
2433 ///
2434 ///Destroys a graphics, compute, or ray tracing pipeline. The pipeline
2435 ///must not be bound in any command buffer that is still pending
2436 ///execution.
2437 ///
2438 ///Pipelines are expensive to create but cheap to keep around. Only
2439 ///destroy them when you are certain they will not be needed again
2440 ///(e.g. during level transitions or application shutdown).
2441 ///
2442 ///Shader modules used to create the pipeline can be destroyed
2443 ///independently, the pipeline retains its own copy of the compiled
2444 ///state.
2445 pub unsafe fn destroy_pipeline(
2446 &self,
2447 pipeline: Pipeline,
2448 allocator: Option<&AllocationCallbacks>,
2449 ) {
2450 let fp = self
2451 .commands()
2452 .destroy_pipeline
2453 .expect("vkDestroyPipeline not loaded");
2454 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2455 unsafe { fp(self.handle(), pipeline, alloc_ptr) };
2456 }
2457 ///Wraps [`vkCreatePipelineLayout`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreatePipelineLayout.html).
2458 /**
2459 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2460 ///
2461 ///# Errors
2462 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2463 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2464 ///- `VK_ERROR_UNKNOWN`
2465 ///- `VK_ERROR_VALIDATION_FAILED`
2466 ///
2467 ///# Safety
2468 ///- `device` (self) must be valid and not destroyed.
2469 ///
2470 ///# Panics
2471 ///Panics if `vkCreatePipelineLayout` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2472 ///
2473 ///# Usage Notes
2474 ///
2475 ///A pipeline layout defines the interface between shader stages and
2476 ///the descriptor sets and push constants that feed them. It specifies:
2477 ///
2478 ///- **Descriptor set layouts**: which bindings are available at each
2479 /// set index (0, 1, 2, ...).
2480 ///- **Push constant ranges**: byte ranges per shader stage for small,
2481 /// frequently-updated data.
2482 ///
2483 ///**Set layout ordering convention**: a common pattern is:
2484 ///
2485 ///- Set 0: per-frame data (camera, time).
2486 ///- Set 1: per-material data (textures, material params).
2487 ///- Set 2: per-object data (transforms).
2488 ///
2489 ///This lets you bind set 0 once per frame and only rebind sets 1–2
2490 ///as materials and objects change, minimising descriptor set switches.
2491 ///
2492 ///Pipeline layouts are immutable after creation. Two pipelines that
2493 ///share the same layout can share descriptor sets without rebinding.
2494 ///
2495 ///Push constants are limited to `max_push_constants_size` bytes
2496 ///(guaranteed at least 128). Use them for small per-draw data like
2497 ///transform matrices or material indices.
2498 ///
2499 ///# Guide
2500 ///
2501 ///See [Pipelines](https://hiddentale.github.io/vulkan_rust/concepts/pipelines.html) in the vulkan_rust guide.
2502 pub unsafe fn create_pipeline_layout(
2503 &self,
2504 p_create_info: &PipelineLayoutCreateInfo,
2505 allocator: Option<&AllocationCallbacks>,
2506 ) -> VkResult<PipelineLayout> {
2507 let fp = self
2508 .commands()
2509 .create_pipeline_layout
2510 .expect("vkCreatePipelineLayout not loaded");
2511 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2512 let mut out = unsafe { core::mem::zeroed() };
2513 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
2514 Ok(out)
2515 }
2516 ///Wraps [`vkDestroyPipelineLayout`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyPipelineLayout.html).
2517 /**
2518 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2519 ///
2520 ///# Safety
2521 ///- `device` (self) must be valid and not destroyed.
2522 ///- `pipelineLayout` must be externally synchronized.
2523 ///
2524 ///# Panics
2525 ///Panics if `vkDestroyPipelineLayout` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2526 ///
2527 ///# Usage Notes
2528 ///
2529 ///Destroys a pipeline layout. All pipelines and descriptor sets that
2530 ///were created with this layout must no longer be in use.
2531 ///
2532 ///In practice, pipeline layouts are typically created once and live for
2533 ///the duration of the application or a major rendering context. There
2534 ///is little reason to destroy them early.
2535 pub unsafe fn destroy_pipeline_layout(
2536 &self,
2537 pipeline_layout: PipelineLayout,
2538 allocator: Option<&AllocationCallbacks>,
2539 ) {
2540 let fp = self
2541 .commands()
2542 .destroy_pipeline_layout
2543 .expect("vkDestroyPipelineLayout not loaded");
2544 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2545 unsafe { fp(self.handle(), pipeline_layout, alloc_ptr) };
2546 }
2547 ///Wraps [`vkCreateSampler`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateSampler.html).
2548 /**
2549 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2550 ///
2551 ///# Errors
2552 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2553 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2554 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
2555 ///- `VK_ERROR_UNKNOWN`
2556 ///- `VK_ERROR_VALIDATION_FAILED`
2557 ///
2558 ///# Safety
2559 ///- `device` (self) must be valid and not destroyed.
2560 ///
2561 ///# Panics
2562 ///Panics if `vkCreateSampler` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2563 ///
2564 ///# Usage Notes
2565 ///
2566 ///Creates a sampler that controls how shaders read image data:
2567 ///filtering, addressing, mip level selection, and anisotropy.
2568 ///
2569 ///**Common configurations**:
2570 ///
2571 ///- **Nearest/point**: `MIN_FILTER_NEAREST`, `MAG_FILTER_NEAREST`.
2572 /// No interpolation, pixel art, data textures, or shadow map
2573 /// comparison.
2574 ///- **Bilinear**: `MIN_FILTER_LINEAR`, `MAG_FILTER_LINEAR`,
2575 /// `MIPMAP_MODE_NEAREST`. Smooth within a mip level but snaps
2576 /// between levels.
2577 ///- **Trilinear**: same as bilinear but with `MIPMAP_MODE_LINEAR`.
2578 /// Smooth transitions between mip levels. The default choice for
2579 /// most 3D textures.
2580 ///- **Anisotropic**: enable `anisotropy_enable` and set
2581 /// `max_anisotropy` (commonly 4–16). Improves quality at oblique
2582 /// viewing angles at a small GPU cost.
2583 ///
2584 ///**Address modes** (`REPEAT`, `MIRRORED_REPEAT`, `CLAMP_TO_EDGE`,
2585 ///`CLAMP_TO_BORDER`) control what happens when UVs go outside [0, 1].
2586 ///
2587 ///Samplers are immutable after creation and can be shared across any
2588 ///number of descriptor sets. Most applications need only a handful of
2589 ///samplers.
2590 pub unsafe fn create_sampler(
2591 &self,
2592 p_create_info: &SamplerCreateInfo,
2593 allocator: Option<&AllocationCallbacks>,
2594 ) -> VkResult<Sampler> {
2595 let fp = self
2596 .commands()
2597 .create_sampler
2598 .expect("vkCreateSampler not loaded");
2599 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2600 let mut out = unsafe { core::mem::zeroed() };
2601 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
2602 Ok(out)
2603 }
2604 ///Wraps [`vkDestroySampler`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroySampler.html).
2605 /**
2606 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2607 ///
2608 ///# Safety
2609 ///- `device` (self) must be valid and not destroyed.
2610 ///- `sampler` must be externally synchronized.
2611 ///
2612 ///# Panics
2613 ///Panics if `vkDestroySampler` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2614 ///
2615 ///# Usage Notes
2616 ///
2617 ///Destroys a sampler. The sampler must not be referenced by any
2618 ///descriptor set that is bound in a pending command buffer.
2619 ///
2620 ///Since most applications use a small fixed set of samplers, they are
2621 ///typically created once at startup and destroyed only during
2622 ///application shutdown.
2623 pub unsafe fn destroy_sampler(
2624 &self,
2625 sampler: Sampler,
2626 allocator: Option<&AllocationCallbacks>,
2627 ) {
2628 let fp = self
2629 .commands()
2630 .destroy_sampler
2631 .expect("vkDestroySampler not loaded");
2632 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2633 unsafe { fp(self.handle(), sampler, alloc_ptr) };
2634 }
2635 ///Wraps [`vkCreateDescriptorSetLayout`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateDescriptorSetLayout.html).
2636 /**
2637 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2638 ///
2639 ///# Errors
2640 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2641 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2642 ///- `VK_ERROR_UNKNOWN`
2643 ///- `VK_ERROR_VALIDATION_FAILED`
2644 ///
2645 ///# Safety
2646 ///- `device` (self) must be valid and not destroyed.
2647 ///
2648 ///# Panics
2649 ///Panics if `vkCreateDescriptorSetLayout` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2650 ///
2651 ///# Usage Notes
2652 ///
2653 ///A descriptor set layout defines the shape of a descriptor set: which
2654 ///binding numbers exist, what descriptor type each binding holds, and
2655 ///at which shader stages each binding is visible.
2656 ///
2657 ///**Binding tips**:
2658 ///
2659 ///- Keep `stage_flags` as narrow as possible. Declaring a binding
2660 /// visible to all stages when only the fragment shader uses it wastes
2661 /// driver resources on some implementations.
2662 ///- Use `DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER` for simple texture
2663 /// sampling. Separate sampler + sampled image bindings offer more
2664 /// flexibility when you want to reuse samplers across many textures.
2665 ///- Array descriptors (`descriptor_count > 1`) map to GLSL arrays.
2666 /// Useful for bindless or material-table patterns.
2667 ///
2668 ///Layouts are immutable after creation and can be shared across
2669 ///multiple pipeline layouts and descriptor set allocations.
2670 ///
2671 ///Destroy with `destroy_descriptor_set_layout` when no pipeline layout
2672 ///or pending descriptor set allocation still references it.
2673 pub unsafe fn create_descriptor_set_layout(
2674 &self,
2675 p_create_info: &DescriptorSetLayoutCreateInfo,
2676 allocator: Option<&AllocationCallbacks>,
2677 ) -> VkResult<DescriptorSetLayout> {
2678 let fp = self
2679 .commands()
2680 .create_descriptor_set_layout
2681 .expect("vkCreateDescriptorSetLayout not loaded");
2682 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2683 let mut out = unsafe { core::mem::zeroed() };
2684 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
2685 Ok(out)
2686 }
2687 ///Wraps [`vkDestroyDescriptorSetLayout`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyDescriptorSetLayout.html).
2688 /**
2689 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2690 ///
2691 ///# Safety
2692 ///- `device` (self) must be valid and not destroyed.
2693 ///- `descriptorSetLayout` must be externally synchronized.
2694 ///
2695 ///# Panics
2696 ///Panics if `vkDestroyDescriptorSetLayout` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2697 ///
2698 ///# Usage Notes
2699 ///
2700 ///Destroys a descriptor set layout. The layout must not be referenced
2701 ///by any pipeline layout or pending descriptor set allocation that is
2702 ///still in use.
2703 ///
2704 ///Descriptor set layouts are lightweight and typically long-lived.
2705 ///Destroy them during application shutdown after all dependent
2706 ///pipeline layouts and descriptor pools have been destroyed.
2707 pub unsafe fn destroy_descriptor_set_layout(
2708 &self,
2709 descriptor_set_layout: DescriptorSetLayout,
2710 allocator: Option<&AllocationCallbacks>,
2711 ) {
2712 let fp = self
2713 .commands()
2714 .destroy_descriptor_set_layout
2715 .expect("vkDestroyDescriptorSetLayout not loaded");
2716 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2717 unsafe { fp(self.handle(), descriptor_set_layout, alloc_ptr) };
2718 }
2719 ///Wraps [`vkCreateDescriptorPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateDescriptorPool.html).
2720 /**
2721 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2722 ///
2723 ///# Errors
2724 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2725 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2726 ///- `VK_ERROR_FRAGMENTATION_EXT`
2727 ///- `VK_ERROR_UNKNOWN`
2728 ///- `VK_ERROR_VALIDATION_FAILED`
2729 ///
2730 ///# Safety
2731 ///- `device` (self) must be valid and not destroyed.
2732 ///
2733 ///# Panics
2734 ///Panics if `vkCreateDescriptorPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2735 ///
2736 ///# Usage Notes
2737 ///
2738 ///Creates a pool from which descriptor sets are allocated. The pool
2739 ///must be sized to accommodate all the descriptor sets and individual
2740 ///descriptor types your application needs.
2741 ///
2742 ///**Sizing**: specify `max_sets` (total descriptor sets) and a list of
2743 ///`DescriptorPoolSize` entries that declare how many descriptors of
2744 ///each type the pool holds. Under-sizing causes
2745 ///`VK_ERROR_OUT_OF_POOL_MEMORY` at allocation time.
2746 ///
2747 ///**Flags**:
2748 ///
2749 ///- `FREE_DESCRIPTOR_SET`: allows individual sets to be freed with
2750 /// `free_descriptor_sets`. Without this flag, sets can only be
2751 /// reclaimed by resetting the entire pool.
2752 ///- `UPDATE_AFTER_BIND`: required if any allocated set uses
2753 /// update-after-bind bindings.
2754 ///
2755 ///**Common pattern**: create one pool per frame-in-flight. At the
2756 ///start of each frame, `reset_descriptor_pool` reclaims all sets at
2757 ///once, no individual tracking or freeing needed.
2758 pub unsafe fn create_descriptor_pool(
2759 &self,
2760 p_create_info: &DescriptorPoolCreateInfo,
2761 allocator: Option<&AllocationCallbacks>,
2762 ) -> VkResult<DescriptorPool> {
2763 let fp = self
2764 .commands()
2765 .create_descriptor_pool
2766 .expect("vkCreateDescriptorPool not loaded");
2767 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2768 let mut out = unsafe { core::mem::zeroed() };
2769 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
2770 Ok(out)
2771 }
2772 ///Wraps [`vkDestroyDescriptorPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyDescriptorPool.html).
2773 /**
2774 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2775 ///
2776 ///# Safety
2777 ///- `device` (self) must be valid and not destroyed.
2778 ///- `descriptorPool` must be externally synchronized.
2779 ///
2780 ///# Panics
2781 ///Panics if `vkDestroyDescriptorPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2782 ///
2783 ///# Usage Notes
2784 ///
2785 ///Destroys a descriptor pool and implicitly frees all descriptor sets
2786 ///allocated from it. You do not need to free individual sets before
2787 ///destroying the pool.
2788 ///
2789 ///Ensure no command buffer that references any set from this pool is
2790 ///still pending execution.
2791 pub unsafe fn destroy_descriptor_pool(
2792 &self,
2793 descriptor_pool: DescriptorPool,
2794 allocator: Option<&AllocationCallbacks>,
2795 ) {
2796 let fp = self
2797 .commands()
2798 .destroy_descriptor_pool
2799 .expect("vkDestroyDescriptorPool not loaded");
2800 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
2801 unsafe { fp(self.handle(), descriptor_pool, alloc_ptr) };
2802 }
2803 ///Wraps [`vkResetDescriptorPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkResetDescriptorPool.html).
2804 /**
2805 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2806 ///
2807 ///# Errors
2808 ///- `VK_ERROR_UNKNOWN`
2809 ///- `VK_ERROR_VALIDATION_FAILED`
2810 ///
2811 ///# Safety
2812 ///- `device` (self) must be valid and not destroyed.
2813 ///- `descriptorPool` must be externally synchronized.
2814 ///
2815 ///# Panics
2816 ///Panics if `vkResetDescriptorPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2817 ///
2818 ///# Usage Notes
2819 ///
2820 ///Recycles all descriptor sets allocated from this pool back to the
2821 ///pool, without destroying the pool itself. After a reset, all
2822 ///previously allocated sets are invalid and must not be used.
2823 ///
2824 ///This is the fastest way to reclaim descriptor sets, much cheaper
2825 ///than freeing them individually. Ideal for the per-frame pool pattern
2826 ///where you allocate fresh sets every frame and reset the pool at the
2827 ///start of the next frame.
2828 ///
2829 ///No command buffer that references any set from this pool may be
2830 ///pending execution when you reset.
2831 pub unsafe fn reset_descriptor_pool(
2832 &self,
2833 descriptor_pool: DescriptorPool,
2834 flags: DescriptorPoolResetFlags,
2835 ) -> VkResult<()> {
2836 let fp = self
2837 .commands()
2838 .reset_descriptor_pool
2839 .expect("vkResetDescriptorPool not loaded");
2840 check(unsafe { fp(self.handle(), descriptor_pool, flags) })
2841 }
2842 ///Wraps [`vkAllocateDescriptorSets`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAllocateDescriptorSets.html).
2843 /**
2844 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2845 ///
2846 ///# Errors
2847 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2848 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
2849 ///- `VK_ERROR_FRAGMENTED_POOL`
2850 ///- `VK_ERROR_OUT_OF_POOL_MEMORY`
2851 ///- `VK_ERROR_UNKNOWN`
2852 ///- `VK_ERROR_VALIDATION_FAILED`
2853 ///
2854 ///# Safety
2855 ///- `device` (self) must be valid and not destroyed.
2856 ///
2857 ///# Panics
2858 ///Panics if `vkAllocateDescriptorSets` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2859 ///
2860 ///# Usage Notes
2861 ///
2862 ///Allocates descriptor sets from a descriptor pool. Each set is backed
2863 ///by one of the `set_layouts` in the allocate info.
2864 ///
2865 ///Common failure causes:
2866 ///
2867 ///- **Pool exhaustion**: the pool does not have enough descriptors of
2868 /// the required types, or the maximum set count has been reached.
2869 /// Returns `VK_ERROR_OUT_OF_POOL_MEMORY`. Pre-calculate pool sizes
2870 /// carefully or use `VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT`
2871 /// to allow freeing and reallocation.
2872 ///- **Fragmentation**: even with enough total descriptors, internal
2873 /// fragmentation can cause allocation failure. Resetting the entire
2874 /// pool with `reset_descriptor_pool` defragments it.
2875 ///
2876 ///Descriptor sets become invalid when their parent pool is destroyed
2877 ///or reset. Do not submit command buffers that reference descriptor
2878 ///sets from a pool that has been reset.
2879 ///
2880 ///For frequently-updated descriptors, consider
2881 ///`VK_KHR_push_descriptor` which avoids set allocation entirely.
2882 pub unsafe fn allocate_descriptor_sets(
2883 &self,
2884 p_allocate_info: &DescriptorSetAllocateInfo,
2885 ) -> VkResult<Vec<DescriptorSet>> {
2886 let fp = self
2887 .commands()
2888 .allocate_descriptor_sets
2889 .expect("vkAllocateDescriptorSets not loaded");
2890 let count = p_allocate_info.descriptor_set_count as usize;
2891 let mut out = vec![unsafe { core::mem::zeroed() }; count];
2892 check(unsafe { fp(self.handle(), p_allocate_info, out.as_mut_ptr()) })?;
2893 Ok(out)
2894 }
2895 ///Wraps [`vkFreeDescriptorSets`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkFreeDescriptorSets.html).
2896 /**
2897 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2898 ///
2899 ///# Errors
2900 ///- `VK_ERROR_UNKNOWN`
2901 ///- `VK_ERROR_VALIDATION_FAILED`
2902 ///
2903 ///# Safety
2904 ///- `device` (self) must be valid and not destroyed.
2905 ///- `descriptorPool` must be externally synchronized.
2906 ///- `pDescriptorSets` must be externally synchronized.
2907 ///
2908 ///# Panics
2909 ///Panics if `vkFreeDescriptorSets` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2910 ///
2911 ///# Usage Notes
2912 ///
2913 ///Returns individual descriptor sets back to their parent pool. The
2914 ///pool must have been created with `FREE_DESCRIPTOR_SET`, without
2915 ///that flag this call is invalid.
2916 ///
2917 ///For most applications, resetting the entire pool with
2918 ///`reset_descriptor_pool` is simpler and faster than tracking and
2919 ///freeing individual sets. Use `free_descriptor_sets` only when you
2920 ///need fine-grained lifetime control over specific sets.
2921 ///
2922 ///Freed sets must not be referenced by any pending command buffer.
2923 pub unsafe fn free_descriptor_sets(
2924 &self,
2925 descriptor_pool: DescriptorPool,
2926 p_descriptor_sets: &[DescriptorSet],
2927 ) -> VkResult<()> {
2928 let fp = self
2929 .commands()
2930 .free_descriptor_sets
2931 .expect("vkFreeDescriptorSets not loaded");
2932 check(unsafe {
2933 fp(
2934 self.handle(),
2935 descriptor_pool,
2936 p_descriptor_sets.len() as u32,
2937 p_descriptor_sets.as_ptr(),
2938 )
2939 })
2940 }
2941 ///Wraps [`vkUpdateDescriptorSets`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkUpdateDescriptorSets.html).
2942 /**
2943 Provided by **VK_COMPUTE_VERSION_1_0**.*/
2944 ///
2945 ///# Safety
2946 ///- `device` (self) must be valid and not destroyed.
2947 ///- `pDescriptorWrites` must be externally synchronized.
2948 ///
2949 ///# Panics
2950 ///Panics if `vkUpdateDescriptorSets` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
2951 ///
2952 ///# Usage Notes
2953 ///
2954 ///Writes or copies resource bindings into descriptor sets. This is
2955 ///how you connect actual buffers, images, and samplers to the
2956 ///descriptor slots that shaders read from.
2957 ///
2958 ///**Writes** (`WriteDescriptorSet`): bind concrete resources to a
2959 ///specific set + binding + array element. Each write targets one
2960 ///descriptor type (uniform buffer, combined image sampler, storage
2961 ///buffer, etc.).
2962 ///
2963 ///**Copies** (`CopyDescriptorSet`): duplicate bindings from one set
2964 ///to another. Rarely used, writes cover nearly all cases.
2965 ///
2966 ///Updates take effect immediately and are visible to any command buffer
2967 ///recorded after the update. However, updating a set that is currently
2968 ///bound in a pending command buffer is undefined behaviour unless the
2969 ///set was allocated from a pool with `UPDATE_AFTER_BIND` and the
2970 ///binding is marked as update-after-bind in the layout.
2971 ///
2972 ///Batch multiple writes into a single call when possible, the driver
2973 ///can often process them more efficiently.
2974 pub unsafe fn update_descriptor_sets(
2975 &self,
2976 p_descriptor_writes: &[WriteDescriptorSet],
2977 p_descriptor_copies: &[CopyDescriptorSet],
2978 ) {
2979 let fp = self
2980 .commands()
2981 .update_descriptor_sets
2982 .expect("vkUpdateDescriptorSets not loaded");
2983 unsafe {
2984 fp(
2985 self.handle(),
2986 p_descriptor_writes.len() as u32,
2987 p_descriptor_writes.as_ptr(),
2988 p_descriptor_copies.len() as u32,
2989 p_descriptor_copies.as_ptr(),
2990 )
2991 };
2992 }
2993 ///Wraps [`vkCreateFramebuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateFramebuffer.html).
2994 /**
2995 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
2996 ///
2997 ///# Errors
2998 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
2999 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3000 ///- `VK_ERROR_UNKNOWN`
3001 ///- `VK_ERROR_VALIDATION_FAILED`
3002 ///
3003 ///# Safety
3004 ///- `device` (self) must be valid and not destroyed.
3005 ///
3006 ///# Panics
3007 ///Panics if `vkCreateFramebuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3008 ///
3009 ///# Usage Notes
3010 ///
3011 ///A framebuffer binds concrete image views to the attachment slots
3012 ///defined by a render pass. The number and format of attachments must
3013 ///match the render pass exactly, mismatches cause validation errors.
3014 ///
3015 ///**Dimensions**: `width`, `height`, and `layers` must be less than
3016 ///or equal to the corresponding dimensions of every attached image
3017 ///view. They define the renderable area for `cmd_begin_render_pass`.
3018 ///
3019 ///**Lifetime**: the framebuffer must stay alive for the entire
3020 ///duration of any render pass instance that uses it. In practice,
3021 ///framebuffers are typically recreated when the swapchain is resized.
3022 ///
3023 ///**Imageless framebuffers** (Vulkan 1.2+): create the framebuffer
3024 ///with `FRAMEBUFFER_CREATE_IMAGELESS` and no attachments. Concrete
3025 ///image views are then supplied at `cmd_begin_render_pass` time via
3026 ///`RenderPassAttachmentBeginInfo`. This avoids recreating framebuffers
3027 ///on swapchain resize.
3028 ///
3029 ///# Guide
3030 ///
3031 ///See [Render Passes & Framebuffers](https://hiddentale.github.io/vulkan_rust/concepts/render-passes.html) in the vulkan_rust guide.
3032 pub unsafe fn create_framebuffer(
3033 &self,
3034 p_create_info: &FramebufferCreateInfo,
3035 allocator: Option<&AllocationCallbacks>,
3036 ) -> VkResult<Framebuffer> {
3037 let fp = self
3038 .commands()
3039 .create_framebuffer
3040 .expect("vkCreateFramebuffer not loaded");
3041 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
3042 let mut out = unsafe { core::mem::zeroed() };
3043 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
3044 Ok(out)
3045 }
3046 ///Wraps [`vkDestroyFramebuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyFramebuffer.html).
3047 /**
3048 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3049 ///
3050 ///# Safety
3051 ///- `device` (self) must be valid and not destroyed.
3052 ///- `framebuffer` must be externally synchronized.
3053 ///
3054 ///# Panics
3055 ///Panics if `vkDestroyFramebuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3056 ///
3057 ///# Usage Notes
3058 ///
3059 ///Destroys a framebuffer. No render pass instance using this
3060 ///framebuffer may be pending execution.
3061 ///
3062 ///Framebuffers are typically recreated whenever the swapchain is
3063 ///resized, so they tend to have shorter lifetimes than most Vulkan
3064 ///objects. With imageless framebuffers (Vulkan 1.2+) you can avoid
3065 ///this churn entirely.
3066 pub unsafe fn destroy_framebuffer(
3067 &self,
3068 framebuffer: Framebuffer,
3069 allocator: Option<&AllocationCallbacks>,
3070 ) {
3071 let fp = self
3072 .commands()
3073 .destroy_framebuffer
3074 .expect("vkDestroyFramebuffer not loaded");
3075 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
3076 unsafe { fp(self.handle(), framebuffer, alloc_ptr) };
3077 }
3078 ///Wraps [`vkCreateRenderPass`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateRenderPass.html).
3079 /**
3080 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3081 ///
3082 ///# Errors
3083 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3084 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3085 ///- `VK_ERROR_UNKNOWN`
3086 ///- `VK_ERROR_VALIDATION_FAILED`
3087 ///
3088 ///# Safety
3089 ///- `device` (self) must be valid and not destroyed.
3090 ///
3091 ///# Panics
3092 ///Panics if `vkCreateRenderPass` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3093 ///
3094 ///# Usage Notes
3095 ///
3096 ///A render pass describes the attachments, subpasses, and dependencies
3097 ///used during rendering. It does not reference actual images, those
3098 ///are bound later via a framebuffer.
3099 ///
3100 ///Key design points:
3101 ///
3102 ///- **`load_op` / `store_op`**: use `DONT_CARE` for attachments whose
3103 /// prior contents are irrelevant (e.g. a transient depth buffer). This
3104 /// lets tile-based GPUs skip loads/stores, which is significant on
3105 /// mobile.
3106 ///- **`initial_layout` / `final_layout`**: Vulkan inserts implicit layout
3107 /// transitions at render pass boundaries. Set these to match your actual
3108 /// usage to avoid unnecessary transitions. `UNDEFINED` for `initial_layout`
3109 /// is fine when `load_op` is `CLEAR` or `DONT_CARE`.
3110 ///- **Subpass dependencies**: the implicit external dependencies
3111 /// (`VK_SUBPASS_EXTERNAL`) are often insufficient. Add explicit
3112 /// dependencies when subsequent passes read the output.
3113 ///
3114 ///For dynamic rendering (Vulkan 1.3+), consider `cmd_begin_rendering`
3115 ///instead, which avoids the need for render pass and framebuffer objects.
3116 ///
3117 ///# Guide
3118 ///
3119 ///See [Render Passes & Framebuffers](https://hiddentale.github.io/vulkan_rust/concepts/render-passes.html) in the vulkan_rust guide.
3120 pub unsafe fn create_render_pass(
3121 &self,
3122 p_create_info: &RenderPassCreateInfo,
3123 allocator: Option<&AllocationCallbacks>,
3124 ) -> VkResult<RenderPass> {
3125 let fp = self
3126 .commands()
3127 .create_render_pass
3128 .expect("vkCreateRenderPass not loaded");
3129 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
3130 let mut out = unsafe { core::mem::zeroed() };
3131 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
3132 Ok(out)
3133 }
3134 ///Wraps [`vkDestroyRenderPass`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyRenderPass.html).
3135 /**
3136 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3137 ///
3138 ///# Safety
3139 ///- `device` (self) must be valid and not destroyed.
3140 ///- `renderPass` must be externally synchronized.
3141 ///
3142 ///# Panics
3143 ///Panics if `vkDestroyRenderPass` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3144 ///
3145 ///# Usage Notes
3146 ///
3147 ///Destroys a render pass. All framebuffers and pipelines created with
3148 ///this render pass must no longer be in use.
3149 ///
3150 ///Render passes are typically long-lived, created once at startup
3151 ///and destroyed during shutdown. Destroying a render pass does not
3152 ///affect pipelines that were created with a compatible render pass
3153 ///(same attachment count, formats, and sample counts).
3154 pub unsafe fn destroy_render_pass(
3155 &self,
3156 render_pass: RenderPass,
3157 allocator: Option<&AllocationCallbacks>,
3158 ) {
3159 let fp = self
3160 .commands()
3161 .destroy_render_pass
3162 .expect("vkDestroyRenderPass not loaded");
3163 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
3164 unsafe { fp(self.handle(), render_pass, alloc_ptr) };
3165 }
3166 ///Wraps [`vkGetRenderAreaGranularity`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetRenderAreaGranularity.html).
3167 /**
3168 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3169 ///
3170 ///# Safety
3171 ///- `device` (self) must be valid and not destroyed.
3172 ///
3173 ///# Panics
3174 ///Panics if `vkGetRenderAreaGranularity` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3175 ///
3176 ///# Usage Notes
3177 ///
3178 ///Returns the granularity (in pixels) at which the render area should
3179 ///be aligned for optimal performance with this render pass.
3180 ///
3181 ///The render area passed to `cmd_begin_render_pass` should have its
3182 ///`offset` be a multiple of this granularity and its `extent` should
3183 ///either cover the full framebuffer or be rounded up to a multiple.
3184 ///
3185 ///On most desktop GPUs this returns (1, 1), meaning any alignment is
3186 ///fine. On tile-based GPUs this may return the tile size (e.g. 32×32),
3187 ///and misalignment can cause partial-tile overhead.
3188 ///
3189 ///In practice, most applications render to the full framebuffer extent
3190 ///and never need to worry about this.
3191 pub unsafe fn get_render_area_granularity(&self, render_pass: RenderPass) -> Extent2D {
3192 let fp = self
3193 .commands()
3194 .get_render_area_granularity
3195 .expect("vkGetRenderAreaGranularity not loaded");
3196 let mut out = unsafe { core::mem::zeroed() };
3197 unsafe { fp(self.handle(), render_pass, &mut out) };
3198 out
3199 }
3200 ///Wraps [`vkGetRenderingAreaGranularity`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetRenderingAreaGranularity.html).
3201 /**
3202 Provided by **VK_GRAPHICS_VERSION_1_4**.*/
3203 ///
3204 ///# Safety
3205 ///- `device` (self) must be valid and not destroyed.
3206 ///
3207 ///# Panics
3208 ///Panics if `vkGetRenderingAreaGranularity` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3209 ///
3210 ///# Usage Notes
3211 ///
3212 ///Vulkan 1.4 command that queries the optimal render area granularity
3213 ///for a given dynamic rendering configuration, without needing a
3214 ///render pass object.
3215 ///
3216 ///This is the dynamic rendering equivalent of
3217 ///`get_render_area_granularity`. Pass a `RenderingAreaInfo` describing
3218 ///the attachment formats and sample count, and receive the granularity
3219 ///(in pixels) at which the render area should be aligned.
3220 ///
3221 ///On most desktop GPUs this returns (1, 1). On tile-based GPUs the
3222 ///granularity may match the tile size.
3223 pub unsafe fn get_rendering_area_granularity(
3224 &self,
3225 p_rendering_area_info: &RenderingAreaInfo,
3226 ) -> Extent2D {
3227 let fp = self
3228 .commands()
3229 .get_rendering_area_granularity
3230 .expect("vkGetRenderingAreaGranularity not loaded");
3231 let mut out = unsafe { core::mem::zeroed() };
3232 unsafe { fp(self.handle(), p_rendering_area_info, &mut out) };
3233 out
3234 }
3235 ///Wraps [`vkCreateCommandPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateCommandPool.html).
3236 /**
3237 Provided by **VK_BASE_VERSION_1_0**.*/
3238 ///
3239 ///# Errors
3240 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3241 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3242 ///- `VK_ERROR_UNKNOWN`
3243 ///- `VK_ERROR_VALIDATION_FAILED`
3244 ///
3245 ///# Safety
3246 ///- `device` (self) must be valid and not destroyed.
3247 ///
3248 ///# Panics
3249 ///Panics if `vkCreateCommandPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3250 ///
3251 ///# Usage Notes
3252 ///
3253 ///A command pool provides the memory backing for command buffers
3254 ///allocated from it. Pools are tied to a single queue family, command
3255 ///buffers allocated from the pool can only be submitted to queues of
3256 ///that family.
3257 ///
3258 ///**Flags**:
3259 ///
3260 ///- `TRANSIENT`: hint that command buffers are short-lived and reset or
3261 /// freed frequently. Lets the driver use a faster allocation strategy.
3262 ///- `RESET_COMMAND_BUFFER`: allows individual command buffers to be
3263 /// reset via `reset_command_buffer`. Without this flag you must reset
3264 /// the entire pool with `reset_command_pool`.
3265 ///
3266 ///A common pattern is one pool per frame-in-flight per thread: reset the
3267 ///whole pool at the start of each frame instead of managing individual
3268 ///command buffer lifetimes.
3269 ///
3270 ///Command pools are **not thread-safe**. If multiple threads record
3271 ///commands concurrently, each thread needs its own pool.
3272 ///
3273 ///# Guide
3274 ///
3275 ///See [Command Buffers](https://hiddentale.github.io/vulkan_rust/concepts/command-buffers.html) in the vulkan_rust guide.
3276 pub unsafe fn create_command_pool(
3277 &self,
3278 p_create_info: &CommandPoolCreateInfo,
3279 allocator: Option<&AllocationCallbacks>,
3280 ) -> VkResult<CommandPool> {
3281 let fp = self
3282 .commands()
3283 .create_command_pool
3284 .expect("vkCreateCommandPool not loaded");
3285 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
3286 let mut out = unsafe { core::mem::zeroed() };
3287 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
3288 Ok(out)
3289 }
3290 ///Wraps [`vkDestroyCommandPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyCommandPool.html).
3291 /**
3292 Provided by **VK_BASE_VERSION_1_0**.*/
3293 ///
3294 ///# Safety
3295 ///- `device` (self) must be valid and not destroyed.
3296 ///- `commandPool` must be externally synchronized.
3297 ///
3298 ///# Panics
3299 ///Panics if `vkDestroyCommandPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3300 ///
3301 ///# Usage Notes
3302 ///
3303 ///Destroys a command pool and implicitly frees all command buffers
3304 ///allocated from it. You do not need to free individual command buffers
3305 ///before destroying the pool.
3306 ///
3307 ///All command buffers allocated from this pool must have completed
3308 ///execution before the pool is destroyed. Call `device_wait_idle` or
3309 ///wait on the relevant fences first.
3310 pub unsafe fn destroy_command_pool(
3311 &self,
3312 command_pool: CommandPool,
3313 allocator: Option<&AllocationCallbacks>,
3314 ) {
3315 let fp = self
3316 .commands()
3317 .destroy_command_pool
3318 .expect("vkDestroyCommandPool not loaded");
3319 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
3320 unsafe { fp(self.handle(), command_pool, alloc_ptr) };
3321 }
3322 ///Wraps [`vkResetCommandPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkResetCommandPool.html).
3323 /**
3324 Provided by **VK_BASE_VERSION_1_0**.*/
3325 ///
3326 ///# Errors
3327 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3328 ///- `VK_ERROR_UNKNOWN`
3329 ///- `VK_ERROR_VALIDATION_FAILED`
3330 ///
3331 ///# Safety
3332 ///- `device` (self) must be valid and not destroyed.
3333 ///- `commandPool` must be externally synchronized.
3334 ///
3335 ///# Panics
3336 ///Panics if `vkResetCommandPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3337 ///
3338 ///# Usage Notes
3339 ///
3340 ///Resets a command pool, recycling all command buffers allocated from
3341 ///it back to the initial state. This is faster than resetting
3342 ///individual command buffers.
3343 ///
3344 ///**Flags**:
3345 ///
3346 ///- `RELEASE_RESOURCES`: return memory to the system. Without this
3347 /// flag, the pool keeps its internal memory for reuse by future
3348 /// allocations, usually what you want in a frame loop.
3349 ///
3350 ///**Per-frame pattern**: reset the pool at the start of each frame
3351 ///(without `RELEASE_RESOURCES`), then re-record command buffers from
3352 ///the same pool. Memory is reused without reallocation overhead.
3353 ///
3354 ///All command buffers from this pool must have completed execution
3355 ///before resetting.
3356 pub unsafe fn reset_command_pool(
3357 &self,
3358 command_pool: CommandPool,
3359 flags: CommandPoolResetFlags,
3360 ) -> VkResult<()> {
3361 let fp = self
3362 .commands()
3363 .reset_command_pool
3364 .expect("vkResetCommandPool not loaded");
3365 check(unsafe { fp(self.handle(), command_pool, flags) })
3366 }
3367 ///Wraps [`vkAllocateCommandBuffers`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAllocateCommandBuffers.html).
3368 /**
3369 Provided by **VK_BASE_VERSION_1_0**.*/
3370 ///
3371 ///# Errors
3372 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3373 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3374 ///- `VK_ERROR_UNKNOWN`
3375 ///- `VK_ERROR_VALIDATION_FAILED`
3376 ///
3377 ///# Safety
3378 ///- `device` (self) must be valid and not destroyed.
3379 ///
3380 ///# Panics
3381 ///Panics if `vkAllocateCommandBuffers` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3382 ///
3383 ///# Usage Notes
3384 ///
3385 ///Allocates one or more command buffers from a command pool. The
3386 ///`command_buffer_count` and output slice length must match.
3387 ///
3388 ///**Level**:
3389 ///
3390 ///- `PRIMARY`: submitted directly to a queue via `queue_submit`.
3391 ///- `SECONDARY`: recorded separately and executed inside a primary
3392 /// buffer via `cmd_execute_commands`. Useful for pre-recording
3393 /// draw calls that are reused across frames.
3394 ///
3395 ///All allocated command buffers start in the *initial* state and must
3396 ///be recorded with `begin_command_buffer` before submission.
3397 ///
3398 ///Command buffers are freed either individually with
3399 ///`free_command_buffers` or implicitly when the parent pool is
3400 ///destroyed or reset.
3401 ///
3402 ///# Guide
3403 ///
3404 ///See [Command Buffers](https://hiddentale.github.io/vulkan_rust/concepts/command-buffers.html) in the vulkan_rust guide.
3405 pub unsafe fn allocate_command_buffers(
3406 &self,
3407 p_allocate_info: &CommandBufferAllocateInfo,
3408 ) -> VkResult<Vec<CommandBuffer>> {
3409 let fp = self
3410 .commands()
3411 .allocate_command_buffers
3412 .expect("vkAllocateCommandBuffers not loaded");
3413 let count = p_allocate_info.command_buffer_count as usize;
3414 let mut out = vec![unsafe { core::mem::zeroed() }; count];
3415 check(unsafe { fp(self.handle(), p_allocate_info, out.as_mut_ptr()) })?;
3416 Ok(out)
3417 }
3418 ///Wraps [`vkFreeCommandBuffers`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkFreeCommandBuffers.html).
3419 /**
3420 Provided by **VK_BASE_VERSION_1_0**.*/
3421 ///
3422 ///# Safety
3423 ///- `device` (self) must be valid and not destroyed.
3424 ///- `commandPool` must be externally synchronized.
3425 ///- `pCommandBuffers` must be externally synchronized.
3426 ///
3427 ///# Panics
3428 ///Panics if `vkFreeCommandBuffers` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3429 ///
3430 ///# Usage Notes
3431 ///
3432 ///Returns individual command buffers to their parent pool. The command
3433 ///buffers must not be pending execution.
3434 ///
3435 ///For most applications, resetting the entire pool with
3436 ///`reset_command_pool` is simpler. Use `free_command_buffers` only
3437 ///when you need fine-grained lifetime control, for example, freeing
3438 ///a one-shot transfer command buffer immediately after use while
3439 ///keeping other buffers from the same pool alive.
3440 ///
3441 ///Freed command buffer handles become invalid. Do not resubmit them.
3442 pub unsafe fn free_command_buffers(
3443 &self,
3444 command_pool: CommandPool,
3445 p_command_buffers: &[CommandBuffer],
3446 ) {
3447 let fp = self
3448 .commands()
3449 .free_command_buffers
3450 .expect("vkFreeCommandBuffers not loaded");
3451 unsafe {
3452 fp(
3453 self.handle(),
3454 command_pool,
3455 p_command_buffers.len() as u32,
3456 p_command_buffers.as_ptr(),
3457 )
3458 };
3459 }
3460 ///Wraps [`vkBeginCommandBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBeginCommandBuffer.html).
3461 /**
3462 Provided by **VK_BASE_VERSION_1_0**.*/
3463 ///
3464 ///# Errors
3465 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3466 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3467 ///- `VK_ERROR_UNKNOWN`
3468 ///- `VK_ERROR_VALIDATION_FAILED`
3469 ///
3470 ///# Safety
3471 ///- `commandBuffer` (self) must be valid and not destroyed.
3472 ///- `commandBuffer` must be externally synchronized.
3473 ///
3474 ///# Panics
3475 ///Panics if `vkBeginCommandBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3476 ///
3477 ///# Usage Notes
3478 ///
3479 ///Begins recording commands into a command buffer. The command buffer
3480 ///must be in the *initial* state, either freshly allocated, or reset
3481 ///via `reset_command_buffer` / `reset_command_pool`.
3482 ///
3483 ///**Flags**:
3484 ///
3485 ///- `ONE_TIME_SUBMIT`: the command buffer will be submitted once and
3486 /// then reset or freed. Lets the driver skip internal tracking it
3487 /// would otherwise need for resubmission.
3488 ///- `SIMULTANEOUS_USE`: the command buffer can be pending execution on
3489 /// multiple queues simultaneously. Required for secondary command
3490 /// buffers reused across multiple primary buffers.
3491 ///
3492 ///**Inheritance info**: only required for secondary command buffers.
3493 ///When recording a secondary buffer that will execute inside a render
3494 ///pass, set `render_pass`, `subpass`, and optionally `framebuffer` in
3495 ///the `CommandBufferInheritanceInfo`. For primary buffers the
3496 ///inheritance info is ignored.
3497 ///
3498 ///Calling `begin_command_buffer` on a buffer that is already recording
3499 ///is an error. Calling it on a buffer in the *executable* state
3500 ///implicitly resets it first (if the pool allows it).
3501 ///
3502 ///# Guide
3503 ///
3504 ///See [Command Buffers](https://hiddentale.github.io/vulkan_rust/concepts/command-buffers.html) in the vulkan_rust guide.
3505 pub unsafe fn begin_command_buffer(
3506 &self,
3507 command_buffer: CommandBuffer,
3508 p_begin_info: &CommandBufferBeginInfo,
3509 ) -> VkResult<()> {
3510 let fp = self
3511 .commands()
3512 .begin_command_buffer
3513 .expect("vkBeginCommandBuffer not loaded");
3514 check(unsafe { fp(command_buffer, p_begin_info) })
3515 }
3516 ///Wraps [`vkEndCommandBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkEndCommandBuffer.html).
3517 /**
3518 Provided by **VK_BASE_VERSION_1_0**.*/
3519 ///
3520 ///# Errors
3521 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
3522 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3523 ///- `VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR`
3524 ///- `VK_ERROR_UNKNOWN`
3525 ///- `VK_ERROR_VALIDATION_FAILED`
3526 ///
3527 ///# Safety
3528 ///- `commandBuffer` (self) must be valid and not destroyed.
3529 ///- `commandBuffer` must be externally synchronized.
3530 ///
3531 ///# Panics
3532 ///Panics if `vkEndCommandBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3533 ///
3534 ///# Usage Notes
3535 ///
3536 ///Finishes recording a command buffer. After this call the command
3537 ///buffer moves from the *recording* state to the *executable* state
3538 ///and can be submitted via `queue_submit`.
3539 ///
3540 ///If an error occurred during recording (e.g. out of memory), this
3541 ///call returns the error. Always check the return value, a failed
3542 ///`end_command_buffer` means the command buffer is in an invalid state
3543 ///and must be reset before reuse.
3544 ///
3545 ///A command buffer that is inside a render pass must end the render
3546 ///pass with `cmd_end_render_pass` before calling `end_command_buffer`.
3547 ///
3548 ///# Guide
3549 ///
3550 ///See [Command Buffers](https://hiddentale.github.io/vulkan_rust/concepts/command-buffers.html) in the vulkan_rust guide.
3551 pub unsafe fn end_command_buffer(&self, command_buffer: CommandBuffer) -> VkResult<()> {
3552 let fp = self
3553 .commands()
3554 .end_command_buffer
3555 .expect("vkEndCommandBuffer not loaded");
3556 check(unsafe { fp(command_buffer) })
3557 }
3558 ///Wraps [`vkResetCommandBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkResetCommandBuffer.html).
3559 /**
3560 Provided by **VK_BASE_VERSION_1_0**.*/
3561 ///
3562 ///# Errors
3563 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
3564 ///- `VK_ERROR_UNKNOWN`
3565 ///- `VK_ERROR_VALIDATION_FAILED`
3566 ///
3567 ///# Safety
3568 ///- `commandBuffer` (self) must be valid and not destroyed.
3569 ///- `commandBuffer` must be externally synchronized.
3570 ///
3571 ///# Panics
3572 ///Panics if `vkResetCommandBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3573 ///
3574 ///# Usage Notes
3575 ///
3576 ///Resets a single command buffer back to the initial state so it can
3577 ///be re-recorded. The command pool must have been created with
3578 ///`RESET_COMMAND_BUFFER` for this to be valid.
3579 ///
3580 ///**Flags**:
3581 ///
3582 ///- `RELEASE_RESOURCES`: return the command buffer's memory to the
3583 /// pool. Without this flag, memory is retained for reuse during the
3584 /// next recording, usually preferred in a frame loop.
3585 ///
3586 ///For bulk resets, `reset_command_pool` is more efficient than
3587 ///resetting buffers individually.
3588 ///
3589 ///The command buffer must not be pending execution when reset.
3590 pub unsafe fn reset_command_buffer(
3591 &self,
3592 command_buffer: CommandBuffer,
3593 flags: CommandBufferResetFlags,
3594 ) -> VkResult<()> {
3595 let fp = self
3596 .commands()
3597 .reset_command_buffer
3598 .expect("vkResetCommandBuffer not loaded");
3599 check(unsafe { fp(command_buffer, flags) })
3600 }
3601 ///Wraps [`vkCmdBindPipeline`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindPipeline.html).
3602 /**
3603 Provided by **VK_COMPUTE_VERSION_1_0**.*/
3604 ///
3605 ///# Safety
3606 ///- `commandBuffer` (self) must be valid and not destroyed.
3607 ///- `commandBuffer` must be externally synchronized.
3608 ///
3609 ///# Panics
3610 ///Panics if `vkCmdBindPipeline` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3611 ///
3612 ///# Usage Notes
3613 ///
3614 ///Binds a pipeline to a command buffer for subsequent draw or dispatch
3615 ///calls. The `pipeline_bind_point` must match the pipeline type:
3616 ///
3617 ///- `PIPELINE_BIND_POINT_GRAPHICS` for graphics pipelines.
3618 ///- `PIPELINE_BIND_POINT_COMPUTE` for compute pipelines.
3619 ///- `PIPELINE_BIND_POINT_RAY_TRACING_KHR` for ray tracing pipelines.
3620 ///
3621 ///Binding a pipeline invalidates any incompatible dynamic state. For
3622 ///example, binding a new graphics pipeline that uses dynamic viewport
3623 ///requires you to call `cmd_set_viewport` again before drawing.
3624 ///
3625 ///Pipeline binds are relatively cheap, the driver patches command
3626 ///state internally. Minimise binds by sorting draw calls by pipeline
3627 ///when possible, but do not over-optimise at the expense of code
3628 ///clarity.
3629 ///
3630 ///Graphics pipelines can only be bound inside a render pass (or
3631 ///dynamic rendering). Compute pipelines can be bound anywhere.
3632 ///
3633 ///# Guide
3634 ///
3635 ///See [Pipelines](https://hiddentale.github.io/vulkan_rust/concepts/pipelines.html) in the vulkan_rust guide.
3636 pub unsafe fn cmd_bind_pipeline(
3637 &self,
3638 command_buffer: CommandBuffer,
3639 pipeline_bind_point: PipelineBindPoint,
3640 pipeline: Pipeline,
3641 ) {
3642 let fp = self
3643 .commands()
3644 .cmd_bind_pipeline
3645 .expect("vkCmdBindPipeline not loaded");
3646 unsafe { fp(command_buffer, pipeline_bind_point, pipeline) };
3647 }
3648 ///Wraps [`vkCmdSetAttachmentFeedbackLoopEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetAttachmentFeedbackLoopEnableEXT.html).
3649 /**
3650 Provided by **VK_EXT_attachment_feedback_loop_dynamic_state**.*/
3651 ///
3652 ///# Safety
3653 ///- `commandBuffer` (self) must be valid and not destroyed.
3654 ///- `commandBuffer` must be externally synchronized.
3655 ///
3656 ///# Panics
3657 ///Panics if `vkCmdSetAttachmentFeedbackLoopEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3658 ///
3659 ///# Usage Notes
3660 ///
3661 ///Dynamically enables or disables attachment feedback loops for
3662 ///specific image aspects (color, depth, stencil). When enabled,
3663 ///shaders can both read from and write to the same attachment
3664 ///within a render pass.
3665 ///
3666 ///Use with care, feedback loops create read-after-write hazards.
3667 ///The implementation handles coherency when this flag is set.
3668 ///
3669 ///Requires `VK_EXT_attachment_feedback_loop_dynamic_state`.
3670 pub unsafe fn cmd_set_attachment_feedback_loop_enable_ext(
3671 &self,
3672 command_buffer: CommandBuffer,
3673 aspect_mask: ImageAspectFlags,
3674 ) {
3675 let fp = self
3676 .commands()
3677 .cmd_set_attachment_feedback_loop_enable_ext
3678 .expect("vkCmdSetAttachmentFeedbackLoopEnableEXT not loaded");
3679 unsafe { fp(command_buffer, aspect_mask) };
3680 }
3681 ///Wraps [`vkCmdSetViewport`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetViewport.html).
3682 /**
3683 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3684 ///
3685 ///# Safety
3686 ///- `commandBuffer` (self) must be valid and not destroyed.
3687 ///- `commandBuffer` must be externally synchronized.
3688 ///
3689 ///# Panics
3690 ///Panics if `vkCmdSetViewport` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3691 ///
3692 ///# Usage Notes
3693 ///
3694 ///Sets the viewport transform dynamically. Only takes effect if the
3695 ///pipeline was created with `DYNAMIC_STATE_VIEWPORT`.
3696 ///
3697 ///The viewport defines the mapping from normalised device coordinates
3698 ///to framebuffer coordinates. Most applications use a single viewport
3699 ///covering the full render target:
3700 ///
3701 ///```text
3702 ///Viewport { x: 0.0, y: 0.0, width: w, height: h, min_depth: 0.0, max_depth: 1.0 }
3703 ///```
3704 ///
3705 ///**Flipped Y**: Vulkan's clip space has Y pointing downward (unlike
3706 ///OpenGL). To match OpenGL conventions, use a negative height and
3707 ///offset Y by the framebuffer height:
3708 ///`Viewport { y: h, height: -h, ... }`. This requires Vulkan 1.1 or
3709 ///`VK_KHR_maintenance1`.
3710 ///
3711 ///Multiple viewports are supported for multi-view rendering (e.g.
3712 ///VR). The `first_viewport` parameter selects which viewport index to
3713 ///start writing at.
3714 pub unsafe fn cmd_set_viewport(
3715 &self,
3716 command_buffer: CommandBuffer,
3717 first_viewport: u32,
3718 p_viewports: &[Viewport],
3719 ) {
3720 let fp = self
3721 .commands()
3722 .cmd_set_viewport
3723 .expect("vkCmdSetViewport not loaded");
3724 unsafe {
3725 fp(
3726 command_buffer,
3727 first_viewport,
3728 p_viewports.len() as u32,
3729 p_viewports.as_ptr(),
3730 )
3731 };
3732 }
3733 ///Wraps [`vkCmdSetScissor`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetScissor.html).
3734 /**
3735 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3736 ///
3737 ///# Safety
3738 ///- `commandBuffer` (self) must be valid and not destroyed.
3739 ///- `commandBuffer` must be externally synchronized.
3740 ///
3741 ///# Panics
3742 ///Panics if `vkCmdSetScissor` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3743 ///
3744 ///# Usage Notes
3745 ///
3746 ///Sets the scissor rectangle dynamically. Only takes effect if the
3747 ///pipeline was created with `DYNAMIC_STATE_SCISSOR`.
3748 ///
3749 ///The scissor test discards fragments outside the rectangle. Unlike
3750 ///the viewport (which transforms coordinates), the scissor is a
3751 ///hard clip in framebuffer pixel coordinates.
3752 ///
3753 ///A common default is a scissor covering the full framebuffer:
3754 ///
3755 ///```text
3756 ///Rect2D { offset: { x: 0, y: 0 }, extent: { width: w, height: h } }
3757 ///```
3758 ///
3759 ///Scissor rectangles are useful for UI rendering, split-screen, or
3760 ///any case where you want to restrict rendering to a sub-region
3761 ///without changing the viewport transform.
3762 ///
3763 ///The scissor must be set before any draw call when using dynamic
3764 ///scissor state, even if it covers the full framebuffer.
3765 pub unsafe fn cmd_set_scissor(
3766 &self,
3767 command_buffer: CommandBuffer,
3768 first_scissor: u32,
3769 p_scissors: &[Rect2D],
3770 ) {
3771 let fp = self
3772 .commands()
3773 .cmd_set_scissor
3774 .expect("vkCmdSetScissor not loaded");
3775 unsafe {
3776 fp(
3777 command_buffer,
3778 first_scissor,
3779 p_scissors.len() as u32,
3780 p_scissors.as_ptr(),
3781 )
3782 };
3783 }
3784 ///Wraps [`vkCmdSetLineWidth`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetLineWidth.html).
3785 /**
3786 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3787 ///
3788 ///# Safety
3789 ///- `commandBuffer` (self) must be valid and not destroyed.
3790 ///- `commandBuffer` must be externally synchronized.
3791 ///
3792 ///# Panics
3793 ///Panics if `vkCmdSetLineWidth` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3794 ///
3795 ///# Usage Notes
3796 ///
3797 ///Sets the width of rasterised line primitives dynamically. Only takes
3798 ///effect if the pipeline was created with `DYNAMIC_STATE_LINE_WIDTH`.
3799 ///
3800 ///The default line width is 1.0. Wide lines (width > 1.0) require the
3801 ///`wide_lines` device feature, check
3802 ///`physical_device_features.wide_lines` before using.
3803 ///
3804 ///The supported range is device-dependent (query
3805 ///`physical_device_limits.line_width_range`). If `wide_lines` is not
3806 ///supported, only 1.0 is valid.
3807 ///
3808 ///Line width is specified in framebuffer pixels. Anti-aliased lines
3809 ///may be rendered slightly wider than the specified width due to
3810 ///coverage calculations.
3811 pub unsafe fn cmd_set_line_width(&self, command_buffer: CommandBuffer, line_width: f32) {
3812 let fp = self
3813 .commands()
3814 .cmd_set_line_width
3815 .expect("vkCmdSetLineWidth not loaded");
3816 unsafe { fp(command_buffer, line_width) };
3817 }
3818 ///Wraps [`vkCmdSetDepthBias`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthBias.html).
3819 /**
3820 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3821 ///
3822 ///# Safety
3823 ///- `commandBuffer` (self) must be valid and not destroyed.
3824 ///- `commandBuffer` must be externally synchronized.
3825 ///
3826 ///# Panics
3827 ///Panics if `vkCmdSetDepthBias` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3828 ///
3829 ///# Usage Notes
3830 ///
3831 ///Sets depth bias parameters dynamically. Only takes effect if the
3832 ///pipeline was created with `DYNAMIC_STATE_DEPTH_BIAS` and depth bias
3833 ///is enabled in the rasterisation state.
3834 ///
3835 ///Depth bias adds a computed offset to each fragment's depth value
3836 ///before the depth test. The primary use case is **shadow mapping**,
3837 ///biasing shadow caster geometry slightly away from the light prevents
3838 ///self-shadowing artifacts (shadow acne).
3839 ///
3840 ///The final bias is computed as:
3841 ///
3842 ///```text
3843 ///bias = constant_factor * r + slope_factor * max_slope
3844 ///```
3845 ///
3846 ///where `r` is the minimum resolvable depth difference and `max_slope`
3847 ///is the maximum depth slope of the triangle.
3848 ///
3849 ///**`depth_bias_clamp`** limits the maximum bias value. Requires the
3850 ///`depth_bias_clamp` device feature. A clamp of 0.0 disables clamping.
3851 ///
3852 ///Typical shadow map values: `constant_factor` = 1.25,
3853 ///`slope_factor` = 1.75, `clamp` = 0.0. Tune per scene.
3854 pub unsafe fn cmd_set_depth_bias(
3855 &self,
3856 command_buffer: CommandBuffer,
3857 depth_bias_constant_factor: f32,
3858 depth_bias_clamp: f32,
3859 depth_bias_slope_factor: f32,
3860 ) {
3861 let fp = self
3862 .commands()
3863 .cmd_set_depth_bias
3864 .expect("vkCmdSetDepthBias not loaded");
3865 unsafe {
3866 fp(
3867 command_buffer,
3868 depth_bias_constant_factor,
3869 depth_bias_clamp,
3870 depth_bias_slope_factor,
3871 )
3872 };
3873 }
3874 ///Wraps [`vkCmdSetBlendConstants`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetBlendConstants.html).
3875 /**
3876 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3877 ///
3878 ///# Safety
3879 ///- `commandBuffer` (self) must be valid and not destroyed.
3880 ///- `commandBuffer` must be externally synchronized.
3881 ///
3882 ///# Panics
3883 ///Panics if `vkCmdSetBlendConstants` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3884 ///
3885 ///# Usage Notes
3886 ///
3887 ///Sets the constant blend colour used when a blend factor references
3888 ///`BLEND_FACTOR_CONSTANT_COLOR`, `BLEND_FACTOR_CONSTANT_ALPHA`, or
3889 ///their one-minus variants. Only takes effect if the pipeline was
3890 ///created with `DYNAMIC_STATE_BLEND_CONSTANTS`.
3891 ///
3892 ///The four values are RGBA in [0.0, 1.0]. A common use is fading
3893 ///geometry by setting a constant alpha and blending with
3894 ///`BLEND_FACTOR_CONSTANT_ALPHA`.
3895 ///
3896 ///If your pipeline does not use any constant blend factors, you do not
3897 ///need to set this state. The values are ignored for blend modes that
3898 ///do not reference them.
3899 pub unsafe fn cmd_set_blend_constants(
3900 &self,
3901 command_buffer: CommandBuffer,
3902 blend_constants: f32,
3903 ) {
3904 let fp = self
3905 .commands()
3906 .cmd_set_blend_constants
3907 .expect("vkCmdSetBlendConstants not loaded");
3908 unsafe { fp(command_buffer, blend_constants) };
3909 }
3910 ///Wraps [`vkCmdSetDepthBounds`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthBounds.html).
3911 /**
3912 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3913 ///
3914 ///# Safety
3915 ///- `commandBuffer` (self) must be valid and not destroyed.
3916 ///- `commandBuffer` must be externally synchronized.
3917 ///
3918 ///# Panics
3919 ///Panics if `vkCmdSetDepthBounds` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3920 ///
3921 ///# Usage Notes
3922 ///
3923 ///Sets the depth bounds test range dynamically. Only takes effect if
3924 ///the pipeline was created with `DYNAMIC_STATE_DEPTH_BOUNDS` and
3925 ///depth bounds testing is enabled in the depth-stencil state.
3926 ///
3927 ///The depth bounds test discards fragments whose depth buffer value
3928 ///falls outside [`min_depth_bounds`, `max_depth_bounds`]. Note that
3929 ///this tests the **existing** depth buffer value, not the fragment's
3930 ///incoming depth.
3931 ///
3932 ///Use cases are niche:
3933 ///
3934 ///- **Stencil shadow volumes**: reject fragments that are clearly
3935 /// outside the shadow volume's depth range.
3936 ///- **Deferred shading light volumes**: skip fragments outside the
3937 /// light's depth range.
3938 ///
3939 ///Requires the `depth_bounds` device feature. Not supported on all
3940 ///hardware, check `physical_device_features.depth_bounds` before
3941 ///enabling.
3942 pub unsafe fn cmd_set_depth_bounds(
3943 &self,
3944 command_buffer: CommandBuffer,
3945 min_depth_bounds: f32,
3946 max_depth_bounds: f32,
3947 ) {
3948 let fp = self
3949 .commands()
3950 .cmd_set_depth_bounds
3951 .expect("vkCmdSetDepthBounds not loaded");
3952 unsafe { fp(command_buffer, min_depth_bounds, max_depth_bounds) };
3953 }
3954 ///Wraps [`vkCmdSetStencilCompareMask`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetStencilCompareMask.html).
3955 /**
3956 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3957 ///
3958 ///# Safety
3959 ///- `commandBuffer` (self) must be valid and not destroyed.
3960 ///- `commandBuffer` must be externally synchronized.
3961 ///
3962 ///# Panics
3963 ///Panics if `vkCmdSetStencilCompareMask` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
3964 ///
3965 ///# Usage Notes
3966 ///
3967 ///Sets the stencil compare mask dynamically for front-facing,
3968 ///back-facing, or both face sets. Only takes effect if the pipeline
3969 ///was created with `DYNAMIC_STATE_STENCIL_COMPARE_MASK`.
3970 ///
3971 ///The compare mask is ANDed with both the reference value and the
3972 ///stencil buffer value before the stencil comparison. This lets you
3973 ///use individual bits of the stencil buffer for different purposes
3974 ///(e.g. bit 0 for portals, bits 1–3 for decal layers).
3975 ///
3976 ///A mask of `0xFF` (the default) uses all 8 bits of the stencil
3977 ///buffer. Narrower masks isolate specific bit planes for multi-purpose
3978 ///stencil schemes.
3979 pub unsafe fn cmd_set_stencil_compare_mask(
3980 &self,
3981 command_buffer: CommandBuffer,
3982 face_mask: StencilFaceFlags,
3983 compare_mask: u32,
3984 ) {
3985 let fp = self
3986 .commands()
3987 .cmd_set_stencil_compare_mask
3988 .expect("vkCmdSetStencilCompareMask not loaded");
3989 unsafe { fp(command_buffer, face_mask, compare_mask) };
3990 }
3991 ///Wraps [`vkCmdSetStencilWriteMask`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetStencilWriteMask.html).
3992 /**
3993 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
3994 ///
3995 ///# Safety
3996 ///- `commandBuffer` (self) must be valid and not destroyed.
3997 ///- `commandBuffer` must be externally synchronized.
3998 ///
3999 ///# Panics
4000 ///Panics if `vkCmdSetStencilWriteMask` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4001 ///
4002 ///# Usage Notes
4003 ///
4004 ///Sets the stencil write mask dynamically for front-facing,
4005 ///back-facing, or both face sets. Only takes effect if the pipeline
4006 ///was created with `DYNAMIC_STATE_STENCIL_WRITE_MASK`.
4007 ///
4008 ///The write mask controls which bits of the stencil buffer are updated
4009 ///by stencil operations (`KEEP`, `REPLACE`, `INCREMENT`, etc.). Bits
4010 ///that are zero in the mask are left unchanged.
4011 ///
4012 ///A mask of `0xFF` writes all 8 bits. Use narrower masks when
4013 ///different rendering passes own different stencil bit planes.
4014 pub unsafe fn cmd_set_stencil_write_mask(
4015 &self,
4016 command_buffer: CommandBuffer,
4017 face_mask: StencilFaceFlags,
4018 write_mask: u32,
4019 ) {
4020 let fp = self
4021 .commands()
4022 .cmd_set_stencil_write_mask
4023 .expect("vkCmdSetStencilWriteMask not loaded");
4024 unsafe { fp(command_buffer, face_mask, write_mask) };
4025 }
4026 ///Wraps [`vkCmdSetStencilReference`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetStencilReference.html).
4027 /**
4028 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
4029 ///
4030 ///# Safety
4031 ///- `commandBuffer` (self) must be valid and not destroyed.
4032 ///- `commandBuffer` must be externally synchronized.
4033 ///
4034 ///# Panics
4035 ///Panics if `vkCmdSetStencilReference` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4036 ///
4037 ///# Usage Notes
4038 ///
4039 ///Sets the stencil reference value dynamically for front-facing,
4040 ///back-facing, or both face sets. Only takes effect if the pipeline
4041 ///was created with `DYNAMIC_STATE_STENCIL_REFERENCE`.
4042 ///
4043 ///The reference value is used in stencil comparison operations (e.g.
4044 ///`COMPARE_OP_EQUAL` compares the masked buffer value against the
4045 ///masked reference) and as the source value for `STENCIL_OP_REPLACE`.
4046 ///
4047 ///Common patterns:
4048 ///
4049 ///- **Portal/mirror rendering**: set reference to a unique ID per
4050 /// portal, write it with `STENCIL_OP_REPLACE`, then test with
4051 /// `COMPARE_OP_EQUAL` to mask subsequent draws to that portal's
4052 /// region.
4053 ///- **Decal layering**: increment the reference per layer.
4054 pub unsafe fn cmd_set_stencil_reference(
4055 &self,
4056 command_buffer: CommandBuffer,
4057 face_mask: StencilFaceFlags,
4058 reference: u32,
4059 ) {
4060 let fp = self
4061 .commands()
4062 .cmd_set_stencil_reference
4063 .expect("vkCmdSetStencilReference not loaded");
4064 unsafe { fp(command_buffer, face_mask, reference) };
4065 }
4066 ///Wraps [`vkCmdBindDescriptorSets`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindDescriptorSets.html).
4067 /**
4068 Provided by **VK_COMPUTE_VERSION_1_0**.*/
4069 ///
4070 ///# Safety
4071 ///- `commandBuffer` (self) must be valid and not destroyed.
4072 ///- `commandBuffer` must be externally synchronized.
4073 ///
4074 ///# Panics
4075 ///Panics if `vkCmdBindDescriptorSets` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4076 ///
4077 ///# Usage Notes
4078 ///
4079 ///Binds one or more descriptor sets to a command buffer at specified
4080 ///set indices. Subsequent draw or dispatch calls read resources from
4081 ///these bound sets.
4082 ///
4083 ///**`first_set`**: the set index at which binding starts. Sets at
4084 ///lower indices are not disturbed. This lets you bind per-frame data
4085 ///at set 0 once and rebind only per-material or per-object sets at
4086 ///higher indices.
4087 ///
4088 ///**Dynamic offsets**: for descriptors of type
4089 ///`UNIFORM_BUFFER_DYNAMIC` or `STORAGE_BUFFER_DYNAMIC`, the
4090 ///`dynamic_offsets` slice provides byte offsets applied at bind time.
4091 ///This lets multiple draw calls share a single large buffer with
4092 ///different sub-regions without updating the descriptor set.
4093 ///
4094 ///The bound pipeline layout and the descriptor set layouts must be
4095 ///compatible, same binding layout at each set index. Binding a set
4096 ///with an incompatible layout is undefined behaviour.
4097 pub unsafe fn cmd_bind_descriptor_sets(
4098 &self,
4099 command_buffer: CommandBuffer,
4100 pipeline_bind_point: PipelineBindPoint,
4101 layout: PipelineLayout,
4102 first_set: u32,
4103 p_descriptor_sets: &[DescriptorSet],
4104 p_dynamic_offsets: &[u32],
4105 ) {
4106 let fp = self
4107 .commands()
4108 .cmd_bind_descriptor_sets
4109 .expect("vkCmdBindDescriptorSets not loaded");
4110 unsafe {
4111 fp(
4112 command_buffer,
4113 pipeline_bind_point,
4114 layout,
4115 first_set,
4116 p_descriptor_sets.len() as u32,
4117 p_descriptor_sets.as_ptr(),
4118 p_dynamic_offsets.len() as u32,
4119 p_dynamic_offsets.as_ptr(),
4120 )
4121 };
4122 }
4123 ///Wraps [`vkCmdBindIndexBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindIndexBuffer.html).
4124 /**
4125 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
4126 ///
4127 ///# Safety
4128 ///- `commandBuffer` (self) must be valid and not destroyed.
4129 ///- `commandBuffer` must be externally synchronized.
4130 ///
4131 ///# Panics
4132 ///Panics if `vkCmdBindIndexBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4133 ///
4134 ///# Usage Notes
4135 ///
4136 ///Binds an index buffer for subsequent indexed draw calls
4137 ///(`cmd_draw_indexed`, `cmd_draw_indexed_indirect`).
4138 ///
4139 ///**Index type**:
4140 ///
4141 ///- `INDEX_TYPE_UINT16`: 2 bytes per index. Good for meshes with
4142 /// fewer than 65536 vertices, saves memory bandwidth.
4143 ///- `INDEX_TYPE_UINT32`: 4 bytes per index. Required for large meshes.
4144 ///- `INDEX_TYPE_UINT8_KHR` (extension): 1 byte per index for very
4145 /// small meshes.
4146 ///
4147 ///The buffer must have been created with `BUFFER_USAGE_INDEX_BUFFER`.
4148 ///The `offset` must be a multiple of the index type size (2 for
4149 ///UINT16, 4 for UINT32).
4150 ///
4151 ///Only one index buffer can be bound at a time, binding a new one
4152 ///replaces the previous binding.
4153 pub unsafe fn cmd_bind_index_buffer(
4154 &self,
4155 command_buffer: CommandBuffer,
4156 buffer: Buffer,
4157 offset: u64,
4158 index_type: IndexType,
4159 ) {
4160 let fp = self
4161 .commands()
4162 .cmd_bind_index_buffer
4163 .expect("vkCmdBindIndexBuffer not loaded");
4164 unsafe { fp(command_buffer, buffer, offset, index_type) };
4165 }
4166 ///Wraps [`vkCmdBindVertexBuffers`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindVertexBuffers.html).
4167 /**
4168 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
4169 ///
4170 ///# Safety
4171 ///- `commandBuffer` (self) must be valid and not destroyed.
4172 ///- `commandBuffer` must be externally synchronized.
4173 ///
4174 ///# Panics
4175 ///Panics if `vkCmdBindVertexBuffers` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4176 ///
4177 ///# Usage Notes
4178 ///
4179 ///Binds one or more vertex buffers to input binding slots for
4180 ///subsequent draw calls.
4181 ///
4182 ///**`first_binding`**: the binding slot index to start at. Binding
4183 ///slots are defined in the pipeline's vertex input state. Multiple
4184 ///buffers can be bound to consecutive slots in a single call.
4185 ///
4186 ///**Interleaved vs separate**: a single buffer with interleaved
4187 ///attributes (position + normal + UV) uses one binding slot. Separate
4188 ///attribute streams (one buffer per attribute) use multiple slots.
4189 ///Interleaved is generally more cache-friendly.
4190 ///
4191 ///Buffers must have been created with `BUFFER_USAGE_VERTEX_BUFFER`.
4192 ///The `offsets` array specifies the byte offset within each buffer
4193 ///where vertex data starts.
4194 ///
4195 ///For Vulkan 1.3+, `cmd_bind_vertex_buffers2` also lets you set
4196 ///buffer sizes and strides dynamically.
4197 pub unsafe fn cmd_bind_vertex_buffers(
4198 &self,
4199 command_buffer: CommandBuffer,
4200 first_binding: u32,
4201 p_buffers: &[Buffer],
4202 p_offsets: &[u64],
4203 ) {
4204 let fp = self
4205 .commands()
4206 .cmd_bind_vertex_buffers
4207 .expect("vkCmdBindVertexBuffers not loaded");
4208 unsafe {
4209 fp(
4210 command_buffer,
4211 first_binding,
4212 p_buffers.len() as u32,
4213 p_buffers.as_ptr(),
4214 p_offsets.as_ptr(),
4215 )
4216 };
4217 }
4218 ///Wraps [`vkCmdDraw`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDraw.html).
4219 /**
4220 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
4221 ///
4222 ///# Safety
4223 ///- `commandBuffer` (self) must be valid and not destroyed.
4224 ///- `commandBuffer` must be externally synchronized.
4225 ///
4226 ///# Panics
4227 ///Panics if `vkCmdDraw` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4228 ///
4229 ///# Usage Notes
4230 ///
4231 ///Records a non-indexed draw call. Vertices are generated sequentially
4232 ///from `first_vertex` to `first_vertex + vertex_count - 1`.
4233 ///
4234 ///**Parameters**:
4235 ///
4236 ///- `vertex_count`: number of vertices to draw.
4237 ///- `instance_count`: number of instances. Use 1 for non-instanced
4238 /// drawing.
4239 ///- `first_vertex`: offset into the vertex buffer (added to
4240 /// `gl_VertexIndex` in the shader).
4241 ///- `first_instance`: offset into instance data (added to
4242 /// `gl_InstanceIndex`). Requires the `first_instance` feature if
4243 /// non-zero.
4244 ///
4245 ///For indexed geometry (the common case for meshes), use
4246 ///`cmd_draw_indexed` instead. `cmd_draw` is typically used for
4247 ///full-screen quads, procedural geometry, or particle systems where
4248 ///vertices are generated in the shader.
4249 ///
4250 ///# Guide
4251 ///
4252 ///See [Command Buffers](https://hiddentale.github.io/vulkan_rust/concepts/command-buffers.html) in the vulkan_rust guide.
4253 pub unsafe fn cmd_draw(
4254 &self,
4255 command_buffer: CommandBuffer,
4256 vertex_count: u32,
4257 instance_count: u32,
4258 first_vertex: u32,
4259 first_instance: u32,
4260 ) {
4261 let fp = self.commands().cmd_draw.expect("vkCmdDraw not loaded");
4262 unsafe {
4263 fp(
4264 command_buffer,
4265 vertex_count,
4266 instance_count,
4267 first_vertex,
4268 first_instance,
4269 )
4270 };
4271 }
4272 ///Wraps [`vkCmdDrawIndexed`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndexed.html).
4273 /**
4274 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
4275 ///
4276 ///# Safety
4277 ///- `commandBuffer` (self) must be valid and not destroyed.
4278 ///- `commandBuffer` must be externally synchronized.
4279 ///
4280 ///# Panics
4281 ///Panics if `vkCmdDrawIndexed` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4282 ///
4283 ///# Usage Notes
4284 ///
4285 ///Records an indexed draw call, the standard way to draw meshes.
4286 ///Indices are read from the bound index buffer, and each index is used
4287 ///to fetch vertex attributes from the bound vertex buffers.
4288 ///
4289 ///**Parameters**:
4290 ///
4291 ///- `index_count`: number of indices to read.
4292 ///- `instance_count`: number of instances. Use 1 for non-instanced.
4293 ///- `first_index`: offset into the index buffer (in units of indices,
4294 /// not bytes).
4295 ///- `vertex_offset`: added to each index value before fetching the
4296 /// vertex. Useful for packing multiple meshes into a single vertex
4297 /// buffer at different offsets.
4298 ///- `first_instance`: offset into instance data.
4299 ///
4300 ///Indexed drawing reuses vertices via the index buffer, saving memory
4301 ///and bandwidth compared to non-indexed draws for any mesh with shared
4302 ///vertices (which is nearly all of them).
4303 pub unsafe fn cmd_draw_indexed(
4304 &self,
4305 command_buffer: CommandBuffer,
4306 index_count: u32,
4307 instance_count: u32,
4308 first_index: u32,
4309 vertex_offset: i32,
4310 first_instance: u32,
4311 ) {
4312 let fp = self
4313 .commands()
4314 .cmd_draw_indexed
4315 .expect("vkCmdDrawIndexed not loaded");
4316 unsafe {
4317 fp(
4318 command_buffer,
4319 index_count,
4320 instance_count,
4321 first_index,
4322 vertex_offset,
4323 first_instance,
4324 )
4325 };
4326 }
4327 ///Wraps [`vkCmdDrawMultiEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMultiEXT.html).
4328 /**
4329 Provided by **VK_EXT_multi_draw**.*/
4330 ///
4331 ///# Safety
4332 ///- `commandBuffer` (self) must be valid and not destroyed.
4333 ///- `commandBuffer` must be externally synchronized.
4334 ///
4335 ///# Panics
4336 ///Panics if `vkCmdDrawMultiEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4337 ///
4338 ///# Usage Notes
4339 ///
4340 ///Draws multiple non-indexed draw calls from an array of
4341 ///`MultiDrawInfoEXT` (first_vertex, vertex_count pairs). More
4342 ///efficient than issuing separate `cmd_draw` calls because the
4343 ///driver can batch them.
4344 ///
4345 ///Requires `VK_EXT_multi_draw` and the `multiDraw` feature.
4346 pub unsafe fn cmd_draw_multi_ext(
4347 &self,
4348 command_buffer: CommandBuffer,
4349 p_vertex_info: &[MultiDrawInfoEXT],
4350 instance_count: u32,
4351 first_instance: u32,
4352 stride: u32,
4353 ) {
4354 let fp = self
4355 .commands()
4356 .cmd_draw_multi_ext
4357 .expect("vkCmdDrawMultiEXT not loaded");
4358 unsafe {
4359 fp(
4360 command_buffer,
4361 p_vertex_info.len() as u32,
4362 p_vertex_info.as_ptr(),
4363 instance_count,
4364 first_instance,
4365 stride,
4366 )
4367 };
4368 }
4369 ///Wraps [`vkCmdDrawMultiIndexedEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMultiIndexedEXT.html).
4370 /**
4371 Provided by **VK_EXT_multi_draw**.*/
4372 ///
4373 ///# Safety
4374 ///- `commandBuffer` (self) must be valid and not destroyed.
4375 ///- `commandBuffer` must be externally synchronized.
4376 ///
4377 ///# Panics
4378 ///Panics if `vkCmdDrawMultiIndexedEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4379 ///
4380 ///# Usage Notes
4381 ///
4382 ///Draws multiple indexed draw calls from an array of
4383 ///`MultiDrawIndexedInfoEXT` (first_index, index_count,
4384 ///vertex_offset triples). More efficient than separate
4385 ///`cmd_draw_indexed` calls.
4386 ///
4387 ///An optional `p_vertex_offset` overrides all per-draw vertex
4388 ///offsets with a single value.
4389 ///
4390 ///Requires `VK_EXT_multi_draw` and the `multiDraw` feature.
4391 pub unsafe fn cmd_draw_multi_indexed_ext(
4392 &self,
4393 command_buffer: CommandBuffer,
4394 p_index_info: &[MultiDrawIndexedInfoEXT],
4395 instance_count: u32,
4396 first_instance: u32,
4397 stride: u32,
4398 p_vertex_offset: *const i32,
4399 ) {
4400 let fp = self
4401 .commands()
4402 .cmd_draw_multi_indexed_ext
4403 .expect("vkCmdDrawMultiIndexedEXT not loaded");
4404 unsafe {
4405 fp(
4406 command_buffer,
4407 p_index_info.len() as u32,
4408 p_index_info.as_ptr(),
4409 instance_count,
4410 first_instance,
4411 stride,
4412 p_vertex_offset,
4413 )
4414 };
4415 }
4416 ///Wraps [`vkCmdDrawIndirect`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndirect.html).
4417 /**
4418 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
4419 ///
4420 ///# Safety
4421 ///- `commandBuffer` (self) must be valid and not destroyed.
4422 ///- `commandBuffer` must be externally synchronized.
4423 ///
4424 ///# Panics
4425 ///Panics if `vkCmdDrawIndirect` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4426 ///
4427 ///# Usage Notes
4428 ///
4429 ///Records one or more non-indexed draw calls whose parameters are read
4430 ///from a GPU buffer at execution time rather than baked into the
4431 ///command buffer.
4432 ///
4433 ///Each `DrawIndirectCommand` in the buffer contains `vertex_count`,
4434 ///`instance_count`, `first_vertex`, and `first_instance`, the same
4435 ///parameters as `cmd_draw`.
4436 ///
4437 ///**Use cases**:
4438 ///
4439 ///- **GPU-driven rendering**: a compute shader fills the indirect
4440 /// buffer with draw parameters (e.g. after culling), and the GPU
4441 /// draws without CPU round-trips.
4442 ///- **Conditional draw counts**: pair with
4443 /// `cmd_draw_indirect_count` (Vulkan 1.2) to have the GPU also
4444 /// determine how many draws to execute.
4445 ///
4446 ///The buffer must have been created with
4447 ///`BUFFER_USAGE_INDIRECT_BUFFER`. The `stride` between commands must
4448 ///be at least `sizeof(DrawIndirectCommand)` (16 bytes) and a
4449 ///multiple of 4.
4450 pub unsafe fn cmd_draw_indirect(
4451 &self,
4452 command_buffer: CommandBuffer,
4453 buffer: Buffer,
4454 offset: u64,
4455 draw_count: u32,
4456 stride: u32,
4457 ) {
4458 let fp = self
4459 .commands()
4460 .cmd_draw_indirect
4461 .expect("vkCmdDrawIndirect not loaded");
4462 unsafe { fp(command_buffer, buffer, offset, draw_count, stride) };
4463 }
4464 ///Wraps [`vkCmdDrawIndexedIndirect`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndexedIndirect.html).
4465 /**
4466 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
4467 ///
4468 ///# Safety
4469 ///- `commandBuffer` (self) must be valid and not destroyed.
4470 ///- `commandBuffer` must be externally synchronized.
4471 ///
4472 ///# Panics
4473 ///Panics if `vkCmdDrawIndexedIndirect` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4474 ///
4475 ///# Usage Notes
4476 ///
4477 ///Records one or more indexed draw calls whose parameters are read
4478 ///from a GPU buffer. Each `DrawIndexedIndirectCommand` contains
4479 ///`index_count`, `instance_count`, `first_index`, `vertex_offset`,
4480 ///and `first_instance`.
4481 ///
4482 ///This is the indexed counterpart to `cmd_draw_indirect` and the most
4483 ///common indirect draw call for GPU-driven rendering pipelines. A
4484 ///compute shader performs culling and writes surviving draw commands
4485 ///into the buffer; the GPU then draws them without CPU involvement.
4486 ///
4487 ///The buffer must have `BUFFER_USAGE_INDIRECT_BUFFER`. The `stride`
4488 ///must be at least `sizeof(DrawIndexedIndirectCommand)` (20 bytes)
4489 ///and a multiple of 4.
4490 ///
4491 ///For dynamic draw counts, use `cmd_draw_indexed_indirect_count`
4492 ///(Vulkan 1.2).
4493 pub unsafe fn cmd_draw_indexed_indirect(
4494 &self,
4495 command_buffer: CommandBuffer,
4496 buffer: Buffer,
4497 offset: u64,
4498 draw_count: u32,
4499 stride: u32,
4500 ) {
4501 let fp = self
4502 .commands()
4503 .cmd_draw_indexed_indirect
4504 .expect("vkCmdDrawIndexedIndirect not loaded");
4505 unsafe { fp(command_buffer, buffer, offset, draw_count, stride) };
4506 }
4507 ///Wraps [`vkCmdDispatch`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDispatch.html).
4508 /**
4509 Provided by **VK_COMPUTE_VERSION_1_0**.*/
4510 ///
4511 ///# Safety
4512 ///- `commandBuffer` (self) must be valid and not destroyed.
4513 ///- `commandBuffer` must be externally synchronized.
4514 ///
4515 ///# Panics
4516 ///Panics if `vkCmdDispatch` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4517 ///
4518 ///# Usage Notes
4519 ///
4520 ///Launches a compute shader with the given number of workgroups in
4521 ///X, Y, and Z dimensions. The total number of invocations is
4522 ///`group_count * local_size` (defined in the shader's `local_size_x`,
4523 ///`local_size_y`, `local_size_z`).
4524 ///
4525 ///A compute pipeline must be bound before calling this. Compute
4526 ///dispatches can be recorded outside a render pass.
4527 ///
4528 ///**Sizing**: to process an image of `width × height` pixels with a
4529 ///local size of 16×16, dispatch
4530 ///`ceil(width / 16) × ceil(height / 16) × 1` workgroups.
4531 ///
4532 ///**Limits**: each dimension is capped by
4533 ///`max_compute_work_group_count` (at least 65535 per axis). The total
4534 ///invocations per workgroup are capped by
4535 ///`max_compute_work_group_invocations` (at least 128).
4536 ///
4537 ///For GPU-driven dispatch counts, use `cmd_dispatch_indirect`.
4538 pub unsafe fn cmd_dispatch(
4539 &self,
4540 command_buffer: CommandBuffer,
4541 group_count_x: u32,
4542 group_count_y: u32,
4543 group_count_z: u32,
4544 ) {
4545 let fp = self
4546 .commands()
4547 .cmd_dispatch
4548 .expect("vkCmdDispatch not loaded");
4549 unsafe { fp(command_buffer, group_count_x, group_count_y, group_count_z) };
4550 }
4551 ///Wraps [`vkCmdDispatchIndirect`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDispatchIndirect.html).
4552 /**
4553 Provided by **VK_COMPUTE_VERSION_1_0**.*/
4554 ///
4555 ///# Safety
4556 ///- `commandBuffer` (self) must be valid and not destroyed.
4557 ///- `commandBuffer` must be externally synchronized.
4558 ///
4559 ///# Panics
4560 ///Panics if `vkCmdDispatchIndirect` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4561 ///
4562 ///# Usage Notes
4563 ///
4564 ///Launches a compute shader with workgroup counts read from a GPU
4565 ///buffer. The buffer contains a `DispatchIndirectCommand` with
4566 ///`group_count_x`, `group_count_y`, `group_count_z`.
4567 ///
4568 ///Use this when a prior compute pass determines how much work to do,
4569 ///for example, a culling pass writes the surviving workgroup count
4570 ///for a subsequent processing pass.
4571 ///
4572 ///The buffer must have `BUFFER_USAGE_INDIRECT_BUFFER`. The offset must
4573 ///be a multiple of 4.
4574 ///
4575 ///The same workgroup count limits apply as for `cmd_dispatch`.
4576 pub unsafe fn cmd_dispatch_indirect(
4577 &self,
4578 command_buffer: CommandBuffer,
4579 buffer: Buffer,
4580 offset: u64,
4581 ) {
4582 let fp = self
4583 .commands()
4584 .cmd_dispatch_indirect
4585 .expect("vkCmdDispatchIndirect not loaded");
4586 unsafe { fp(command_buffer, buffer, offset) };
4587 }
4588 ///Wraps [`vkCmdSubpassShadingHUAWEI`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSubpassShadingHUAWEI.html).
4589 /**
4590 Provided by **VK_HUAWEI_subpass_shading**.*/
4591 ///
4592 ///# Safety
4593 ///- `commandBuffer` (self) must be valid and not destroyed.
4594 ///- `commandBuffer` must be externally synchronized.
4595 ///
4596 ///# Panics
4597 ///Panics if `vkCmdSubpassShadingHUAWEI` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4598 ///
4599 ///# Usage Notes
4600 ///
4601 ///Dispatches subpass shading work within the current subpass.
4602 ///Subpass shading runs compute-like shaders that have access to
4603 ///input attachments at the fragment's location, combining the
4604 ///efficiency of compute with the data locality of subpasses.
4605 ///
4606 ///Requires `VK_HUAWEI_subpass_shading`.
4607 pub unsafe fn cmd_subpass_shading_huawei(&self, command_buffer: CommandBuffer) {
4608 let fp = self
4609 .commands()
4610 .cmd_subpass_shading_huawei
4611 .expect("vkCmdSubpassShadingHUAWEI not loaded");
4612 unsafe { fp(command_buffer) };
4613 }
4614 ///Wraps [`vkCmdDrawClusterHUAWEI`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawClusterHUAWEI.html).
4615 /**
4616 Provided by **VK_HUAWEI_cluster_culling_shader**.*/
4617 ///
4618 ///# Safety
4619 ///- `commandBuffer` (self) must be valid and not destroyed.
4620 ///- `commandBuffer` must be externally synchronized.
4621 ///
4622 ///# Panics
4623 ///Panics if `vkCmdDrawClusterHUAWEI` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4624 ///
4625 ///# Usage Notes
4626 ///
4627 ///Dispatches cluster culling shader workgroups using the Huawei
4628 ///cluster culling shader pipeline. The group counts specify the
4629 ///3D dispatch dimensions, similar to `cmd_dispatch`.
4630 ///
4631 ///Requires `VK_HUAWEI_cluster_culling_shader`.
4632 pub unsafe fn cmd_draw_cluster_huawei(
4633 &self,
4634 command_buffer: CommandBuffer,
4635 group_count_x: u32,
4636 group_count_y: u32,
4637 group_count_z: u32,
4638 ) {
4639 let fp = self
4640 .commands()
4641 .cmd_draw_cluster_huawei
4642 .expect("vkCmdDrawClusterHUAWEI not loaded");
4643 unsafe { fp(command_buffer, group_count_x, group_count_y, group_count_z) };
4644 }
4645 ///Wraps [`vkCmdDrawClusterIndirectHUAWEI`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawClusterIndirectHUAWEI.html).
4646 /**
4647 Provided by **VK_HUAWEI_cluster_culling_shader**.*/
4648 ///
4649 ///# Safety
4650 ///- `commandBuffer` (self) must be valid and not destroyed.
4651 ///- `commandBuffer` must be externally synchronized.
4652 ///
4653 ///# Panics
4654 ///Panics if `vkCmdDrawClusterIndirectHUAWEI` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4655 ///
4656 ///# Usage Notes
4657 ///
4658 ///Indirect variant of `cmd_draw_cluster_huawei`. Reads the cluster
4659 ///dispatch parameters from a buffer at the given offset, allowing
4660 ///GPU-driven cluster culling without CPU readback.
4661 ///
4662 ///Requires `VK_HUAWEI_cluster_culling_shader`.
4663 pub unsafe fn cmd_draw_cluster_indirect_huawei(
4664 &self,
4665 command_buffer: CommandBuffer,
4666 buffer: Buffer,
4667 offset: u64,
4668 ) {
4669 let fp = self
4670 .commands()
4671 .cmd_draw_cluster_indirect_huawei
4672 .expect("vkCmdDrawClusterIndirectHUAWEI not loaded");
4673 unsafe { fp(command_buffer, buffer, offset) };
4674 }
4675 ///Wraps [`vkCmdUpdatePipelineIndirectBufferNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdUpdatePipelineIndirectBufferNV.html).
4676 /**
4677 Provided by **VK_NV_device_generated_commands_compute**.*/
4678 ///
4679 ///# Safety
4680 ///- `commandBuffer` (self) must be valid and not destroyed.
4681 ///- `commandBuffer` must be externally synchronized.
4682 ///
4683 ///# Panics
4684 ///Panics if `vkCmdUpdatePipelineIndirectBufferNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4685 ///
4686 ///# Usage Notes
4687 ///
4688 ///Updates the indirect dispatch parameters for a compute pipeline
4689 ///in a GPU buffer. Used with device-generated compute commands so
4690 ///the GPU can dispatch compute pipelines indirectly.
4691 ///
4692 ///Requires `VK_NV_device_generated_commands_compute`.
4693 pub unsafe fn cmd_update_pipeline_indirect_buffer_nv(
4694 &self,
4695 command_buffer: CommandBuffer,
4696 pipeline_bind_point: PipelineBindPoint,
4697 pipeline: Pipeline,
4698 ) {
4699 let fp = self
4700 .commands()
4701 .cmd_update_pipeline_indirect_buffer_nv
4702 .expect("vkCmdUpdatePipelineIndirectBufferNV not loaded");
4703 unsafe { fp(command_buffer, pipeline_bind_point, pipeline) };
4704 }
4705 ///Wraps [`vkCmdCopyBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyBuffer.html).
4706 /**
4707 Provided by **VK_BASE_VERSION_1_0**.*/
4708 ///
4709 ///# Safety
4710 ///- `commandBuffer` (self) must be valid and not destroyed.
4711 ///- `commandBuffer` must be externally synchronized.
4712 ///
4713 ///# Panics
4714 ///Panics if `vkCmdCopyBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4715 ///
4716 ///# Usage Notes
4717 ///
4718 ///Copies data between two buffers. Multiple regions can be copied in
4719 ///a single call. Must be recorded outside a render pass.
4720 ///
4721 ///Common patterns:
4722 ///
4723 ///- **Staging upload**: copy from a host-visible staging buffer to a
4724 /// device-local buffer. This is the standard way to get vertex,
4725 /// index, and uniform data onto the GPU.
4726 ///- **Buffer-to-buffer transfers**: defragment or reorganise GPU data.
4727 ///
4728 ///Source and destination regions must not overlap within the same
4729 ///buffer. Use a temporary staging buffer if you need to shift data
4730 ///within a single buffer.
4731 ///
4732 ///For Vulkan 1.3+, prefer `cmd_copy_buffer2` which uses an extensible
4733 ///`CopyBufferInfo2` struct.
4734 pub unsafe fn cmd_copy_buffer(
4735 &self,
4736 command_buffer: CommandBuffer,
4737 src_buffer: Buffer,
4738 dst_buffer: Buffer,
4739 p_regions: &[BufferCopy],
4740 ) {
4741 let fp = self
4742 .commands()
4743 .cmd_copy_buffer
4744 .expect("vkCmdCopyBuffer not loaded");
4745 unsafe {
4746 fp(
4747 command_buffer,
4748 src_buffer,
4749 dst_buffer,
4750 p_regions.len() as u32,
4751 p_regions.as_ptr(),
4752 )
4753 };
4754 }
4755 ///Wraps [`vkCmdCopyImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyImage.html).
4756 /**
4757 Provided by **VK_BASE_VERSION_1_0**.*/
4758 ///
4759 ///# Safety
4760 ///- `commandBuffer` (self) must be valid and not destroyed.
4761 ///- `commandBuffer` must be externally synchronized.
4762 ///
4763 ///# Panics
4764 ///Panics if `vkCmdCopyImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4765 ///
4766 ///# Usage Notes
4767 ///
4768 ///Copies texel data between two images. Both images must have been
4769 ///created with `TRANSFER_SRC` and `TRANSFER_DST` usage respectively,
4770 ///and must be in compatible layouts (`TRANSFER_SRC_OPTIMAL` /
4771 ///`TRANSFER_DST_OPTIMAL` or `GENERAL`).
4772 ///
4773 ///The source and destination formats must be identical, or both must
4774 ///be in the same size-compatibility class. For format conversion, use
4775 ///`cmd_blit_image` instead.
4776 ///
4777 ///Copy operates on raw texel blocks, no filtering or scaling. The
4778 ///extent must be aligned to the texel block size for compressed
4779 ///formats.
4780 ///
4781 ///Must be recorded outside a render pass. For Vulkan 1.3+, prefer
4782 ///`cmd_copy_image2`.
4783 pub unsafe fn cmd_copy_image(
4784 &self,
4785 command_buffer: CommandBuffer,
4786 src_image: Image,
4787 src_image_layout: ImageLayout,
4788 dst_image: Image,
4789 dst_image_layout: ImageLayout,
4790 p_regions: &[ImageCopy],
4791 ) {
4792 let fp = self
4793 .commands()
4794 .cmd_copy_image
4795 .expect("vkCmdCopyImage not loaded");
4796 unsafe {
4797 fp(
4798 command_buffer,
4799 src_image,
4800 src_image_layout,
4801 dst_image,
4802 dst_image_layout,
4803 p_regions.len() as u32,
4804 p_regions.as_ptr(),
4805 )
4806 };
4807 }
4808 ///Wraps [`vkCmdBlitImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBlitImage.html).
4809 /**
4810 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
4811 ///
4812 ///# Safety
4813 ///- `commandBuffer` (self) must be valid and not destroyed.
4814 ///- `commandBuffer` must be externally synchronized.
4815 ///
4816 ///# Panics
4817 ///Panics if `vkCmdBlitImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4818 ///
4819 ///# Usage Notes
4820 ///
4821 ///Copies a region between two images with optional scaling and format
4822 ///conversion. Unlike `cmd_copy_image`, blit supports different source
4823 ///and destination extents (scaling) and applies a filter.
4824 ///
4825 ///**Filters**:
4826 ///
4827 ///- `FILTER_NEAREST`: no interpolation. Fast, but produces blocky
4828 /// results when scaling.
4829 ///- `FILTER_LINEAR`: bilinear interpolation. Smooth scaling. Requires
4830 /// the format to support `FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR`.
4831 ///
4832 ///Common uses:
4833 ///
4834 ///- **Mipmap generation**: blit each mip level from the previous one,
4835 /// halving dimensions each step.
4836 ///- **Resolve or downscale**: blit a high-resolution offscreen image
4837 /// to a smaller swapchain image.
4838 ///
4839 ///Both images must be in appropriate transfer layouts. Must be recorded
4840 ///outside a render pass. For Vulkan 1.3+, prefer `cmd_blit_image2`.
4841 ///
4842 ///Not supported for depth/stencil or compressed formats. Use
4843 ///`cmd_copy_image` or `cmd_resolve_image` for those.
4844 pub unsafe fn cmd_blit_image(
4845 &self,
4846 command_buffer: CommandBuffer,
4847 src_image: Image,
4848 src_image_layout: ImageLayout,
4849 dst_image: Image,
4850 dst_image_layout: ImageLayout,
4851 p_regions: &[ImageBlit],
4852 filter: Filter,
4853 ) {
4854 let fp = self
4855 .commands()
4856 .cmd_blit_image
4857 .expect("vkCmdBlitImage not loaded");
4858 unsafe {
4859 fp(
4860 command_buffer,
4861 src_image,
4862 src_image_layout,
4863 dst_image,
4864 dst_image_layout,
4865 p_regions.len() as u32,
4866 p_regions.as_ptr(),
4867 filter,
4868 )
4869 };
4870 }
4871 ///Wraps [`vkCmdCopyBufferToImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyBufferToImage.html).
4872 /**
4873 Provided by **VK_BASE_VERSION_1_0**.*/
4874 ///
4875 ///# Safety
4876 ///- `commandBuffer` (self) must be valid and not destroyed.
4877 ///- `commandBuffer` must be externally synchronized.
4878 ///
4879 ///# Panics
4880 ///Panics if `vkCmdCopyBufferToImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4881 ///
4882 ///# Usage Notes
4883 ///
4884 ///Copies data from a buffer to an image, the primary way to upload
4885 ///texture data from CPU to GPU.
4886 ///
4887 ///**Typical upload workflow**:
4888 ///
4889 ///1. Write pixel data into a host-visible staging buffer.
4890 ///2. Transition the target image to `TRANSFER_DST_OPTIMAL`.
4891 ///3. `cmd_copy_buffer_to_image` with the appropriate
4892 /// `BufferImageCopy` regions.
4893 ///4. Transition the image to `SHADER_READ_ONLY_OPTIMAL` for sampling.
4894 ///
4895 ///**Buffer layout**: `buffer_row_length` and `buffer_image_height`
4896 ///control the row and slice pitch of the source data in the buffer.
4897 ///Set both to zero to use a tightly packed layout matching the image
4898 ///extent.
4899 ///
4900 ///Multiple regions can be copied in a single call (e.g. all mip
4901 ///levels of a texture). Must be recorded outside a render pass.
4902 ///
4903 ///For Vulkan 1.3+, prefer `cmd_copy_buffer_to_image2`.
4904 pub unsafe fn cmd_copy_buffer_to_image(
4905 &self,
4906 command_buffer: CommandBuffer,
4907 src_buffer: Buffer,
4908 dst_image: Image,
4909 dst_image_layout: ImageLayout,
4910 p_regions: &[BufferImageCopy],
4911 ) {
4912 let fp = self
4913 .commands()
4914 .cmd_copy_buffer_to_image
4915 .expect("vkCmdCopyBufferToImage not loaded");
4916 unsafe {
4917 fp(
4918 command_buffer,
4919 src_buffer,
4920 dst_image,
4921 dst_image_layout,
4922 p_regions.len() as u32,
4923 p_regions.as_ptr(),
4924 )
4925 };
4926 }
4927 ///Wraps [`vkCmdCopyImageToBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyImageToBuffer.html).
4928 /**
4929 Provided by **VK_BASE_VERSION_1_0**.*/
4930 ///
4931 ///# Safety
4932 ///- `commandBuffer` (self) must be valid and not destroyed.
4933 ///- `commandBuffer` must be externally synchronized.
4934 ///
4935 ///# Panics
4936 ///Panics if `vkCmdCopyImageToBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4937 ///
4938 ///# Usage Notes
4939 ///
4940 ///Copies data from an image to a buffer, used for GPU readback of
4941 ///rendered images, screenshots, or compute shader output.
4942 ///
4943 ///**Typical readback workflow**:
4944 ///
4945 ///1. Transition the source image to `TRANSFER_SRC_OPTIMAL`.
4946 ///2. `cmd_copy_image_to_buffer` into a host-visible buffer.
4947 ///3. Submit and wait for the fence.
4948 ///4. Map the buffer and read the pixel data on the CPU.
4949 ///
4950 ///The `buffer_row_length` and `buffer_image_height` fields in
4951 ///`BufferImageCopy` control the destination layout. Set both to zero
4952 ///for tightly packed output.
4953 ///
4954 ///Be aware that readback is not instantaneous, it requires a full
4955 ///GPU round-trip. Avoid reading back in the render loop unless you
4956 ///are double- or triple-buffering the readback to hide latency.
4957 ///
4958 ///Must be recorded outside a render pass. For Vulkan 1.3+, prefer
4959 ///`cmd_copy_image_to_buffer2`.
4960 pub unsafe fn cmd_copy_image_to_buffer(
4961 &self,
4962 command_buffer: CommandBuffer,
4963 src_image: Image,
4964 src_image_layout: ImageLayout,
4965 dst_buffer: Buffer,
4966 p_regions: &[BufferImageCopy],
4967 ) {
4968 let fp = self
4969 .commands()
4970 .cmd_copy_image_to_buffer
4971 .expect("vkCmdCopyImageToBuffer not loaded");
4972 unsafe {
4973 fp(
4974 command_buffer,
4975 src_image,
4976 src_image_layout,
4977 dst_buffer,
4978 p_regions.len() as u32,
4979 p_regions.as_ptr(),
4980 )
4981 };
4982 }
4983 ///Wraps [`vkCmdCopyMemoryIndirectNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMemoryIndirectNV.html).
4984 /**
4985 Provided by **VK_NV_copy_memory_indirect**.*/
4986 ///
4987 ///# Safety
4988 ///- `commandBuffer` (self) must be valid and not destroyed.
4989 ///- `commandBuffer` must be externally synchronized.
4990 ///
4991 ///# Panics
4992 ///Panics if `vkCmdCopyMemoryIndirectNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
4993 ///
4994 ///# Usage Notes
4995 ///
4996 ///Copies memory regions using indirect parameters stored in a GPU
4997 ///buffer at the given device address. Enables GPU-driven memory
4998 ///copy workflows where the copy descriptors are generated on the
4999 ///device.
5000 ///
5001 ///Requires `VK_NV_copy_memory_indirect`.
5002 pub unsafe fn cmd_copy_memory_indirect_nv(
5003 &self,
5004 command_buffer: CommandBuffer,
5005 copy_buffer_address: u64,
5006 copy_count: u32,
5007 stride: u32,
5008 ) {
5009 let fp = self
5010 .commands()
5011 .cmd_copy_memory_indirect_nv
5012 .expect("vkCmdCopyMemoryIndirectNV not loaded");
5013 unsafe { fp(command_buffer, copy_buffer_address, copy_count, stride) };
5014 }
5015 ///Wraps [`vkCmdCopyMemoryIndirectKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMemoryIndirectKHR.html).
5016 /**
5017 Provided by **VK_KHR_copy_memory_indirect**.*/
5018 ///
5019 ///# Safety
5020 ///- `commandBuffer` (self) must be valid and not destroyed.
5021 ///- `commandBuffer` must be externally synchronized.
5022 ///
5023 ///# Panics
5024 ///Panics if `vkCmdCopyMemoryIndirectKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5025 ///
5026 ///# Usage Notes
5027 ///
5028 ///Copies memory regions using parameters read from a device-side
5029 ///info structure. Enables GPU-driven memory copies without CPU
5030 ///involvement in specifying source/destination addresses.
5031 ///
5032 ///Requires `VK_KHR_copy_memory_indirect`.
5033 pub unsafe fn cmd_copy_memory_indirect_khr(
5034 &self,
5035 command_buffer: CommandBuffer,
5036 p_copy_memory_indirect_info: &CopyMemoryIndirectInfoKHR,
5037 ) {
5038 let fp = self
5039 .commands()
5040 .cmd_copy_memory_indirect_khr
5041 .expect("vkCmdCopyMemoryIndirectKHR not loaded");
5042 unsafe { fp(command_buffer, p_copy_memory_indirect_info) };
5043 }
5044 ///Wraps [`vkCmdCopyMemoryToImageIndirectNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMemoryToImageIndirectNV.html).
5045 /**
5046 Provided by **VK_NV_copy_memory_indirect**.*/
5047 ///
5048 ///# Safety
5049 ///- `commandBuffer` (self) must be valid and not destroyed.
5050 ///- `commandBuffer` must be externally synchronized.
5051 ///
5052 ///# Panics
5053 ///Panics if `vkCmdCopyMemoryToImageIndirectNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5054 ///
5055 ///# Usage Notes
5056 ///
5057 ///Copies data from memory to an image using indirect parameters
5058 ///stored at a device address. Enables GPU-driven texture uploads
5059 ///where the copy regions are generated on the device.
5060 ///
5061 ///Requires `VK_NV_copy_memory_indirect`.
5062 pub unsafe fn cmd_copy_memory_to_image_indirect_nv(
5063 &self,
5064 command_buffer: CommandBuffer,
5065 copy_buffer_address: u64,
5066 stride: u32,
5067 dst_image: Image,
5068 dst_image_layout: ImageLayout,
5069 p_image_subresources: &[ImageSubresourceLayers],
5070 ) {
5071 let fp = self
5072 .commands()
5073 .cmd_copy_memory_to_image_indirect_nv
5074 .expect("vkCmdCopyMemoryToImageIndirectNV not loaded");
5075 unsafe {
5076 fp(
5077 command_buffer,
5078 copy_buffer_address,
5079 p_image_subresources.len() as u32,
5080 stride,
5081 dst_image,
5082 dst_image_layout,
5083 p_image_subresources.as_ptr(),
5084 )
5085 };
5086 }
5087 ///Wraps [`vkCmdCopyMemoryToImageIndirectKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMemoryToImageIndirectKHR.html).
5088 /**
5089 Provided by **VK_KHR_copy_memory_indirect**.*/
5090 ///
5091 ///# Safety
5092 ///- `commandBuffer` (self) must be valid and not destroyed.
5093 ///- `commandBuffer` must be externally synchronized.
5094 ///
5095 ///# Panics
5096 ///Panics if `vkCmdCopyMemoryToImageIndirectKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5097 ///
5098 ///# Usage Notes
5099 ///
5100 ///Copies data from memory to an image using parameters read from a
5101 ///device-side info structure. Enables GPU-driven memory-to-image
5102 ///transfers without CPU readback of copy parameters.
5103 ///
5104 ///Requires `VK_KHR_copy_memory_indirect`.
5105 pub unsafe fn cmd_copy_memory_to_image_indirect_khr(
5106 &self,
5107 command_buffer: CommandBuffer,
5108 p_copy_memory_to_image_indirect_info: &CopyMemoryToImageIndirectInfoKHR,
5109 ) {
5110 let fp = self
5111 .commands()
5112 .cmd_copy_memory_to_image_indirect_khr
5113 .expect("vkCmdCopyMemoryToImageIndirectKHR not loaded");
5114 unsafe { fp(command_buffer, p_copy_memory_to_image_indirect_info) };
5115 }
5116 ///Wraps [`vkCmdUpdateBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdUpdateBuffer.html).
5117 /**
5118 Provided by **VK_BASE_VERSION_1_0**.*/
5119 ///
5120 ///# Safety
5121 ///- `commandBuffer` (self) must be valid and not destroyed.
5122 ///- `commandBuffer` must be externally synchronized.
5123 ///
5124 ///# Panics
5125 ///Panics if `vkCmdUpdateBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5126 ///
5127 ///# Usage Notes
5128 ///
5129 ///Writes a small amount of data inline into a buffer from the command
5130 ///stream. The data is embedded directly in the command buffer, no
5131 ///staging buffer needed.
5132 ///
5133 ///**Size limit**: the data size must be ≤ 65536 bytes and a multiple
5134 ///of 4. For larger uploads, use `cmd_copy_buffer` with a staging
5135 ///buffer instead.
5136 ///
5137 ///This is convenient for small per-frame updates (e.g. a uniform
5138 ///buffer with a single matrix) but should not be used for bulk data,
5139 ///it inflates command buffer size and the data is uploaded through the
5140 ///command stream, which is slower than a DMA transfer.
5141 ///
5142 ///Must be recorded outside a render pass. The destination buffer must
5143 ///have `BUFFER_USAGE_TRANSFER_DST`.
5144 pub unsafe fn cmd_update_buffer(
5145 &self,
5146 command_buffer: CommandBuffer,
5147 dst_buffer: Buffer,
5148 dst_offset: u64,
5149 data_size: u64,
5150 p_data: *const core::ffi::c_void,
5151 ) {
5152 let fp = self
5153 .commands()
5154 .cmd_update_buffer
5155 .expect("vkCmdUpdateBuffer not loaded");
5156 unsafe { fp(command_buffer, dst_buffer, dst_offset, data_size, p_data) };
5157 }
5158 ///Wraps [`vkCmdFillBuffer`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdFillBuffer.html).
5159 /**
5160 Provided by **VK_BASE_VERSION_1_0**.*/
5161 ///
5162 ///# Safety
5163 ///- `commandBuffer` (self) must be valid and not destroyed.
5164 ///- `commandBuffer` must be externally synchronized.
5165 ///
5166 ///# Panics
5167 ///Panics if `vkCmdFillBuffer` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5168 ///
5169 ///# Usage Notes
5170 ///
5171 ///Fills a region of a buffer with a repeating 4-byte value. Useful
5172 ///for clearing GPU buffers to zero (or any uniform value) without a
5173 ///staging upload.
5174 ///
5175 ///Common uses:
5176 ///
5177 ///- **Zero-initialise** an indirect draw count buffer before a compute
5178 /// culling pass.
5179 ///- **Clear** a storage buffer used as a histogram or counter.
5180 ///
5181 ///The `offset` and `size` must be multiples of 4. Use `VK_WHOLE_SIZE`
5182 ///to fill from the offset to the end of the buffer.
5183 ///
5184 ///Must be recorded outside a render pass. The buffer must have
5185 ///`BUFFER_USAGE_TRANSFER_DST`.
5186 pub unsafe fn cmd_fill_buffer(
5187 &self,
5188 command_buffer: CommandBuffer,
5189 dst_buffer: Buffer,
5190 dst_offset: u64,
5191 size: u64,
5192 data: u32,
5193 ) {
5194 let fp = self
5195 .commands()
5196 .cmd_fill_buffer
5197 .expect("vkCmdFillBuffer not loaded");
5198 unsafe { fp(command_buffer, dst_buffer, dst_offset, size, data) };
5199 }
5200 ///Wraps [`vkCmdClearColorImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdClearColorImage.html).
5201 /**
5202 Provided by **VK_COMPUTE_VERSION_1_0**.*/
5203 ///
5204 ///# Safety
5205 ///- `commandBuffer` (self) must be valid and not destroyed.
5206 ///- `commandBuffer` must be externally synchronized.
5207 ///
5208 ///# Panics
5209 ///Panics if `vkCmdClearColorImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5210 ///
5211 ///# Usage Notes
5212 ///
5213 ///Clears one or more regions of a colour image to a specified value.
5214 ///The image must be in `TRANSFER_DST_OPTIMAL` or `GENERAL` layout.
5215 ///
5216 ///This is an explicit clear outside a render pass. For clears inside
5217 ///a render pass, use `load_op = CLEAR` in the attachment description
5218 ///or `cmd_clear_attachments`, both are typically faster because the
5219 ///driver can integrate them with tile-based rendering.
5220 ///
5221 ///The clear value is a `ClearColorValue` union: either four `float32`,
5222 ///`int32`, or `uint32` values depending on the image format.
5223 ///
5224 ///Must be recorded outside a render pass.
5225 pub unsafe fn cmd_clear_color_image(
5226 &self,
5227 command_buffer: CommandBuffer,
5228 image: Image,
5229 image_layout: ImageLayout,
5230 p_color: &ClearColorValue,
5231 p_ranges: &[ImageSubresourceRange],
5232 ) {
5233 let fp = self
5234 .commands()
5235 .cmd_clear_color_image
5236 .expect("vkCmdClearColorImage not loaded");
5237 unsafe {
5238 fp(
5239 command_buffer,
5240 image,
5241 image_layout,
5242 p_color,
5243 p_ranges.len() as u32,
5244 p_ranges.as_ptr(),
5245 )
5246 };
5247 }
5248 ///Wraps [`vkCmdClearDepthStencilImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdClearDepthStencilImage.html).
5249 /**
5250 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
5251 ///
5252 ///# Safety
5253 ///- `commandBuffer` (self) must be valid and not destroyed.
5254 ///- `commandBuffer` must be externally synchronized.
5255 ///
5256 ///# Panics
5257 ///Panics if `vkCmdClearDepthStencilImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5258 ///
5259 ///# Usage Notes
5260 ///
5261 ///Clears one or more regions of a depth/stencil image to a specified
5262 ///depth and stencil value. The image must be in
5263 ///`TRANSFER_DST_OPTIMAL` or `GENERAL` layout.
5264 ///
5265 ///For most rendering, clearing via `load_op = CLEAR` on the
5266 ///depth/stencil attachment is preferred, it lets tile-based GPUs
5267 ///avoid a separate clear pass. Use this command only when you need to
5268 ///clear a depth/stencil image outside a render pass.
5269 ///
5270 ///The `image_subresource_range` must reference the appropriate aspect
5271 ///flags (`DEPTH`, `STENCIL`, or both).
5272 ///
5273 ///Must be recorded outside a render pass.
5274 pub unsafe fn cmd_clear_depth_stencil_image(
5275 &self,
5276 command_buffer: CommandBuffer,
5277 image: Image,
5278 image_layout: ImageLayout,
5279 p_depth_stencil: &ClearDepthStencilValue,
5280 p_ranges: &[ImageSubresourceRange],
5281 ) {
5282 let fp = self
5283 .commands()
5284 .cmd_clear_depth_stencil_image
5285 .expect("vkCmdClearDepthStencilImage not loaded");
5286 unsafe {
5287 fp(
5288 command_buffer,
5289 image,
5290 image_layout,
5291 p_depth_stencil,
5292 p_ranges.len() as u32,
5293 p_ranges.as_ptr(),
5294 )
5295 };
5296 }
5297 ///Wraps [`vkCmdClearAttachments`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdClearAttachments.html).
5298 /**
5299 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
5300 ///
5301 ///# Safety
5302 ///- `commandBuffer` (self) must be valid and not destroyed.
5303 ///- `commandBuffer` must be externally synchronized.
5304 ///
5305 ///# Panics
5306 ///Panics if `vkCmdClearAttachments` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5307 ///
5308 ///# Usage Notes
5309 ///
5310 ///Clears one or more attachment regions **inside** an active render
5311 ///pass. Unlike `load_op = CLEAR` (which clears the entire attachment
5312 ///at render pass begin), this clears arbitrary rectangular regions
5313 ///mid-render-pass.
5314 ///
5315 ///Use cases:
5316 ///
5317 ///- Clear a sub-region of a colour attachment (e.g. a UI panel
5318 /// background).
5319 ///- Clear the stencil buffer for a specific screen region.
5320 ///
5321 ///Each `ClearAttachment` specifies which attachment to clear (colour
5322 ///index, depth, or stencil) and the clear value. Each `ClearRect`
5323 ///defines the pixel rectangle and layer range.
5324 ///
5325 ///For whole-attachment clears, prefer `load_op = CLEAR`, it is
5326 ///always at least as fast and often faster on tile-based hardware.
5327 pub unsafe fn cmd_clear_attachments(
5328 &self,
5329 command_buffer: CommandBuffer,
5330 p_attachments: &[ClearAttachment],
5331 p_rects: &[ClearRect],
5332 ) {
5333 let fp = self
5334 .commands()
5335 .cmd_clear_attachments
5336 .expect("vkCmdClearAttachments not loaded");
5337 unsafe {
5338 fp(
5339 command_buffer,
5340 p_attachments.len() as u32,
5341 p_attachments.as_ptr(),
5342 p_rects.len() as u32,
5343 p_rects.as_ptr(),
5344 )
5345 };
5346 }
5347 ///Wraps [`vkCmdResolveImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdResolveImage.html).
5348 /**
5349 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
5350 ///
5351 ///# Safety
5352 ///- `commandBuffer` (self) must be valid and not destroyed.
5353 ///- `commandBuffer` must be externally synchronized.
5354 ///
5355 ///# Panics
5356 ///Panics if `vkCmdResolveImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5357 ///
5358 ///# Usage Notes
5359 ///
5360 ///Resolves (downsamples) a multisample image into a single-sample
5361 ///image. Typically used to produce the final single-sample result from
5362 ///a multisampled colour attachment.
5363 ///
5364 ///Both images must be in appropriate transfer layouts
5365 ///(`TRANSFER_SRC_OPTIMAL` and `TRANSFER_DST_OPTIMAL` respectively).
5366 ///The source must be multisampled; the destination must be
5367 ///single-sample. Formats must be identical.
5368 ///
5369 ///For resolving inside a render pass, use `resolve_attachment` in the
5370 ///subpass description instead, it is more efficient on tile-based
5371 ///GPUs because the resolve happens in-tile.
5372 ///
5373 ///Must be recorded outside a render pass. For Vulkan 1.3+, prefer
5374 ///`cmd_resolve_image2`.
5375 pub unsafe fn cmd_resolve_image(
5376 &self,
5377 command_buffer: CommandBuffer,
5378 src_image: Image,
5379 src_image_layout: ImageLayout,
5380 dst_image: Image,
5381 dst_image_layout: ImageLayout,
5382 p_regions: &[ImageResolve],
5383 ) {
5384 let fp = self
5385 .commands()
5386 .cmd_resolve_image
5387 .expect("vkCmdResolveImage not loaded");
5388 unsafe {
5389 fp(
5390 command_buffer,
5391 src_image,
5392 src_image_layout,
5393 dst_image,
5394 dst_image_layout,
5395 p_regions.len() as u32,
5396 p_regions.as_ptr(),
5397 )
5398 };
5399 }
5400 ///Wraps [`vkCmdSetEvent`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetEvent.html).
5401 /**
5402 Provided by **VK_COMPUTE_VERSION_1_0**.*/
5403 ///
5404 ///# Safety
5405 ///- `commandBuffer` (self) must be valid and not destroyed.
5406 ///- `commandBuffer` must be externally synchronized.
5407 ///
5408 ///# Panics
5409 ///Panics if `vkCmdSetEvent` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5410 ///
5411 ///# Usage Notes
5412 ///
5413 ///Signals an event from the GPU at a specific pipeline stage. A later
5414 ///`cmd_wait_events` call can wait for this signal to synchronise work
5415 ///within the same queue.
5416 ///
5417 ///Events provide finer-grained synchronisation than pipeline barriers
5418 ///when you want to split a dependency into a "signal" point and a
5419 ///"wait" point separated by other commands. This lets the GPU execute
5420 ///interleaving work between the signal and wait.
5421 ///
5422 ///The `stage_mask` specifies at which pipeline stage the event is
5423 ///signaled. The event becomes signaled once all commands prior to this
5424 ///call have completed that stage.
5425 ///
5426 ///Events must only be used within a single queue. For cross-queue
5427 ///synchronisation, use semaphores.
5428 ///
5429 ///For Vulkan 1.3+, prefer `cmd_set_event2` which supports more
5430 ///precise stage and access masks.
5431 pub unsafe fn cmd_set_event(
5432 &self,
5433 command_buffer: CommandBuffer,
5434 event: Event,
5435 stage_mask: PipelineStageFlags,
5436 ) {
5437 let fp = self
5438 .commands()
5439 .cmd_set_event
5440 .expect("vkCmdSetEvent not loaded");
5441 unsafe { fp(command_buffer, event, stage_mask) };
5442 }
5443 ///Wraps [`vkCmdResetEvent`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdResetEvent.html).
5444 /**
5445 Provided by **VK_COMPUTE_VERSION_1_0**.*/
5446 ///
5447 ///# Safety
5448 ///- `commandBuffer` (self) must be valid and not destroyed.
5449 ///- `commandBuffer` must be externally synchronized.
5450 ///
5451 ///# Panics
5452 ///Panics if `vkCmdResetEvent` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5453 ///
5454 ///# Usage Notes
5455 ///
5456 ///Resets an event to the unsignaled state from the GPU at a specific
5457 ///pipeline stage. The event can then be signaled again by a
5458 ///subsequent `cmd_set_event`.
5459 ///
5460 ///Must not be called while a `cmd_wait_events` that waits on this
5461 ///event is between its wait and the completion of the dependent work.
5462 ///
5463 ///For Vulkan 1.3+, prefer `cmd_reset_event2`.
5464 pub unsafe fn cmd_reset_event(
5465 &self,
5466 command_buffer: CommandBuffer,
5467 event: Event,
5468 stage_mask: PipelineStageFlags,
5469 ) {
5470 let fp = self
5471 .commands()
5472 .cmd_reset_event
5473 .expect("vkCmdResetEvent not loaded");
5474 unsafe { fp(command_buffer, event, stage_mask) };
5475 }
5476 ///Wraps [`vkCmdWaitEvents`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWaitEvents.html).
5477 /**
5478 Provided by **VK_COMPUTE_VERSION_1_0**.*/
5479 ///
5480 ///# Safety
5481 ///- `commandBuffer` (self) must be valid and not destroyed.
5482 ///- `commandBuffer` must be externally synchronized.
5483 ///
5484 ///# Panics
5485 ///Panics if `vkCmdWaitEvents` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5486 ///
5487 ///# Usage Notes
5488 ///
5489 ///Waits for one or more events to be signaled and then inserts memory
5490 ///and execution dependencies. This is the "wait" half of the
5491 ///signal/wait pattern started by `cmd_set_event`.
5492 ///
5493 ///The wait blocks execution at the specified destination pipeline
5494 ///stages until all events are signaled. Memory barriers provided in
5495 ///this call make the specified source writes visible to the
5496 ///destination stages.
5497 ///
5498 ///**Split barriers**: the main advantage over `cmd_pipeline_barrier`
5499 ///is that you can interleave unrelated commands between the signal and
5500 ///wait, giving the GPU more opportunity for parallel execution.
5501 ///
5502 ///Events must not be waited on across different queues. For
5503 ///cross-queue synchronisation, use semaphores.
5504 ///
5505 ///For Vulkan 1.3+, prefer `cmd_wait_events2`.
5506 pub unsafe fn cmd_wait_events(
5507 &self,
5508 command_buffer: CommandBuffer,
5509 p_events: &[Event],
5510 src_stage_mask: PipelineStageFlags,
5511 dst_stage_mask: PipelineStageFlags,
5512 p_memory_barriers: &[MemoryBarrier],
5513 p_buffer_memory_barriers: &[BufferMemoryBarrier],
5514 p_image_memory_barriers: &[ImageMemoryBarrier],
5515 ) {
5516 let fp = self
5517 .commands()
5518 .cmd_wait_events
5519 .expect("vkCmdWaitEvents not loaded");
5520 unsafe {
5521 fp(
5522 command_buffer,
5523 p_events.len() as u32,
5524 p_events.as_ptr(),
5525 src_stage_mask,
5526 dst_stage_mask,
5527 p_memory_barriers.len() as u32,
5528 p_memory_barriers.as_ptr(),
5529 p_buffer_memory_barriers.len() as u32,
5530 p_buffer_memory_barriers.as_ptr(),
5531 p_image_memory_barriers.len() as u32,
5532 p_image_memory_barriers.as_ptr(),
5533 )
5534 };
5535 }
5536 ///Wraps [`vkCmdPipelineBarrier`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPipelineBarrier.html).
5537 /**
5538 Provided by **VK_BASE_VERSION_1_0**.*/
5539 ///
5540 ///# Safety
5541 ///- `commandBuffer` (self) must be valid and not destroyed.
5542 ///- `commandBuffer` must be externally synchronized.
5543 ///
5544 ///# Panics
5545 ///Panics if `vkCmdPipelineBarrier` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5546 ///
5547 ///# Usage Notes
5548 ///
5549 ///Inserts an execution and memory dependency between commands recorded
5550 ///before and after the barrier. This is the primary synchronisation
5551 ///tool inside a command buffer.
5552 ///
5553 ///**Three types of barrier**:
5554 ///
5555 ///- **Memory barriers** (`MemoryBarrier`): global, affects all
5556 /// resources. Rarely needed, prefer the more specific variants.
5557 ///- **Buffer memory barriers** (`BufferMemoryBarrier`): targets a
5558 /// specific buffer region. Use for storage buffer read-after-write.
5559 ///- **Image memory barriers** (`ImageMemoryBarrier`): targets a
5560 /// specific image subresource range. Also performs layout transitions.
5561 ///
5562 ///**Layout transitions**: image memory barriers are the primary way to
5563 ///transition images between layouts (e.g.
5564 ///`TRANSFER_DST_OPTIMAL` → `SHADER_READ_ONLY_OPTIMAL`). The old and
5565 ///new layouts in the barrier define the transition.
5566 ///
5567 ///**Stage masks**: `src_stage_mask` is the set of stages that must
5568 ///complete before the barrier. `dst_stage_mask` is the set of stages
5569 ///that must wait for the barrier. Choose the narrowest stages possible
5570 ///to minimise stalls.
5571 ///
5572 ///Inside a render pass, only self-dependencies are allowed (barriers
5573 ///within a single subpass). Outside a render pass, there are no
5574 ///restrictions.
5575 ///
5576 ///For Vulkan 1.3+, prefer `cmd_pipeline_barrier2` which uses
5577 ///extensible structs.
5578 pub unsafe fn cmd_pipeline_barrier(
5579 &self,
5580 command_buffer: CommandBuffer,
5581 src_stage_mask: PipelineStageFlags,
5582 dst_stage_mask: PipelineStageFlags,
5583 dependency_flags: DependencyFlags,
5584 p_memory_barriers: &[MemoryBarrier],
5585 p_buffer_memory_barriers: &[BufferMemoryBarrier],
5586 p_image_memory_barriers: &[ImageMemoryBarrier],
5587 ) {
5588 let fp = self
5589 .commands()
5590 .cmd_pipeline_barrier
5591 .expect("vkCmdPipelineBarrier not loaded");
5592 unsafe {
5593 fp(
5594 command_buffer,
5595 src_stage_mask,
5596 dst_stage_mask,
5597 dependency_flags,
5598 p_memory_barriers.len() as u32,
5599 p_memory_barriers.as_ptr(),
5600 p_buffer_memory_barriers.len() as u32,
5601 p_buffer_memory_barriers.as_ptr(),
5602 p_image_memory_barriers.len() as u32,
5603 p_image_memory_barriers.as_ptr(),
5604 )
5605 };
5606 }
5607 ///Wraps [`vkCmdBeginQuery`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginQuery.html).
5608 /**
5609 Provided by **VK_BASE_VERSION_1_0**.*/
5610 ///
5611 ///# Safety
5612 ///- `commandBuffer` (self) must be valid and not destroyed.
5613 ///- `commandBuffer` must be externally synchronized.
5614 ///
5615 ///# Panics
5616 ///Panics if `vkCmdBeginQuery` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5617 ///
5618 ///# Usage Notes
5619 ///
5620 ///Begins a query at the specified index in a query pool. All
5621 ///rendering or compute commands recorded between `cmd_begin_query` and
5622 ///`cmd_end_query` are measured by the query.
5623 ///
5624 ///**Flags**:
5625 ///
5626 ///- `QUERY_CONTROL_PRECISE`: for occlusion queries, return an exact
5627 /// sample count instead of a boolean. More expensive on some
5628 /// hardware. Requires the `occlusion_query_precise` device feature.
5629 ///
5630 ///The query slot must have been reset with `cmd_reset_query_pool` (or
5631 ///`reset_query_pool` on Vulkan 1.2+) before beginning.
5632 ///
5633 ///Pipeline statistics queries must be begun and ended outside a render
5634 ///pass. Occlusion queries can span draw calls within a render pass.
5635 pub unsafe fn cmd_begin_query(
5636 &self,
5637 command_buffer: CommandBuffer,
5638 query_pool: QueryPool,
5639 query: u32,
5640 flags: QueryControlFlags,
5641 ) {
5642 let fp = self
5643 .commands()
5644 .cmd_begin_query
5645 .expect("vkCmdBeginQuery not loaded");
5646 unsafe { fp(command_buffer, query_pool, query, flags) };
5647 }
5648 ///Wraps [`vkCmdEndQuery`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndQuery.html).
5649 /**
5650 Provided by **VK_BASE_VERSION_1_0**.*/
5651 ///
5652 ///# Safety
5653 ///- `commandBuffer` (self) must be valid and not destroyed.
5654 ///- `commandBuffer` must be externally synchronized.
5655 ///
5656 ///# Panics
5657 ///Panics if `vkCmdEndQuery` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5658 ///
5659 ///# Usage Notes
5660 ///
5661 ///Ends an active query at the specified index. The query results
5662 ///become available for retrieval via `get_query_pool_results` or
5663 ///`cmd_copy_query_pool_results` once the command buffer has completed
5664 ///execution.
5665 ///
5666 ///Must be paired with a preceding `cmd_begin_query` on the same
5667 ///query index. Beginning a query without ending it, or ending one
5668 ///that was not begun, is an error.
5669 pub unsafe fn cmd_end_query(
5670 &self,
5671 command_buffer: CommandBuffer,
5672 query_pool: QueryPool,
5673 query: u32,
5674 ) {
5675 let fp = self
5676 .commands()
5677 .cmd_end_query
5678 .expect("vkCmdEndQuery not loaded");
5679 unsafe { fp(command_buffer, query_pool, query) };
5680 }
5681 ///Wraps [`vkCmdBeginConditionalRenderingEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginConditionalRenderingEXT.html).
5682 /**
5683 Provided by **VK_EXT_conditional_rendering**.*/
5684 ///
5685 ///# Safety
5686 ///- `commandBuffer` (self) must be valid and not destroyed.
5687 ///- `commandBuffer` must be externally synchronized.
5688 ///
5689 ///# Panics
5690 ///Panics if `vkCmdBeginConditionalRenderingEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5691 ///
5692 ///# Usage Notes
5693 ///
5694 ///Begins a conditional rendering block. Subsequent rendering and
5695 ///dispatch commands are discarded if the 32-bit value at the
5696 ///specified buffer offset is zero (or non-zero if `INVERTED` is
5697 ///set).
5698 ///
5699 ///End with `cmd_end_conditional_rendering_ext`.
5700 ///
5701 ///Useful for GPU-driven occlusion culling, write visibility
5702 ///results to a buffer, then conditionally skip draw calls.
5703 ///
5704 ///Requires `VK_EXT_conditional_rendering`.
5705 pub unsafe fn cmd_begin_conditional_rendering_ext(
5706 &self,
5707 command_buffer: CommandBuffer,
5708 p_conditional_rendering_begin: &ConditionalRenderingBeginInfoEXT,
5709 ) {
5710 let fp = self
5711 .commands()
5712 .cmd_begin_conditional_rendering_ext
5713 .expect("vkCmdBeginConditionalRenderingEXT not loaded");
5714 unsafe { fp(command_buffer, p_conditional_rendering_begin) };
5715 }
5716 ///Wraps [`vkCmdEndConditionalRenderingEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndConditionalRenderingEXT.html).
5717 /**
5718 Provided by **VK_EXT_conditional_rendering**.*/
5719 ///
5720 ///# Safety
5721 ///- `commandBuffer` (self) must be valid and not destroyed.
5722 ///- `commandBuffer` must be externally synchronized.
5723 ///
5724 ///# Panics
5725 ///Panics if `vkCmdEndConditionalRenderingEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5726 ///
5727 ///# Usage Notes
5728 ///
5729 ///Ends a conditional rendering block started with
5730 ///`cmd_begin_conditional_rendering_ext`. Commands after this call
5731 ///execute unconditionally.
5732 ///
5733 ///Requires `VK_EXT_conditional_rendering`.
5734 pub unsafe fn cmd_end_conditional_rendering_ext(&self, command_buffer: CommandBuffer) {
5735 let fp = self
5736 .commands()
5737 .cmd_end_conditional_rendering_ext
5738 .expect("vkCmdEndConditionalRenderingEXT not loaded");
5739 unsafe { fp(command_buffer) };
5740 }
5741 ///Wraps [`vkCmdBeginCustomResolveEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginCustomResolveEXT.html).
5742 /**
5743 Provided by **VK_EXT_custom_resolve**.*/
5744 ///
5745 ///# Safety
5746 ///- `commandBuffer` (self) must be valid and not destroyed.
5747 ///- `commandBuffer` must be externally synchronized.
5748 ///
5749 ///# Panics
5750 ///Panics if `vkCmdBeginCustomResolveEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5751 ///
5752 ///# Usage Notes
5753 ///
5754 ///Begins a custom resolve region, allowing the application to use
5755 ///its own fragment shader for MSAA resolve instead of the fixed-
5756 ///function resolve. End with `cmd_end_custom_resolve_ext`.
5757 ///
5758 ///Useful for tone-mapped or weighted resolves that the built-in
5759 ///resolve operations cannot express.
5760 ///
5761 ///Requires `VK_EXT_custom_resolve`.
5762 pub unsafe fn cmd_begin_custom_resolve_ext(
5763 &self,
5764 command_buffer: CommandBuffer,
5765 p_begin_custom_resolve_info: Option<&BeginCustomResolveInfoEXT>,
5766 ) {
5767 let fp = self
5768 .commands()
5769 .cmd_begin_custom_resolve_ext
5770 .expect("vkCmdBeginCustomResolveEXT not loaded");
5771 let p_begin_custom_resolve_info_ptr =
5772 p_begin_custom_resolve_info.map_or(core::ptr::null(), core::ptr::from_ref);
5773 unsafe { fp(command_buffer, p_begin_custom_resolve_info_ptr) };
5774 }
5775 ///Wraps [`vkCmdResetQueryPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdResetQueryPool.html).
5776 /**
5777 Provided by **VK_BASE_VERSION_1_0**.*/
5778 ///
5779 ///# Safety
5780 ///- `commandBuffer` (self) must be valid and not destroyed.
5781 ///- `commandBuffer` must be externally synchronized.
5782 ///
5783 ///# Panics
5784 ///Panics if `vkCmdResetQueryPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5785 ///
5786 ///# Usage Notes
5787 ///
5788 ///Resets a range of queries in a pool from the GPU command stream.
5789 ///Queries must be reset before they can be used in `cmd_begin_query`
5790 ///or `cmd_write_timestamp`.
5791 ///
5792 ///This is the pre-1.2 way to reset queries. For Vulkan 1.2+,
5793 ///`reset_query_pool` (host-side) is often more convenient and avoids
5794 ///adding the reset to the command buffer.
5795 ///
5796 ///Must be recorded outside a render pass.
5797 pub unsafe fn cmd_reset_query_pool(
5798 &self,
5799 command_buffer: CommandBuffer,
5800 query_pool: QueryPool,
5801 first_query: u32,
5802 query_count: u32,
5803 ) {
5804 let fp = self
5805 .commands()
5806 .cmd_reset_query_pool
5807 .expect("vkCmdResetQueryPool not loaded");
5808 unsafe { fp(command_buffer, query_pool, first_query, query_count) };
5809 }
5810 ///Wraps [`vkCmdWriteTimestamp`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWriteTimestamp.html).
5811 /**
5812 Provided by **VK_BASE_VERSION_1_0**.*/
5813 ///
5814 ///# Safety
5815 ///- `commandBuffer` (self) must be valid and not destroyed.
5816 ///- `commandBuffer` must be externally synchronized.
5817 ///
5818 ///# Panics
5819 ///Panics if `vkCmdWriteTimestamp` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5820 ///
5821 ///# Usage Notes
5822 ///
5823 ///Writes the current GPU timestamp into a query pool slot when the
5824 ///specified pipeline stage completes. Use two timestamps to measure
5825 ///elapsed GPU time:
5826 ///
5827 ///```text
5828 ///cmd_write_timestamp(PIPELINE_STAGE_TOP_OF_PIPE, pool, 0);
5829 #[doc = "// ... commands to measure ..."]
5830 ///cmd_write_timestamp(PIPELINE_STAGE_BOTTOM_OF_PIPE, pool, 1);
5831 ///```
5832 ///
5833 ///After the command buffer completes, read the values with
5834 ///`get_query_pool_results` (with `QUERY_RESULT_64`) and compute:
5835 ///
5836 ///```text
5837 ///elapsed_ns = (timestamp[1] - timestamp[0]) * timestamp_period
5838 ///```
5839 ///
5840 ///`timestamp_period` is in nanoseconds per tick, available from
5841 ///`physical_device_limits`.
5842 ///
5843 ///Not all queue families support timestamps, check
5844 ///`timestamp_valid_bits` in the queue family properties. A value of 0
5845 ///means timestamps are not supported on that queue.
5846 ///
5847 ///For Vulkan 1.3+, prefer `cmd_write_timestamp2`.
5848 pub unsafe fn cmd_write_timestamp(
5849 &self,
5850 command_buffer: CommandBuffer,
5851 pipeline_stage: PipelineStageFlagBits,
5852 query_pool: QueryPool,
5853 query: u32,
5854 ) {
5855 let fp = self
5856 .commands()
5857 .cmd_write_timestamp
5858 .expect("vkCmdWriteTimestamp not loaded");
5859 unsafe { fp(command_buffer, pipeline_stage, query_pool, query) };
5860 }
5861 ///Wraps [`vkCmdCopyQueryPoolResults`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyQueryPoolResults.html).
5862 /**
5863 Provided by **VK_BASE_VERSION_1_0**.*/
5864 ///
5865 ///# Safety
5866 ///- `commandBuffer` (self) must be valid and not destroyed.
5867 ///- `commandBuffer` must be externally synchronized.
5868 ///
5869 ///# Panics
5870 ///Panics if `vkCmdCopyQueryPoolResults` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5871 ///
5872 ///# Usage Notes
5873 ///
5874 ///Copies query results directly into a GPU buffer. This is the
5875 ///GPU-side counterpart to `get_query_pool_results` and avoids a CPU
5876 ///round-trip when the results are consumed by subsequent GPU work
5877 ///(e.g. conditional rendering or indirect dispatch).
5878 ///
5879 ///The same flags apply as for `get_query_pool_results`:
5880 ///`QUERY_RESULT_64`, `QUERY_RESULT_WAIT`,
5881 ///`QUERY_RESULT_WITH_AVAILABILITY`, and `QUERY_RESULT_PARTIAL`.
5882 ///
5883 ///The destination buffer must have `BUFFER_USAGE_TRANSFER_DST`. The
5884 ///stride must be large enough to hold the result (and availability
5885 ///value, if requested).
5886 ///
5887 ///Must be recorded outside a render pass.
5888 pub unsafe fn cmd_copy_query_pool_results(
5889 &self,
5890 command_buffer: CommandBuffer,
5891 query_pool: QueryPool,
5892 first_query: u32,
5893 query_count: u32,
5894 dst_buffer: Buffer,
5895 dst_offset: u64,
5896 stride: u64,
5897 flags: QueryResultFlags,
5898 ) {
5899 let fp = self
5900 .commands()
5901 .cmd_copy_query_pool_results
5902 .expect("vkCmdCopyQueryPoolResults not loaded");
5903 unsafe {
5904 fp(
5905 command_buffer,
5906 query_pool,
5907 first_query,
5908 query_count,
5909 dst_buffer,
5910 dst_offset,
5911 stride,
5912 flags,
5913 )
5914 };
5915 }
5916 ///Wraps [`vkCmdPushConstants`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPushConstants.html).
5917 /**
5918 Provided by **VK_COMPUTE_VERSION_1_0**.*/
5919 ///
5920 ///# Safety
5921 ///- `commandBuffer` (self) must be valid and not destroyed.
5922 ///- `commandBuffer` must be externally synchronized.
5923 ///
5924 ///# Panics
5925 ///Panics if `vkCmdPushConstants` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5926 ///
5927 ///# Usage Notes
5928 ///
5929 ///Updates push constant values for the bound pipeline layout. Push
5930 ///constants are a fast path for small, frequently-changing data that
5931 ///avoids descriptor set updates entirely.
5932 ///
5933 ///**Size limit**: the total push constant range is at least 128 bytes
5934 ///(device limit `max_push_constants_size`). Use push constants for
5935 ///per-draw data like transform matrices, material indices, or time
5936 ///values.
5937 ///
5938 ///**Stage flags**: the `stage_flags` parameter must match the stages
5939 ///declared in the pipeline layout's push constant range. You can
5940 ///update different stage ranges separately (e.g. update the vertex
5941 ///shader's range without touching the fragment shader's range).
5942 ///
5943 ///Push constant data persists across draw/dispatch calls until the
5944 ///pipeline layout is changed or the values are overwritten.
5945 ///
5946 ///For Vulkan 1.4+, `cmd_push_constants2` uses an extensible struct.
5947 pub unsafe fn cmd_push_constants(
5948 &self,
5949 command_buffer: CommandBuffer,
5950 layout: PipelineLayout,
5951 stage_flags: ShaderStageFlags,
5952 offset: u32,
5953 p_values: &[u8],
5954 ) {
5955 let fp = self
5956 .commands()
5957 .cmd_push_constants
5958 .expect("vkCmdPushConstants not loaded");
5959 unsafe {
5960 fp(
5961 command_buffer,
5962 layout,
5963 stage_flags,
5964 offset,
5965 p_values.len() as u32,
5966 p_values.as_ptr().cast(),
5967 )
5968 };
5969 }
5970 ///Wraps [`vkCmdBeginRenderPass`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginRenderPass.html).
5971 /**
5972 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
5973 ///
5974 ///# Safety
5975 ///- `commandBuffer` (self) must be valid and not destroyed.
5976 ///- `commandBuffer` must be externally synchronized.
5977 ///
5978 ///# Panics
5979 ///Panics if `vkCmdBeginRenderPass` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
5980 ///
5981 ///# Usage Notes
5982 ///
5983 ///Begins a render pass instance. All subsequent drawing commands are
5984 ///recorded within this render pass until `cmd_end_render_pass`.
5985 ///
5986 ///**`render_pass_begin_info`** specifies:
5987 ///
5988 ///- **Render pass and framebuffer**: which render pass to use and
5989 /// which concrete image views are bound.
5990 ///- **Render area**: the pixel region to render. Should match the
5991 /// framebuffer extent for best performance. Misalignment with the
5992 /// render area granularity can cause overhead on tile-based GPUs.
5993 ///- **Clear values**: one per attachment with `load_op = CLEAR`. The
5994 /// array must include entries for all attachments (use a dummy value
5995 /// for non-cleared attachments).
5996 ///
5997 ///**`contents`**:
5998 ///
5999 ///- `SUBPASS_CONTENTS_INLINE`: draw commands are recorded directly
6000 /// in this command buffer.
6001 ///- `SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS`: draw commands come
6002 /// from secondary command buffers via `cmd_execute_commands`.
6003 ///
6004 ///For Vulkan 1.2+, `cmd_begin_render_pass2` accepts a `SubpassBeginInfo`.
6005 ///For Vulkan 1.3+, consider dynamic rendering (`cmd_begin_rendering`)
6006 ///which avoids render pass and framebuffer objects entirely.
6007 ///
6008 ///# Guide
6009 ///
6010 ///See [Render Passes & Framebuffers](https://hiddentale.github.io/vulkan_rust/concepts/render-passes.html) in the vulkan_rust guide.
6011 pub unsafe fn cmd_begin_render_pass(
6012 &self,
6013 command_buffer: CommandBuffer,
6014 p_render_pass_begin: &RenderPassBeginInfo,
6015 contents: SubpassContents,
6016 ) {
6017 let fp = self
6018 .commands()
6019 .cmd_begin_render_pass
6020 .expect("vkCmdBeginRenderPass not loaded");
6021 unsafe { fp(command_buffer, p_render_pass_begin, contents) };
6022 }
6023 ///Wraps [`vkCmdNextSubpass`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdNextSubpass.html).
6024 /**
6025 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
6026 ///
6027 ///# Safety
6028 ///- `commandBuffer` (self) must be valid and not destroyed.
6029 ///- `commandBuffer` must be externally synchronized.
6030 ///
6031 ///# Panics
6032 ///Panics if `vkCmdNextSubpass` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6033 ///
6034 ///# Usage Notes
6035 ///
6036 ///Advances to the next subpass within a render pass. Subpass
6037 ///transitions allow the driver to resolve dependencies between
6038 ///subpasses, for example, reading a colour attachment written in
6039 ///the previous subpass as an input attachment.
6040 ///
6041 ///The `contents` parameter has the same meaning as in
6042 ///`cmd_begin_render_pass`: `INLINE` or `SECONDARY_COMMAND_BUFFERS`.
6043 ///
6044 ///Multi-subpass render passes are an optimisation for tile-based GPUs
6045 ///where they can keep data on-chip between subpasses. On desktop GPUs
6046 ///the benefit is smaller. Many applications use a single subpass and
6047 ///handle inter-pass dependencies with explicit pipeline barriers.
6048 ///
6049 ///For Vulkan 1.2+, prefer `cmd_next_subpass2`.
6050 pub unsafe fn cmd_next_subpass(
6051 &self,
6052 command_buffer: CommandBuffer,
6053 contents: SubpassContents,
6054 ) {
6055 let fp = self
6056 .commands()
6057 .cmd_next_subpass
6058 .expect("vkCmdNextSubpass not loaded");
6059 unsafe { fp(command_buffer, contents) };
6060 }
6061 ///Wraps [`vkCmdEndRenderPass`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndRenderPass.html).
6062 /**
6063 Provided by **VK_GRAPHICS_VERSION_1_0**.*/
6064 ///
6065 ///# Safety
6066 ///- `commandBuffer` (self) must be valid and not destroyed.
6067 ///- `commandBuffer` must be externally synchronized.
6068 ///
6069 ///# Panics
6070 ///Panics if `vkCmdEndRenderPass` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6071 ///
6072 ///# Usage Notes
6073 ///
6074 ///Ends the current render pass instance. After this call, the
6075 ///implicit layout transitions specified by each attachment's
6076 ///`final_layout` are applied.
6077 ///
6078 ///No draw commands may be recorded after this until a new render pass
6079 ///is begun (or dynamic rendering is started).
6080 ///
6081 ///For Vulkan 1.2+, prefer `cmd_end_render_pass2`.
6082 pub unsafe fn cmd_end_render_pass(&self, command_buffer: CommandBuffer) {
6083 let fp = self
6084 .commands()
6085 .cmd_end_render_pass
6086 .expect("vkCmdEndRenderPass not loaded");
6087 unsafe { fp(command_buffer) };
6088 }
6089 ///Wraps [`vkCmdExecuteCommands`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdExecuteCommands.html).
6090 /**
6091 Provided by **VK_BASE_VERSION_1_0**.*/
6092 ///
6093 ///# Safety
6094 ///- `commandBuffer` (self) must be valid and not destroyed.
6095 ///- `commandBuffer` must be externally synchronized.
6096 ///
6097 ///# Panics
6098 ///Panics if `vkCmdExecuteCommands` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6099 ///
6100 ///# Usage Notes
6101 ///
6102 ///Executes one or more secondary command buffers from a primary
6103 ///command buffer. The secondary buffers are inlined into the primary
6104 ///buffer's execution stream in array order.
6105 ///
6106 ///**Use cases**:
6107 ///
6108 ///- **Multi-threaded recording**: each thread records a secondary
6109 /// command buffer, and the main thread assembles them with a single
6110 /// `cmd_execute_commands` call. This is the primary scaling strategy
6111 /// for CPU-bound recording.
6112 ///- **Reusable draw sequences**: record a secondary buffer once and
6113 /// execute it in multiple frames or from multiple primary buffers
6114 /// (requires `SIMULTANEOUS_USE` on the secondary buffer).
6115 ///
6116 ///Secondary command buffers inherit certain state from the primary
6117 ///buffer (viewport, scissor, etc.) only if declared in the
6118 ///`CommandBufferInheritanceInfo`. The render pass and subpass must
6119 ///match what the primary buffer is currently in.
6120 ///
6121 ///This command can only be called from a primary command buffer.
6122 pub unsafe fn cmd_execute_commands(
6123 &self,
6124 command_buffer: CommandBuffer,
6125 p_command_buffers: &[CommandBuffer],
6126 ) {
6127 let fp = self
6128 .commands()
6129 .cmd_execute_commands
6130 .expect("vkCmdExecuteCommands not loaded");
6131 unsafe {
6132 fp(
6133 command_buffer,
6134 p_command_buffers.len() as u32,
6135 p_command_buffers.as_ptr(),
6136 )
6137 };
6138 }
6139 ///Wraps [`vkCreateSharedSwapchainsKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateSharedSwapchainsKHR.html).
6140 /**
6141 Provided by **VK_KHR_display_swapchain**.*/
6142 ///
6143 ///# Errors
6144 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6145 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
6146 ///- `VK_ERROR_INCOMPATIBLE_DISPLAY_KHR`
6147 ///- `VK_ERROR_DEVICE_LOST`
6148 ///- `VK_ERROR_SURFACE_LOST_KHR`
6149 ///- `VK_ERROR_UNKNOWN`
6150 ///- `VK_ERROR_VALIDATION_FAILED`
6151 ///
6152 ///# Safety
6153 ///- `device` (self) must be valid and not destroyed.
6154 ///
6155 ///# Panics
6156 ///Panics if `vkCreateSharedSwapchainsKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6157 ///
6158 ///# Usage Notes
6159 ///
6160 ///Creates one or more swapchains that share presentable images with
6161 ///their `old_swapchain`. Provided by `VK_KHR_display_swapchain`.
6162 ///
6163 ///This is primarily used for direct-to-display rendering where
6164 ///multiple swapchains share the same display plane. For window-based
6165 ///rendering, use `create_swapchain_khr` instead.
6166 pub unsafe fn create_shared_swapchains_khr(
6167 &self,
6168 p_create_infos: &[SwapchainCreateInfoKHR],
6169 allocator: Option<&AllocationCallbacks>,
6170 ) -> VkResult<Vec<SwapchainKHR>> {
6171 let fp = self
6172 .commands()
6173 .create_shared_swapchains_khr
6174 .expect("vkCreateSharedSwapchainsKHR not loaded");
6175 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
6176 let count = p_create_infos.len();
6177 let mut out = vec![unsafe { core::mem::zeroed() }; count];
6178 check(unsafe {
6179 fp(
6180 self.handle(),
6181 p_create_infos.len() as u32,
6182 p_create_infos.as_ptr(),
6183 alloc_ptr,
6184 out.as_mut_ptr(),
6185 )
6186 })?;
6187 Ok(out)
6188 }
6189 ///Wraps [`vkCreateSwapchainKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateSwapchainKHR.html).
6190 /**
6191 Provided by **VK_KHR_swapchain**.*/
6192 ///
6193 ///# Errors
6194 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6195 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
6196 ///- `VK_ERROR_DEVICE_LOST`
6197 ///- `VK_ERROR_SURFACE_LOST_KHR`
6198 ///- `VK_ERROR_NATIVE_WINDOW_IN_USE_KHR`
6199 ///- `VK_ERROR_INITIALIZATION_FAILED`
6200 ///- `VK_ERROR_COMPRESSION_EXHAUSTED_EXT`
6201 ///- `VK_ERROR_UNKNOWN`
6202 ///- `VK_ERROR_VALIDATION_FAILED`
6203 ///
6204 ///# Safety
6205 ///- `device` (self) must be valid and not destroyed.
6206 ///
6207 ///# Panics
6208 ///Panics if `vkCreateSwapchainKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6209 ///
6210 ///# Usage Notes
6211 ///
6212 ///Creates a swapchain, a queue of presentable images tied to a
6213 ///surface (window). The swapchain is the bridge between rendering and
6214 ///display.
6215 ///
6216 ///**Key parameters**:
6217 ///
6218 ///- **`min_image_count`**: request at least this many images. For
6219 /// double buffering use 2, for triple buffering use 3. Query
6220 /// `get_physical_device_surface_capabilities_khr` for the supported
6221 /// range.
6222 ///- **`image_format` / `image_color_space`**: pick a pair from
6223 /// `get_physical_device_surface_formats_khr`. `B8G8R8A8_SRGB` +
6224 /// `SRGB_NONLINEAR` is the most portable.
6225 ///- **`present_mode`**: `FIFO` (vsync, always supported), `MAILBOX`
6226 /// (low-latency triple buffering), `IMMEDIATE` (no vsync, tearing).
6227 ///- **`pre_transform`**: set to `current_transform` from surface
6228 /// capabilities to avoid an extra composition blit.
6229 ///- **`old_swapchain`**: when recreating after a resize, pass the old
6230 /// swapchain here. The driver can reuse internal resources.
6231 ///
6232 ///**Swapchain recreation** is required when the surface size changes
6233 ///(window resize) or when `acquire_next_image_khr` returns
6234 ///`VK_ERROR_OUT_OF_DATE_KHR`. Destroy the old swapchain after
6235 ///creating the new one.
6236 ///
6237 ///# Guide
6238 ///
6239 ///See [Hello Triangle, Part 2](https://hiddentale.github.io/vulkan_rust/getting-started/hello-triangle-2.html) in the vulkan_rust guide.
6240 pub unsafe fn create_swapchain_khr(
6241 &self,
6242 p_create_info: &SwapchainCreateInfoKHR,
6243 allocator: Option<&AllocationCallbacks>,
6244 ) -> VkResult<SwapchainKHR> {
6245 let fp = self
6246 .commands()
6247 .create_swapchain_khr
6248 .expect("vkCreateSwapchainKHR not loaded");
6249 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
6250 let mut out = unsafe { core::mem::zeroed() };
6251 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
6252 Ok(out)
6253 }
6254 ///Wraps [`vkDestroySwapchainKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroySwapchainKHR.html).
6255 /**
6256 Provided by **VK_KHR_swapchain**.*/
6257 ///
6258 ///# Safety
6259 ///- `device` (self) must be valid and not destroyed.
6260 ///- `swapchain` must be externally synchronized.
6261 ///
6262 ///# Panics
6263 ///Panics if `vkDestroySwapchainKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6264 ///
6265 ///# Usage Notes
6266 ///
6267 ///Destroys a swapchain. All images obtained from
6268 ///`get_swapchain_images_khr` become invalid, destroy any image views
6269 ///and framebuffers referencing them first.
6270 ///
6271 ///Wait for all rendering to complete (`device_wait_idle`) before
6272 ///destroying. Do not destroy a swapchain while an acquired image has
6273 ///not been presented.
6274 ///
6275 ///When recreating a swapchain (e.g. on resize), create the new one
6276 ///first (passing the old as `old_swapchain`), then destroy the old
6277 ///one.
6278 ///
6279 ///# Guide
6280 ///
6281 ///See [Hello Triangle, Part 2](https://hiddentale.github.io/vulkan_rust/getting-started/hello-triangle-2.html) in the vulkan_rust guide.
6282 pub unsafe fn destroy_swapchain_khr(
6283 &self,
6284 swapchain: SwapchainKHR,
6285 allocator: Option<&AllocationCallbacks>,
6286 ) {
6287 let fp = self
6288 .commands()
6289 .destroy_swapchain_khr
6290 .expect("vkDestroySwapchainKHR not loaded");
6291 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
6292 unsafe { fp(self.handle(), swapchain, alloc_ptr) };
6293 }
6294 ///Wraps [`vkGetSwapchainImagesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSwapchainImagesKHR.html).
6295 /**
6296 Provided by **VK_KHR_swapchain**.*/
6297 ///
6298 ///# Errors
6299 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6300 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
6301 ///- `VK_ERROR_UNKNOWN`
6302 ///- `VK_ERROR_VALIDATION_FAILED`
6303 ///
6304 ///# Safety
6305 ///- `device` (self) must be valid and not destroyed.
6306 ///
6307 ///# Panics
6308 ///Panics if `vkGetSwapchainImagesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6309 ///
6310 ///# Usage Notes
6311 ///
6312 ///Returns the array of presentable images owned by the swapchain. You
6313 ///do not create or destroy these images, they are managed by the
6314 ///swapchain.
6315 ///
6316 ///The returned image count may be greater than `min_image_count`
6317 ///requested at swapchain creation.
6318 ///
6319 ///Create an `ImageView` for each swapchain image to use them as
6320 ///render targets. These views (and any framebuffers using them) must
6321 ///be destroyed before the swapchain is destroyed.
6322 ///
6323 ///The images start in an undefined layout. Transition them to the
6324 ///appropriate layout (e.g. `COLOR_ATTACHMENT_OPTIMAL`) during the
6325 ///first render pass or via a pipeline barrier.
6326 ///
6327 ///# Guide
6328 ///
6329 ///See [Hello Triangle, Part 2](https://hiddentale.github.io/vulkan_rust/getting-started/hello-triangle-2.html) in the vulkan_rust guide.
6330 pub unsafe fn get_swapchain_images_khr(&self, swapchain: SwapchainKHR) -> VkResult<Vec<Image>> {
6331 let fp = self
6332 .commands()
6333 .get_swapchain_images_khr
6334 .expect("vkGetSwapchainImagesKHR not loaded");
6335 enumerate_two_call(|count, data| unsafe { fp(self.handle(), swapchain, count, data) })
6336 }
6337 ///Wraps [`vkAcquireNextImageKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAcquireNextImageKHR.html).
6338 /**
6339 Provided by **VK_KHR_swapchain**.*/
6340 ///
6341 ///# Errors
6342 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6343 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
6344 ///- `VK_ERROR_DEVICE_LOST`
6345 ///- `VK_ERROR_OUT_OF_DATE_KHR`
6346 ///- `VK_ERROR_SURFACE_LOST_KHR`
6347 ///- `VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT`
6348 ///- `VK_ERROR_UNKNOWN`
6349 ///- `VK_ERROR_VALIDATION_FAILED`
6350 ///
6351 ///# Safety
6352 ///- `device` (self) must be valid and not destroyed.
6353 ///- `swapchain` must be externally synchronized.
6354 ///- `semaphore` must be externally synchronized.
6355 ///- `fence` must be externally synchronized.
6356 ///
6357 ///# Panics
6358 ///Panics if `vkAcquireNextImageKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6359 ///
6360 ///# Usage Notes
6361 ///
6362 ///Acquires the next available image from the swapchain for rendering.
6363 ///Returns the index into the array from `get_swapchain_images_khr`.
6364 ///
6365 ///**Synchronisation**: pass a semaphore, a fence, or both. The
6366 ///semaphore/fence is signaled when the image is ready to be rendered
6367 ///to. Do not start rendering until the semaphore is waited on in
6368 ///`queue_submit`.
6369 ///
6370 ///**Timeout**: in nanoseconds. `u64::MAX` blocks indefinitely.
6371 ///
6372 ///**Special return values**:
6373 ///
6374 ///- `VK_SUBOPTIMAL_KHR`: the swapchain still works but no longer
6375 /// matches the surface perfectly (e.g. after a resize). You can
6376 /// continue rendering but should recreate the swapchain soon.
6377 ///- `VK_ERROR_OUT_OF_DATE_KHR`: the swapchain is incompatible with
6378 /// the surface and must be recreated before rendering. Do not present
6379 /// the acquired image.
6380 ///
6381 ///A common frame loop:
6382 ///
6383 ///```text
6384 ///acquire_next_image_khr(swapchain, u64::MAX, image_available_sem, null)
6385 #[doc = "// wait on image_available_sem in queue_submit"]
6386 #[doc = "// render to swapchain_images[index]"]
6387 #[doc = "// signal render_finished_sem in queue_submit"]
6388 ///queue_present_khr(render_finished_sem, swapchain, index)
6389 ///```
6390 ///
6391 ///# Guide
6392 ///
6393 ///See [Synchronization](https://hiddentale.github.io/vulkan_rust/concepts/synchronization.html) in the vulkan_rust guide.
6394 pub unsafe fn acquire_next_image_khr(
6395 &self,
6396 swapchain: SwapchainKHR,
6397 timeout: u64,
6398 semaphore: Semaphore,
6399 fence: Fence,
6400 ) -> VkResult<u32> {
6401 let fp = self
6402 .commands()
6403 .acquire_next_image_khr
6404 .expect("vkAcquireNextImageKHR not loaded");
6405 let mut out = unsafe { core::mem::zeroed() };
6406 check(unsafe {
6407 fp(
6408 self.handle(),
6409 swapchain,
6410 timeout,
6411 semaphore,
6412 fence,
6413 &mut out,
6414 )
6415 })?;
6416 Ok(out)
6417 }
6418 ///Wraps [`vkQueuePresentKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueuePresentKHR.html).
6419 /**
6420 Provided by **VK_KHR_swapchain**.*/
6421 ///
6422 ///# Errors
6423 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6424 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
6425 ///- `VK_ERROR_DEVICE_LOST`
6426 ///- `VK_ERROR_OUT_OF_DATE_KHR`
6427 ///- `VK_ERROR_SURFACE_LOST_KHR`
6428 ///- `VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT`
6429 ///- `VK_ERROR_UNKNOWN`
6430 ///- `VK_ERROR_VALIDATION_FAILED`
6431 ///- `VK_ERROR_PRESENT_TIMING_QUEUE_FULL_EXT`
6432 ///
6433 ///# Safety
6434 ///- `queue` (self) must be valid and not destroyed.
6435 ///- `queue` must be externally synchronized.
6436 ///
6437 ///# Panics
6438 ///Panics if `vkQueuePresentKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6439 ///
6440 ///# Usage Notes
6441 ///
6442 ///Presents a rendered swapchain image to the display. This is the
6443 ///final step in the frame loop, after rendering is complete, present
6444 ///the image to make it visible.
6445 ///
6446 ///**Wait semaphores**: the present waits on these semaphores before
6447 ///presenting. Pass the semaphore that your render submission signals
6448 ///to ensure the image is fully rendered before it goes to the display.
6449 ///
6450 ///**Multiple swapchains**: a single present call can present to
6451 ///multiple swapchains simultaneously (e.g. for multi-window or
6452 ///multi-monitor rendering).
6453 ///
6454 ///**Return values**:
6455 ///
6456 ///- `VK_SUBOPTIMAL_KHR`: presented successfully but the swapchain
6457 /// should be recreated.
6458 ///- `VK_ERROR_OUT_OF_DATE_KHR`: presentation failed, the swapchain
6459 /// must be recreated.
6460 ///
6461 ///The present queue does not need to be the same as the graphics
6462 ///queue, but the semaphore synchronisation must be correct if they
6463 ///differ.
6464 ///
6465 ///# Guide
6466 ///
6467 ///See [Hello Triangle, Part 4](https://hiddentale.github.io/vulkan_rust/getting-started/hello-triangle-4.html) in the vulkan_rust guide.
6468 pub unsafe fn queue_present_khr(
6469 &self,
6470 queue: Queue,
6471 p_present_info: &PresentInfoKHR,
6472 ) -> VkResult<()> {
6473 let fp = self
6474 .commands()
6475 .queue_present_khr
6476 .expect("vkQueuePresentKHR not loaded");
6477 check(unsafe { fp(queue, p_present_info) })
6478 }
6479 ///Wraps [`vkDebugMarkerSetObjectNameEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDebugMarkerSetObjectNameEXT.html).
6480 /**
6481 Provided by **VK_EXT_debug_marker**.*/
6482 ///
6483 ///# Errors
6484 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6485 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
6486 ///- `VK_ERROR_UNKNOWN`
6487 ///- `VK_ERROR_VALIDATION_FAILED`
6488 ///
6489 ///# Safety
6490 ///- `device` (self) must be valid and not destroyed.
6491 ///
6492 ///# Panics
6493 ///Panics if `vkDebugMarkerSetObjectNameEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6494 ///
6495 ///# Usage Notes
6496 ///
6497 ///Assigns a name to a Vulkan object for debugging. This is the
6498 ///legacy `VK_EXT_debug_marker` equivalent of
6499 ///`set_debug_utils_object_name_ext`.
6500 ///
6501 ///`DebugMarkerObjectNameInfoEXT` uses the old
6502 ///`DebugReportObjectTypeEXT` enum to identify object types.
6503 ///
6504 ///Superseded by `VK_EXT_debug_utils`. Prefer
6505 ///`set_debug_utils_object_name_ext` for new code.
6506 pub unsafe fn debug_marker_set_object_name_ext(
6507 &self,
6508 p_name_info: &DebugMarkerObjectNameInfoEXT,
6509 ) -> VkResult<()> {
6510 let fp = self
6511 .commands()
6512 .debug_marker_set_object_name_ext
6513 .expect("vkDebugMarkerSetObjectNameEXT not loaded");
6514 check(unsafe { fp(self.handle(), p_name_info) })
6515 }
6516 ///Wraps [`vkDebugMarkerSetObjectTagEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDebugMarkerSetObjectTagEXT.html).
6517 /**
6518 Provided by **VK_EXT_debug_marker**.*/
6519 ///
6520 ///# Errors
6521 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6522 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
6523 ///- `VK_ERROR_UNKNOWN`
6524 ///- `VK_ERROR_VALIDATION_FAILED`
6525 ///
6526 ///# Safety
6527 ///- `device` (self) must be valid and not destroyed.
6528 ///
6529 ///# Panics
6530 ///Panics if `vkDebugMarkerSetObjectTagEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6531 ///
6532 ///# Usage Notes
6533 ///
6534 ///Attaches arbitrary binary data to a Vulkan object. This is the
6535 ///legacy `VK_EXT_debug_marker` equivalent of
6536 ///`set_debug_utils_object_tag_ext`.
6537 ///
6538 ///Superseded by `VK_EXT_debug_utils`. Prefer
6539 ///`set_debug_utils_object_tag_ext` for new code.
6540 pub unsafe fn debug_marker_set_object_tag_ext(
6541 &self,
6542 p_tag_info: &DebugMarkerObjectTagInfoEXT,
6543 ) -> VkResult<()> {
6544 let fp = self
6545 .commands()
6546 .debug_marker_set_object_tag_ext
6547 .expect("vkDebugMarkerSetObjectTagEXT not loaded");
6548 check(unsafe { fp(self.handle(), p_tag_info) })
6549 }
6550 ///Wraps [`vkCmdDebugMarkerBeginEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDebugMarkerBeginEXT.html).
6551 /**
6552 Provided by **VK_EXT_debug_marker**.*/
6553 ///
6554 ///# Safety
6555 ///- `commandBuffer` (self) must be valid and not destroyed.
6556 ///- `commandBuffer` must be externally synchronized.
6557 ///
6558 ///# Panics
6559 ///Panics if `vkCmdDebugMarkerBeginEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6560 ///
6561 ///# Usage Notes
6562 ///
6563 ///Opens a debug marker region in a command buffer. This is the
6564 ///legacy `VK_EXT_debug_marker` equivalent of
6565 ///`cmd_begin_debug_utils_label_ext`.
6566 ///
6567 ///`DebugMarkerMarkerInfoEXT` specifies a name and optional RGBA
6568 ///color. Close with `cmd_debug_marker_end_ext`.
6569 ///
6570 ///Superseded by `VK_EXT_debug_utils`. Prefer
6571 ///`cmd_begin_debug_utils_label_ext` for new code.
6572 pub unsafe fn cmd_debug_marker_begin_ext(
6573 &self,
6574 command_buffer: CommandBuffer,
6575 p_marker_info: &DebugMarkerMarkerInfoEXT,
6576 ) {
6577 let fp = self
6578 .commands()
6579 .cmd_debug_marker_begin_ext
6580 .expect("vkCmdDebugMarkerBeginEXT not loaded");
6581 unsafe { fp(command_buffer, p_marker_info) };
6582 }
6583 ///Wraps [`vkCmdDebugMarkerEndEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDebugMarkerEndEXT.html).
6584 /**
6585 Provided by **VK_EXT_debug_marker**.*/
6586 ///
6587 ///# Safety
6588 ///- `commandBuffer` (self) must be valid and not destroyed.
6589 ///- `commandBuffer` must be externally synchronized.
6590 ///
6591 ///# Panics
6592 ///Panics if `vkCmdDebugMarkerEndEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6593 ///
6594 ///# Usage Notes
6595 ///
6596 ///Closes the most recently opened debug marker region in the command
6597 ///buffer. Must be paired with `cmd_debug_marker_begin_ext`.
6598 ///
6599 ///This is the legacy `VK_EXT_debug_marker` equivalent of
6600 ///`cmd_end_debug_utils_label_ext`. Prefer `VK_EXT_debug_utils`
6601 ///for new code.
6602 pub unsafe fn cmd_debug_marker_end_ext(&self, command_buffer: CommandBuffer) {
6603 let fp = self
6604 .commands()
6605 .cmd_debug_marker_end_ext
6606 .expect("vkCmdDebugMarkerEndEXT not loaded");
6607 unsafe { fp(command_buffer) };
6608 }
6609 ///Wraps [`vkCmdDebugMarkerInsertEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDebugMarkerInsertEXT.html).
6610 /**
6611 Provided by **VK_EXT_debug_marker**.*/
6612 ///
6613 ///# Safety
6614 ///- `commandBuffer` (self) must be valid and not destroyed.
6615 ///- `commandBuffer` must be externally synchronized.
6616 ///
6617 ///# Panics
6618 ///Panics if `vkCmdDebugMarkerInsertEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6619 ///
6620 ///# Usage Notes
6621 ///
6622 ///Inserts a single-point debug marker into the command buffer.
6623 ///This is the legacy `VK_EXT_debug_marker` equivalent of
6624 ///`cmd_insert_debug_utils_label_ext`.
6625 ///
6626 ///`DebugMarkerMarkerInfoEXT` specifies a name and optional RGBA
6627 ///color.
6628 ///
6629 ///Superseded by `VK_EXT_debug_utils`. Prefer
6630 ///`cmd_insert_debug_utils_label_ext` for new code.
6631 pub unsafe fn cmd_debug_marker_insert_ext(
6632 &self,
6633 command_buffer: CommandBuffer,
6634 p_marker_info: &DebugMarkerMarkerInfoEXT,
6635 ) {
6636 let fp = self
6637 .commands()
6638 .cmd_debug_marker_insert_ext
6639 .expect("vkCmdDebugMarkerInsertEXT not loaded");
6640 unsafe { fp(command_buffer, p_marker_info) };
6641 }
6642 ///Wraps [`vkGetMemoryWin32HandleNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryWin32HandleNV.html).
6643 /**
6644 Provided by **VK_NV_external_memory_win32**.*/
6645 ///
6646 ///# Errors
6647 ///- `VK_ERROR_TOO_MANY_OBJECTS`
6648 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6649 ///- `VK_ERROR_UNKNOWN`
6650 ///- `VK_ERROR_VALIDATION_FAILED`
6651 ///
6652 ///# Safety
6653 ///- `device` (self) must be valid and not destroyed.
6654 ///
6655 ///# Panics
6656 ///Panics if `vkGetMemoryWin32HandleNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6657 ///
6658 ///# Usage Notes
6659 ///
6660 ///Exports a Vulkan device memory allocation as a Win32 handle
6661 ///(HANDLE) for sharing with other APIs or processes. This is the
6662 ///legacy NV path; prefer `get_memory_win32_handle_khr` for new
6663 ///code.
6664 ///
6665 ///Requires `VK_NV_external_memory_win32`. Windows only.
6666 pub unsafe fn get_memory_win32_handle_nv(
6667 &self,
6668 memory: DeviceMemory,
6669 handle_type: ExternalMemoryHandleTypeFlagsNV,
6670 ) -> VkResult<isize> {
6671 let fp = self
6672 .commands()
6673 .get_memory_win32_handle_nv
6674 .expect("vkGetMemoryWin32HandleNV not loaded");
6675 let mut out = unsafe { core::mem::zeroed() };
6676 check(unsafe { fp(self.handle(), memory, handle_type, &mut out) })?;
6677 Ok(out)
6678 }
6679 ///Wraps [`vkCmdExecuteGeneratedCommandsNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdExecuteGeneratedCommandsNV.html).
6680 /**
6681 Provided by **VK_NV_device_generated_commands**.*/
6682 ///
6683 ///# Safety
6684 ///- `commandBuffer` (self) must be valid and not destroyed.
6685 ///- `commandBuffer` must be externally synchronized.
6686 ///
6687 ///# Panics
6688 ///Panics if `vkCmdExecuteGeneratedCommandsNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6689 ///
6690 ///# Usage Notes
6691 ///
6692 ///Executes commands that were generated on the GPU. If
6693 ///`is_preprocessed` is set, the commands must have been
6694 ///preprocessed with `cmd_preprocess_generated_commands_nv` first.
6695 ///
6696 ///Requires `VK_NV_device_generated_commands`.
6697 pub unsafe fn cmd_execute_generated_commands_nv(
6698 &self,
6699 command_buffer: CommandBuffer,
6700 is_preprocessed: bool,
6701 p_generated_commands_info: &GeneratedCommandsInfoNV,
6702 ) {
6703 let fp = self
6704 .commands()
6705 .cmd_execute_generated_commands_nv
6706 .expect("vkCmdExecuteGeneratedCommandsNV not loaded");
6707 unsafe {
6708 fp(
6709 command_buffer,
6710 is_preprocessed as u32,
6711 p_generated_commands_info,
6712 )
6713 };
6714 }
6715 ///Wraps [`vkCmdPreprocessGeneratedCommandsNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPreprocessGeneratedCommandsNV.html).
6716 /**
6717 Provided by **VK_NV_device_generated_commands**.*/
6718 ///
6719 ///# Safety
6720 ///- `commandBuffer` (self) must be valid and not destroyed.
6721 ///- `commandBuffer` must be externally synchronized.
6722 ///
6723 ///# Panics
6724 ///Panics if `vkCmdPreprocessGeneratedCommandsNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6725 ///
6726 ///# Usage Notes
6727 ///
6728 ///Preprocesses device-generated commands into a form suitable for
6729 ///fast execution. The preprocessing result is stored in a
6730 ///preprocess buffer and later consumed by
6731 ///`cmd_execute_generated_commands_nv` with `is_preprocessed` set.
6732 ///
6733 ///Requires `VK_NV_device_generated_commands`.
6734 pub unsafe fn cmd_preprocess_generated_commands_nv(
6735 &self,
6736 command_buffer: CommandBuffer,
6737 p_generated_commands_info: &GeneratedCommandsInfoNV,
6738 ) {
6739 let fp = self
6740 .commands()
6741 .cmd_preprocess_generated_commands_nv
6742 .expect("vkCmdPreprocessGeneratedCommandsNV not loaded");
6743 unsafe { fp(command_buffer, p_generated_commands_info) };
6744 }
6745 ///Wraps [`vkCmdBindPipelineShaderGroupNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindPipelineShaderGroupNV.html).
6746 /**
6747 Provided by **VK_NV_device_generated_commands**.*/
6748 ///
6749 ///# Safety
6750 ///- `commandBuffer` (self) must be valid and not destroyed.
6751 ///- `commandBuffer` must be externally synchronized.
6752 ///
6753 ///# Panics
6754 ///Panics if `vkCmdBindPipelineShaderGroupNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6755 ///
6756 ///# Usage Notes
6757 ///
6758 ///Binds a shader group from a pipeline that was created with
6759 ///multiple shader groups. Used with device-generated commands to
6760 ///switch between pre-compiled shader variants without rebinding
6761 ///the entire pipeline.
6762 ///
6763 ///Requires `VK_NV_device_generated_commands`.
6764 pub unsafe fn cmd_bind_pipeline_shader_group_nv(
6765 &self,
6766 command_buffer: CommandBuffer,
6767 pipeline_bind_point: PipelineBindPoint,
6768 pipeline: Pipeline,
6769 group_index: u32,
6770 ) {
6771 let fp = self
6772 .commands()
6773 .cmd_bind_pipeline_shader_group_nv
6774 .expect("vkCmdBindPipelineShaderGroupNV not loaded");
6775 unsafe { fp(command_buffer, pipeline_bind_point, pipeline, group_index) };
6776 }
6777 ///Wraps [`vkGetGeneratedCommandsMemoryRequirementsNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetGeneratedCommandsMemoryRequirementsNV.html).
6778 /**
6779 Provided by **VK_NV_device_generated_commands**.*/
6780 ///
6781 ///# Safety
6782 ///- `device` (self) must be valid and not destroyed.
6783 ///
6784 ///# Panics
6785 ///Panics if `vkGetGeneratedCommandsMemoryRequirementsNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6786 ///
6787 ///# Usage Notes
6788 ///
6789 ///Queries the memory requirements for preprocessing device-generated
6790 ///commands. The returned size determines how large the preprocess
6791 ///buffer must be for `cmd_preprocess_generated_commands_nv`.
6792 ///
6793 ///Requires `VK_NV_device_generated_commands`.
6794 pub unsafe fn get_generated_commands_memory_requirements_nv(
6795 &self,
6796 p_info: &GeneratedCommandsMemoryRequirementsInfoNV,
6797 p_memory_requirements: &mut MemoryRequirements2,
6798 ) {
6799 let fp = self
6800 .commands()
6801 .get_generated_commands_memory_requirements_nv
6802 .expect("vkGetGeneratedCommandsMemoryRequirementsNV not loaded");
6803 unsafe { fp(self.handle(), p_info, p_memory_requirements) };
6804 }
6805 ///Wraps [`vkCreateIndirectCommandsLayoutNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateIndirectCommandsLayoutNV.html).
6806 /**
6807 Provided by **VK_NV_device_generated_commands**.*/
6808 ///
6809 ///# Errors
6810 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6811 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
6812 ///- `VK_ERROR_UNKNOWN`
6813 ///- `VK_ERROR_VALIDATION_FAILED`
6814 ///
6815 ///# Safety
6816 ///- `device` (self) must be valid and not destroyed.
6817 ///
6818 ///# Panics
6819 ///Panics if `vkCreateIndirectCommandsLayoutNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6820 ///
6821 ///# Usage Notes
6822 ///
6823 ///Creates a layout that describes the structure of indirect command
6824 ///sequences for device-generated commands. The layout defines which
6825 ///tokens (draw, dispatch, push constants, etc.) appear in the
6826 ///command stream and their order.
6827 ///
6828 ///Destroy with `destroy_indirect_commands_layout_nv`.
6829 ///
6830 ///Requires `VK_NV_device_generated_commands`.
6831 pub unsafe fn create_indirect_commands_layout_nv(
6832 &self,
6833 p_create_info: &IndirectCommandsLayoutCreateInfoNV,
6834 allocator: Option<&AllocationCallbacks>,
6835 ) -> VkResult<IndirectCommandsLayoutNV> {
6836 let fp = self
6837 .commands()
6838 .create_indirect_commands_layout_nv
6839 .expect("vkCreateIndirectCommandsLayoutNV not loaded");
6840 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
6841 let mut out = unsafe { core::mem::zeroed() };
6842 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
6843 Ok(out)
6844 }
6845 ///Wraps [`vkDestroyIndirectCommandsLayoutNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyIndirectCommandsLayoutNV.html).
6846 /**
6847 Provided by **VK_NV_device_generated_commands**.*/
6848 ///
6849 ///# Safety
6850 ///- `device` (self) must be valid and not destroyed.
6851 ///- `indirectCommandsLayout` must be externally synchronized.
6852 ///
6853 ///# Panics
6854 ///Panics if `vkDestroyIndirectCommandsLayoutNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6855 ///
6856 ///# Usage Notes
6857 ///
6858 ///Destroys an indirect commands layout created with
6859 ///`create_indirect_commands_layout_nv`.
6860 ///
6861 ///Requires `VK_NV_device_generated_commands`.
6862 pub unsafe fn destroy_indirect_commands_layout_nv(
6863 &self,
6864 indirect_commands_layout: IndirectCommandsLayoutNV,
6865 allocator: Option<&AllocationCallbacks>,
6866 ) {
6867 let fp = self
6868 .commands()
6869 .destroy_indirect_commands_layout_nv
6870 .expect("vkDestroyIndirectCommandsLayoutNV not loaded");
6871 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
6872 unsafe { fp(self.handle(), indirect_commands_layout, alloc_ptr) };
6873 }
6874 ///Wraps [`vkCmdExecuteGeneratedCommandsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdExecuteGeneratedCommandsEXT.html).
6875 /**
6876 Provided by **VK_EXT_device_generated_commands**.*/
6877 ///
6878 ///# Safety
6879 ///- `commandBuffer` (self) must be valid and not destroyed.
6880 ///- `commandBuffer` must be externally synchronized.
6881 ///
6882 ///# Panics
6883 ///Panics if `vkCmdExecuteGeneratedCommandsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6884 ///
6885 ///# Usage Notes
6886 ///
6887 ///Executes commands generated on the GPU from an indirect commands
6888 ///layout. The `GeneratedCommandsInfoEXT` specifies the indirect
6889 ///commands layout, pipeline/shader objects, and the buffer
6890 ///containing the generated command data.
6891 ///
6892 ///If `is_preprocessed` is true, the command data was prepared by
6893 ///a prior `cmd_preprocess_generated_commands_ext` call. Otherwise,
6894 ///preprocessing and execution happen in one step.
6895 ///
6896 ///Requires `VK_EXT_device_generated_commands`.
6897 pub unsafe fn cmd_execute_generated_commands_ext(
6898 &self,
6899 command_buffer: CommandBuffer,
6900 is_preprocessed: bool,
6901 p_generated_commands_info: &GeneratedCommandsInfoEXT,
6902 ) {
6903 let fp = self
6904 .commands()
6905 .cmd_execute_generated_commands_ext
6906 .expect("vkCmdExecuteGeneratedCommandsEXT not loaded");
6907 unsafe {
6908 fp(
6909 command_buffer,
6910 is_preprocessed as u32,
6911 p_generated_commands_info,
6912 )
6913 };
6914 }
6915 ///Wraps [`vkCmdPreprocessGeneratedCommandsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPreprocessGeneratedCommandsEXT.html).
6916 /**
6917 Provided by **VK_EXT_device_generated_commands**.*/
6918 ///
6919 ///# Safety
6920 ///- `commandBuffer` (self) must be valid and not destroyed.
6921 ///- `commandBuffer` must be externally synchronized.
6922 ///- `stateCommandBuffer` must be externally synchronized.
6923 ///
6924 ///# Panics
6925 ///Panics if `vkCmdPreprocessGeneratedCommandsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6926 ///
6927 ///# Usage Notes
6928 ///
6929 ///Preprocesses device-generated commands into an intermediate
6930 ///format. This can be done in a separate command buffer or pass,
6931 ///then executed later with `cmd_execute_generated_commands_ext`
6932 ///(with `is_preprocessed` = true).
6933 ///
6934 ///Separating preprocessing from execution allows overlapping the
6935 ///preprocessing work with other GPU tasks.
6936 ///
6937 ///Requires `VK_EXT_device_generated_commands`.
6938 pub unsafe fn cmd_preprocess_generated_commands_ext(
6939 &self,
6940 command_buffer: CommandBuffer,
6941 p_generated_commands_info: &GeneratedCommandsInfoEXT,
6942 state_command_buffer: CommandBuffer,
6943 ) {
6944 let fp = self
6945 .commands()
6946 .cmd_preprocess_generated_commands_ext
6947 .expect("vkCmdPreprocessGeneratedCommandsEXT not loaded");
6948 unsafe {
6949 fp(
6950 command_buffer,
6951 p_generated_commands_info,
6952 state_command_buffer,
6953 )
6954 };
6955 }
6956 ///Wraps [`vkGetGeneratedCommandsMemoryRequirementsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetGeneratedCommandsMemoryRequirementsEXT.html).
6957 /**
6958 Provided by **VK_EXT_device_generated_commands**.*/
6959 ///
6960 ///# Safety
6961 ///- `device` (self) must be valid and not destroyed.
6962 ///
6963 ///# Panics
6964 ///Panics if `vkGetGeneratedCommandsMemoryRequirementsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
6965 ///
6966 ///# Usage Notes
6967 ///
6968 ///Queries the memory requirements for preprocessing and executing
6969 ///device-generated commands. Returns a `MemoryRequirements2` with
6970 ///the size and alignment needed for the preprocess buffer.
6971 ///
6972 ///Call this before allocating the preprocess buffer used by
6973 ///`cmd_preprocess_generated_commands_ext` and
6974 ///`cmd_execute_generated_commands_ext`.
6975 ///
6976 ///Requires `VK_EXT_device_generated_commands`.
6977 pub unsafe fn get_generated_commands_memory_requirements_ext(
6978 &self,
6979 p_info: &GeneratedCommandsMemoryRequirementsInfoEXT,
6980 p_memory_requirements: &mut MemoryRequirements2,
6981 ) {
6982 let fp = self
6983 .commands()
6984 .get_generated_commands_memory_requirements_ext
6985 .expect("vkGetGeneratedCommandsMemoryRequirementsEXT not loaded");
6986 unsafe { fp(self.handle(), p_info, p_memory_requirements) };
6987 }
6988 ///Wraps [`vkCreateIndirectCommandsLayoutEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateIndirectCommandsLayoutEXT.html).
6989 /**
6990 Provided by **VK_EXT_device_generated_commands**.*/
6991 ///
6992 ///# Errors
6993 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
6994 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
6995 ///- `VK_ERROR_UNKNOWN`
6996 ///- `VK_ERROR_VALIDATION_FAILED`
6997 ///
6998 ///# Safety
6999 ///- `device` (self) must be valid and not destroyed.
7000 ///
7001 ///# Panics
7002 ///Panics if `vkCreateIndirectCommandsLayoutEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7003 ///
7004 ///# Usage Notes
7005 ///
7006 ///Creates an indirect commands layout that defines the structure of
7007 ///GPU-generated command sequences. Each token in the layout
7008 ///describes one command element (draw, dispatch, push constant,
7009 ///vertex buffer bind, index buffer bind, etc.).
7010 ///
7011 ///The layout is used with `cmd_execute_generated_commands_ext`.
7012 ///
7013 ///Destroy with `destroy_indirect_commands_layout_ext`.
7014 ///
7015 ///Requires `VK_EXT_device_generated_commands`.
7016 pub unsafe fn create_indirect_commands_layout_ext(
7017 &self,
7018 p_create_info: &IndirectCommandsLayoutCreateInfoEXT,
7019 allocator: Option<&AllocationCallbacks>,
7020 ) -> VkResult<IndirectCommandsLayoutEXT> {
7021 let fp = self
7022 .commands()
7023 .create_indirect_commands_layout_ext
7024 .expect("vkCreateIndirectCommandsLayoutEXT not loaded");
7025 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
7026 let mut out = unsafe { core::mem::zeroed() };
7027 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
7028 Ok(out)
7029 }
7030 ///Wraps [`vkDestroyIndirectCommandsLayoutEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyIndirectCommandsLayoutEXT.html).
7031 /**
7032 Provided by **VK_EXT_device_generated_commands**.*/
7033 ///
7034 ///# Safety
7035 ///- `device` (self) must be valid and not destroyed.
7036 ///- `indirectCommandsLayout` must be externally synchronized.
7037 ///
7038 ///# Panics
7039 ///Panics if `vkDestroyIndirectCommandsLayoutEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7040 ///
7041 ///# Usage Notes
7042 ///
7043 ///Destroys an indirect commands layout created with
7044 ///`create_indirect_commands_layout_ext`.
7045 ///
7046 ///Requires `VK_EXT_device_generated_commands`.
7047 pub unsafe fn destroy_indirect_commands_layout_ext(
7048 &self,
7049 indirect_commands_layout: IndirectCommandsLayoutEXT,
7050 allocator: Option<&AllocationCallbacks>,
7051 ) {
7052 let fp = self
7053 .commands()
7054 .destroy_indirect_commands_layout_ext
7055 .expect("vkDestroyIndirectCommandsLayoutEXT not loaded");
7056 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
7057 unsafe { fp(self.handle(), indirect_commands_layout, alloc_ptr) };
7058 }
7059 ///Wraps [`vkCreateIndirectExecutionSetEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateIndirectExecutionSetEXT.html).
7060 /**
7061 Provided by **VK_EXT_device_generated_commands**.*/
7062 ///
7063 ///# Errors
7064 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7065 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
7066 ///- `VK_ERROR_UNKNOWN`
7067 ///- `VK_ERROR_VALIDATION_FAILED`
7068 ///
7069 ///# Safety
7070 ///- `device` (self) must be valid and not destroyed.
7071 ///
7072 ///# Panics
7073 ///Panics if `vkCreateIndirectExecutionSetEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7074 ///
7075 ///# Usage Notes
7076 ///
7077 ///Creates an indirect execution set, a table of pipelines or
7078 ///shader objects that can be indexed at execution time by
7079 ///device-generated commands.
7080 ///
7081 ///The GPU selects which pipeline/shader to use based on an index
7082 ///in the generated command stream, enabling fully GPU-driven
7083 ///material/shader selection.
7084 ///
7085 ///Destroy with `destroy_indirect_execution_set_ext`.
7086 ///
7087 ///Requires `VK_EXT_device_generated_commands`.
7088 pub unsafe fn create_indirect_execution_set_ext(
7089 &self,
7090 p_create_info: &IndirectExecutionSetCreateInfoEXT,
7091 allocator: Option<&AllocationCallbacks>,
7092 ) -> VkResult<IndirectExecutionSetEXT> {
7093 let fp = self
7094 .commands()
7095 .create_indirect_execution_set_ext
7096 .expect("vkCreateIndirectExecutionSetEXT not loaded");
7097 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
7098 let mut out = unsafe { core::mem::zeroed() };
7099 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
7100 Ok(out)
7101 }
7102 ///Wraps [`vkDestroyIndirectExecutionSetEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyIndirectExecutionSetEXT.html).
7103 /**
7104 Provided by **VK_EXT_device_generated_commands**.*/
7105 ///
7106 ///# Safety
7107 ///- `device` (self) must be valid and not destroyed.
7108 ///- `indirectExecutionSet` must be externally synchronized.
7109 ///
7110 ///# Panics
7111 ///Panics if `vkDestroyIndirectExecutionSetEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7112 ///
7113 ///# Usage Notes
7114 ///
7115 ///Destroys an indirect execution set created with
7116 ///`create_indirect_execution_set_ext`.
7117 ///
7118 ///Requires `VK_EXT_device_generated_commands`.
7119 pub unsafe fn destroy_indirect_execution_set_ext(
7120 &self,
7121 indirect_execution_set: IndirectExecutionSetEXT,
7122 allocator: Option<&AllocationCallbacks>,
7123 ) {
7124 let fp = self
7125 .commands()
7126 .destroy_indirect_execution_set_ext
7127 .expect("vkDestroyIndirectExecutionSetEXT not loaded");
7128 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
7129 unsafe { fp(self.handle(), indirect_execution_set, alloc_ptr) };
7130 }
7131 ///Wraps [`vkUpdateIndirectExecutionSetPipelineEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkUpdateIndirectExecutionSetPipelineEXT.html).
7132 /**
7133 Provided by **VK_EXT_device_generated_commands**.*/
7134 ///
7135 ///# Safety
7136 ///- `device` (self) must be valid and not destroyed.
7137 ///- `indirectExecutionSet` must be externally synchronized.
7138 ///
7139 ///# Panics
7140 ///Panics if `vkUpdateIndirectExecutionSetPipelineEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7141 ///
7142 ///# Usage Notes
7143 ///
7144 ///Updates entries in an indirect execution set that holds pipelines.
7145 ///Each `WriteIndirectExecutionSetPipelineEXT` maps an index to a
7146 ///pipeline handle.
7147 ///
7148 ///The pipelines must be compatible with the initial pipeline used
7149 ///to create the execution set.
7150 ///
7151 ///Requires `VK_EXT_device_generated_commands`.
7152 pub unsafe fn update_indirect_execution_set_pipeline_ext(
7153 &self,
7154 indirect_execution_set: IndirectExecutionSetEXT,
7155 p_execution_set_writes: &[WriteIndirectExecutionSetPipelineEXT],
7156 ) {
7157 let fp = self
7158 .commands()
7159 .update_indirect_execution_set_pipeline_ext
7160 .expect("vkUpdateIndirectExecutionSetPipelineEXT not loaded");
7161 unsafe {
7162 fp(
7163 self.handle(),
7164 indirect_execution_set,
7165 p_execution_set_writes.len() as u32,
7166 p_execution_set_writes.as_ptr(),
7167 )
7168 };
7169 }
7170 ///Wraps [`vkUpdateIndirectExecutionSetShaderEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkUpdateIndirectExecutionSetShaderEXT.html).
7171 /**
7172 Provided by **VK_EXT_device_generated_commands**.*/
7173 ///
7174 ///# Safety
7175 ///- `device` (self) must be valid and not destroyed.
7176 ///- `indirectExecutionSet` must be externally synchronized.
7177 ///
7178 ///# Panics
7179 ///Panics if `vkUpdateIndirectExecutionSetShaderEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7180 ///
7181 ///# Usage Notes
7182 ///
7183 ///Updates entries in an indirect execution set that holds shader
7184 ///objects. Each `WriteIndirectExecutionSetShaderEXT` maps an index
7185 ///to a shader object handle.
7186 ///
7187 ///The shaders must be compatible with the initial shader used to
7188 ///create the execution set.
7189 ///
7190 ///Requires `VK_EXT_device_generated_commands`.
7191 pub unsafe fn update_indirect_execution_set_shader_ext(
7192 &self,
7193 indirect_execution_set: IndirectExecutionSetEXT,
7194 p_execution_set_writes: &[WriteIndirectExecutionSetShaderEXT],
7195 ) {
7196 let fp = self
7197 .commands()
7198 .update_indirect_execution_set_shader_ext
7199 .expect("vkUpdateIndirectExecutionSetShaderEXT not loaded");
7200 unsafe {
7201 fp(
7202 self.handle(),
7203 indirect_execution_set,
7204 p_execution_set_writes.len() as u32,
7205 p_execution_set_writes.as_ptr(),
7206 )
7207 };
7208 }
7209 ///Wraps [`vkCmdPushDescriptorSet`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPushDescriptorSet.html).
7210 /**
7211 Provided by **VK_COMPUTE_VERSION_1_4**.*/
7212 ///
7213 ///# Safety
7214 ///- `commandBuffer` (self) must be valid and not destroyed.
7215 ///- `commandBuffer` must be externally synchronized.
7216 ///
7217 ///# Panics
7218 ///Panics if `vkCmdPushDescriptorSet` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7219 ///
7220 ///# Usage Notes
7221 ///
7222 ///Pushes descriptor updates directly into the command buffer without
7223 ///allocating a descriptor set from a pool. The descriptors are embedded
7224 ///in the command stream and only live for the duration of the current
7225 ///command buffer recording.
7226 ///
7227 ///**Advantages**:
7228 ///
7229 ///- No descriptor pool allocation or management.
7230 ///- No need to track descriptor set lifetimes.
7231 ///- Ideal for per-draw data that changes every frame.
7232 ///
7233 ///**Trade-offs**:
7234 ///
7235 ///- Inflates command buffer size (descriptors are stored inline).
7236 ///- Not suitable for large descriptor sets, use conventional
7237 /// allocated sets for sets with many bindings.
7238 ///
7239 ///The pipeline layout must have been created with
7240 ///`DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR` on the target set
7241 ///index.
7242 ///
7243 ///Core in Vulkan 1.4. Previously available via `VK_KHR_push_descriptor`.
7244 pub unsafe fn cmd_push_descriptor_set(
7245 &self,
7246 command_buffer: CommandBuffer,
7247 pipeline_bind_point: PipelineBindPoint,
7248 layout: PipelineLayout,
7249 set: u32,
7250 p_descriptor_writes: &[WriteDescriptorSet],
7251 ) {
7252 let fp = self
7253 .commands()
7254 .cmd_push_descriptor_set
7255 .expect("vkCmdPushDescriptorSet not loaded");
7256 unsafe {
7257 fp(
7258 command_buffer,
7259 pipeline_bind_point,
7260 layout,
7261 set,
7262 p_descriptor_writes.len() as u32,
7263 p_descriptor_writes.as_ptr(),
7264 )
7265 };
7266 }
7267 ///Wraps [`vkTrimCommandPool`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkTrimCommandPool.html).
7268 /**
7269 Provided by **VK_BASE_VERSION_1_1**.*/
7270 ///
7271 ///# Safety
7272 ///- `device` (self) must be valid and not destroyed.
7273 ///- `commandPool` must be externally synchronized.
7274 ///
7275 ///# Panics
7276 ///Panics if `vkTrimCommandPool` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7277 ///
7278 ///# Usage Notes
7279 ///
7280 ///Returns unused memory from a command pool back to the system. This
7281 ///is a hint to the driver, it may or may not actually release memory.
7282 ///
7283 ///Call this after a period of high command buffer allocation followed
7284 ///by a return to lower usage (e.g. after loading screens or level
7285 ///transitions). It does not affect any allocated command buffers.
7286 ///
7287 ///Unlike `reset_command_pool`, trimming does not reset or invalidate
7288 ///command buffers. It only reclaims excess internal memory that the
7289 ///pool pre-allocated.
7290 ///
7291 ///In a steady-state frame loop where you reset the pool every frame,
7292 ///trimming is unnecessary, the pool reuses its memory naturally.
7293 pub unsafe fn trim_command_pool(&self, command_pool: CommandPool, flags: CommandPoolTrimFlags) {
7294 let fp = self
7295 .commands()
7296 .trim_command_pool
7297 .expect("vkTrimCommandPool not loaded");
7298 unsafe { fp(self.handle(), command_pool, flags) };
7299 }
7300 ///Wraps [`vkGetMemoryWin32HandleKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryWin32HandleKHR.html).
7301 /**
7302 Provided by **VK_KHR_external_memory_win32**.*/
7303 ///
7304 ///# Errors
7305 ///- `VK_ERROR_TOO_MANY_OBJECTS`
7306 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7307 ///- `VK_ERROR_UNKNOWN`
7308 ///- `VK_ERROR_VALIDATION_FAILED`
7309 ///
7310 ///# Safety
7311 ///- `device` (self) must be valid and not destroyed.
7312 ///
7313 ///# Panics
7314 ///Panics if `vkGetMemoryWin32HandleKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7315 ///
7316 ///# Usage Notes
7317 ///
7318 ///Exports a device memory allocation as a Windows HANDLE. The
7319 ///handle can be shared with other processes or APIs (D3D12, CUDA)
7320 ///for GPU memory interop.
7321 ///
7322 ///`MemoryGetWin32HandleInfoKHR` specifies the `DeviceMemory` and
7323 ///handle type (`OPAQUE_WIN32` or `OPAQUE_WIN32_KMT`).
7324 ///
7325 ///For `OPAQUE_WIN32`, the handle must be closed with `CloseHandle`
7326 ///when done. `OPAQUE_WIN32_KMT` handles are kernel-managed and do
7327 ///not need explicit cleanup.
7328 ///
7329 ///Windows only. Use `get_memory_fd_khr` on Linux.
7330 pub unsafe fn get_memory_win32_handle_khr(
7331 &self,
7332 p_get_win32_handle_info: &MemoryGetWin32HandleInfoKHR,
7333 ) -> VkResult<isize> {
7334 let fp = self
7335 .commands()
7336 .get_memory_win32_handle_khr
7337 .expect("vkGetMemoryWin32HandleKHR not loaded");
7338 let mut out = unsafe { core::mem::zeroed() };
7339 check(unsafe { fp(self.handle(), p_get_win32_handle_info, &mut out) })?;
7340 Ok(out)
7341 }
7342 ///Wraps [`vkGetMemoryWin32HandlePropertiesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryWin32HandlePropertiesKHR.html).
7343 /**
7344 Provided by **VK_KHR_external_memory_win32**.*/
7345 ///
7346 ///# Errors
7347 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7348 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
7349 ///- `VK_ERROR_UNKNOWN`
7350 ///- `VK_ERROR_VALIDATION_FAILED`
7351 ///
7352 ///# Safety
7353 ///- `device` (self) must be valid and not destroyed.
7354 ///
7355 ///# Panics
7356 ///Panics if `vkGetMemoryWin32HandlePropertiesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7357 ///
7358 ///# Usage Notes
7359 ///
7360 ///Queries which memory types are compatible with an external
7361 ///Windows HANDLE. Use this when importing memory from a handle
7362 ///received from another process or API (e.g., D3D11 shared
7363 ///textures).
7364 ///
7365 ///Returns `MemoryWin32HandlePropertiesKHR` with `memory_type_bits`
7366 ///indicating compatible memory type indices for import.
7367 ///
7368 ///Not valid for `OPAQUE_WIN32` or `OPAQUE_WIN32_KMT` handle types,
7369 ///those have their memory type determined by the exporting
7370 ///allocation.
7371 pub unsafe fn get_memory_win32_handle_properties_khr(
7372 &self,
7373 handle_type: ExternalMemoryHandleTypeFlagBits,
7374 handle: isize,
7375 p_memory_win32_handle_properties: &mut MemoryWin32HandlePropertiesKHR,
7376 ) -> VkResult<()> {
7377 let fp = self
7378 .commands()
7379 .get_memory_win32_handle_properties_khr
7380 .expect("vkGetMemoryWin32HandlePropertiesKHR not loaded");
7381 check(unsafe {
7382 fp(
7383 self.handle(),
7384 handle_type,
7385 handle,
7386 p_memory_win32_handle_properties,
7387 )
7388 })
7389 }
7390 ///Wraps [`vkGetMemoryFdKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryFdKHR.html).
7391 /**
7392 Provided by **VK_KHR_external_memory_fd**.*/
7393 ///
7394 ///# Errors
7395 ///- `VK_ERROR_TOO_MANY_OBJECTS`
7396 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7397 ///- `VK_ERROR_UNKNOWN`
7398 ///- `VK_ERROR_VALIDATION_FAILED`
7399 ///
7400 ///# Safety
7401 ///- `device` (self) must be valid and not destroyed.
7402 ///
7403 ///# Panics
7404 ///Panics if `vkGetMemoryFdKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7405 ///
7406 ///# Usage Notes
7407 ///
7408 ///Exports a device memory allocation as a POSIX file descriptor.
7409 ///The fd can be sent to another process (via Unix domain sockets)
7410 ///or another Vulkan device to share GPU memory.
7411 ///
7412 ///`MemoryGetFdInfoKHR` specifies the `DeviceMemory` and the handle
7413 ///type (`OPAQUE_FD` or `DMA_BUF`). The memory must have been
7414 ///allocated with `ExportMemoryAllocateInfo` requesting the
7415 ///corresponding handle type.
7416 ///
7417 ///The caller owns the returned fd and must close it when done.
7418 ///Each call returns a new fd, duplicates are independent.
7419 ///
7420 ///Linux/Android only. Use `get_memory_win32_handle_khr` on Windows.
7421 pub unsafe fn get_memory_fd_khr(
7422 &self,
7423 p_get_fd_info: &MemoryGetFdInfoKHR,
7424 ) -> VkResult<core::ffi::c_int> {
7425 let fp = self
7426 .commands()
7427 .get_memory_fd_khr
7428 .expect("vkGetMemoryFdKHR not loaded");
7429 let mut out = unsafe { core::mem::zeroed() };
7430 check(unsafe { fp(self.handle(), p_get_fd_info, &mut out) })?;
7431 Ok(out)
7432 }
7433 ///Wraps [`vkGetMemoryFdPropertiesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryFdPropertiesKHR.html).
7434 /**
7435 Provided by **VK_KHR_external_memory_fd**.*/
7436 ///
7437 ///# Errors
7438 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7439 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
7440 ///- `VK_ERROR_UNKNOWN`
7441 ///- `VK_ERROR_VALIDATION_FAILED`
7442 ///
7443 ///# Safety
7444 ///- `device` (self) must be valid and not destroyed.
7445 ///
7446 ///# Panics
7447 ///Panics if `vkGetMemoryFdPropertiesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7448 ///
7449 ///# Usage Notes
7450 ///
7451 ///Queries which memory types are compatible with an external file
7452 ///descriptor. Use this when importing memory from an fd received
7453 ///from another process or API.
7454 ///
7455 ///Returns `MemoryFdPropertiesKHR` with a `memory_type_bits` bitmask
7456 ///indicating which memory type indices can be used when allocating
7457 ///memory to import this fd.
7458 ///
7459 ///Only valid for `DMA_BUF` handle types. `OPAQUE_FD` handles don't
7460 ///need this query, their memory type is determined by the
7461 ///exporting allocation.
7462 pub unsafe fn get_memory_fd_properties_khr(
7463 &self,
7464 handle_type: ExternalMemoryHandleTypeFlagBits,
7465 fd: core::ffi::c_int,
7466 p_memory_fd_properties: &mut MemoryFdPropertiesKHR,
7467 ) -> VkResult<()> {
7468 let fp = self
7469 .commands()
7470 .get_memory_fd_properties_khr
7471 .expect("vkGetMemoryFdPropertiesKHR not loaded");
7472 check(unsafe { fp(self.handle(), handle_type, fd, p_memory_fd_properties) })
7473 }
7474 ///Wraps [`vkGetMemoryZirconHandleFUCHSIA`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryZirconHandleFUCHSIA.html).
7475 /**
7476 Provided by **VK_FUCHSIA_external_memory**.*/
7477 ///
7478 ///# Errors
7479 ///- `VK_ERROR_TOO_MANY_OBJECTS`
7480 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7481 ///- `VK_ERROR_UNKNOWN`
7482 ///- `VK_ERROR_VALIDATION_FAILED`
7483 ///
7484 ///# Safety
7485 ///- `device` (self) must be valid and not destroyed.
7486 ///
7487 ///# Panics
7488 ///Panics if `vkGetMemoryZirconHandleFUCHSIA` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7489 ///
7490 ///# Usage Notes
7491 ///
7492 ///Exports a Vulkan device memory allocation as a Fuchsia Zircon
7493 ///VMO handle. The returned handle can be shared with other Fuchsia
7494 ///processes. Fuchsia OS only.
7495 ///
7496 ///Requires `VK_FUCHSIA_external_memory`.
7497 pub unsafe fn get_memory_zircon_handle_fuchsia(
7498 &self,
7499 p_get_zircon_handle_info: &MemoryGetZirconHandleInfoFUCHSIA,
7500 ) -> VkResult<u32> {
7501 let fp = self
7502 .commands()
7503 .get_memory_zircon_handle_fuchsia
7504 .expect("vkGetMemoryZirconHandleFUCHSIA not loaded");
7505 let mut out = unsafe { core::mem::zeroed() };
7506 check(unsafe { fp(self.handle(), p_get_zircon_handle_info, &mut out) })?;
7507 Ok(out)
7508 }
7509 ///Wraps [`vkGetMemoryZirconHandlePropertiesFUCHSIA`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryZirconHandlePropertiesFUCHSIA.html).
7510 /**
7511 Provided by **VK_FUCHSIA_external_memory**.*/
7512 ///
7513 ///# Errors
7514 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
7515 ///- `VK_ERROR_UNKNOWN`
7516 ///- `VK_ERROR_VALIDATION_FAILED`
7517 ///
7518 ///# Safety
7519 ///- `device` (self) must be valid and not destroyed.
7520 ///
7521 ///# Panics
7522 ///Panics if `vkGetMemoryZirconHandlePropertiesFUCHSIA` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7523 ///
7524 ///# Usage Notes
7525 ///
7526 ///Queries the memory properties (compatible memory type bits) for
7527 ///a Zircon VMO handle. Use before importing external memory to
7528 ///determine which memory type to allocate. Fuchsia OS only.
7529 ///
7530 ///Requires `VK_FUCHSIA_external_memory`.
7531 pub unsafe fn get_memory_zircon_handle_properties_fuchsia(
7532 &self,
7533 handle_type: ExternalMemoryHandleTypeFlagBits,
7534 zircon_handle: u32,
7535 p_memory_zircon_handle_properties: &mut MemoryZirconHandlePropertiesFUCHSIA,
7536 ) -> VkResult<()> {
7537 let fp = self
7538 .commands()
7539 .get_memory_zircon_handle_properties_fuchsia
7540 .expect("vkGetMemoryZirconHandlePropertiesFUCHSIA not loaded");
7541 check(unsafe {
7542 fp(
7543 self.handle(),
7544 handle_type,
7545 zircon_handle,
7546 p_memory_zircon_handle_properties,
7547 )
7548 })
7549 }
7550 ///Wraps [`vkGetMemoryRemoteAddressNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryRemoteAddressNV.html).
7551 /**
7552 Provided by **VK_NV_external_memory_rdma**.*/
7553 ///
7554 ///# Errors
7555 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
7556 ///- `VK_ERROR_UNKNOWN`
7557 ///- `VK_ERROR_VALIDATION_FAILED`
7558 ///
7559 ///# Safety
7560 ///- `device` (self) must be valid and not destroyed.
7561 ///
7562 ///# Panics
7563 ///Panics if `vkGetMemoryRemoteAddressNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7564 ///
7565 ///# Usage Notes
7566 ///
7567 ///Retrieves a remote device address for a Vulkan memory allocation,
7568 ///enabling RDMA (Remote Direct Memory Access) between devices. The
7569 ///returned address can be used by another device to directly access
7570 ///this memory over a high-speed interconnect.
7571 ///
7572 ///Requires `VK_NV_external_memory_rdma`.
7573 pub unsafe fn get_memory_remote_address_nv(
7574 &self,
7575 p_memory_get_remote_address_info: &MemoryGetRemoteAddressInfoNV,
7576 ) -> VkResult<*mut core::ffi::c_void> {
7577 let fp = self
7578 .commands()
7579 .get_memory_remote_address_nv
7580 .expect("vkGetMemoryRemoteAddressNV not loaded");
7581 let mut out = unsafe { core::mem::zeroed() };
7582 check(unsafe { fp(self.handle(), p_memory_get_remote_address_info, &mut out) })?;
7583 Ok(out)
7584 }
7585 ///Wraps [`vkGetMemorySciBufNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemorySciBufNV.html).
7586 ///
7587 ///# Errors
7588 ///- `VK_ERROR_INITIALIZATION_FAILED`
7589 ///- `VK_ERROR_UNKNOWN`
7590 ///- `VK_ERROR_VALIDATION_FAILED`
7591 ///
7592 ///# Safety
7593 ///- `device` (self) must be valid and not destroyed.
7594 ///
7595 ///# Panics
7596 ///Panics if `vkGetMemorySciBufNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7597 ///
7598 ///# Usage Notes
7599 ///
7600 ///Exports a Vulkan device memory allocation as a QNX SCI buffer
7601 ///for cross-process or cross-API sharing on QNX platforms.
7602 ///
7603 ///Requires `VK_NV_external_memory_sci_buf`. QNX only.
7604 pub unsafe fn get_memory_sci_buf_nv(
7605 &self,
7606 p_get_sci_buf_info: &MemoryGetSciBufInfoNV,
7607 ) -> VkResult<core::ffi::c_void> {
7608 let fp = self
7609 .commands()
7610 .get_memory_sci_buf_nv
7611 .expect("vkGetMemorySciBufNV not loaded");
7612 let mut out = unsafe { core::mem::zeroed() };
7613 check(unsafe { fp(self.handle(), p_get_sci_buf_info, &mut out) })?;
7614 Ok(out)
7615 }
7616 ///Wraps [`vkGetSemaphoreWin32HandleKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSemaphoreWin32HandleKHR.html).
7617 /**
7618 Provided by **VK_KHR_external_semaphore_win32**.*/
7619 ///
7620 ///# Errors
7621 ///- `VK_ERROR_TOO_MANY_OBJECTS`
7622 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7623 ///- `VK_ERROR_UNKNOWN`
7624 ///- `VK_ERROR_VALIDATION_FAILED`
7625 ///
7626 ///# Safety
7627 ///- `device` (self) must be valid and not destroyed.
7628 ///
7629 ///# Panics
7630 ///Panics if `vkGetSemaphoreWin32HandleKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7631 ///
7632 ///# Usage Notes
7633 ///
7634 ///Exports a semaphore's synchronization state as a Windows HANDLE.
7635 ///The handle can be shared with other processes or APIs for
7636 ///cross-process GPU synchronization.
7637 ///
7638 ///`SemaphoreGetWin32HandleInfoKHR` specifies the semaphore and
7639 ///handle type (`OPAQUE_WIN32`, `OPAQUE_WIN32_KMT`, or
7640 ///`D3D12_FENCE`).
7641 ///
7642 ///For `OPAQUE_WIN32` and `D3D12_FENCE`, close the handle with
7643 ///`CloseHandle` when done. `OPAQUE_WIN32_KMT` handles are
7644 ///kernel-managed.
7645 ///
7646 ///Windows only. Use `get_semaphore_fd_khr` on Linux.
7647 pub unsafe fn get_semaphore_win32_handle_khr(
7648 &self,
7649 p_get_win32_handle_info: &SemaphoreGetWin32HandleInfoKHR,
7650 ) -> VkResult<isize> {
7651 let fp = self
7652 .commands()
7653 .get_semaphore_win32_handle_khr
7654 .expect("vkGetSemaphoreWin32HandleKHR not loaded");
7655 let mut out = unsafe { core::mem::zeroed() };
7656 check(unsafe { fp(self.handle(), p_get_win32_handle_info, &mut out) })?;
7657 Ok(out)
7658 }
7659 ///Wraps [`vkImportSemaphoreWin32HandleKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkImportSemaphoreWin32HandleKHR.html).
7660 /**
7661 Provided by **VK_KHR_external_semaphore_win32**.*/
7662 ///
7663 ///# Errors
7664 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7665 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
7666 ///- `VK_ERROR_UNKNOWN`
7667 ///- `VK_ERROR_VALIDATION_FAILED`
7668 ///
7669 ///# Safety
7670 ///- `device` (self) must be valid and not destroyed.
7671 ///
7672 ///# Panics
7673 ///Panics if `vkImportSemaphoreWin32HandleKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7674 ///
7675 ///# Usage Notes
7676 ///
7677 ///Imports a synchronization payload from a Windows HANDLE into a
7678 ///semaphore. After import, the semaphore uses the external
7679 ///synchronization state.
7680 ///
7681 ///`ImportSemaphoreWin32HandleInfoKHR` specifies the target
7682 ///semaphore, handle type, handle (or name for named handles), and
7683 ///whether the import is temporary or permanent.
7684 ///
7685 ///The handle is duplicated internally, the caller retains
7686 ///ownership and should close it when no longer needed.
7687 ///
7688 ///Windows only. Use `import_semaphore_fd_khr` on Linux.
7689 pub unsafe fn import_semaphore_win32_handle_khr(
7690 &self,
7691 p_import_semaphore_win32_handle_info: &ImportSemaphoreWin32HandleInfoKHR,
7692 ) -> VkResult<()> {
7693 let fp = self
7694 .commands()
7695 .import_semaphore_win32_handle_khr
7696 .expect("vkImportSemaphoreWin32HandleKHR not loaded");
7697 check(unsafe { fp(self.handle(), p_import_semaphore_win32_handle_info) })
7698 }
7699 ///Wraps [`vkGetSemaphoreFdKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSemaphoreFdKHR.html).
7700 /**
7701 Provided by **VK_KHR_external_semaphore_fd**.*/
7702 ///
7703 ///# Errors
7704 ///- `VK_ERROR_TOO_MANY_OBJECTS`
7705 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7706 ///- `VK_ERROR_UNKNOWN`
7707 ///- `VK_ERROR_VALIDATION_FAILED`
7708 ///
7709 ///# Safety
7710 ///- `device` (self) must be valid and not destroyed.
7711 ///
7712 ///# Panics
7713 ///Panics if `vkGetSemaphoreFdKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7714 ///
7715 ///# Usage Notes
7716 ///
7717 ///Exports a semaphore's synchronization state as a POSIX file
7718 ///descriptor. The fd can be transferred to another process for
7719 ///cross-process GPU synchronization.
7720 ///
7721 ///`SemaphoreGetFdInfoKHR` specifies the semaphore and handle type
7722 ///(`OPAQUE_FD` or `SYNC_FD`). For `SYNC_FD`, the semaphore must
7723 ///be signaled or have a pending signal operation, exporting
7724 ///transfers ownership and resets the semaphore to unsignaled.
7725 ///
7726 ///The caller owns the returned fd. For `OPAQUE_FD`, each export
7727 ///creates a new reference. For `SYNC_FD`, the export is a
7728 ///move, the semaphore payload is transferred.
7729 ///
7730 ///Linux/Android only. Use `get_semaphore_win32_handle_khr` on
7731 ///Windows.
7732 pub unsafe fn get_semaphore_fd_khr(
7733 &self,
7734 p_get_fd_info: &SemaphoreGetFdInfoKHR,
7735 ) -> VkResult<core::ffi::c_int> {
7736 let fp = self
7737 .commands()
7738 .get_semaphore_fd_khr
7739 .expect("vkGetSemaphoreFdKHR not loaded");
7740 let mut out = unsafe { core::mem::zeroed() };
7741 check(unsafe { fp(self.handle(), p_get_fd_info, &mut out) })?;
7742 Ok(out)
7743 }
7744 ///Wraps [`vkImportSemaphoreFdKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkImportSemaphoreFdKHR.html).
7745 /**
7746 Provided by **VK_KHR_external_semaphore_fd**.*/
7747 ///
7748 ///# Errors
7749 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7750 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
7751 ///- `VK_ERROR_UNKNOWN`
7752 ///- `VK_ERROR_VALIDATION_FAILED`
7753 ///
7754 ///# Safety
7755 ///- `device` (self) must be valid and not destroyed.
7756 ///
7757 ///# Panics
7758 ///Panics if `vkImportSemaphoreFdKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7759 ///
7760 ///# Usage Notes
7761 ///
7762 ///Imports a synchronization payload from a POSIX file descriptor
7763 ///into a semaphore. After import, the semaphore uses the external
7764 ///synchronization state.
7765 ///
7766 ///`ImportSemaphoreFdInfoKHR` specifies the target semaphore, handle
7767 ///type, fd, and whether the import is temporary (payload consumed
7768 ///on first wait) or permanent.
7769 ///
7770 ///For `SYNC_FD`, the import takes ownership of the fd, do not
7771 ///close it afterward. For `OPAQUE_FD`, the fd is duplicated
7772 ///internally and can be closed after the call.
7773 ///
7774 ///Linux/Android only. Use `import_semaphore_win32_handle_khr` on
7775 ///Windows.
7776 pub unsafe fn import_semaphore_fd_khr(
7777 &self,
7778 p_import_semaphore_fd_info: &ImportSemaphoreFdInfoKHR,
7779 ) -> VkResult<()> {
7780 let fp = self
7781 .commands()
7782 .import_semaphore_fd_khr
7783 .expect("vkImportSemaphoreFdKHR not loaded");
7784 check(unsafe { fp(self.handle(), p_import_semaphore_fd_info) })
7785 }
7786 ///Wraps [`vkGetSemaphoreZirconHandleFUCHSIA`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSemaphoreZirconHandleFUCHSIA.html).
7787 /**
7788 Provided by **VK_FUCHSIA_external_semaphore**.*/
7789 ///
7790 ///# Errors
7791 ///- `VK_ERROR_TOO_MANY_OBJECTS`
7792 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7793 ///- `VK_ERROR_UNKNOWN`
7794 ///- `VK_ERROR_VALIDATION_FAILED`
7795 ///
7796 ///# Safety
7797 ///- `device` (self) must be valid and not destroyed.
7798 ///
7799 ///# Panics
7800 ///Panics if `vkGetSemaphoreZirconHandleFUCHSIA` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7801 ///
7802 ///# Usage Notes
7803 ///
7804 ///Exports a Vulkan semaphore as a Fuchsia Zircon event handle for
7805 ///cross-process synchronisation. Fuchsia OS only.
7806 ///
7807 ///Requires `VK_FUCHSIA_external_semaphore`.
7808 pub unsafe fn get_semaphore_zircon_handle_fuchsia(
7809 &self,
7810 p_get_zircon_handle_info: &SemaphoreGetZirconHandleInfoFUCHSIA,
7811 ) -> VkResult<u32> {
7812 let fp = self
7813 .commands()
7814 .get_semaphore_zircon_handle_fuchsia
7815 .expect("vkGetSemaphoreZirconHandleFUCHSIA not loaded");
7816 let mut out = unsafe { core::mem::zeroed() };
7817 check(unsafe { fp(self.handle(), p_get_zircon_handle_info, &mut out) })?;
7818 Ok(out)
7819 }
7820 ///Wraps [`vkImportSemaphoreZirconHandleFUCHSIA`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkImportSemaphoreZirconHandleFUCHSIA.html).
7821 /**
7822 Provided by **VK_FUCHSIA_external_semaphore**.*/
7823 ///
7824 ///# Errors
7825 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7826 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
7827 ///- `VK_ERROR_UNKNOWN`
7828 ///- `VK_ERROR_VALIDATION_FAILED`
7829 ///
7830 ///# Safety
7831 ///- `device` (self) must be valid and not destroyed.
7832 ///
7833 ///# Panics
7834 ///Panics if `vkImportSemaphoreZirconHandleFUCHSIA` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7835 ///
7836 ///# Usage Notes
7837 ///
7838 ///Imports a Fuchsia Zircon event handle into an existing Vulkan
7839 ///semaphore for cross-process synchronisation. Fuchsia OS only.
7840 ///
7841 ///Requires `VK_FUCHSIA_external_semaphore`.
7842 pub unsafe fn import_semaphore_zircon_handle_fuchsia(
7843 &self,
7844 p_import_semaphore_zircon_handle_info: &ImportSemaphoreZirconHandleInfoFUCHSIA,
7845 ) -> VkResult<()> {
7846 let fp = self
7847 .commands()
7848 .import_semaphore_zircon_handle_fuchsia
7849 .expect("vkImportSemaphoreZirconHandleFUCHSIA not loaded");
7850 check(unsafe { fp(self.handle(), p_import_semaphore_zircon_handle_info) })
7851 }
7852 ///Wraps [`vkGetFenceWin32HandleKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetFenceWin32HandleKHR.html).
7853 /**
7854 Provided by **VK_KHR_external_fence_win32**.*/
7855 ///
7856 ///# Errors
7857 ///- `VK_ERROR_TOO_MANY_OBJECTS`
7858 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7859 ///- `VK_ERROR_UNKNOWN`
7860 ///- `VK_ERROR_VALIDATION_FAILED`
7861 ///
7862 ///# Safety
7863 ///- `device` (self) must be valid and not destroyed.
7864 ///
7865 ///# Panics
7866 ///Panics if `vkGetFenceWin32HandleKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7867 ///
7868 ///# Usage Notes
7869 ///
7870 ///Exports a fence's synchronization state as a Windows HANDLE
7871 ///for cross-process fence synchronization.
7872 ///
7873 ///`FenceGetWin32HandleInfoKHR` specifies the fence and handle type
7874 ///(`OPAQUE_WIN32` or `OPAQUE_WIN32_KMT`).
7875 ///
7876 ///For `OPAQUE_WIN32`, close the handle with `CloseHandle` when
7877 ///done. `OPAQUE_WIN32_KMT` handles are kernel-managed.
7878 ///
7879 ///Windows only. Use `get_fence_fd_khr` on Linux.
7880 pub unsafe fn get_fence_win32_handle_khr(
7881 &self,
7882 p_get_win32_handle_info: &FenceGetWin32HandleInfoKHR,
7883 ) -> VkResult<isize> {
7884 let fp = self
7885 .commands()
7886 .get_fence_win32_handle_khr
7887 .expect("vkGetFenceWin32HandleKHR not loaded");
7888 let mut out = unsafe { core::mem::zeroed() };
7889 check(unsafe { fp(self.handle(), p_get_win32_handle_info, &mut out) })?;
7890 Ok(out)
7891 }
7892 ///Wraps [`vkImportFenceWin32HandleKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkImportFenceWin32HandleKHR.html).
7893 /**
7894 Provided by **VK_KHR_external_fence_win32**.*/
7895 ///
7896 ///# Errors
7897 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7898 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
7899 ///- `VK_ERROR_UNKNOWN`
7900 ///- `VK_ERROR_VALIDATION_FAILED`
7901 ///
7902 ///# Safety
7903 ///- `device` (self) must be valid and not destroyed.
7904 ///
7905 ///# Panics
7906 ///Panics if `vkImportFenceWin32HandleKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7907 ///
7908 ///# Usage Notes
7909 ///
7910 ///Imports a synchronization payload from a Windows HANDLE into a
7911 ///fence.
7912 ///
7913 ///`ImportFenceWin32HandleInfoKHR` specifies the target fence,
7914 ///handle type, handle (or name), and whether the import is
7915 ///temporary or permanent.
7916 ///
7917 ///The handle is duplicated internally, the caller retains
7918 ///ownership and should close it when no longer needed.
7919 ///
7920 ///Windows only. Use `import_fence_fd_khr` on Linux.
7921 pub unsafe fn import_fence_win32_handle_khr(
7922 &self,
7923 p_import_fence_win32_handle_info: &ImportFenceWin32HandleInfoKHR,
7924 ) -> VkResult<()> {
7925 let fp = self
7926 .commands()
7927 .import_fence_win32_handle_khr
7928 .expect("vkImportFenceWin32HandleKHR not loaded");
7929 check(unsafe { fp(self.handle(), p_import_fence_win32_handle_info) })
7930 }
7931 ///Wraps [`vkGetFenceFdKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetFenceFdKHR.html).
7932 /**
7933 Provided by **VK_KHR_external_fence_fd**.*/
7934 ///
7935 ///# Errors
7936 ///- `VK_ERROR_TOO_MANY_OBJECTS`
7937 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7938 ///- `VK_ERROR_UNKNOWN`
7939 ///- `VK_ERROR_VALIDATION_FAILED`
7940 ///
7941 ///# Safety
7942 ///- `device` (self) must be valid and not destroyed.
7943 ///
7944 ///# Panics
7945 ///Panics if `vkGetFenceFdKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7946 ///
7947 ///# Usage Notes
7948 ///
7949 ///Exports a fence's synchronization state as a POSIX file
7950 ///descriptor. The fd enables cross-process fence synchronization.
7951 ///
7952 ///`FenceGetFdInfoKHR` specifies the fence and handle type
7953 ///(`OPAQUE_FD` or `SYNC_FD`). For `SYNC_FD`, the fence must be
7954 ///signaled or have a pending signal, exporting transfers the
7955 ///payload and resets the fence.
7956 ///
7957 ///The caller owns the returned fd and must close it when done.
7958 ///
7959 ///Linux/Android only. Use `get_fence_win32_handle_khr` on Windows.
7960 pub unsafe fn get_fence_fd_khr(
7961 &self,
7962 p_get_fd_info: &FenceGetFdInfoKHR,
7963 ) -> VkResult<core::ffi::c_int> {
7964 let fp = self
7965 .commands()
7966 .get_fence_fd_khr
7967 .expect("vkGetFenceFdKHR not loaded");
7968 let mut out = unsafe { core::mem::zeroed() };
7969 check(unsafe { fp(self.handle(), p_get_fd_info, &mut out) })?;
7970 Ok(out)
7971 }
7972 ///Wraps [`vkImportFenceFdKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkImportFenceFdKHR.html).
7973 /**
7974 Provided by **VK_KHR_external_fence_fd**.*/
7975 ///
7976 ///# Errors
7977 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
7978 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
7979 ///- `VK_ERROR_UNKNOWN`
7980 ///- `VK_ERROR_VALIDATION_FAILED`
7981 ///
7982 ///# Safety
7983 ///- `device` (self) must be valid and not destroyed.
7984 ///
7985 ///# Panics
7986 ///Panics if `vkImportFenceFdKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
7987 ///
7988 ///# Usage Notes
7989 ///
7990 ///Imports a synchronization payload from a POSIX file descriptor
7991 ///into a fence.
7992 ///
7993 ///`ImportFenceFdInfoKHR` specifies the target fence, handle type,
7994 ///fd, and whether the import is temporary (payload consumed on
7995 ///first wait/reset) or permanent.
7996 ///
7997 ///For `SYNC_FD`, ownership of the fd transfers to the
7998 ///implementation, do not close it. For `OPAQUE_FD`, the fd is
7999 ///duplicated and can be closed after the call.
8000 ///
8001 ///Linux/Android only. Use `import_fence_win32_handle_khr` on
8002 ///Windows.
8003 pub unsafe fn import_fence_fd_khr(
8004 &self,
8005 p_import_fence_fd_info: &ImportFenceFdInfoKHR,
8006 ) -> VkResult<()> {
8007 let fp = self
8008 .commands()
8009 .import_fence_fd_khr
8010 .expect("vkImportFenceFdKHR not loaded");
8011 check(unsafe { fp(self.handle(), p_import_fence_fd_info) })
8012 }
8013 ///Wraps [`vkGetFenceSciSyncFenceNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetFenceSciSyncFenceNV.html).
8014 ///
8015 ///# Errors
8016 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
8017 ///- `VK_ERROR_NOT_PERMITTED`
8018 ///- `VK_ERROR_UNKNOWN`
8019 ///- `VK_ERROR_VALIDATION_FAILED`
8020 ///
8021 ///# Safety
8022 ///- `device` (self) must be valid and not destroyed.
8023 ///
8024 ///# Panics
8025 ///Panics if `vkGetFenceSciSyncFenceNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8026 ///
8027 ///# Usage Notes
8028 ///
8029 ///Exports a Vulkan fence as a SciSync fence handle for
8030 ///cross-process synchronisation on NV safety-critical platforms.
8031 ///QNX/NVIDIA Safety only.
8032 ///
8033 ///Requires `VK_NV_external_sci_sync`.
8034 pub unsafe fn get_fence_sci_sync_fence_nv(
8035 &self,
8036 p_get_sci_sync_handle_info: &FenceGetSciSyncInfoNV,
8037 ) -> VkResult<core::ffi::c_void> {
8038 let fp = self
8039 .commands()
8040 .get_fence_sci_sync_fence_nv
8041 .expect("vkGetFenceSciSyncFenceNV not loaded");
8042 let mut out = unsafe { core::mem::zeroed() };
8043 check(unsafe { fp(self.handle(), p_get_sci_sync_handle_info, &mut out) })?;
8044 Ok(out)
8045 }
8046 ///Wraps [`vkGetFenceSciSyncObjNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetFenceSciSyncObjNV.html).
8047 ///
8048 ///# Errors
8049 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
8050 ///- `VK_ERROR_NOT_PERMITTED`
8051 ///- `VK_ERROR_UNKNOWN`
8052 ///- `VK_ERROR_VALIDATION_FAILED`
8053 ///
8054 ///# Safety
8055 ///- `device` (self) must be valid and not destroyed.
8056 ///
8057 ///# Panics
8058 ///Panics if `vkGetFenceSciSyncObjNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8059 ///
8060 ///# Usage Notes
8061 ///
8062 ///Exports a Vulkan fence as a SciSync object handle for
8063 ///cross-process synchronisation on NV safety-critical platforms.
8064 ///QNX/NVIDIA Safety only.
8065 ///
8066 ///Requires `VK_NV_external_sci_sync`.
8067 pub unsafe fn get_fence_sci_sync_obj_nv(
8068 &self,
8069 p_get_sci_sync_handle_info: &FenceGetSciSyncInfoNV,
8070 ) -> VkResult<core::ffi::c_void> {
8071 let fp = self
8072 .commands()
8073 .get_fence_sci_sync_obj_nv
8074 .expect("vkGetFenceSciSyncObjNV not loaded");
8075 let mut out = unsafe { core::mem::zeroed() };
8076 check(unsafe { fp(self.handle(), p_get_sci_sync_handle_info, &mut out) })?;
8077 Ok(out)
8078 }
8079 ///Wraps [`vkImportFenceSciSyncFenceNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkImportFenceSciSyncFenceNV.html).
8080 ///
8081 ///# Errors
8082 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
8083 ///- `VK_ERROR_NOT_PERMITTED`
8084 ///- `VK_ERROR_UNKNOWN`
8085 ///- `VK_ERROR_VALIDATION_FAILED`
8086 ///
8087 ///# Safety
8088 ///- `device` (self) must be valid and not destroyed.
8089 ///
8090 ///# Panics
8091 ///Panics if `vkImportFenceSciSyncFenceNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8092 ///
8093 ///# Usage Notes
8094 ///
8095 ///Imports a SciSync fence handle into an existing Vulkan fence for
8096 ///cross-process synchronisation on NV safety-critical platforms.
8097 ///QNX/NVIDIA Safety only.
8098 ///
8099 ///Requires `VK_NV_external_sci_sync`.
8100 pub unsafe fn import_fence_sci_sync_fence_nv(
8101 &self,
8102 p_import_fence_sci_sync_info: &ImportFenceSciSyncInfoNV,
8103 ) -> VkResult<()> {
8104 let fp = self
8105 .commands()
8106 .import_fence_sci_sync_fence_nv
8107 .expect("vkImportFenceSciSyncFenceNV not loaded");
8108 check(unsafe { fp(self.handle(), p_import_fence_sci_sync_info) })
8109 }
8110 ///Wraps [`vkImportFenceSciSyncObjNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkImportFenceSciSyncObjNV.html).
8111 ///
8112 ///# Errors
8113 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
8114 ///- `VK_ERROR_NOT_PERMITTED`
8115 ///- `VK_ERROR_UNKNOWN`
8116 ///- `VK_ERROR_VALIDATION_FAILED`
8117 ///
8118 ///# Safety
8119 ///- `device` (self) must be valid and not destroyed.
8120 ///
8121 ///# Panics
8122 ///Panics if `vkImportFenceSciSyncObjNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8123 ///
8124 ///# Usage Notes
8125 ///
8126 ///Imports a SciSync object handle into an existing Vulkan fence
8127 ///for cross-process synchronisation on NV safety-critical
8128 ///platforms. QNX/NVIDIA Safety only.
8129 ///
8130 ///Requires `VK_NV_external_sci_sync`.
8131 pub unsafe fn import_fence_sci_sync_obj_nv(
8132 &self,
8133 p_import_fence_sci_sync_info: &ImportFenceSciSyncInfoNV,
8134 ) -> VkResult<()> {
8135 let fp = self
8136 .commands()
8137 .import_fence_sci_sync_obj_nv
8138 .expect("vkImportFenceSciSyncObjNV not loaded");
8139 check(unsafe { fp(self.handle(), p_import_fence_sci_sync_info) })
8140 }
8141 ///Wraps [`vkGetSemaphoreSciSyncObjNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSemaphoreSciSyncObjNV.html).
8142 ///
8143 ///# Errors
8144 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
8145 ///- `VK_ERROR_NOT_PERMITTED`
8146 ///- `VK_ERROR_UNKNOWN`
8147 ///- `VK_ERROR_VALIDATION_FAILED`
8148 ///
8149 ///# Safety
8150 ///- `device` (self) must be valid and not destroyed.
8151 ///
8152 ///# Panics
8153 ///Panics if `vkGetSemaphoreSciSyncObjNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8154 ///
8155 ///# Usage Notes
8156 ///
8157 ///Exports a Vulkan semaphore as a SciSync object handle for
8158 ///cross-process synchronisation on NV safety-critical platforms.
8159 ///QNX/NVIDIA Safety only.
8160 ///
8161 ///Requires `VK_NV_external_sci_sync`.
8162 pub unsafe fn get_semaphore_sci_sync_obj_nv(
8163 &self,
8164 p_get_sci_sync_info: &SemaphoreGetSciSyncInfoNV,
8165 ) -> VkResult<core::ffi::c_void> {
8166 let fp = self
8167 .commands()
8168 .get_semaphore_sci_sync_obj_nv
8169 .expect("vkGetSemaphoreSciSyncObjNV not loaded");
8170 let mut out = unsafe { core::mem::zeroed() };
8171 check(unsafe { fp(self.handle(), p_get_sci_sync_info, &mut out) })?;
8172 Ok(out)
8173 }
8174 ///Wraps [`vkImportSemaphoreSciSyncObjNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkImportSemaphoreSciSyncObjNV.html).
8175 ///
8176 ///# Errors
8177 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
8178 ///- `VK_ERROR_NOT_PERMITTED`
8179 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8180 ///- `VK_ERROR_UNKNOWN`
8181 ///- `VK_ERROR_VALIDATION_FAILED`
8182 ///
8183 ///# Safety
8184 ///- `device` (self) must be valid and not destroyed.
8185 ///
8186 ///# Panics
8187 ///Panics if `vkImportSemaphoreSciSyncObjNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8188 ///
8189 ///# Usage Notes
8190 ///
8191 ///Imports a SciSync object handle into an existing Vulkan
8192 ///semaphore for cross-process synchronisation on NV
8193 ///safety-critical platforms. QNX/NVIDIA Safety only.
8194 ///
8195 ///Requires `VK_NV_external_sci_sync`.
8196 pub unsafe fn import_semaphore_sci_sync_obj_nv(
8197 &self,
8198 p_import_semaphore_sci_sync_info: &ImportSemaphoreSciSyncInfoNV,
8199 ) -> VkResult<()> {
8200 let fp = self
8201 .commands()
8202 .import_semaphore_sci_sync_obj_nv
8203 .expect("vkImportSemaphoreSciSyncObjNV not loaded");
8204 check(unsafe { fp(self.handle(), p_import_semaphore_sci_sync_info) })
8205 }
8206 ///Wraps [`vkCreateSemaphoreSciSyncPoolNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateSemaphoreSciSyncPoolNV.html).
8207 ///
8208 ///# Errors
8209 ///- `VK_ERROR_INITIALIZATION_FAILED`
8210 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8211 ///- `VK_ERROR_UNKNOWN`
8212 ///- `VK_ERROR_VALIDATION_FAILED`
8213 ///
8214 ///# Safety
8215 ///- `device` (self) must be valid and not destroyed.
8216 ///
8217 ///# Panics
8218 ///Panics if `vkCreateSemaphoreSciSyncPoolNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8219 ///
8220 ///# Usage Notes
8221 ///
8222 ///Creates a pool of SciSync-backed semaphores for efficient
8223 ///cross-engine synchronisation on NV safety-critical platforms.
8224 ///QNX/NVIDIA Safety only.
8225 ///
8226 ///Requires `VK_NV_external_sci_sync2`.
8227 pub unsafe fn create_semaphore_sci_sync_pool_nv(
8228 &self,
8229 p_create_info: &SemaphoreSciSyncPoolCreateInfoNV,
8230 allocator: Option<&AllocationCallbacks>,
8231 ) -> VkResult<SemaphoreSciSyncPoolNV> {
8232 let fp = self
8233 .commands()
8234 .create_semaphore_sci_sync_pool_nv
8235 .expect("vkCreateSemaphoreSciSyncPoolNV not loaded");
8236 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
8237 let mut out = unsafe { core::mem::zeroed() };
8238 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
8239 Ok(out)
8240 }
8241 ///Wraps [`vkDestroySemaphoreSciSyncPoolNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroySemaphoreSciSyncPoolNV.html).
8242 ///
8243 ///# Safety
8244 ///- `device` (self) must be valid and not destroyed.
8245 ///- `semaphorePool` must be externally synchronized.
8246 ///
8247 ///# Panics
8248 ///Panics if `vkDestroySemaphoreSciSyncPoolNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8249 ///
8250 ///# Usage Notes
8251 ///
8252 ///Destroys a SciSync semaphore pool. The pool must not be in use
8253 ///by any pending operations. QNX/NVIDIA Safety only.
8254 ///
8255 ///Requires `VK_NV_external_sci_sync2`.
8256 pub unsafe fn destroy_semaphore_sci_sync_pool_nv(
8257 &self,
8258 semaphore_pool: SemaphoreSciSyncPoolNV,
8259 allocator: Option<&AllocationCallbacks>,
8260 ) {
8261 let fp = self
8262 .commands()
8263 .destroy_semaphore_sci_sync_pool_nv
8264 .expect("vkDestroySemaphoreSciSyncPoolNV not loaded");
8265 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
8266 unsafe { fp(self.handle(), semaphore_pool, alloc_ptr) };
8267 }
8268 ///Wraps [`vkDisplayPowerControlEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDisplayPowerControlEXT.html).
8269 /**
8270 Provided by **VK_EXT_display_control**.*/
8271 ///
8272 ///# Errors
8273 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8274 ///- `VK_ERROR_UNKNOWN`
8275 ///- `VK_ERROR_VALIDATION_FAILED`
8276 ///
8277 ///# Safety
8278 ///- `device` (self) must be valid and not destroyed.
8279 ///
8280 ///# Panics
8281 ///Panics if `vkDisplayPowerControlEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8282 ///
8283 ///# Usage Notes
8284 ///
8285 ///Controls the power state of a display (e.g., standby, suspend,
8286 ///off, on). `DisplayPowerInfoEXT` specifies the desired power state.
8287 ///
8288 ///Requires `VK_EXT_display_control`.
8289 pub unsafe fn display_power_control_ext(
8290 &self,
8291 display: DisplayKHR,
8292 p_display_power_info: &DisplayPowerInfoEXT,
8293 ) -> VkResult<()> {
8294 let fp = self
8295 .commands()
8296 .display_power_control_ext
8297 .expect("vkDisplayPowerControlEXT not loaded");
8298 check(unsafe { fp(self.handle(), display, p_display_power_info) })
8299 }
8300 ///Wraps [`vkRegisterDeviceEventEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkRegisterDeviceEventEXT.html).
8301 /**
8302 Provided by **VK_EXT_display_control**.*/
8303 ///
8304 ///# Errors
8305 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8306 ///- `VK_ERROR_UNKNOWN`
8307 ///- `VK_ERROR_VALIDATION_FAILED`
8308 ///
8309 ///# Safety
8310 ///- `device` (self) must be valid and not destroyed.
8311 ///
8312 ///# Panics
8313 ///Panics if `vkRegisterDeviceEventEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8314 ///
8315 ///# Usage Notes
8316 ///
8317 ///Registers a fence to be signaled when a device event occurs.
8318 ///`DeviceEventInfoEXT` specifies the event type (e.g.,
8319 ///`DISPLAY_HOTPLUG`).
8320 ///
8321 ///Returns a fence that will be signaled when the event fires.
8322 ///
8323 ///Requires `VK_EXT_display_control`.
8324 pub unsafe fn register_device_event_ext(
8325 &self,
8326 p_device_event_info: &DeviceEventInfoEXT,
8327 allocator: Option<&AllocationCallbacks>,
8328 ) -> VkResult<Fence> {
8329 let fp = self
8330 .commands()
8331 .register_device_event_ext
8332 .expect("vkRegisterDeviceEventEXT not loaded");
8333 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
8334 let mut out = unsafe { core::mem::zeroed() };
8335 check(unsafe { fp(self.handle(), p_device_event_info, alloc_ptr, &mut out) })?;
8336 Ok(out)
8337 }
8338 ///Wraps [`vkRegisterDisplayEventEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkRegisterDisplayEventEXT.html).
8339 /**
8340 Provided by **VK_EXT_display_control**.*/
8341 ///
8342 ///# Errors
8343 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8344 ///- `VK_ERROR_UNKNOWN`
8345 ///- `VK_ERROR_VALIDATION_FAILED`
8346 ///
8347 ///# Safety
8348 ///- `device` (self) must be valid and not destroyed.
8349 ///
8350 ///# Panics
8351 ///Panics if `vkRegisterDisplayEventEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8352 ///
8353 ///# Usage Notes
8354 ///
8355 ///Registers a fence to be signaled when a display event occurs.
8356 ///`DisplayEventInfoEXT` specifies the event type (e.g.,
8357 ///`FIRST_PIXEL_OUT`, signaled at the start of the first scanline
8358 ///after a present).
8359 ///
8360 ///Returns a fence. Useful for frame pacing and display timing.
8361 ///
8362 ///Requires `VK_EXT_display_control`.
8363 pub unsafe fn register_display_event_ext(
8364 &self,
8365 display: DisplayKHR,
8366 p_display_event_info: &DisplayEventInfoEXT,
8367 allocator: Option<&AllocationCallbacks>,
8368 ) -> VkResult<Fence> {
8369 let fp = self
8370 .commands()
8371 .register_display_event_ext
8372 .expect("vkRegisterDisplayEventEXT not loaded");
8373 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
8374 let mut out = unsafe { core::mem::zeroed() };
8375 check(unsafe {
8376 fp(
8377 self.handle(),
8378 display,
8379 p_display_event_info,
8380 alloc_ptr,
8381 &mut out,
8382 )
8383 })?;
8384 Ok(out)
8385 }
8386 ///Wraps [`vkGetSwapchainCounterEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSwapchainCounterEXT.html).
8387 /**
8388 Provided by **VK_EXT_display_control**.*/
8389 ///
8390 ///# Errors
8391 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8392 ///- `VK_ERROR_DEVICE_LOST`
8393 ///- `VK_ERROR_OUT_OF_DATE_KHR`
8394 ///- `VK_ERROR_UNKNOWN`
8395 ///- `VK_ERROR_VALIDATION_FAILED`
8396 ///
8397 ///# Safety
8398 ///- `device` (self) must be valid and not destroyed.
8399 ///
8400 ///# Panics
8401 ///Panics if `vkGetSwapchainCounterEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8402 ///
8403 ///# Usage Notes
8404 ///
8405 ///Queries a performance counter associated with a swapchain (e.g.,
8406 ///vertical blanks). Returns the counter value as a `u64`.
8407 ///
8408 ///The counter type is specified as a `SurfaceCounterFlagBitsEXT`
8409 ///(typically `VBLANK`).
8410 ///
8411 ///Requires `VK_EXT_display_control`.
8412 pub unsafe fn get_swapchain_counter_ext(
8413 &self,
8414 swapchain: SwapchainKHR,
8415 counter: SurfaceCounterFlagBitsEXT,
8416 ) -> VkResult<u64> {
8417 let fp = self
8418 .commands()
8419 .get_swapchain_counter_ext
8420 .expect("vkGetSwapchainCounterEXT not loaded");
8421 let mut out = unsafe { core::mem::zeroed() };
8422 check(unsafe { fp(self.handle(), swapchain, counter, &mut out) })?;
8423 Ok(out)
8424 }
8425 ///Wraps [`vkGetDeviceGroupPeerMemoryFeatures`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceGroupPeerMemoryFeatures.html).
8426 /**
8427 Provided by **VK_BASE_VERSION_1_1**.*/
8428 ///
8429 ///# Safety
8430 ///- `device` (self) must be valid and not destroyed.
8431 ///
8432 ///# Panics
8433 ///Panics if `vkGetDeviceGroupPeerMemoryFeatures` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8434 ///
8435 ///# Usage Notes
8436 ///
8437 ///Queries the memory access capabilities between two physical devices
8438 ///in a device group. Returns flags indicating whether memory allocated
8439 ///on one device can be copied to, accessed generically, or accessed
8440 ///natively from the other device.
8441 ///
8442 ///Only relevant for multi-GPU device groups. On single-GPU systems
8443 ///this is not needed.
8444 ///
8445 ///Use the returned flags to decide how to share resources across
8446 ///devices, for example, whether a texture on GPU 0 can be sampled
8447 ///directly by GPU 1, or whether it must be copied.
8448 pub unsafe fn get_device_group_peer_memory_features(
8449 &self,
8450 heap_index: u32,
8451 local_device_index: u32,
8452 remote_device_index: u32,
8453 ) -> PeerMemoryFeatureFlags {
8454 let fp = self
8455 .commands()
8456 .get_device_group_peer_memory_features
8457 .expect("vkGetDeviceGroupPeerMemoryFeatures not loaded");
8458 let mut out = unsafe { core::mem::zeroed() };
8459 unsafe {
8460 fp(
8461 self.handle(),
8462 heap_index,
8463 local_device_index,
8464 remote_device_index,
8465 &mut out,
8466 )
8467 };
8468 out
8469 }
8470 ///Wraps [`vkBindBufferMemory2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBindBufferMemory2.html).
8471 /**
8472 Provided by **VK_BASE_VERSION_1_1**.*/
8473 ///
8474 ///# Errors
8475 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8476 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
8477 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
8478 ///- `VK_ERROR_UNKNOWN`
8479 ///- `VK_ERROR_VALIDATION_FAILED`
8480 ///
8481 ///# Safety
8482 ///- `device` (self) must be valid and not destroyed.
8483 ///
8484 ///# Panics
8485 ///Panics if `vkBindBufferMemory2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8486 ///
8487 ///# Usage Notes
8488 ///
8489 ///Binds memory to one or more buffers in a single call. This is the
8490 ///Vulkan 1.1 batch version of `bind_buffer_memory`.
8491 ///
8492 ///Each `BindBufferMemoryInfo` specifies a buffer, memory object, and
8493 ///offset, the same parameters as `bind_buffer_memory`, but batched.
8494 ///
8495 ///Use `BindBufferMemoryDeviceGroupInfo` in the pNext chain to bind
8496 ///memory for specific devices in a device group (multi-GPU). For
8497 ///single-GPU usage, `bind_buffer_memory` and `bind_buffer_memory2`
8498 ///are equivalent.
8499 pub unsafe fn bind_buffer_memory2(
8500 &self,
8501 p_bind_infos: &[BindBufferMemoryInfo],
8502 ) -> VkResult<()> {
8503 let fp = self
8504 .commands()
8505 .bind_buffer_memory2
8506 .expect("vkBindBufferMemory2 not loaded");
8507 check(unsafe {
8508 fp(
8509 self.handle(),
8510 p_bind_infos.len() as u32,
8511 p_bind_infos.as_ptr(),
8512 )
8513 })
8514 }
8515 ///Wraps [`vkBindImageMemory2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBindImageMemory2.html).
8516 /**
8517 Provided by **VK_BASE_VERSION_1_1**.*/
8518 ///
8519 ///# Errors
8520 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8521 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
8522 ///- `VK_ERROR_UNKNOWN`
8523 ///- `VK_ERROR_VALIDATION_FAILED`
8524 ///
8525 ///# Safety
8526 ///- `device` (self) must be valid and not destroyed.
8527 ///
8528 ///# Panics
8529 ///Panics if `vkBindImageMemory2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8530 ///
8531 ///# Usage Notes
8532 ///
8533 ///Binds memory to one or more images in a single call. This is the
8534 ///Vulkan 1.1 batch version of `bind_image_memory`.
8535 ///
8536 ///Also required when binding memory to images created with
8537 ///disjoint multi-planar formats, each plane is bound separately via
8538 ///`BindImagePlaneMemoryInfo` in the pNext chain.
8539 ///
8540 ///For device groups (multi-GPU), chain
8541 ///`BindImageMemoryDeviceGroupInfo` to assign memory per device and
8542 ///specify split-instance bind regions.
8543 pub unsafe fn bind_image_memory2(&self, p_bind_infos: &[BindImageMemoryInfo]) -> VkResult<()> {
8544 let fp = self
8545 .commands()
8546 .bind_image_memory2
8547 .expect("vkBindImageMemory2 not loaded");
8548 check(unsafe {
8549 fp(
8550 self.handle(),
8551 p_bind_infos.len() as u32,
8552 p_bind_infos.as_ptr(),
8553 )
8554 })
8555 }
8556 ///Wraps [`vkCmdSetDeviceMask`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDeviceMask.html).
8557 /**
8558 Provided by **VK_BASE_VERSION_1_1**.*/
8559 ///
8560 ///# Safety
8561 ///- `commandBuffer` (self) must be valid and not destroyed.
8562 ///- `commandBuffer` must be externally synchronized.
8563 ///
8564 ///# Panics
8565 ///Panics if `vkCmdSetDeviceMask` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8566 ///
8567 ///# Usage Notes
8568 ///
8569 ///Sets the device mask for subsequent commands in a command buffer
8570 ///when using device groups (multi-GPU with
8571 ///`VK_KHR_device_group` / Vulkan 1.1).
8572 ///
8573 ///The device mask is a bitmask where bit *i* indicates that subsequent
8574 ///commands execute on physical device *i* in the device group.
8575 ///
8576 ///For single-GPU systems (the common case), the device mask is always
8577 ///`0x1` and this command is not needed.
8578 ///
8579 ///Must only be called outside a render pass, or inside a render pass
8580 ///that was begun with `DEVICE_GROUP_BEGIN_INFO` and has the
8581 ///`DEVICE_GROUP` flag set.
8582 pub unsafe fn cmd_set_device_mask(&self, command_buffer: CommandBuffer, device_mask: u32) {
8583 let fp = self
8584 .commands()
8585 .cmd_set_device_mask
8586 .expect("vkCmdSetDeviceMask not loaded");
8587 unsafe { fp(command_buffer, device_mask) };
8588 }
8589 ///Wraps [`vkGetDeviceGroupPresentCapabilitiesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceGroupPresentCapabilitiesKHR.html).
8590 /**
8591 Provided by **VK_KHR_swapchain**.*/
8592 ///
8593 ///# Errors
8594 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8595 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
8596 ///- `VK_ERROR_UNKNOWN`
8597 ///- `VK_ERROR_VALIDATION_FAILED`
8598 ///
8599 ///# Safety
8600 ///- `device` (self) must be valid and not destroyed.
8601 ///
8602 ///# Panics
8603 ///Panics if `vkGetDeviceGroupPresentCapabilitiesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8604 ///
8605 ///# Usage Notes
8606 ///
8607 ///Queries the present capabilities of a device group, which physical
8608 ///devices can present to which surfaces, and what presentation modes
8609 ///are supported.
8610 ///
8611 ///Only relevant for multi-GPU device groups. On single-GPU systems,
8612 ///only `DEVICE_GROUP_PRESENT_MODE_LOCAL` is supported (each device
8613 ///presents its own images).
8614 pub unsafe fn get_device_group_present_capabilities_khr(
8615 &self,
8616 p_device_group_present_capabilities: &mut DeviceGroupPresentCapabilitiesKHR,
8617 ) -> VkResult<()> {
8618 let fp = self
8619 .commands()
8620 .get_device_group_present_capabilities_khr
8621 .expect("vkGetDeviceGroupPresentCapabilitiesKHR not loaded");
8622 check(unsafe { fp(self.handle(), p_device_group_present_capabilities) })
8623 }
8624 ///Wraps [`vkGetDeviceGroupSurfacePresentModesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceGroupSurfacePresentModesKHR.html).
8625 /**
8626 Provided by **VK_KHR_swapchain**.*/
8627 ///
8628 ///# Errors
8629 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8630 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
8631 ///- `VK_ERROR_SURFACE_LOST_KHR`
8632 ///- `VK_ERROR_UNKNOWN`
8633 ///- `VK_ERROR_VALIDATION_FAILED`
8634 ///
8635 ///# Safety
8636 ///- `device` (self) must be valid and not destroyed.
8637 ///- `surface` must be externally synchronized.
8638 ///
8639 ///# Panics
8640 ///Panics if `vkGetDeviceGroupSurfacePresentModesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8641 ///
8642 ///# Usage Notes
8643 ///
8644 ///Queries which device group present modes a surface supports. The
8645 ///returned bitmask indicates whether `LOCAL`, `REMOTE`, `SUM`, or
8646 ///`LOCAL_MULTI_DEVICE` modes are available.
8647 ///
8648 ///Only relevant for multi-GPU device groups. On single-GPU systems,
8649 ///only `LOCAL` is supported.
8650 pub unsafe fn get_device_group_surface_present_modes_khr(
8651 &self,
8652 surface: SurfaceKHR,
8653 ) -> VkResult<DeviceGroupPresentModeFlagsKHR> {
8654 let fp = self
8655 .commands()
8656 .get_device_group_surface_present_modes_khr
8657 .expect("vkGetDeviceGroupSurfacePresentModesKHR not loaded");
8658 let mut out = unsafe { core::mem::zeroed() };
8659 check(unsafe { fp(self.handle(), surface, &mut out) })?;
8660 Ok(out)
8661 }
8662 ///Wraps [`vkAcquireNextImage2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAcquireNextImage2KHR.html).
8663 /**
8664 Provided by **VK_KHR_swapchain**.*/
8665 ///
8666 ///# Errors
8667 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8668 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
8669 ///- `VK_ERROR_DEVICE_LOST`
8670 ///- `VK_ERROR_OUT_OF_DATE_KHR`
8671 ///- `VK_ERROR_SURFACE_LOST_KHR`
8672 ///- `VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT`
8673 ///- `VK_ERROR_UNKNOWN`
8674 ///- `VK_ERROR_VALIDATION_FAILED`
8675 ///
8676 ///# Safety
8677 ///- `device` (self) must be valid and not destroyed.
8678 ///
8679 ///# Panics
8680 ///Panics if `vkAcquireNextImage2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8681 ///
8682 ///# Usage Notes
8683 ///
8684 ///Extended version of `acquire_next_image_khr` that takes an
8685 ///`AcquireNextImageInfoKHR` struct with pNext support.
8686 ///
8687 ///The key addition is `device_mask` for device groups (multi-GPU),
8688 ///specifying which physical devices the acquired image will be used
8689 ///on.
8690 ///
8691 ///For single-GPU usage, this is functionally identical to
8692 ///`acquire_next_image_khr`.
8693 pub unsafe fn acquire_next_image2_khr(
8694 &self,
8695 p_acquire_info: &AcquireNextImageInfoKHR,
8696 ) -> VkResult<u32> {
8697 let fp = self
8698 .commands()
8699 .acquire_next_image2_khr
8700 .expect("vkAcquireNextImage2KHR not loaded");
8701 let mut out = unsafe { core::mem::zeroed() };
8702 check(unsafe { fp(self.handle(), p_acquire_info, &mut out) })?;
8703 Ok(out)
8704 }
8705 ///Wraps [`vkCmdDispatchBase`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDispatchBase.html).
8706 /**
8707 Provided by **VK_COMPUTE_VERSION_1_1**.*/
8708 ///
8709 ///# Safety
8710 ///- `commandBuffer` (self) must be valid and not destroyed.
8711 ///- `commandBuffer` must be externally synchronized.
8712 ///
8713 ///# Panics
8714 ///Panics if `vkCmdDispatchBase` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8715 ///
8716 ///# Usage Notes
8717 ///
8718 ///Dispatches a compute shader with a non-zero base workgroup offset.
8719 ///The shader's `gl_WorkGroupID` starts at (`base_group_x`,
8720 ///`base_group_y`, `base_group_z`) instead of (0, 0, 0).
8721 ///
8722 ///This is useful for splitting a large dispatch across multiple
8723 ///submissions or for device groups where different physical devices
8724 ///handle different regions of the workgroup space.
8725 ///
8726 ///`gl_NumWorkGroups` reflects the `group_count` parameters, not the
8727 ///total. The shader sees workgroup IDs in the range
8728 ///[`base`, `base + count`).
8729 ///
8730 ///For single-GPU, zero-base dispatches, use `cmd_dispatch` instead.
8731 pub unsafe fn cmd_dispatch_base(
8732 &self,
8733 command_buffer: CommandBuffer,
8734 base_group_x: u32,
8735 base_group_y: u32,
8736 base_group_z: u32,
8737 group_count_x: u32,
8738 group_count_y: u32,
8739 group_count_z: u32,
8740 ) {
8741 let fp = self
8742 .commands()
8743 .cmd_dispatch_base
8744 .expect("vkCmdDispatchBase not loaded");
8745 unsafe {
8746 fp(
8747 command_buffer,
8748 base_group_x,
8749 base_group_y,
8750 base_group_z,
8751 group_count_x,
8752 group_count_y,
8753 group_count_z,
8754 )
8755 };
8756 }
8757 ///Wraps [`vkCreateDescriptorUpdateTemplate`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateDescriptorUpdateTemplate.html).
8758 /**
8759 Provided by **VK_COMPUTE_VERSION_1_1**.*/
8760 ///
8761 ///# Errors
8762 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8763 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
8764 ///- `VK_ERROR_UNKNOWN`
8765 ///- `VK_ERROR_VALIDATION_FAILED`
8766 ///
8767 ///# Safety
8768 ///- `device` (self) must be valid and not destroyed.
8769 ///
8770 ///# Panics
8771 ///Panics if `vkCreateDescriptorUpdateTemplate` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8772 ///
8773 ///# Usage Notes
8774 ///
8775 ///Creates a template that describes how to update a descriptor set
8776 ///from a compact block of host memory. Instead of building an array
8777 ///of `WriteDescriptorSet` structs, you define the layout once in the
8778 ///template and then call `update_descriptor_set_with_template` with
8779 ///a raw pointer to your data.
8780 ///
8781 ///**Benefits**:
8782 ///
8783 ///- Reduces CPU overhead for frequent descriptor updates.
8784 ///- Avoids allocating `WriteDescriptorSet` arrays every frame.
8785 ///- Pairs well with `cmd_push_descriptor_set_with_template` for
8786 /// push descriptors.
8787 ///
8788 ///Each entry in the template maps an offset in your host data block to
8789 ///a descriptor binding, array element, and type. The driver compiles
8790 ///this into an optimised update path.
8791 ///
8792 ///Templates are immutable after creation and can be reused across
8793 ///frames.
8794 pub unsafe fn create_descriptor_update_template(
8795 &self,
8796 p_create_info: &DescriptorUpdateTemplateCreateInfo,
8797 allocator: Option<&AllocationCallbacks>,
8798 ) -> VkResult<DescriptorUpdateTemplate> {
8799 let fp = self
8800 .commands()
8801 .create_descriptor_update_template
8802 .expect("vkCreateDescriptorUpdateTemplate not loaded");
8803 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
8804 let mut out = unsafe { core::mem::zeroed() };
8805 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
8806 Ok(out)
8807 }
8808 ///Wraps [`vkDestroyDescriptorUpdateTemplate`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyDescriptorUpdateTemplate.html).
8809 /**
8810 Provided by **VK_COMPUTE_VERSION_1_1**.*/
8811 ///
8812 ///# Safety
8813 ///- `device` (self) must be valid and not destroyed.
8814 ///- `descriptorUpdateTemplate` must be externally synchronized.
8815 ///
8816 ///# Panics
8817 ///Panics if `vkDestroyDescriptorUpdateTemplate` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8818 ///
8819 ///# Usage Notes
8820 ///
8821 ///Destroys a descriptor update template. The template must not be in
8822 ///use by any pending `update_descriptor_set_with_template` or
8823 ///`cmd_push_descriptor_set_with_template` call.
8824 pub unsafe fn destroy_descriptor_update_template(
8825 &self,
8826 descriptor_update_template: DescriptorUpdateTemplate,
8827 allocator: Option<&AllocationCallbacks>,
8828 ) {
8829 let fp = self
8830 .commands()
8831 .destroy_descriptor_update_template
8832 .expect("vkDestroyDescriptorUpdateTemplate not loaded");
8833 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
8834 unsafe { fp(self.handle(), descriptor_update_template, alloc_ptr) };
8835 }
8836 ///Wraps [`vkUpdateDescriptorSetWithTemplate`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkUpdateDescriptorSetWithTemplate.html).
8837 /**
8838 Provided by **VK_COMPUTE_VERSION_1_1**.*/
8839 ///
8840 ///# Safety
8841 ///- `device` (self) must be valid and not destroyed.
8842 ///- `descriptorSet` must be externally synchronized.
8843 ///
8844 ///# Panics
8845 ///Panics if `vkUpdateDescriptorSetWithTemplate` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8846 ///
8847 ///# Usage Notes
8848 ///
8849 ///Updates a descriptor set using a descriptor update template and a
8850 ///raw pointer to a block of host data. The template defines the mapping
8851 ///from the data block to descriptor bindings.
8852 ///
8853 ///This is faster than `update_descriptor_sets` for repeated updates
8854 ///with the same layout, the driver has pre-compiled the update path.
8855 ///
8856 ///The `data` pointer must point to a block of memory laid out according
8857 ///to the template's entry offsets and strides. The data is consumed
8858 ///immediately; the pointer does not need to remain valid after the
8859 ///call returns.
8860 pub unsafe fn update_descriptor_set_with_template(
8861 &self,
8862 descriptor_set: DescriptorSet,
8863 descriptor_update_template: DescriptorUpdateTemplate,
8864 p_data: *const core::ffi::c_void,
8865 ) {
8866 let fp = self
8867 .commands()
8868 .update_descriptor_set_with_template
8869 .expect("vkUpdateDescriptorSetWithTemplate not loaded");
8870 unsafe {
8871 fp(
8872 self.handle(),
8873 descriptor_set,
8874 descriptor_update_template,
8875 p_data,
8876 )
8877 };
8878 }
8879 ///Wraps [`vkCmdPushDescriptorSetWithTemplate`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPushDescriptorSetWithTemplate.html).
8880 /**
8881 Provided by **VK_COMPUTE_VERSION_1_4**.*/
8882 ///
8883 ///# Safety
8884 ///- `commandBuffer` (self) must be valid and not destroyed.
8885 ///- `commandBuffer` must be externally synchronized.
8886 ///
8887 ///# Panics
8888 ///Panics if `vkCmdPushDescriptorSetWithTemplate` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8889 ///
8890 ///# Usage Notes
8891 ///
8892 ///Combines push descriptors with descriptor update templates for
8893 ///maximum efficiency. Updates are pushed directly into the command
8894 ///buffer using the compact host data format defined by the template.
8895 ///
8896 ///This is the fastest path for per-draw descriptor updates: no pool
8897 ///allocation, no `WriteDescriptorSet` array construction, and the
8898 ///driver has a pre-compiled update path from the template.
8899 ///
8900 ///The template must have been created with
8901 ///`DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS`.
8902 ///
8903 ///Core in Vulkan 1.4. Previously via `VK_KHR_push_descriptor` +
8904 ///`VK_KHR_descriptor_update_template`.
8905 pub unsafe fn cmd_push_descriptor_set_with_template(
8906 &self,
8907 command_buffer: CommandBuffer,
8908 descriptor_update_template: DescriptorUpdateTemplate,
8909 layout: PipelineLayout,
8910 set: u32,
8911 p_data: *const core::ffi::c_void,
8912 ) {
8913 let fp = self
8914 .commands()
8915 .cmd_push_descriptor_set_with_template
8916 .expect("vkCmdPushDescriptorSetWithTemplate not loaded");
8917 unsafe {
8918 fp(
8919 command_buffer,
8920 descriptor_update_template,
8921 layout,
8922 set,
8923 p_data,
8924 )
8925 };
8926 }
8927 ///Wraps [`vkSetHdrMetadataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetHdrMetadataEXT.html).
8928 /**
8929 Provided by **VK_EXT_hdr_metadata**.*/
8930 ///
8931 ///# Safety
8932 ///- `device` (self) must be valid and not destroyed.
8933 ///
8934 ///# Panics
8935 ///Panics if `vkSetHdrMetadataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8936 ///
8937 ///# Usage Notes
8938 ///
8939 ///Sets HDR metadata (mastering display color volume, content light
8940 ///levels) for one or more swapchains. The compositor uses this to
8941 ///tone-map content appropriately for the connected display.
8942 ///
8943 ///Call whenever the content characteristics change (e.g., switching
8944 ///between SDR UI and HDR scene rendering).
8945 ///
8946 ///Requires `VK_EXT_hdr_metadata`.
8947 pub unsafe fn set_hdr_metadata_ext(
8948 &self,
8949 p_swapchains: &[SwapchainKHR],
8950 p_metadata: &[HdrMetadataEXT],
8951 ) {
8952 let fp = self
8953 .commands()
8954 .set_hdr_metadata_ext
8955 .expect("vkSetHdrMetadataEXT not loaded");
8956 unsafe {
8957 fp(
8958 self.handle(),
8959 p_swapchains.len() as u32,
8960 p_swapchains.as_ptr(),
8961 p_metadata.as_ptr(),
8962 )
8963 };
8964 }
8965 ///Wraps [`vkGetSwapchainStatusKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSwapchainStatusKHR.html).
8966 /**
8967 Provided by **VK_KHR_shared_presentable_image**.*/
8968 ///
8969 ///# Errors
8970 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
8971 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
8972 ///- `VK_ERROR_DEVICE_LOST`
8973 ///- `VK_ERROR_OUT_OF_DATE_KHR`
8974 ///- `VK_ERROR_SURFACE_LOST_KHR`
8975 ///- `VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT`
8976 ///- `VK_ERROR_UNKNOWN`
8977 ///- `VK_ERROR_VALIDATION_FAILED`
8978 ///
8979 ///# Safety
8980 ///- `device` (self) must be valid and not destroyed.
8981 ///- `swapchain` must be externally synchronized.
8982 ///
8983 ///# Panics
8984 ///Panics if `vkGetSwapchainStatusKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
8985 ///
8986 ///# Usage Notes
8987 ///
8988 ///Queries the current status of a shared presentable swapchain
8989 ///(created with `PRESENT_MODE_SHARED_DEMAND_REFRESH` or
8990 ///`PRESENT_MODE_SHARED_CONTINUOUS_REFRESH`).
8991 ///
8992 ///Returns `VK_SUCCESS` if the swapchain is usable, or
8993 ///`VK_SUBOPTIMAL_KHR` / `VK_ERROR_OUT_OF_DATE_KHR` / surface-lost
8994 ///errors if the swapchain needs recreation.
8995 ///
8996 ///Only relevant for shared presentable images
8997 ///(`VK_KHR_shared_presentable_image`). For regular swapchains, status
8998 ///is communicated through `acquire_next_image_khr` and
8999 ///`queue_present_khr` return values.
9000 pub unsafe fn get_swapchain_status_khr(&self, swapchain: SwapchainKHR) -> VkResult<()> {
9001 let fp = self
9002 .commands()
9003 .get_swapchain_status_khr
9004 .expect("vkGetSwapchainStatusKHR not loaded");
9005 check(unsafe { fp(self.handle(), swapchain) })
9006 }
9007 ///Wraps [`vkGetRefreshCycleDurationGOOGLE`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetRefreshCycleDurationGOOGLE.html).
9008 /**
9009 Provided by **VK_GOOGLE_display_timing**.*/
9010 ///
9011 ///# Errors
9012 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
9013 ///- `VK_ERROR_DEVICE_LOST`
9014 ///- `VK_ERROR_SURFACE_LOST_KHR`
9015 ///- `VK_ERROR_UNKNOWN`
9016 ///- `VK_ERROR_VALIDATION_FAILED`
9017 ///
9018 ///# Safety
9019 ///- `device` (self) must be valid and not destroyed.
9020 ///- `swapchain` must be externally synchronized.
9021 ///
9022 ///# Panics
9023 ///Panics if `vkGetRefreshCycleDurationGOOGLE` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9024 ///
9025 ///# Usage Notes
9026 ///
9027 ///Queries the duration of a single refresh cycle (vsync interval)
9028 ///for the display associated with the given swapchain. Returns
9029 ///the period in nanoseconds. Essential for accurate frame pacing.
9030 ///
9031 ///Requires `VK_GOOGLE_display_timing`.
9032 pub unsafe fn get_refresh_cycle_duration_google(
9033 &self,
9034 swapchain: SwapchainKHR,
9035 ) -> VkResult<RefreshCycleDurationGOOGLE> {
9036 let fp = self
9037 .commands()
9038 .get_refresh_cycle_duration_google
9039 .expect("vkGetRefreshCycleDurationGOOGLE not loaded");
9040 let mut out = unsafe { core::mem::zeroed() };
9041 check(unsafe { fp(self.handle(), swapchain, &mut out) })?;
9042 Ok(out)
9043 }
9044 ///Wraps [`vkGetPastPresentationTimingGOOGLE`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPastPresentationTimingGOOGLE.html).
9045 /**
9046 Provided by **VK_GOOGLE_display_timing**.*/
9047 ///
9048 ///# Errors
9049 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
9050 ///- `VK_ERROR_DEVICE_LOST`
9051 ///- `VK_ERROR_OUT_OF_DATE_KHR`
9052 ///- `VK_ERROR_SURFACE_LOST_KHR`
9053 ///- `VK_ERROR_UNKNOWN`
9054 ///- `VK_ERROR_VALIDATION_FAILED`
9055 ///
9056 ///# Safety
9057 ///- `device` (self) must be valid and not destroyed.
9058 ///- `swapchain` must be externally synchronized.
9059 ///
9060 ///# Panics
9061 ///Panics if `vkGetPastPresentationTimingGOOGLE` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9062 ///
9063 ///# Usage Notes
9064 ///
9065 ///Returns timing data for past presentations on a swapchain,
9066 ///including actual present time, earliest possible present time,
9067 ///and finish time. Uses the two-call idiom (call once to get the
9068 ///count, again to fill the buffer). Useful for frame pacing and
9069 ///latency analysis.
9070 ///
9071 ///Requires `VK_GOOGLE_display_timing`.
9072 pub unsafe fn get_past_presentation_timing_google(
9073 &self,
9074 swapchain: SwapchainKHR,
9075 ) -> VkResult<Vec<PastPresentationTimingGOOGLE>> {
9076 let fp = self
9077 .commands()
9078 .get_past_presentation_timing_google
9079 .expect("vkGetPastPresentationTimingGOOGLE not loaded");
9080 enumerate_two_call(|count, data| unsafe { fp(self.handle(), swapchain, count, data) })
9081 }
9082 ///Wraps [`vkCmdSetViewportWScalingNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetViewportWScalingNV.html).
9083 /**
9084 Provided by **VK_NV_clip_space_w_scaling**.*/
9085 ///
9086 ///# Safety
9087 ///- `commandBuffer` (self) must be valid and not destroyed.
9088 ///- `commandBuffer` must be externally synchronized.
9089 ///
9090 ///# Panics
9091 ///Panics if `vkCmdSetViewportWScalingNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9092 ///
9093 ///# Usage Notes
9094 ///
9095 ///Sets per-viewport W scaling factors for lens-matched shading.
9096 ///The W scaling modifies the clip-space W coordinate to account
9097 ///for lens distortion in VR headsets, enabling more efficient
9098 ///shading by varying pixel density across the viewport.
9099 ///
9100 ///Requires `VK_NV_clip_space_w_scaling`.
9101 pub unsafe fn cmd_set_viewport_w_scaling_nv(
9102 &self,
9103 command_buffer: CommandBuffer,
9104 first_viewport: u32,
9105 p_viewport_w_scalings: &[ViewportWScalingNV],
9106 ) {
9107 let fp = self
9108 .commands()
9109 .cmd_set_viewport_w_scaling_nv
9110 .expect("vkCmdSetViewportWScalingNV not loaded");
9111 unsafe {
9112 fp(
9113 command_buffer,
9114 first_viewport,
9115 p_viewport_w_scalings.len() as u32,
9116 p_viewport_w_scalings.as_ptr(),
9117 )
9118 };
9119 }
9120 ///Wraps [`vkCmdSetDiscardRectangleEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDiscardRectangleEXT.html).
9121 /**
9122 Provided by **VK_EXT_discard_rectangles**.*/
9123 ///
9124 ///# Safety
9125 ///- `commandBuffer` (self) must be valid and not destroyed.
9126 ///- `commandBuffer` must be externally synchronized.
9127 ///
9128 ///# Panics
9129 ///Panics if `vkCmdSetDiscardRectangleEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9130 ///
9131 ///# Usage Notes
9132 ///
9133 ///Dynamically sets the discard rectangles for the current command
9134 ///buffer. Fragments inside (or outside, depending on mode) these
9135 ///rectangles are discarded before the fragment shader runs.
9136 ///
9137 ///Useful for multi-view or split-screen rendering to cheaply cull
9138 ///fragments that belong to a different viewport.
9139 ///
9140 ///Requires `VK_EXT_discard_rectangles`.
9141 pub unsafe fn cmd_set_discard_rectangle_ext(
9142 &self,
9143 command_buffer: CommandBuffer,
9144 first_discard_rectangle: u32,
9145 p_discard_rectangles: &[Rect2D],
9146 ) {
9147 let fp = self
9148 .commands()
9149 .cmd_set_discard_rectangle_ext
9150 .expect("vkCmdSetDiscardRectangleEXT not loaded");
9151 unsafe {
9152 fp(
9153 command_buffer,
9154 first_discard_rectangle,
9155 p_discard_rectangles.len() as u32,
9156 p_discard_rectangles.as_ptr(),
9157 )
9158 };
9159 }
9160 ///Wraps [`vkCmdSetDiscardRectangleEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDiscardRectangleEnableEXT.html).
9161 /**
9162 Provided by **VK_EXT_discard_rectangles**.*/
9163 ///
9164 ///# Safety
9165 ///- `commandBuffer` (self) must be valid and not destroyed.
9166 ///- `commandBuffer` must be externally synchronized.
9167 ///
9168 ///# Panics
9169 ///Panics if `vkCmdSetDiscardRectangleEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9170 ///
9171 ///# Usage Notes
9172 ///
9173 ///Dynamically enables or disables discard rectangles for subsequent
9174 ///draw commands. When disabled, no fragments are discarded regardless
9175 ///of the configured rectangles.
9176 ///
9177 ///Requires `VK_EXT_discard_rectangles`.
9178 pub unsafe fn cmd_set_discard_rectangle_enable_ext(
9179 &self,
9180 command_buffer: CommandBuffer,
9181 discard_rectangle_enable: bool,
9182 ) {
9183 let fp = self
9184 .commands()
9185 .cmd_set_discard_rectangle_enable_ext
9186 .expect("vkCmdSetDiscardRectangleEnableEXT not loaded");
9187 unsafe { fp(command_buffer, discard_rectangle_enable as u32) };
9188 }
9189 ///Wraps [`vkCmdSetDiscardRectangleModeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDiscardRectangleModeEXT.html).
9190 /**
9191 Provided by **VK_EXT_discard_rectangles**.*/
9192 ///
9193 ///# Safety
9194 ///- `commandBuffer` (self) must be valid and not destroyed.
9195 ///- `commandBuffer` must be externally synchronized.
9196 ///
9197 ///# Panics
9198 ///Panics if `vkCmdSetDiscardRectangleModeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9199 ///
9200 ///# Usage Notes
9201 ///
9202 ///Dynamically sets whether fragments inside or outside the discard
9203 ///rectangles are discarded. `INCLUSIVE` discards fragments inside
9204 ///the rectangles; `EXCLUSIVE` discards fragments outside.
9205 ///
9206 ///Requires `VK_EXT_discard_rectangles`.
9207 pub unsafe fn cmd_set_discard_rectangle_mode_ext(
9208 &self,
9209 command_buffer: CommandBuffer,
9210 discard_rectangle_mode: DiscardRectangleModeEXT,
9211 ) {
9212 let fp = self
9213 .commands()
9214 .cmd_set_discard_rectangle_mode_ext
9215 .expect("vkCmdSetDiscardRectangleModeEXT not loaded");
9216 unsafe { fp(command_buffer, discard_rectangle_mode) };
9217 }
9218 ///Wraps [`vkCmdSetSampleLocationsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetSampleLocationsEXT.html).
9219 /**
9220 Provided by **VK_EXT_sample_locations**.*/
9221 ///
9222 ///# Safety
9223 ///- `commandBuffer` (self) must be valid and not destroyed.
9224 ///- `commandBuffer` must be externally synchronized.
9225 ///
9226 ///# Panics
9227 ///Panics if `vkCmdSetSampleLocationsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9228 ///
9229 ///# Usage Notes
9230 ///
9231 ///Sets custom sample locations for multisampled rasterization.
9232 ///`SampleLocationsInfoEXT` specifies the grid size, sample count,
9233 ///and per-sample (x, y) positions within each pixel.
9234 ///
9235 ///Custom sample locations enable techniques like temporal AA
9236 ///jittering and programmable MSAA patterns.
9237 ///
9238 ///Must be called when custom sample locations are enabled (via
9239 ///`cmd_set_sample_locations_enable_ext` or pipeline state).
9240 ///
9241 ///Requires `VK_EXT_sample_locations`.
9242 pub unsafe fn cmd_set_sample_locations_ext(
9243 &self,
9244 command_buffer: CommandBuffer,
9245 p_sample_locations_info: &SampleLocationsInfoEXT,
9246 ) {
9247 let fp = self
9248 .commands()
9249 .cmd_set_sample_locations_ext
9250 .expect("vkCmdSetSampleLocationsEXT not loaded");
9251 unsafe { fp(command_buffer, p_sample_locations_info) };
9252 }
9253 ///Wraps [`vkGetBufferMemoryRequirements2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetBufferMemoryRequirements2.html).
9254 /**
9255 Provided by **VK_BASE_VERSION_1_1**.*/
9256 ///
9257 ///# Safety
9258 ///- `device` (self) must be valid and not destroyed.
9259 ///
9260 ///# Panics
9261 ///Panics if `vkGetBufferMemoryRequirements2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9262 ///
9263 ///# Usage Notes
9264 ///
9265 ///Vulkan 1.1 version of `get_buffer_memory_requirements` that supports
9266 ///extensible output structs via pNext.
9267 ///
9268 ///Chain `MemoryDedicatedRequirements` to query whether the driver
9269 ///prefers or requires a dedicated allocation for this buffer. If
9270 ///`prefers_dedicated_allocation` is true, allocating a dedicated
9271 ///`DeviceMemory` for this buffer may improve performance.
9272 ///
9273 ///The base `MemoryRequirements` (size, alignment, memory type bits) is
9274 ///identical to what `get_buffer_memory_requirements` returns.
9275 pub unsafe fn get_buffer_memory_requirements2(
9276 &self,
9277 p_info: &BufferMemoryRequirementsInfo2,
9278 p_memory_requirements: &mut MemoryRequirements2,
9279 ) {
9280 let fp = self
9281 .commands()
9282 .get_buffer_memory_requirements2
9283 .expect("vkGetBufferMemoryRequirements2 not loaded");
9284 unsafe { fp(self.handle(), p_info, p_memory_requirements) };
9285 }
9286 ///Wraps [`vkGetImageMemoryRequirements2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageMemoryRequirements2.html).
9287 /**
9288 Provided by **VK_BASE_VERSION_1_1**.*/
9289 ///
9290 ///# Safety
9291 ///- `device` (self) must be valid and not destroyed.
9292 ///
9293 ///# Panics
9294 ///Panics if `vkGetImageMemoryRequirements2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9295 ///
9296 ///# Usage Notes
9297 ///
9298 ///Vulkan 1.1 version of `get_image_memory_requirements` that supports
9299 ///extensible output structs via pNext.
9300 ///
9301 ///Chain `MemoryDedicatedRequirements` to query whether the driver
9302 ///prefers or requires a dedicated allocation for this image. Dedicated
9303 ///allocations are common for large render targets and swapchain-sized
9304 ///images, some drivers require them.
9305 ///
9306 ///For multi-planar images, chain `ImagePlaneMemoryRequirementsInfo` in
9307 ///the input to query requirements for a specific plane.
9308 ///
9309 ///The base `MemoryRequirements` is identical to what
9310 ///`get_image_memory_requirements` returns.
9311 pub unsafe fn get_image_memory_requirements2(
9312 &self,
9313 p_info: &ImageMemoryRequirementsInfo2,
9314 p_memory_requirements: &mut MemoryRequirements2,
9315 ) {
9316 let fp = self
9317 .commands()
9318 .get_image_memory_requirements2
9319 .expect("vkGetImageMemoryRequirements2 not loaded");
9320 unsafe { fp(self.handle(), p_info, p_memory_requirements) };
9321 }
9322 ///Wraps [`vkGetImageSparseMemoryRequirements2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageSparseMemoryRequirements2.html).
9323 /**
9324 Provided by **VK_BASE_VERSION_1_1**.*/
9325 ///
9326 ///# Safety
9327 ///- `device` (self) must be valid and not destroyed.
9328 ///
9329 ///# Panics
9330 ///Panics if `vkGetImageSparseMemoryRequirements2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9331 ///
9332 ///# Usage Notes
9333 ///
9334 ///Vulkan 1.1 version of `get_image_sparse_memory_requirements` that
9335 ///supports extensible output structs via pNext. Returns the sparse
9336 ///memory requirements for an image created with sparse flags.
9337 ///
9338 ///For non-sparse images, returns an empty list. Only relevant if you
9339 ///are using sparse resources.
9340 pub unsafe fn get_image_sparse_memory_requirements2(
9341 &self,
9342 p_info: &ImageSparseMemoryRequirementsInfo2,
9343 ) -> Vec<SparseImageMemoryRequirements2> {
9344 let fp = self
9345 .commands()
9346 .get_image_sparse_memory_requirements2
9347 .expect("vkGetImageSparseMemoryRequirements2 not loaded");
9348 fill_two_call(|count, data| unsafe { fp(self.handle(), p_info, count, data) })
9349 }
9350 ///Wraps [`vkGetDeviceBufferMemoryRequirements`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceBufferMemoryRequirements.html).
9351 /**
9352 Provided by **VK_BASE_VERSION_1_3**.*/
9353 ///
9354 ///# Safety
9355 ///- `device` (self) must be valid and not destroyed.
9356 ///
9357 ///# Panics
9358 ///Panics if `vkGetDeviceBufferMemoryRequirements` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9359 ///
9360 ///# Usage Notes
9361 ///
9362 ///Vulkan 1.3 command that queries memory requirements for a buffer
9363 ///**without creating it first**. Pass a `DeviceBufferMemoryRequirements`
9364 ///containing the hypothetical `BufferCreateInfo`.
9365 ///
9366 ///This lets you pre-plan memory allocations before creating any
9367 ///objects, useful for memory allocation strategies that need to know
9368 ///sizes and alignments up front.
9369 ///
9370 ///The returned requirements are identical to what
9371 ///`get_buffer_memory_requirements2` would return for an actual buffer
9372 ///created with the same parameters.
9373 pub unsafe fn get_device_buffer_memory_requirements(
9374 &self,
9375 p_info: &DeviceBufferMemoryRequirements,
9376 p_memory_requirements: &mut MemoryRequirements2,
9377 ) {
9378 let fp = self
9379 .commands()
9380 .get_device_buffer_memory_requirements
9381 .expect("vkGetDeviceBufferMemoryRequirements not loaded");
9382 unsafe { fp(self.handle(), p_info, p_memory_requirements) };
9383 }
9384 ///Wraps [`vkGetDeviceImageMemoryRequirements`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceImageMemoryRequirements.html).
9385 /**
9386 Provided by **VK_BASE_VERSION_1_3**.*/
9387 ///
9388 ///# Safety
9389 ///- `device` (self) must be valid and not destroyed.
9390 ///
9391 ///# Panics
9392 ///Panics if `vkGetDeviceImageMemoryRequirements` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9393 ///
9394 ///# Usage Notes
9395 ///
9396 ///Vulkan 1.3 command that queries memory requirements for an image
9397 ///**without creating it first**. Pass a `DeviceImageMemoryRequirements`
9398 ///containing the hypothetical `ImageCreateInfo`.
9399 ///
9400 ///Useful for pre-planning memory allocations or estimating VRAM usage
9401 ///before committing to image creation.
9402 ///
9403 ///For multi-planar images, set `plane_aspect` to query requirements
9404 ///for a specific plane.
9405 ///
9406 ///The returned requirements are identical to what
9407 ///`get_image_memory_requirements2` would return for an actual image
9408 ///created with the same parameters.
9409 pub unsafe fn get_device_image_memory_requirements(
9410 &self,
9411 p_info: &DeviceImageMemoryRequirements,
9412 p_memory_requirements: &mut MemoryRequirements2,
9413 ) {
9414 let fp = self
9415 .commands()
9416 .get_device_image_memory_requirements
9417 .expect("vkGetDeviceImageMemoryRequirements not loaded");
9418 unsafe { fp(self.handle(), p_info, p_memory_requirements) };
9419 }
9420 ///Wraps [`vkGetDeviceImageSparseMemoryRequirements`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceImageSparseMemoryRequirements.html).
9421 /**
9422 Provided by **VK_BASE_VERSION_1_3**.*/
9423 ///
9424 ///# Safety
9425 ///- `device` (self) must be valid and not destroyed.
9426 ///
9427 ///# Panics
9428 ///Panics if `vkGetDeviceImageSparseMemoryRequirements` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9429 ///
9430 ///# Usage Notes
9431 ///
9432 ///Vulkan 1.3 command that queries sparse memory requirements for an
9433 ///image **without creating it first**. The counterpart to
9434 ///`get_device_image_memory_requirements` for sparse images.
9435 ///
9436 ///Only relevant if you are using sparse resources with the hypothetical
9437 ///image creation parameters.
9438 pub unsafe fn get_device_image_sparse_memory_requirements(
9439 &self,
9440 p_info: &DeviceImageMemoryRequirements,
9441 ) -> Vec<SparseImageMemoryRequirements2> {
9442 let fp = self
9443 .commands()
9444 .get_device_image_sparse_memory_requirements
9445 .expect("vkGetDeviceImageSparseMemoryRequirements not loaded");
9446 fill_two_call(|count, data| unsafe { fp(self.handle(), p_info, count, data) })
9447 }
9448 ///Wraps [`vkCreateSamplerYcbcrConversion`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateSamplerYcbcrConversion.html).
9449 /**
9450 Provided by **VK_COMPUTE_VERSION_1_1**.*/
9451 ///
9452 ///# Errors
9453 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
9454 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
9455 ///- `VK_ERROR_UNKNOWN`
9456 ///- `VK_ERROR_VALIDATION_FAILED`
9457 ///
9458 ///# Safety
9459 ///- `device` (self) must be valid and not destroyed.
9460 ///
9461 ///# Panics
9462 ///Panics if `vkCreateSamplerYcbcrConversion` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9463 ///
9464 ///# Usage Notes
9465 ///
9466 ///Creates a sampler YCBCR conversion object that describes how to
9467 ///convert YCBCR-encoded image data to RGB during sampling. Required
9468 ///for multi-planar formats like `G8_B8_R8_3PLANE_420_UNORM` commonly
9469 ///used in video decoding and camera capture.
9470 ///
9471 ///The conversion parameters specify:
9472 ///
9473 ///- **Format**: the multi-planar format being converted.
9474 ///- **YCBCR model**: `RGB_IDENTITY`, `YCBCR_IDENTITY`,
9475 /// `YCBCR_709`, `YCBCR_601`, `YCBCR_2020`.
9476 ///- **Range**: `ITU_FULL` or `ITU_NARROW`.
9477 ///- **Chroma location**: where subsampled chroma samples are located
9478 /// relative to luma samples.
9479 ///- **Chroma filter**: `NEAREST` or `LINEAR` for chroma upsampling.
9480 ///
9481 ///The conversion object is attached to a sampler via
9482 ///`SamplerYcbcrConversionInfo` in the pNext chain, and that sampler
9483 ///must be used as an immutable sampler in the descriptor set layout.
9484 pub unsafe fn create_sampler_ycbcr_conversion(
9485 &self,
9486 p_create_info: &SamplerYcbcrConversionCreateInfo,
9487 allocator: Option<&AllocationCallbacks>,
9488 ) -> VkResult<SamplerYcbcrConversion> {
9489 let fp = self
9490 .commands()
9491 .create_sampler_ycbcr_conversion
9492 .expect("vkCreateSamplerYcbcrConversion not loaded");
9493 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
9494 let mut out = unsafe { core::mem::zeroed() };
9495 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
9496 Ok(out)
9497 }
9498 ///Wraps [`vkDestroySamplerYcbcrConversion`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroySamplerYcbcrConversion.html).
9499 /**
9500 Provided by **VK_COMPUTE_VERSION_1_1**.*/
9501 ///
9502 ///# Safety
9503 ///- `device` (self) must be valid and not destroyed.
9504 ///- `ycbcrConversion` must be externally synchronized.
9505 ///
9506 ///# Panics
9507 ///Panics if `vkDestroySamplerYcbcrConversion` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9508 ///
9509 ///# Usage Notes
9510 ///
9511 ///Destroys a sampler YCBCR conversion object. Any sampler that was
9512 ///created with this conversion must already be destroyed.
9513 ///
9514 ///After destruction, any descriptor set layout that used the associated
9515 ///sampler as an immutable sampler remains valid but cannot be used to
9516 ///allocate new descriptor sets.
9517 pub unsafe fn destroy_sampler_ycbcr_conversion(
9518 &self,
9519 ycbcr_conversion: SamplerYcbcrConversion,
9520 allocator: Option<&AllocationCallbacks>,
9521 ) {
9522 let fp = self
9523 .commands()
9524 .destroy_sampler_ycbcr_conversion
9525 .expect("vkDestroySamplerYcbcrConversion not loaded");
9526 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
9527 unsafe { fp(self.handle(), ycbcr_conversion, alloc_ptr) };
9528 }
9529 ///Wraps [`vkGetDeviceQueue2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceQueue2.html).
9530 /**
9531 Provided by **VK_BASE_VERSION_1_1**.*/
9532 ///
9533 ///# Safety
9534 ///- `device` (self) must be valid and not destroyed.
9535 ///
9536 ///# Panics
9537 ///Panics if `vkGetDeviceQueue2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9538 ///
9539 ///# Usage Notes
9540 ///
9541 ///Retrieves a queue handle for a queue created with specific flags.
9542 ///This is the Vulkan 1.1 version of `get_device_queue` that supports
9543 ///`DeviceQueueInfo2` with queue creation flags.
9544 ///
9545 ///Use this instead of `get_device_queue` when you created queues with
9546 ///non-zero `DeviceQueueCreateFlags` (e.g. `PROTECTED` for protected
9547 ///content processing). For queues created without flags, both
9548 ///`get_device_queue` and `get_device_queue2` work.
9549 pub unsafe fn get_device_queue2(&self, p_queue_info: &DeviceQueueInfo2) -> Queue {
9550 let fp = self
9551 .commands()
9552 .get_device_queue2
9553 .expect("vkGetDeviceQueue2 not loaded");
9554 let mut out = unsafe { core::mem::zeroed() };
9555 unsafe { fp(self.handle(), p_queue_info, &mut out) };
9556 out
9557 }
9558 ///Wraps [`vkCreateValidationCacheEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateValidationCacheEXT.html).
9559 /**
9560 Provided by **VK_EXT_validation_cache**.*/
9561 ///
9562 ///# Errors
9563 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
9564 ///- `VK_ERROR_UNKNOWN`
9565 ///- `VK_ERROR_VALIDATION_FAILED`
9566 ///
9567 ///# Safety
9568 ///- `device` (self) must be valid and not destroyed.
9569 ///
9570 ///# Panics
9571 ///Panics if `vkCreateValidationCacheEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9572 ///
9573 ///# Usage Notes
9574 ///
9575 ///Creates a validation cache that stores the results of validation
9576 ///layer checks. Subsequent pipeline creations with the same shaders
9577 ///can skip redundant validation, improving pipeline creation time.
9578 ///
9579 ///Provide previously saved cache data to warm-start the cache.
9580 ///Retrieve data with `get_validation_cache_data_ext`.
9581 ///
9582 ///Destroy with `destroy_validation_cache_ext`.
9583 ///
9584 ///Requires `VK_EXT_validation_cache`.
9585 pub unsafe fn create_validation_cache_ext(
9586 &self,
9587 p_create_info: &ValidationCacheCreateInfoEXT,
9588 allocator: Option<&AllocationCallbacks>,
9589 ) -> VkResult<ValidationCacheEXT> {
9590 let fp = self
9591 .commands()
9592 .create_validation_cache_ext
9593 .expect("vkCreateValidationCacheEXT not loaded");
9594 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
9595 let mut out = unsafe { core::mem::zeroed() };
9596 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
9597 Ok(out)
9598 }
9599 ///Wraps [`vkDestroyValidationCacheEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyValidationCacheEXT.html).
9600 /**
9601 Provided by **VK_EXT_validation_cache**.*/
9602 ///
9603 ///# Safety
9604 ///- `device` (self) must be valid and not destroyed.
9605 ///- `validationCache` must be externally synchronized.
9606 ///
9607 ///# Panics
9608 ///Panics if `vkDestroyValidationCacheEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9609 ///
9610 ///# Usage Notes
9611 ///
9612 ///Destroys a validation cache created with
9613 ///`create_validation_cache_ext`.
9614 ///
9615 ///Requires `VK_EXT_validation_cache`.
9616 pub unsafe fn destroy_validation_cache_ext(
9617 &self,
9618 validation_cache: ValidationCacheEXT,
9619 allocator: Option<&AllocationCallbacks>,
9620 ) {
9621 let fp = self
9622 .commands()
9623 .destroy_validation_cache_ext
9624 .expect("vkDestroyValidationCacheEXT not loaded");
9625 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
9626 unsafe { fp(self.handle(), validation_cache, alloc_ptr) };
9627 }
9628 ///Wraps [`vkGetValidationCacheDataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetValidationCacheDataEXT.html).
9629 /**
9630 Provided by **VK_EXT_validation_cache**.*/
9631 ///
9632 ///# Errors
9633 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
9634 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
9635 ///- `VK_ERROR_UNKNOWN`
9636 ///- `VK_ERROR_VALIDATION_FAILED`
9637 ///
9638 ///# Safety
9639 ///- `device` (self) must be valid and not destroyed.
9640 ///
9641 ///# Panics
9642 ///Panics if `vkGetValidationCacheDataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9643 ///
9644 ///# Usage Notes
9645 ///
9646 ///Retrieves the data from a validation cache for serialization to
9647 ///disk. Call once with a null buffer to query the size, then again
9648 ///with an appropriately sized buffer.
9649 ///
9650 ///Feed the saved data back into `create_validation_cache_ext` on
9651 ///the next run to avoid redundant validation.
9652 ///
9653 ///Requires `VK_EXT_validation_cache`.
9654 pub unsafe fn get_validation_cache_data_ext(
9655 &self,
9656 validation_cache: ValidationCacheEXT,
9657 p_data: *mut core::ffi::c_void,
9658 ) -> VkResult<usize> {
9659 let fp = self
9660 .commands()
9661 .get_validation_cache_data_ext
9662 .expect("vkGetValidationCacheDataEXT not loaded");
9663 let mut out = unsafe { core::mem::zeroed() };
9664 check(unsafe { fp(self.handle(), validation_cache, &mut out, p_data) })?;
9665 Ok(out)
9666 }
9667 ///Wraps [`vkMergeValidationCachesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkMergeValidationCachesEXT.html).
9668 /**
9669 Provided by **VK_EXT_validation_cache**.*/
9670 ///
9671 ///# Errors
9672 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
9673 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
9674 ///- `VK_ERROR_UNKNOWN`
9675 ///- `VK_ERROR_VALIDATION_FAILED`
9676 ///
9677 ///# Safety
9678 ///- `device` (self) must be valid and not destroyed.
9679 ///- `dstCache` must be externally synchronized.
9680 ///
9681 ///# Panics
9682 ///Panics if `vkMergeValidationCachesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9683 ///
9684 ///# Usage Notes
9685 ///
9686 ///Merges one or more source validation caches into a destination
9687 ///cache. Useful for combining caches from parallel pipeline creation
9688 ///threads.
9689 ///
9690 ///Requires `VK_EXT_validation_cache`.
9691 pub unsafe fn merge_validation_caches_ext(
9692 &self,
9693 dst_cache: ValidationCacheEXT,
9694 p_src_caches: &[ValidationCacheEXT],
9695 ) -> VkResult<()> {
9696 let fp = self
9697 .commands()
9698 .merge_validation_caches_ext
9699 .expect("vkMergeValidationCachesEXT not loaded");
9700 check(unsafe {
9701 fp(
9702 self.handle(),
9703 dst_cache,
9704 p_src_caches.len() as u32,
9705 p_src_caches.as_ptr(),
9706 )
9707 })
9708 }
9709 ///Wraps [`vkGetDescriptorSetLayoutSupport`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDescriptorSetLayoutSupport.html).
9710 /**
9711 Provided by **VK_COMPUTE_VERSION_1_1**.*/
9712 ///
9713 ///# Safety
9714 ///- `device` (self) must be valid and not destroyed.
9715 ///
9716 ///# Panics
9717 ///Panics if `vkGetDescriptorSetLayoutSupport` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9718 ///
9719 ///# Usage Notes
9720 ///
9721 ///Queries whether a descriptor set layout with the given bindings can
9722 ///be created on this device, and returns information about the
9723 ///variable descriptor count limit if applicable.
9724 ///
9725 ///Use this before creating layouts with very large descriptor counts
9726 ///or update-after-bind bindings to verify they are within device
9727 ///limits. The call is lightweight and does not allocate anything.
9728 ///
9729 ///Chain `DescriptorSetVariableDescriptorCountLayoutSupport` in the
9730 ///output to query the maximum variable descriptor count for layouts
9731 ///that use `DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT`.
9732 pub unsafe fn get_descriptor_set_layout_support(
9733 &self,
9734 p_create_info: &DescriptorSetLayoutCreateInfo,
9735 p_support: &mut DescriptorSetLayoutSupport,
9736 ) {
9737 let fp = self
9738 .commands()
9739 .get_descriptor_set_layout_support
9740 .expect("vkGetDescriptorSetLayoutSupport not loaded");
9741 unsafe { fp(self.handle(), p_create_info, p_support) };
9742 }
9743 ///Wraps [`vkGetSwapchainGrallocUsageANDROID`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSwapchainGrallocUsageANDROID.html).
9744 ///
9745 ///# Safety
9746 ///- `device` (self) must be valid and not destroyed.
9747 ///
9748 ///# Panics
9749 ///Panics if `vkGetSwapchainGrallocUsageANDROID` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9750 ///
9751 ///# Usage Notes
9752 ///
9753 ///Queries the Android gralloc usage flags needed for swapchain
9754 ///images with the given format and Vulkan image usage. Used
9755 ///internally by the Android WSI implementation. Android only.
9756 ///
9757 ///Requires `VK_ANDROID_native_buffer`.
9758 pub unsafe fn get_swapchain_gralloc_usage_android(
9759 &self,
9760 format: Format,
9761 image_usage: ImageUsageFlags,
9762 ) -> VkResult<core::ffi::c_int> {
9763 let fp = self
9764 .commands()
9765 .get_swapchain_gralloc_usage_android
9766 .expect("vkGetSwapchainGrallocUsageANDROID not loaded");
9767 let mut out = unsafe { core::mem::zeroed() };
9768 check(unsafe { fp(self.handle(), format, image_usage, &mut out) })?;
9769 Ok(out)
9770 }
9771 ///Wraps [`vkGetSwapchainGrallocUsage2ANDROID`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSwapchainGrallocUsage2ANDROID.html).
9772 ///
9773 ///# Safety
9774 ///- `device` (self) must be valid and not destroyed.
9775 ///
9776 ///# Panics
9777 ///Panics if `vkGetSwapchainGrallocUsage2ANDROID` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9778 ///
9779 ///# Usage Notes
9780 ///
9781 ///Extended version of `get_swapchain_gralloc_usage_android` that
9782 ///additionally accepts swapchain-specific image usage flags and
9783 ///returns both producer and consumer gralloc usage. Android only.
9784 ///
9785 ///Requires `VK_ANDROID_native_buffer`.
9786 pub unsafe fn get_swapchain_gralloc_usage2_android(
9787 &self,
9788 format: Format,
9789 image_usage: ImageUsageFlags,
9790 swapchain_image_usage: SwapchainImageUsageFlagsANDROID,
9791 gralloc_consumer_usage: *mut u64,
9792 ) -> VkResult<u64> {
9793 let fp = self
9794 .commands()
9795 .get_swapchain_gralloc_usage2_android
9796 .expect("vkGetSwapchainGrallocUsage2ANDROID not loaded");
9797 let mut out = unsafe { core::mem::zeroed() };
9798 check(unsafe {
9799 fp(
9800 self.handle(),
9801 format,
9802 image_usage,
9803 swapchain_image_usage,
9804 gralloc_consumer_usage,
9805 &mut out,
9806 )
9807 })?;
9808 Ok(out)
9809 }
9810 ///Wraps [`vkAcquireImageANDROID`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAcquireImageANDROID.html).
9811 ///
9812 ///# Safety
9813 ///- `device` (self) must be valid and not destroyed.
9814 ///
9815 ///# Panics
9816 ///Panics if `vkAcquireImageANDROID` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9817 ///
9818 ///# Usage Notes
9819 ///
9820 ///Acquires ownership of a swapchain image on Android. Takes a
9821 ///native fence FD for synchronisation and can signal a Vulkan
9822 ///semaphore or fence on completion. Android only.
9823 ///
9824 ///Requires `VK_ANDROID_native_buffer`.
9825 pub unsafe fn acquire_image_android(
9826 &self,
9827 image: Image,
9828 native_fence_fd: core::ffi::c_int,
9829 semaphore: Semaphore,
9830 fence: Fence,
9831 ) -> VkResult<()> {
9832 let fp = self
9833 .commands()
9834 .acquire_image_android
9835 .expect("vkAcquireImageANDROID not loaded");
9836 check(unsafe { fp(self.handle(), image, native_fence_fd, semaphore, fence) })
9837 }
9838 ///Wraps [`vkQueueSignalReleaseImageANDROID`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueSignalReleaseImageANDROID.html).
9839 ///
9840 ///# Safety
9841 ///- `queue` (self) must be valid and not destroyed.
9842 ///
9843 ///# Panics
9844 ///Panics if `vkQueueSignalReleaseImageANDROID` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9845 ///
9846 ///# Usage Notes
9847 ///
9848 ///Releases a swapchain image back to the Android compositor after
9849 ///rendering. Waits on the given semaphores and returns a native
9850 ///fence FD for external synchronisation. Android only.
9851 ///
9852 ///Requires `VK_ANDROID_native_buffer`.
9853 pub unsafe fn queue_signal_release_image_android(
9854 &self,
9855 queue: Queue,
9856 p_wait_semaphores: &[Semaphore],
9857 image: Image,
9858 ) -> VkResult<core::ffi::c_int> {
9859 let fp = self
9860 .commands()
9861 .queue_signal_release_image_android
9862 .expect("vkQueueSignalReleaseImageANDROID not loaded");
9863 let mut out = unsafe { core::mem::zeroed() };
9864 check(unsafe {
9865 fp(
9866 queue,
9867 p_wait_semaphores.len() as u32,
9868 p_wait_semaphores.as_ptr(),
9869 image,
9870 &mut out,
9871 )
9872 })?;
9873 Ok(out)
9874 }
9875 ///Wraps [`vkGetShaderInfoAMD`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetShaderInfoAMD.html).
9876 /**
9877 Provided by **VK_AMD_shader_info**.*/
9878 ///
9879 ///# Errors
9880 ///- `VK_ERROR_FEATURE_NOT_PRESENT`
9881 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
9882 ///- `VK_ERROR_UNKNOWN`
9883 ///- `VK_ERROR_VALIDATION_FAILED`
9884 ///
9885 ///# Safety
9886 ///- `device` (self) must be valid and not destroyed.
9887 ///
9888 ///# Panics
9889 ///Panics if `vkGetShaderInfoAMD` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9890 ///
9891 ///# Usage Notes
9892 ///
9893 ///Queries AMD-specific shader information such as compiled binary
9894 ///statistics, disassembly, or resource usage. Call once with a null
9895 ///buffer to query the size, then again with an appropriately sized
9896 ///buffer.
9897 ///
9898 ///Requires `VK_AMD_shader_info`.
9899 pub unsafe fn get_shader_info_amd(
9900 &self,
9901 pipeline: Pipeline,
9902 shader_stage: ShaderStageFlagBits,
9903 info_type: ShaderInfoTypeAMD,
9904 p_info: *mut core::ffi::c_void,
9905 ) -> VkResult<usize> {
9906 let fp = self
9907 .commands()
9908 .get_shader_info_amd
9909 .expect("vkGetShaderInfoAMD not loaded");
9910 let mut out = unsafe { core::mem::zeroed() };
9911 check(unsafe {
9912 fp(
9913 self.handle(),
9914 pipeline,
9915 shader_stage,
9916 info_type,
9917 &mut out,
9918 p_info,
9919 )
9920 })?;
9921 Ok(out)
9922 }
9923 ///Wraps [`vkSetLocalDimmingAMD`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetLocalDimmingAMD.html).
9924 /**
9925 Provided by **VK_AMD_display_native_hdr**.*/
9926 ///
9927 ///# Safety
9928 ///- `device` (self) must be valid and not destroyed.
9929 ///
9930 ///# Panics
9931 ///Panics if `vkSetLocalDimmingAMD` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9932 ///
9933 ///# Usage Notes
9934 ///
9935 ///Enables or disables local dimming on an AMD display with native
9936 ///HDR support. Local dimming improves HDR contrast by adjusting
9937 ///backlight zones independently.
9938 ///
9939 ///Requires `VK_AMD_display_native_hdr`.
9940 pub unsafe fn set_local_dimming_amd(
9941 &self,
9942 swap_chain: SwapchainKHR,
9943 local_dimming_enable: bool,
9944 ) {
9945 let fp = self
9946 .commands()
9947 .set_local_dimming_amd
9948 .expect("vkSetLocalDimmingAMD not loaded");
9949 unsafe { fp(self.handle(), swap_chain, local_dimming_enable as u32) };
9950 }
9951 ///Wraps [`vkGetCalibratedTimestampsKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetCalibratedTimestampsKHR.html).
9952 /**
9953 Provided by **VK_KHR_calibrated_timestamps**.*/
9954 ///
9955 ///# Errors
9956 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
9957 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
9958 ///- `VK_ERROR_UNKNOWN`
9959 ///- `VK_ERROR_VALIDATION_FAILED`
9960 ///
9961 ///# Safety
9962 ///- `device` (self) must be valid and not destroyed.
9963 ///
9964 ///# Panics
9965 ///Panics if `vkGetCalibratedTimestampsKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
9966 ///
9967 ///# Usage Notes
9968 ///
9969 ///Samples multiple time domains simultaneously and returns
9970 ///calibrated timestamps. This allows correlating GPU timestamps
9971 ///(from `cmd_write_timestamp2`) with CPU time.
9972 ///
9973 ///Each `CalibratedTimestampInfoKHR` specifies a time domain
9974 ///(e.g., `DEVICE`, `CLOCK_MONOTONIC`, `CLOCK_MONOTONIC_RAW`,
9975 ///`QUERY_PERFORMANCE_COUNTER`). All requested timestamps are
9976 ///sampled as close together as possible.
9977 ///
9978 ///The returned `max_deviation` (in nanoseconds) bounds how far
9979 ///apart the samples could be, smaller is better. If deviation
9980 ///is too large, retry the call.
9981 ///
9982 ///Query available time domains first with
9983 ///`get_physical_device_calibrateable_time_domains_khr`.
9984 pub unsafe fn get_calibrated_timestamps_khr(
9985 &self,
9986 p_timestamp_infos: &[CalibratedTimestampInfoKHR],
9987 p_max_deviation: *mut u64,
9988 ) -> VkResult<Vec<u64>> {
9989 let fp = self
9990 .commands()
9991 .get_calibrated_timestamps_khr
9992 .expect("vkGetCalibratedTimestampsKHR not loaded");
9993 let count = p_timestamp_infos.len();
9994 let mut out = vec![unsafe { core::mem::zeroed() }; count];
9995 check(unsafe {
9996 fp(
9997 self.handle(),
9998 p_timestamp_infos.len() as u32,
9999 p_timestamp_infos.as_ptr(),
10000 out.as_mut_ptr(),
10001 p_max_deviation,
10002 )
10003 })?;
10004 Ok(out)
10005 }
10006 ///Wraps [`vkSetDebugUtilsObjectNameEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetDebugUtilsObjectNameEXT.html).
10007 /**
10008 Provided by **VK_EXT_debug_utils**.*/
10009 ///
10010 ///# Errors
10011 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
10012 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
10013 ///- `VK_ERROR_UNKNOWN`
10014 ///- `VK_ERROR_VALIDATION_FAILED`
10015 ///
10016 ///# Safety
10017 ///- `device` (self) must be valid and not destroyed.
10018 ///- `pNameInfo` must be externally synchronized.
10019 ///
10020 ///# Panics
10021 ///Panics if `vkSetDebugUtilsObjectNameEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10022 ///
10023 ///# Usage Notes
10024 ///
10025 ///Assigns a human-readable name to any Vulkan object. The name
10026 ///appears in validation layer messages, GPU debuggers (RenderDoc,
10027 ///Nsight), and crash reports.
10028 ///
10029 ///`DebugUtilsObjectNameInfoEXT` specifies the object type, handle,
10030 ///and a null-terminated UTF-8 name string.
10031 ///
10032 ///Set the name to null to remove a previously assigned name.
10033 ///
10034 ///This is the most impactful debugging tool in Vulkan, name
10035 ///every object you create.
10036 ///
10037 ///Requires `VK_EXT_debug_utils`.
10038 pub unsafe fn set_debug_utils_object_name_ext(
10039 &self,
10040 p_name_info: &DebugUtilsObjectNameInfoEXT,
10041 ) -> VkResult<()> {
10042 let fp = self
10043 .commands()
10044 .set_debug_utils_object_name_ext
10045 .expect("vkSetDebugUtilsObjectNameEXT not loaded");
10046 check(unsafe { fp(self.handle(), p_name_info) })
10047 }
10048 ///Wraps [`vkSetDebugUtilsObjectTagEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetDebugUtilsObjectTagEXT.html).
10049 /**
10050 Provided by **VK_EXT_debug_utils**.*/
10051 ///
10052 ///# Errors
10053 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
10054 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
10055 ///- `VK_ERROR_UNKNOWN`
10056 ///- `VK_ERROR_VALIDATION_FAILED`
10057 ///
10058 ///# Safety
10059 ///- `device` (self) must be valid and not destroyed.
10060 ///
10061 ///# Panics
10062 ///Panics if `vkSetDebugUtilsObjectTagEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10063 ///
10064 ///# Usage Notes
10065 ///
10066 ///Attaches arbitrary binary data to a Vulkan object. Unlike
10067 ///`set_debug_utils_object_name_ext` (which sets a string),
10068 ///tags carry opaque byte data identified by a `tag_name` (u64).
10069 ///
10070 ///Tags are consumed by debugging tools and layers that understand
10071 ///the specific `tag_name` value. Most applications only need
10072 ///`set_debug_utils_object_name_ext`, use tags for tool-specific
10073 ///metadata.
10074 ///
10075 ///Requires `VK_EXT_debug_utils`.
10076 pub unsafe fn set_debug_utils_object_tag_ext(
10077 &self,
10078 p_tag_info: &DebugUtilsObjectTagInfoEXT,
10079 ) -> VkResult<()> {
10080 let fp = self
10081 .commands()
10082 .set_debug_utils_object_tag_ext
10083 .expect("vkSetDebugUtilsObjectTagEXT not loaded");
10084 check(unsafe { fp(self.handle(), p_tag_info) })
10085 }
10086 ///Wraps [`vkQueueBeginDebugUtilsLabelEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueBeginDebugUtilsLabelEXT.html).
10087 /**
10088 Provided by **VK_EXT_debug_utils**.*/
10089 ///
10090 ///# Safety
10091 ///- `queue` (self) must be valid and not destroyed.
10092 ///- `queue` must be externally synchronized.
10093 ///
10094 ///# Panics
10095 ///Panics if `vkQueueBeginDebugUtilsLabelEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10096 ///
10097 ///# Usage Notes
10098 ///
10099 ///Opens a debug label region on a queue. All submissions between
10100 ///this call and the matching `queue_end_debug_utils_label_ext` are
10101 ///grouped under the label in GPU debuggers.
10102 ///
10103 ///Unlike `cmd_begin_debug_utils_label_ext` (which operates inside
10104 ///a command buffer), this groups entire queue submissions.
10105 ///
10106 ///Requires `VK_EXT_debug_utils`.
10107 pub unsafe fn queue_begin_debug_utils_label_ext(
10108 &self,
10109 queue: Queue,
10110 p_label_info: &DebugUtilsLabelEXT,
10111 ) {
10112 let fp = self
10113 .commands()
10114 .queue_begin_debug_utils_label_ext
10115 .expect("vkQueueBeginDebugUtilsLabelEXT not loaded");
10116 unsafe { fp(queue, p_label_info) };
10117 }
10118 ///Wraps [`vkQueueEndDebugUtilsLabelEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueEndDebugUtilsLabelEXT.html).
10119 /**
10120 Provided by **VK_EXT_debug_utils**.*/
10121 ///
10122 ///# Safety
10123 ///- `queue` (self) must be valid and not destroyed.
10124 ///- `queue` must be externally synchronized.
10125 ///
10126 ///# Panics
10127 ///Panics if `vkQueueEndDebugUtilsLabelEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10128 ///
10129 ///# Usage Notes
10130 ///
10131 ///Closes the most recently opened debug label region on the queue.
10132 ///Must be paired with a prior `queue_begin_debug_utils_label_ext`
10133 ///on the same queue.
10134 ///
10135 ///Requires `VK_EXT_debug_utils`.
10136 pub unsafe fn queue_end_debug_utils_label_ext(&self, queue: Queue) {
10137 let fp = self
10138 .commands()
10139 .queue_end_debug_utils_label_ext
10140 .expect("vkQueueEndDebugUtilsLabelEXT not loaded");
10141 unsafe { fp(queue) };
10142 }
10143 ///Wraps [`vkQueueInsertDebugUtilsLabelEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueInsertDebugUtilsLabelEXT.html).
10144 /**
10145 Provided by **VK_EXT_debug_utils**.*/
10146 ///
10147 ///# Safety
10148 ///- `queue` (self) must be valid and not destroyed.
10149 ///- `queue` must be externally synchronized.
10150 ///
10151 ///# Panics
10152 ///Panics if `vkQueueInsertDebugUtilsLabelEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10153 ///
10154 ///# Usage Notes
10155 ///
10156 ///Inserts a single-point debug label on a queue. Marks a specific
10157 ///moment in the queue's submission timeline without opening a
10158 ///begin/end region.
10159 ///
10160 ///Requires `VK_EXT_debug_utils`.
10161 pub unsafe fn queue_insert_debug_utils_label_ext(
10162 &self,
10163 queue: Queue,
10164 p_label_info: &DebugUtilsLabelEXT,
10165 ) {
10166 let fp = self
10167 .commands()
10168 .queue_insert_debug_utils_label_ext
10169 .expect("vkQueueInsertDebugUtilsLabelEXT not loaded");
10170 unsafe { fp(queue, p_label_info) };
10171 }
10172 ///Wraps [`vkCmdBeginDebugUtilsLabelEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginDebugUtilsLabelEXT.html).
10173 /**
10174 Provided by **VK_EXT_debug_utils**.*/
10175 ///
10176 ///# Safety
10177 ///- `commandBuffer` (self) must be valid and not destroyed.
10178 ///- `commandBuffer` must be externally synchronized.
10179 ///
10180 ///# Panics
10181 ///Panics if `vkCmdBeginDebugUtilsLabelEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10182 ///
10183 ///# Usage Notes
10184 ///
10185 ///Opens a debug label region in a command buffer. All commands
10186 ///recorded between this call and the matching
10187 ///`cmd_end_debug_utils_label_ext` are grouped under the label in
10188 ///GPU debuggers (RenderDoc, Nsight).
10189 ///
10190 ///`DebugUtilsLabelEXT` specifies a name and optional RGBA color
10191 ///for the region.
10192 ///
10193 ///Labels can nest. Every begin must have a matching end within the
10194 ///same command buffer.
10195 ///
10196 ///Requires `VK_EXT_debug_utils`.
10197 pub unsafe fn cmd_begin_debug_utils_label_ext(
10198 &self,
10199 command_buffer: CommandBuffer,
10200 p_label_info: &DebugUtilsLabelEXT,
10201 ) {
10202 let fp = self
10203 .commands()
10204 .cmd_begin_debug_utils_label_ext
10205 .expect("vkCmdBeginDebugUtilsLabelEXT not loaded");
10206 unsafe { fp(command_buffer, p_label_info) };
10207 }
10208 ///Wraps [`vkCmdEndDebugUtilsLabelEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndDebugUtilsLabelEXT.html).
10209 /**
10210 Provided by **VK_EXT_debug_utils**.*/
10211 ///
10212 ///# Safety
10213 ///- `commandBuffer` (self) must be valid and not destroyed.
10214 ///- `commandBuffer` must be externally synchronized.
10215 ///
10216 ///# Panics
10217 ///Panics if `vkCmdEndDebugUtilsLabelEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10218 ///
10219 ///# Usage Notes
10220 ///
10221 ///Closes the most recently opened debug label region in the command
10222 ///buffer. Must be paired with a prior `cmd_begin_debug_utils_label_ext`
10223 ///in the same command buffer.
10224 ///
10225 ///Requires `VK_EXT_debug_utils`.
10226 pub unsafe fn cmd_end_debug_utils_label_ext(&self, command_buffer: CommandBuffer) {
10227 let fp = self
10228 .commands()
10229 .cmd_end_debug_utils_label_ext
10230 .expect("vkCmdEndDebugUtilsLabelEXT not loaded");
10231 unsafe { fp(command_buffer) };
10232 }
10233 ///Wraps [`vkCmdInsertDebugUtilsLabelEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdInsertDebugUtilsLabelEXT.html).
10234 /**
10235 Provided by **VK_EXT_debug_utils**.*/
10236 ///
10237 ///# Safety
10238 ///- `commandBuffer` (self) must be valid and not destroyed.
10239 ///- `commandBuffer` must be externally synchronized.
10240 ///
10241 ///# Panics
10242 ///Panics if `vkCmdInsertDebugUtilsLabelEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10243 ///
10244 ///# Usage Notes
10245 ///
10246 ///Inserts a single-point debug label into the command buffer
10247 ///(as opposed to a begin/end region). Useful for marking specific
10248 ///events like "shadow pass complete" or "post-process start" that
10249 ///don't span a range of commands.
10250 ///
10251 ///Appears as a marker in GPU debuggers (RenderDoc, Nsight).
10252 ///
10253 ///Requires `VK_EXT_debug_utils`.
10254 pub unsafe fn cmd_insert_debug_utils_label_ext(
10255 &self,
10256 command_buffer: CommandBuffer,
10257 p_label_info: &DebugUtilsLabelEXT,
10258 ) {
10259 let fp = self
10260 .commands()
10261 .cmd_insert_debug_utils_label_ext
10262 .expect("vkCmdInsertDebugUtilsLabelEXT not loaded");
10263 unsafe { fp(command_buffer, p_label_info) };
10264 }
10265 ///Wraps [`vkGetMemoryHostPointerPropertiesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryHostPointerPropertiesEXT.html).
10266 /**
10267 Provided by **VK_EXT_external_memory_host**.*/
10268 ///
10269 ///# Errors
10270 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
10271 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
10272 ///- `VK_ERROR_UNKNOWN`
10273 ///- `VK_ERROR_VALIDATION_FAILED`
10274 ///
10275 ///# Safety
10276 ///- `device` (self) must be valid and not destroyed.
10277 ///
10278 ///# Panics
10279 ///Panics if `vkGetMemoryHostPointerPropertiesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10280 ///
10281 ///# Usage Notes
10282 ///
10283 ///Queries which memory types are compatible with importing a host
10284 ///pointer as external memory. Use this before allocating device
10285 ///memory backed by a host-allocated buffer to determine valid
10286 ///memory type bits.
10287 ///
10288 ///Requires `VK_EXT_external_memory_host`.
10289 pub unsafe fn get_memory_host_pointer_properties_ext(
10290 &self,
10291 handle_type: ExternalMemoryHandleTypeFlagBits,
10292 p_host_pointer: *const core::ffi::c_void,
10293 p_memory_host_pointer_properties: &mut MemoryHostPointerPropertiesEXT,
10294 ) -> VkResult<()> {
10295 let fp = self
10296 .commands()
10297 .get_memory_host_pointer_properties_ext
10298 .expect("vkGetMemoryHostPointerPropertiesEXT not loaded");
10299 check(unsafe {
10300 fp(
10301 self.handle(),
10302 handle_type,
10303 p_host_pointer,
10304 p_memory_host_pointer_properties,
10305 )
10306 })
10307 }
10308 ///Wraps [`vkCmdWriteBufferMarkerAMD`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWriteBufferMarkerAMD.html).
10309 /**
10310 Provided by **VK_AMD_buffer_marker**.*/
10311 ///
10312 ///# Safety
10313 ///- `commandBuffer` (self) must be valid and not destroyed.
10314 ///- `commandBuffer` must be externally synchronized.
10315 ///
10316 ///# Panics
10317 ///Panics if `vkCmdWriteBufferMarkerAMD` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10318 ///
10319 ///# Usage Notes
10320 ///
10321 ///Writes a 32-bit marker value into a buffer after a specified
10322 ///pipeline stage completes. Useful for fine-grained GPU progress
10323 ///tracking and debugging GPU hangs by identifying the last
10324 ///completed stage.
10325 ///
10326 ///Requires `VK_AMD_buffer_marker`.
10327 pub unsafe fn cmd_write_buffer_marker_amd(
10328 &self,
10329 command_buffer: CommandBuffer,
10330 pipeline_stage: PipelineStageFlagBits,
10331 dst_buffer: Buffer,
10332 dst_offset: u64,
10333 marker: u32,
10334 ) {
10335 let fp = self
10336 .commands()
10337 .cmd_write_buffer_marker_amd
10338 .expect("vkCmdWriteBufferMarkerAMD not loaded");
10339 unsafe {
10340 fp(
10341 command_buffer,
10342 pipeline_stage,
10343 dst_buffer,
10344 dst_offset,
10345 marker,
10346 )
10347 };
10348 }
10349 ///Wraps [`vkCreateRenderPass2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateRenderPass2.html).
10350 /**
10351 Provided by **VK_GRAPHICS_VERSION_1_2**.*/
10352 ///
10353 ///# Errors
10354 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
10355 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
10356 ///- `VK_ERROR_UNKNOWN`
10357 ///- `VK_ERROR_VALIDATION_FAILED`
10358 ///
10359 ///# Safety
10360 ///- `device` (self) must be valid and not destroyed.
10361 ///
10362 ///# Panics
10363 ///Panics if `vkCreateRenderPass2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10364 ///
10365 ///# Usage Notes
10366 ///
10367 ///Vulkan 1.2 version of `create_render_pass` that uses extensible
10368 ///`RenderPassCreateInfo2`, `AttachmentDescription2`,
10369 ///`SubpassDescription2`, and `SubpassDependency2` structs.
10370 ///
10371 ///Key additions over the 1.0 version:
10372 ///
10373 ///- **View masks**: `SubpassDescription2::view_mask` enables multiview
10374 /// rendering where a single draw call renders to multiple layers
10375 /// simultaneously (e.g. VR left/right eyes).
10376 ///- **Fragment density map**: chain
10377 /// `RenderPassFragmentDensityMapCreateInfoEXT` for variable-rate
10378 /// shading via density maps.
10379 ///- **Depth/stencil resolve**: `SubpassDescriptionDepthStencilResolve`
10380 /// enables automatic depth/stencil resolve at the end of a subpass.
10381 ///
10382 ///Prefer this over `create_render_pass` when targeting Vulkan 1.2+.
10383 ///For Vulkan 1.3+, consider dynamic rendering (`cmd_begin_rendering`)
10384 ///which avoids render pass objects entirely.
10385 pub unsafe fn create_render_pass2(
10386 &self,
10387 p_create_info: &RenderPassCreateInfo2,
10388 allocator: Option<&AllocationCallbacks>,
10389 ) -> VkResult<RenderPass> {
10390 let fp = self
10391 .commands()
10392 .create_render_pass2
10393 .expect("vkCreateRenderPass2 not loaded");
10394 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
10395 let mut out = unsafe { core::mem::zeroed() };
10396 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
10397 Ok(out)
10398 }
10399 ///Wraps [`vkCmdBeginRenderPass2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginRenderPass2.html).
10400 /**
10401 Provided by **VK_GRAPHICS_VERSION_1_2**.*/
10402 ///
10403 ///# Safety
10404 ///- `commandBuffer` (self) must be valid and not destroyed.
10405 ///- `commandBuffer` must be externally synchronized.
10406 ///
10407 ///# Panics
10408 ///Panics if `vkCmdBeginRenderPass2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10409 ///
10410 ///# Usage Notes
10411 ///
10412 ///Vulkan 1.2 version of `cmd_begin_render_pass` that takes an
10413 ///additional `SubpassBeginInfo` parameter specifying the subpass
10414 ///contents mode.
10415 ///
10416 ///The extensible structs allow chaining `RenderPassAttachmentBeginInfo`
10417 ///for imageless framebuffers, concrete image views are supplied at
10418 ///begin time rather than at framebuffer creation time.
10419 ///
10420 ///Prefer this over `cmd_begin_render_pass` when targeting Vulkan 1.2+.
10421 ///For Vulkan 1.3+, consider `cmd_begin_rendering` (dynamic rendering)
10422 ///which eliminates render pass and framebuffer objects entirely.
10423 pub unsafe fn cmd_begin_render_pass2(
10424 &self,
10425 command_buffer: CommandBuffer,
10426 p_render_pass_begin: &RenderPassBeginInfo,
10427 p_subpass_begin_info: &SubpassBeginInfo,
10428 ) {
10429 let fp = self
10430 .commands()
10431 .cmd_begin_render_pass2
10432 .expect("vkCmdBeginRenderPass2 not loaded");
10433 unsafe { fp(command_buffer, p_render_pass_begin, p_subpass_begin_info) };
10434 }
10435 ///Wraps [`vkCmdNextSubpass2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdNextSubpass2.html).
10436 /**
10437 Provided by **VK_GRAPHICS_VERSION_1_2**.*/
10438 ///
10439 ///# Safety
10440 ///- `commandBuffer` (self) must be valid and not destroyed.
10441 ///- `commandBuffer` must be externally synchronized.
10442 ///
10443 ///# Panics
10444 ///Panics if `vkCmdNextSubpass2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10445 ///
10446 ///# Usage Notes
10447 ///
10448 ///Vulkan 1.2 version of `cmd_next_subpass` that takes extensible
10449 ///`SubpassBeginInfo` and `SubpassEndInfo` structs.
10450 ///
10451 ///Functionally identical to `cmd_next_subpass`. Prefer this when
10452 ///targeting Vulkan 1.2+.
10453 pub unsafe fn cmd_next_subpass2(
10454 &self,
10455 command_buffer: CommandBuffer,
10456 p_subpass_begin_info: &SubpassBeginInfo,
10457 p_subpass_end_info: &SubpassEndInfo,
10458 ) {
10459 let fp = self
10460 .commands()
10461 .cmd_next_subpass2
10462 .expect("vkCmdNextSubpass2 not loaded");
10463 unsafe { fp(command_buffer, p_subpass_begin_info, p_subpass_end_info) };
10464 }
10465 ///Wraps [`vkCmdEndRenderPass2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndRenderPass2.html).
10466 /**
10467 Provided by **VK_GRAPHICS_VERSION_1_2**.*/
10468 ///
10469 ///# Safety
10470 ///- `commandBuffer` (self) must be valid and not destroyed.
10471 ///- `commandBuffer` must be externally synchronized.
10472 ///
10473 ///# Panics
10474 ///Panics if `vkCmdEndRenderPass2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10475 ///
10476 ///# Usage Notes
10477 ///
10478 ///Vulkan 1.2 version of `cmd_end_render_pass` that takes an extensible
10479 ///`SubpassEndInfo` struct.
10480 ///
10481 ///Functionally identical to `cmd_end_render_pass`. Prefer this when
10482 ///targeting Vulkan 1.2+.
10483 pub unsafe fn cmd_end_render_pass2(
10484 &self,
10485 command_buffer: CommandBuffer,
10486 p_subpass_end_info: &SubpassEndInfo,
10487 ) {
10488 let fp = self
10489 .commands()
10490 .cmd_end_render_pass2
10491 .expect("vkCmdEndRenderPass2 not loaded");
10492 unsafe { fp(command_buffer, p_subpass_end_info) };
10493 }
10494 ///Wraps [`vkGetSemaphoreCounterValue`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSemaphoreCounterValue.html).
10495 /**
10496 Provided by **VK_BASE_VERSION_1_2**.*/
10497 ///
10498 ///# Errors
10499 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
10500 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
10501 ///- `VK_ERROR_DEVICE_LOST`
10502 ///- `VK_ERROR_UNKNOWN`
10503 ///- `VK_ERROR_VALIDATION_FAILED`
10504 ///
10505 ///# Safety
10506 ///- `device` (self) must be valid and not destroyed.
10507 ///
10508 ///# Panics
10509 ///Panics if `vkGetSemaphoreCounterValue` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10510 ///
10511 ///# Usage Notes
10512 ///
10513 ///Returns the current counter value of a timeline semaphore. Timeline
10514 ///semaphores (Vulkan 1.2) use a monotonically increasing 64-bit
10515 ///counter instead of binary signaled/unsignaled state.
10516 ///
10517 ///Use this for non-blocking progress checks:
10518 ///
10519 ///```text
10520 ///let value = get_semaphore_counter_value(semaphore);
10521 ///if value >= expected_frame {
10522 /// // GPU has finished frame N, safe to reuse resources
10523 ///}
10524 ///```
10525 ///
10526 ///For blocking waits, use `wait_semaphores`. For signaling from the
10527 ///CPU, use `signal_semaphore`.
10528 ///
10529 ///Only valid for semaphores created with `SEMAPHORE_TYPE_TIMELINE`.
10530 ///Calling this on a binary semaphore is an error.
10531 pub unsafe fn get_semaphore_counter_value(&self, semaphore: Semaphore) -> VkResult<u64> {
10532 let fp = self
10533 .commands()
10534 .get_semaphore_counter_value
10535 .expect("vkGetSemaphoreCounterValue not loaded");
10536 let mut out = unsafe { core::mem::zeroed() };
10537 check(unsafe { fp(self.handle(), semaphore, &mut out) })?;
10538 Ok(out)
10539 }
10540 ///Wraps [`vkWaitSemaphores`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkWaitSemaphores.html).
10541 /**
10542 Provided by **VK_BASE_VERSION_1_2**.*/
10543 ///
10544 ///# Errors
10545 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
10546 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
10547 ///- `VK_ERROR_DEVICE_LOST`
10548 ///- `VK_ERROR_UNKNOWN`
10549 ///- `VK_ERROR_VALIDATION_FAILED`
10550 ///
10551 ///# Safety
10552 ///- `device` (self) must be valid and not destroyed.
10553 ///
10554 ///# Panics
10555 ///Panics if `vkWaitSemaphores` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10556 ///
10557 ///# Usage Notes
10558 ///
10559 ///Blocks the calling thread until one or all of the specified timeline
10560 ///semaphores reach their target values, or until the timeout expires.
10561 ///
10562 ///**`SemaphoreWaitInfo` flags**:
10563 ///
10564 ///- `SEMAPHORE_WAIT_ANY`: return when *any* semaphore reaches its
10565 /// target. Without this flag, waits for *all* semaphores.
10566 ///
10567 ///**Timeout**: in nanoseconds. `u64::MAX` for indefinite. Zero for a
10568 ///non-blocking poll.
10569 ///
10570 ///Timeline semaphore waits are the CPU-side counterpart to
10571 ///`queue_submit` timeline waits. They replace many fence-based
10572 ///synchronisation patterns with a single, more flexible primitive.
10573 ///
10574 ///```text
10575 #[doc = "// Wait for frame N to complete on the GPU"]
10576 ///let info = SemaphoreWaitInfo::builder()
10577 /// .semaphores(&[timeline_sem])
10578 /// .values(&[frame_number]);
10579 ///wait_semaphores(&info, u64::MAX);
10580 ///```
10581 ///
10582 ///Only valid for semaphores created with `SEMAPHORE_TYPE_TIMELINE`.
10583 pub unsafe fn wait_semaphores(
10584 &self,
10585 p_wait_info: &SemaphoreWaitInfo,
10586 timeout: u64,
10587 ) -> VkResult<()> {
10588 let fp = self
10589 .commands()
10590 .wait_semaphores
10591 .expect("vkWaitSemaphores not loaded");
10592 check(unsafe { fp(self.handle(), p_wait_info, timeout) })
10593 }
10594 ///Wraps [`vkSignalSemaphore`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSignalSemaphore.html).
10595 /**
10596 Provided by **VK_BASE_VERSION_1_2**.*/
10597 ///
10598 ///# Errors
10599 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
10600 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
10601 ///- `VK_ERROR_UNKNOWN`
10602 ///- `VK_ERROR_VALIDATION_FAILED`
10603 ///
10604 ///# Safety
10605 ///- `device` (self) must be valid and not destroyed.
10606 ///
10607 ///# Panics
10608 ///Panics if `vkSignalSemaphore` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10609 ///
10610 ///# Usage Notes
10611 ///
10612 ///Signals a timeline semaphore from the host (CPU), advancing its
10613 ///counter to the specified value. The value must be greater than the
10614 ///current counter value.
10615 ///
10616 ///Use this to unblock GPU work that is waiting on the semaphore via
10617 ///`queue_submit`. For example, a CPU-side data preparation step can
10618 ///signal a timeline semaphore when data is ready, and the GPU waits on
10619 ///it before processing.
10620 ///
10621 ///Only valid for semaphores created with `SEMAPHORE_TYPE_TIMELINE`.
10622 ///
10623 ///Timeline semaphores replace many use cases that previously required
10624 ///fences, they can be waited on from both the CPU (`wait_semaphores`)
10625 ///and the GPU (`queue_submit`).
10626 pub unsafe fn signal_semaphore(&self, p_signal_info: &SemaphoreSignalInfo) -> VkResult<()> {
10627 let fp = self
10628 .commands()
10629 .signal_semaphore
10630 .expect("vkSignalSemaphore not loaded");
10631 check(unsafe { fp(self.handle(), p_signal_info) })
10632 }
10633 ///Wraps [`vkGetAndroidHardwareBufferPropertiesANDROID`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetAndroidHardwareBufferPropertiesANDROID.html).
10634 /**
10635 Provided by **VK_ANDROID_external_memory_android_hardware_buffer**.*/
10636 ///
10637 ///# Errors
10638 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
10639 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR`
10640 ///- `VK_ERROR_UNKNOWN`
10641 ///- `VK_ERROR_VALIDATION_FAILED`
10642 ///
10643 ///# Safety
10644 ///- `device` (self) must be valid and not destroyed.
10645 ///
10646 ///# Panics
10647 ///Panics if `vkGetAndroidHardwareBufferPropertiesANDROID` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10648 ///
10649 ///# Usage Notes
10650 ///
10651 ///Queries the Vulkan memory properties (memory type bits, size)
10652 ///for an Android `AHardwareBuffer`. Use before importing the
10653 ///buffer as Vulkan memory. Android only.
10654 ///
10655 ///Requires `VK_ANDROID_external_memory_android_hardware_buffer`.
10656 pub unsafe fn get_android_hardware_buffer_properties_android(
10657 &self,
10658 buffer: *const core::ffi::c_void,
10659 p_properties: &mut AndroidHardwareBufferPropertiesANDROID,
10660 ) -> VkResult<()> {
10661 let fp = self
10662 .commands()
10663 .get_android_hardware_buffer_properties_android
10664 .expect("vkGetAndroidHardwareBufferPropertiesANDROID not loaded");
10665 check(unsafe { fp(self.handle(), buffer, p_properties) })
10666 }
10667 ///Wraps [`vkGetMemoryAndroidHardwareBufferANDROID`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryAndroidHardwareBufferANDROID.html).
10668 /**
10669 Provided by **VK_ANDROID_external_memory_android_hardware_buffer**.*/
10670 ///
10671 ///# Errors
10672 ///- `VK_ERROR_TOO_MANY_OBJECTS`
10673 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
10674 ///- `VK_ERROR_UNKNOWN`
10675 ///- `VK_ERROR_VALIDATION_FAILED`
10676 ///
10677 ///# Safety
10678 ///- `device` (self) must be valid and not destroyed.
10679 ///
10680 ///# Panics
10681 ///Panics if `vkGetMemoryAndroidHardwareBufferANDROID` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10682 ///
10683 ///# Usage Notes
10684 ///
10685 ///Exports a Vulkan device memory allocation as an Android
10686 ///`AHardwareBuffer` for sharing with other Android APIs (camera,
10687 ///media codec, SurfaceFlinger). Android only.
10688 ///
10689 ///Requires `VK_ANDROID_external_memory_android_hardware_buffer`.
10690 pub unsafe fn get_memory_android_hardware_buffer_android(
10691 &self,
10692 p_info: &MemoryGetAndroidHardwareBufferInfoANDROID,
10693 p_buffer: *mut *mut core::ffi::c_void,
10694 ) -> VkResult<()> {
10695 let fp = self
10696 .commands()
10697 .get_memory_android_hardware_buffer_android
10698 .expect("vkGetMemoryAndroidHardwareBufferANDROID not loaded");
10699 check(unsafe { fp(self.handle(), p_info, p_buffer) })
10700 }
10701 ///Wraps [`vkCmdDrawIndirectCount`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndirectCount.html).
10702 /**
10703 Provided by **VK_GRAPHICS_VERSION_1_2**.*/
10704 ///
10705 ///# Safety
10706 ///- `commandBuffer` (self) must be valid and not destroyed.
10707 ///- `commandBuffer` must be externally synchronized.
10708 ///
10709 ///# Panics
10710 ///Panics if `vkCmdDrawIndirectCount` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10711 ///
10712 ///# Usage Notes
10713 ///
10714 ///Draws non-indexed geometry with both the draw parameters and the
10715 ///draw **count** read from GPU buffers. The non-indexed counterpart to
10716 ///`cmd_draw_indexed_indirect_count`.
10717 ///
10718 ///See `cmd_draw_indexed_indirect_count` for a full explanation of the
10719 ///GPU-driven rendering pattern. The only difference is that this
10720 ///command reads `DrawIndirectCommand` entries instead of
10721 ///`DrawIndexedIndirectCommand`.
10722 ///
10723 ///Core in Vulkan 1.2. Previously available via
10724 ///`VK_KHR_draw_indirect_count`.
10725 pub unsafe fn cmd_draw_indirect_count(
10726 &self,
10727 command_buffer: CommandBuffer,
10728 buffer: Buffer,
10729 offset: u64,
10730 count_buffer: Buffer,
10731 count_buffer_offset: u64,
10732 max_draw_count: u32,
10733 stride: u32,
10734 ) {
10735 let fp = self
10736 .commands()
10737 .cmd_draw_indirect_count
10738 .expect("vkCmdDrawIndirectCount not loaded");
10739 unsafe {
10740 fp(
10741 command_buffer,
10742 buffer,
10743 offset,
10744 count_buffer,
10745 count_buffer_offset,
10746 max_draw_count,
10747 stride,
10748 )
10749 };
10750 }
10751 ///Wraps [`vkCmdDrawIndexedIndirectCount`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndexedIndirectCount.html).
10752 /**
10753 Provided by **VK_GRAPHICS_VERSION_1_2**.*/
10754 ///
10755 ///# Safety
10756 ///- `commandBuffer` (self) must be valid and not destroyed.
10757 ///- `commandBuffer` must be externally synchronized.
10758 ///
10759 ///# Panics
10760 ///Panics if `vkCmdDrawIndexedIndirectCount` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10761 ///
10762 ///# Usage Notes
10763 ///
10764 ///Draws indexed geometry with both the draw parameters and the draw
10765 ///**count** read from GPU buffers. The `count_buffer` contains a
10766 ///`u32` that limits how many `DrawIndexedIndirectCommand` entries from
10767 ///the main buffer are actually executed, up to `max_draw_count`.
10768 ///
10769 ///This is the key primitive for GPU-driven rendering pipelines: a
10770 ///compute shader fills an indirect buffer and writes the surviving
10771 ///draw count after culling. The CPU does not need to know the count.
10772 ///
10773 ///The main buffer must have `BUFFER_USAGE_INDIRECT_BUFFER`. The count
10774 ///buffer must also have `BUFFER_USAGE_INDIRECT_BUFFER`. The count
10775 ///offset must be a multiple of 4.
10776 ///
10777 ///Core in Vulkan 1.2. Previously available via
10778 ///`VK_KHR_draw_indirect_count`.
10779 pub unsafe fn cmd_draw_indexed_indirect_count(
10780 &self,
10781 command_buffer: CommandBuffer,
10782 buffer: Buffer,
10783 offset: u64,
10784 count_buffer: Buffer,
10785 count_buffer_offset: u64,
10786 max_draw_count: u32,
10787 stride: u32,
10788 ) {
10789 let fp = self
10790 .commands()
10791 .cmd_draw_indexed_indirect_count
10792 .expect("vkCmdDrawIndexedIndirectCount not loaded");
10793 unsafe {
10794 fp(
10795 command_buffer,
10796 buffer,
10797 offset,
10798 count_buffer,
10799 count_buffer_offset,
10800 max_draw_count,
10801 stride,
10802 )
10803 };
10804 }
10805 ///Wraps [`vkCmdSetCheckpointNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetCheckpointNV.html).
10806 /**
10807 Provided by **VK_NV_device_diagnostic_checkpoints**.*/
10808 ///
10809 ///# Safety
10810 ///- `commandBuffer` (self) must be valid and not destroyed.
10811 ///- `commandBuffer` must be externally synchronized.
10812 ///
10813 ///# Panics
10814 ///Panics if `vkCmdSetCheckpointNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10815 ///
10816 ///# Usage Notes
10817 ///
10818 ///Inserts a checkpoint marker into the command buffer for
10819 ///diagnostic purposes. If the device is lost, the most recently
10820 ///executed checkpoint can be retrieved with
10821 ///`get_queue_checkpoint_data_nv` to identify which commands
10822 ///completed before the failure.
10823 ///
10824 ///Requires `VK_NV_device_diagnostic_checkpoints`.
10825 pub unsafe fn cmd_set_checkpoint_nv(
10826 &self,
10827 command_buffer: CommandBuffer,
10828 p_checkpoint_marker: *const core::ffi::c_void,
10829 ) {
10830 let fp = self
10831 .commands()
10832 .cmd_set_checkpoint_nv
10833 .expect("vkCmdSetCheckpointNV not loaded");
10834 unsafe { fp(command_buffer, p_checkpoint_marker) };
10835 }
10836 ///Wraps [`vkGetQueueCheckpointDataNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetQueueCheckpointDataNV.html).
10837 /**
10838 Provided by **VK_NV_device_diagnostic_checkpoints**.*/
10839 ///
10840 ///# Safety
10841 ///- `queue` (self) must be valid and not destroyed.
10842 ///
10843 ///# Panics
10844 ///Panics if `vkGetQueueCheckpointDataNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10845 ///
10846 ///# Usage Notes
10847 ///
10848 ///Retrieves the checkpoint markers that were most recently executed
10849 ///on a queue before a device-lost event. Use with
10850 ///`cmd_set_checkpoint_nv` for post-mortem debugging.
10851 ///
10852 ///Requires `VK_NV_device_diagnostic_checkpoints`.
10853 pub unsafe fn get_queue_checkpoint_data_nv(&self, queue: Queue) -> Vec<CheckpointDataNV> {
10854 let fp = self
10855 .commands()
10856 .get_queue_checkpoint_data_nv
10857 .expect("vkGetQueueCheckpointDataNV not loaded");
10858 fill_two_call(|count, data| unsafe { fp(queue, count, data) })
10859 }
10860 ///Wraps [`vkCmdBindTransformFeedbackBuffersEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindTransformFeedbackBuffersEXT.html).
10861 /**
10862 Provided by **VK_EXT_transform_feedback**.*/
10863 ///
10864 ///# Safety
10865 ///- `commandBuffer` (self) must be valid and not destroyed.
10866 ///- `commandBuffer` must be externally synchronized.
10867 ///
10868 ///# Panics
10869 ///Panics if `vkCmdBindTransformFeedbackBuffersEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10870 ///
10871 ///# Usage Notes
10872 ///
10873 ///Binds buffers for transform feedback output. Each binding slot
10874 ///receives vertex data streamed from the vertex or geometry shader
10875 ///during a transform feedback pass.
10876 ///
10877 ///`first_binding` is the first binding index. Arrays of buffers,
10878 ///offsets, and sizes specify the output targets.
10879 ///
10880 ///Must be called before `cmd_begin_transform_feedback_ext`.
10881 ///
10882 ///Requires `VK_EXT_transform_feedback`.
10883 pub unsafe fn cmd_bind_transform_feedback_buffers_ext(
10884 &self,
10885 command_buffer: CommandBuffer,
10886 first_binding: u32,
10887 p_buffers: &[Buffer],
10888 p_offsets: &[u64],
10889 p_sizes: &[u64],
10890 ) {
10891 let fp = self
10892 .commands()
10893 .cmd_bind_transform_feedback_buffers_ext
10894 .expect("vkCmdBindTransformFeedbackBuffersEXT not loaded");
10895 unsafe {
10896 fp(
10897 command_buffer,
10898 first_binding,
10899 p_buffers.len() as u32,
10900 p_buffers.as_ptr(),
10901 p_offsets.as_ptr(),
10902 p_sizes.as_ptr(),
10903 )
10904 };
10905 }
10906 ///Wraps [`vkCmdBeginTransformFeedbackEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginTransformFeedbackEXT.html).
10907 /**
10908 Provided by **VK_EXT_transform_feedback**.*/
10909 ///
10910 ///# Safety
10911 ///- `commandBuffer` (self) must be valid and not destroyed.
10912 ///- `commandBuffer` must be externally synchronized.
10913 ///
10914 ///# Panics
10915 ///Panics if `vkCmdBeginTransformFeedbackEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10916 ///
10917 ///# Usage Notes
10918 ///
10919 ///Begins a transform feedback pass. Vertex shader outputs (or
10920 ///geometry shader outputs) are written to transform feedback buffers
10921 ///previously bound with `cmd_bind_transform_feedback_buffers_ext`.
10922 ///
10923 ///`first_counter_buffer` and `p_counter_buffer_offsets` specify
10924 ///where to resume writing from (pass null offsets to start from
10925 ///scratch).
10926 ///
10927 ///End with `cmd_end_transform_feedback_ext`.
10928 ///
10929 ///Requires `VK_EXT_transform_feedback` and the
10930 ///`transformFeedback` feature.
10931 pub unsafe fn cmd_begin_transform_feedback_ext(
10932 &self,
10933 command_buffer: CommandBuffer,
10934 first_counter_buffer: u32,
10935 p_counter_buffers: &[Buffer],
10936 p_counter_buffer_offsets: &[u64],
10937 ) {
10938 let fp = self
10939 .commands()
10940 .cmd_begin_transform_feedback_ext
10941 .expect("vkCmdBeginTransformFeedbackEXT not loaded");
10942 unsafe {
10943 fp(
10944 command_buffer,
10945 first_counter_buffer,
10946 p_counter_buffers.len() as u32,
10947 p_counter_buffers.as_ptr(),
10948 p_counter_buffer_offsets.as_ptr(),
10949 )
10950 };
10951 }
10952 ///Wraps [`vkCmdEndTransformFeedbackEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndTransformFeedbackEXT.html).
10953 /**
10954 Provided by **VK_EXT_transform_feedback**.*/
10955 ///
10956 ///# Safety
10957 ///- `commandBuffer` (self) must be valid and not destroyed.
10958 ///- `commandBuffer` must be externally synchronized.
10959 ///
10960 ///# Panics
10961 ///Panics if `vkCmdEndTransformFeedbackEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
10962 ///
10963 ///# Usage Notes
10964 ///
10965 ///Ends a transform feedback pass started with
10966 ///`cmd_begin_transform_feedback_ext`. Counter values are written
10967 ///back to the counter buffers so that a subsequent pass can resume
10968 ///where this one left off.
10969 ///
10970 ///Requires `VK_EXT_transform_feedback`.
10971 pub unsafe fn cmd_end_transform_feedback_ext(
10972 &self,
10973 command_buffer: CommandBuffer,
10974 first_counter_buffer: u32,
10975 p_counter_buffers: &[Buffer],
10976 p_counter_buffer_offsets: &[u64],
10977 ) {
10978 let fp = self
10979 .commands()
10980 .cmd_end_transform_feedback_ext
10981 .expect("vkCmdEndTransformFeedbackEXT not loaded");
10982 unsafe {
10983 fp(
10984 command_buffer,
10985 first_counter_buffer,
10986 p_counter_buffers.len() as u32,
10987 p_counter_buffers.as_ptr(),
10988 p_counter_buffer_offsets.as_ptr(),
10989 )
10990 };
10991 }
10992 ///Wraps [`vkCmdBeginQueryIndexedEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginQueryIndexedEXT.html).
10993 /**
10994 Provided by **VK_EXT_transform_feedback**.*/
10995 ///
10996 ///# Safety
10997 ///- `commandBuffer` (self) must be valid and not destroyed.
10998 ///- `commandBuffer` must be externally synchronized.
10999 ///
11000 ///# Panics
11001 ///Panics if `vkCmdBeginQueryIndexedEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11002 ///
11003 ///# Usage Notes
11004 ///
11005 ///Begins an indexed query, like `cmd_begin_query` but with an
11006 ///additional `index` parameter that selects which vertex stream
11007 ///to query when used with transform feedback statistics queries.
11008 ///
11009 ///For `QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT`, the index
11010 ///selects the stream (0–3). For other query types, index must be 0.
11011 ///
11012 ///End with `cmd_end_query_indexed_ext`.
11013 ///
11014 ///Requires `VK_EXT_transform_feedback`.
11015 pub unsafe fn cmd_begin_query_indexed_ext(
11016 &self,
11017 command_buffer: CommandBuffer,
11018 query_pool: QueryPool,
11019 query: u32,
11020 flags: QueryControlFlags,
11021 index: u32,
11022 ) {
11023 let fp = self
11024 .commands()
11025 .cmd_begin_query_indexed_ext
11026 .expect("vkCmdBeginQueryIndexedEXT not loaded");
11027 unsafe { fp(command_buffer, query_pool, query, flags, index) };
11028 }
11029 ///Wraps [`vkCmdEndQueryIndexedEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndQueryIndexedEXT.html).
11030 /**
11031 Provided by **VK_EXT_transform_feedback**.*/
11032 ///
11033 ///# Safety
11034 ///- `commandBuffer` (self) must be valid and not destroyed.
11035 ///- `commandBuffer` must be externally synchronized.
11036 ///
11037 ///# Panics
11038 ///Panics if `vkCmdEndQueryIndexedEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11039 ///
11040 ///# Usage Notes
11041 ///
11042 ///Ends an indexed query started with `cmd_begin_query_indexed_ext`.
11043 ///The `index` parameter must match the one used in the begin call.
11044 ///
11045 ///Requires `VK_EXT_transform_feedback`.
11046 pub unsafe fn cmd_end_query_indexed_ext(
11047 &self,
11048 command_buffer: CommandBuffer,
11049 query_pool: QueryPool,
11050 query: u32,
11051 index: u32,
11052 ) {
11053 let fp = self
11054 .commands()
11055 .cmd_end_query_indexed_ext
11056 .expect("vkCmdEndQueryIndexedEXT not loaded");
11057 unsafe { fp(command_buffer, query_pool, query, index) };
11058 }
11059 ///Wraps [`vkCmdDrawIndirectByteCountEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndirectByteCountEXT.html).
11060 /**
11061 Provided by **VK_EXT_transform_feedback**.*/
11062 ///
11063 ///# Safety
11064 ///- `commandBuffer` (self) must be valid and not destroyed.
11065 ///- `commandBuffer` must be externally synchronized.
11066 ///
11067 ///# Panics
11068 ///Panics if `vkCmdDrawIndirectByteCountEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11069 ///
11070 ///# Usage Notes
11071 ///
11072 ///Draws vertices using a byte count stored in a counter buffer
11073 ///(typically written by a transform feedback pass). The vertex
11074 ///count is computed as `counter_value / vertex_stride`.
11075 ///
11076 ///`counter_offset` accounts for any header bytes before the
11077 ///counter value in the buffer.
11078 ///
11079 ///Requires `VK_EXT_transform_feedback`.
11080 pub unsafe fn cmd_draw_indirect_byte_count_ext(
11081 &self,
11082 command_buffer: CommandBuffer,
11083 instance_count: u32,
11084 first_instance: u32,
11085 counter_buffer: Buffer,
11086 counter_buffer_offset: u64,
11087 counter_offset: u32,
11088 vertex_stride: u32,
11089 ) {
11090 let fp = self
11091 .commands()
11092 .cmd_draw_indirect_byte_count_ext
11093 .expect("vkCmdDrawIndirectByteCountEXT not loaded");
11094 unsafe {
11095 fp(
11096 command_buffer,
11097 instance_count,
11098 first_instance,
11099 counter_buffer,
11100 counter_buffer_offset,
11101 counter_offset,
11102 vertex_stride,
11103 )
11104 };
11105 }
11106 ///Wraps [`vkCmdSetExclusiveScissorNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetExclusiveScissorNV.html).
11107 /**
11108 Provided by **VK_NV_scissor_exclusive**.*/
11109 ///
11110 ///# Safety
11111 ///- `commandBuffer` (self) must be valid and not destroyed.
11112 ///- `commandBuffer` must be externally synchronized.
11113 ///
11114 ///# Panics
11115 ///Panics if `vkCmdSetExclusiveScissorNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11116 ///
11117 ///# Usage Notes
11118 ///
11119 ///Dynamically sets the exclusive scissor rectangles for one or
11120 ///more viewports. Fragments outside these rectangles are discarded
11121 ///when exclusive scissor testing is enabled.
11122 ///
11123 ///Requires `VK_NV_scissor_exclusive`.
11124 pub unsafe fn cmd_set_exclusive_scissor_nv(
11125 &self,
11126 command_buffer: CommandBuffer,
11127 first_exclusive_scissor: u32,
11128 p_exclusive_scissors: &[Rect2D],
11129 ) {
11130 let fp = self
11131 .commands()
11132 .cmd_set_exclusive_scissor_nv
11133 .expect("vkCmdSetExclusiveScissorNV not loaded");
11134 unsafe {
11135 fp(
11136 command_buffer,
11137 first_exclusive_scissor,
11138 p_exclusive_scissors.len() as u32,
11139 p_exclusive_scissors.as_ptr(),
11140 )
11141 };
11142 }
11143 ///Wraps [`vkCmdSetExclusiveScissorEnableNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetExclusiveScissorEnableNV.html).
11144 /**
11145 Provided by **VK_NV_scissor_exclusive**.*/
11146 ///
11147 ///# Safety
11148 ///- `commandBuffer` (self) must be valid and not destroyed.
11149 ///- `commandBuffer` must be externally synchronized.
11150 ///
11151 ///# Panics
11152 ///Panics if `vkCmdSetExclusiveScissorEnableNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11153 ///
11154 ///# Usage Notes
11155 ///
11156 ///Dynamically enables or disables the exclusive scissor test for
11157 ///one or more viewports. When enabled, fragments outside the
11158 ///exclusive scissor rectangle are discarded.
11159 ///
11160 ///Requires `VK_NV_scissor_exclusive`.
11161 pub unsafe fn cmd_set_exclusive_scissor_enable_nv(
11162 &self,
11163 command_buffer: CommandBuffer,
11164 first_exclusive_scissor: u32,
11165 p_exclusive_scissor_enables: &[u32],
11166 ) {
11167 let fp = self
11168 .commands()
11169 .cmd_set_exclusive_scissor_enable_nv
11170 .expect("vkCmdSetExclusiveScissorEnableNV not loaded");
11171 unsafe {
11172 fp(
11173 command_buffer,
11174 first_exclusive_scissor,
11175 p_exclusive_scissor_enables.len() as u32,
11176 p_exclusive_scissor_enables.as_ptr(),
11177 )
11178 };
11179 }
11180 ///Wraps [`vkCmdBindShadingRateImageNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindShadingRateImageNV.html).
11181 /**
11182 Provided by **VK_NV_shading_rate_image**.*/
11183 ///
11184 ///# Safety
11185 ///- `commandBuffer` (self) must be valid and not destroyed.
11186 ///- `commandBuffer` must be externally synchronized.
11187 ///
11188 ///# Panics
11189 ///Panics if `vkCmdBindShadingRateImageNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11190 ///
11191 ///# Usage Notes
11192 ///
11193 ///Binds a shading rate image that controls per-region fragment
11194 ///shading rate. Each texel in the image maps to a tile of the
11195 ///framebuffer and specifies the coarse shading rate for that tile.
11196 ///
11197 ///Requires `VK_NV_shading_rate_image`.
11198 pub unsafe fn cmd_bind_shading_rate_image_nv(
11199 &self,
11200 command_buffer: CommandBuffer,
11201 image_view: ImageView,
11202 image_layout: ImageLayout,
11203 ) {
11204 let fp = self
11205 .commands()
11206 .cmd_bind_shading_rate_image_nv
11207 .expect("vkCmdBindShadingRateImageNV not loaded");
11208 unsafe { fp(command_buffer, image_view, image_layout) };
11209 }
11210 ///Wraps [`vkCmdSetViewportShadingRatePaletteNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetViewportShadingRatePaletteNV.html).
11211 /**
11212 Provided by **VK_NV_shading_rate_image**.*/
11213 ///
11214 ///# Safety
11215 ///- `commandBuffer` (self) must be valid and not destroyed.
11216 ///- `commandBuffer` must be externally synchronized.
11217 ///
11218 ///# Panics
11219 ///Panics if `vkCmdSetViewportShadingRatePaletteNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11220 ///
11221 ///# Usage Notes
11222 ///
11223 ///Sets the shading rate palette for one or more viewports. The
11224 ///palette maps shading rate image texel values to actual shading
11225 ///rates (e.g., 1x1, 2x2, 4x4).
11226 ///
11227 ///Requires `VK_NV_shading_rate_image`.
11228 pub unsafe fn cmd_set_viewport_shading_rate_palette_nv(
11229 &self,
11230 command_buffer: CommandBuffer,
11231 first_viewport: u32,
11232 p_shading_rate_palettes: &[ShadingRatePaletteNV],
11233 ) {
11234 let fp = self
11235 .commands()
11236 .cmd_set_viewport_shading_rate_palette_nv
11237 .expect("vkCmdSetViewportShadingRatePaletteNV not loaded");
11238 unsafe {
11239 fp(
11240 command_buffer,
11241 first_viewport,
11242 p_shading_rate_palettes.len() as u32,
11243 p_shading_rate_palettes.as_ptr(),
11244 )
11245 };
11246 }
11247 ///Wraps [`vkCmdSetCoarseSampleOrderNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetCoarseSampleOrderNV.html).
11248 /**
11249 Provided by **VK_NV_shading_rate_image**.*/
11250 ///
11251 ///# Safety
11252 ///- `commandBuffer` (self) must be valid and not destroyed.
11253 ///- `commandBuffer` must be externally synchronized.
11254 ///
11255 ///# Panics
11256 ///Panics if `vkCmdSetCoarseSampleOrderNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11257 ///
11258 ///# Usage Notes
11259 ///
11260 ///Sets the sample ordering for coarse shading rate fragments. By
11261 ///default, the driver chooses sample order; use this to specify a
11262 ///custom order when the fragment shader relies on specific sample
11263 ///positions within coarse fragments.
11264 ///
11265 ///Requires `VK_NV_shading_rate_image`.
11266 pub unsafe fn cmd_set_coarse_sample_order_nv(
11267 &self,
11268 command_buffer: CommandBuffer,
11269 sample_order_type: CoarseSampleOrderTypeNV,
11270 p_custom_sample_orders: &[CoarseSampleOrderCustomNV],
11271 ) {
11272 let fp = self
11273 .commands()
11274 .cmd_set_coarse_sample_order_nv
11275 .expect("vkCmdSetCoarseSampleOrderNV not loaded");
11276 unsafe {
11277 fp(
11278 command_buffer,
11279 sample_order_type,
11280 p_custom_sample_orders.len() as u32,
11281 p_custom_sample_orders.as_ptr(),
11282 )
11283 };
11284 }
11285 ///Wraps [`vkCmdDrawMeshTasksNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMeshTasksNV.html).
11286 /**
11287 Provided by **VK_NV_mesh_shader**.*/
11288 ///
11289 ///# Safety
11290 ///- `commandBuffer` (self) must be valid and not destroyed.
11291 ///- `commandBuffer` must be externally synchronized.
11292 ///
11293 ///# Panics
11294 ///Panics if `vkCmdDrawMeshTasksNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11295 ///
11296 ///# Usage Notes
11297 ///
11298 ///Dispatches mesh shader work using the NV mesh shader model.
11299 ///Launches `task_count` task shader workgroups starting at
11300 ///`first_task`.
11301 ///
11302 ///This is the legacy NV path; prefer `cmd_draw_mesh_tasks_ext`
11303 ///for new code.
11304 ///
11305 ///Requires `VK_NV_mesh_shader`.
11306 pub unsafe fn cmd_draw_mesh_tasks_nv(
11307 &self,
11308 command_buffer: CommandBuffer,
11309 task_count: u32,
11310 first_task: u32,
11311 ) {
11312 let fp = self
11313 .commands()
11314 .cmd_draw_mesh_tasks_nv
11315 .expect("vkCmdDrawMeshTasksNV not loaded");
11316 unsafe { fp(command_buffer, task_count, first_task) };
11317 }
11318 ///Wraps [`vkCmdDrawMeshTasksIndirectNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMeshTasksIndirectNV.html).
11319 /**
11320 Provided by **VK_NV_mesh_shader**.*/
11321 ///
11322 ///# Safety
11323 ///- `commandBuffer` (self) must be valid and not destroyed.
11324 ///- `commandBuffer` must be externally synchronized.
11325 ///
11326 ///# Panics
11327 ///Panics if `vkCmdDrawMeshTasksIndirectNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11328 ///
11329 ///# Usage Notes
11330 ///
11331 ///Indirect variant of `cmd_draw_mesh_tasks_nv`. Reads draw
11332 ///parameters from a buffer, enabling GPU-driven mesh shader
11333 ///dispatch.
11334 ///
11335 ///Requires `VK_NV_mesh_shader`.
11336 pub unsafe fn cmd_draw_mesh_tasks_indirect_nv(
11337 &self,
11338 command_buffer: CommandBuffer,
11339 buffer: Buffer,
11340 offset: u64,
11341 draw_count: u32,
11342 stride: u32,
11343 ) {
11344 let fp = self
11345 .commands()
11346 .cmd_draw_mesh_tasks_indirect_nv
11347 .expect("vkCmdDrawMeshTasksIndirectNV not loaded");
11348 unsafe { fp(command_buffer, buffer, offset, draw_count, stride) };
11349 }
11350 ///Wraps [`vkCmdDrawMeshTasksIndirectCountNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMeshTasksIndirectCountNV.html).
11351 /**
11352 Provided by **VK_NV_mesh_shader**.*/
11353 ///
11354 ///# Safety
11355 ///- `commandBuffer` (self) must be valid and not destroyed.
11356 ///- `commandBuffer` must be externally synchronized.
11357 ///
11358 ///# Panics
11359 ///Panics if `vkCmdDrawMeshTasksIndirectCountNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11360 ///
11361 ///# Usage Notes
11362 ///
11363 ///Indirect-count variant of `cmd_draw_mesh_tasks_nv`. Reads both
11364 ///the draw parameters and the draw count from GPU buffers, enabling
11365 ///fully GPU-driven mesh shader dispatch where the number of draws
11366 ///is determined at runtime.
11367 ///
11368 ///Requires `VK_NV_mesh_shader`.
11369 pub unsafe fn cmd_draw_mesh_tasks_indirect_count_nv(
11370 &self,
11371 command_buffer: CommandBuffer,
11372 buffer: Buffer,
11373 offset: u64,
11374 count_buffer: Buffer,
11375 count_buffer_offset: u64,
11376 max_draw_count: u32,
11377 stride: u32,
11378 ) {
11379 let fp = self
11380 .commands()
11381 .cmd_draw_mesh_tasks_indirect_count_nv
11382 .expect("vkCmdDrawMeshTasksIndirectCountNV not loaded");
11383 unsafe {
11384 fp(
11385 command_buffer,
11386 buffer,
11387 offset,
11388 count_buffer,
11389 count_buffer_offset,
11390 max_draw_count,
11391 stride,
11392 )
11393 };
11394 }
11395 ///Wraps [`vkCmdDrawMeshTasksEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMeshTasksEXT.html).
11396 /**
11397 Provided by **VK_EXT_mesh_shader**.*/
11398 ///
11399 ///# Safety
11400 ///- `commandBuffer` (self) must be valid and not destroyed.
11401 ///- `commandBuffer` must be externally synchronized.
11402 ///
11403 ///# Panics
11404 ///Panics if `vkCmdDrawMeshTasksEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11405 ///
11406 ///# Usage Notes
11407 ///
11408 ///Dispatches mesh shader work groups. `group_count_x/y/z` specify
11409 ///the number of task or mesh shader work groups to launch.
11410 ///
11411 ///Each work group runs the mesh shader (or task shader, if bound)
11412 ///which emits primitives directly without traditional vertex/index
11413 ///buffers.
11414 ///
11415 ///Requires `VK_EXT_mesh_shader` and the `meshShader` feature.
11416 pub unsafe fn cmd_draw_mesh_tasks_ext(
11417 &self,
11418 command_buffer: CommandBuffer,
11419 group_count_x: u32,
11420 group_count_y: u32,
11421 group_count_z: u32,
11422 ) {
11423 let fp = self
11424 .commands()
11425 .cmd_draw_mesh_tasks_ext
11426 .expect("vkCmdDrawMeshTasksEXT not loaded");
11427 unsafe { fp(command_buffer, group_count_x, group_count_y, group_count_z) };
11428 }
11429 ///Wraps [`vkCmdDrawMeshTasksIndirectEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMeshTasksIndirectEXT.html).
11430 /**
11431 Provided by **VK_EXT_mesh_shader**.*/
11432 ///
11433 ///# Safety
11434 ///- `commandBuffer` (self) must be valid and not destroyed.
11435 ///- `commandBuffer` must be externally synchronized.
11436 ///
11437 ///# Panics
11438 ///Panics if `vkCmdDrawMeshTasksIndirectEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11439 ///
11440 ///# Usage Notes
11441 ///
11442 ///Indirect version of `cmd_draw_mesh_tasks_ext`. Reads mesh shader
11443 ///dispatch parameters from a buffer. Each indirect command contains
11444 ///group counts (x, y, z).
11445 ///
11446 ///`draw_count` specifies how many indirect commands to execute.
11447 ///`stride` is the byte stride between commands in the buffer.
11448 ///
11449 ///Requires `VK_EXT_mesh_shader`.
11450 pub unsafe fn cmd_draw_mesh_tasks_indirect_ext(
11451 &self,
11452 command_buffer: CommandBuffer,
11453 buffer: Buffer,
11454 offset: u64,
11455 draw_count: u32,
11456 stride: u32,
11457 ) {
11458 let fp = self
11459 .commands()
11460 .cmd_draw_mesh_tasks_indirect_ext
11461 .expect("vkCmdDrawMeshTasksIndirectEXT not loaded");
11462 unsafe { fp(command_buffer, buffer, offset, draw_count, stride) };
11463 }
11464 ///Wraps [`vkCmdDrawMeshTasksIndirectCountEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMeshTasksIndirectCountEXT.html).
11465 /**
11466 Provided by **VK_EXT_mesh_shader**.*/
11467 ///
11468 ///# Safety
11469 ///- `commandBuffer` (self) must be valid and not destroyed.
11470 ///- `commandBuffer` must be externally synchronized.
11471 ///
11472 ///# Panics
11473 ///Panics if `vkCmdDrawMeshTasksIndirectCountEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11474 ///
11475 ///# Usage Notes
11476 ///
11477 ///Count-indirect version of mesh shader dispatch. Both the dispatch
11478 ///parameters and the draw count are read from GPU buffers, enabling
11479 ///fully GPU-driven mesh shader workloads.
11480 ///
11481 ///`max_draw_count` caps the count read from the count buffer.
11482 ///
11483 ///Requires `VK_EXT_mesh_shader`.
11484 pub unsafe fn cmd_draw_mesh_tasks_indirect_count_ext(
11485 &self,
11486 command_buffer: CommandBuffer,
11487 buffer: Buffer,
11488 offset: u64,
11489 count_buffer: Buffer,
11490 count_buffer_offset: u64,
11491 max_draw_count: u32,
11492 stride: u32,
11493 ) {
11494 let fp = self
11495 .commands()
11496 .cmd_draw_mesh_tasks_indirect_count_ext
11497 .expect("vkCmdDrawMeshTasksIndirectCountEXT not loaded");
11498 unsafe {
11499 fp(
11500 command_buffer,
11501 buffer,
11502 offset,
11503 count_buffer,
11504 count_buffer_offset,
11505 max_draw_count,
11506 stride,
11507 )
11508 };
11509 }
11510 ///Wraps [`vkCompileDeferredNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCompileDeferredNV.html).
11511 /**
11512 Provided by **VK_NV_ray_tracing**.*/
11513 ///
11514 ///# Errors
11515 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
11516 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
11517 ///- `VK_ERROR_UNKNOWN`
11518 ///- `VK_ERROR_VALIDATION_FAILED`
11519 ///
11520 ///# Safety
11521 ///- `device` (self) must be valid and not destroyed.
11522 ///
11523 ///# Panics
11524 ///Panics if `vkCompileDeferredNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11525 ///
11526 ///# Usage Notes
11527 ///
11528 ///Triggers compilation of a deferred shader in an NV ray tracing
11529 ///pipeline. When a pipeline is created with
11530 ///`PIPELINE_CREATE_DEFER_COMPILE_BIT_NV`, individual shaders can
11531 ///be compiled on demand using this command.
11532 ///
11533 ///Useful for spreading compilation cost across frames or threads.
11534 ///
11535 ///Requires `VK_NV_ray_tracing`.
11536 pub unsafe fn compile_deferred_nv(&self, pipeline: Pipeline, shader: u32) -> VkResult<()> {
11537 let fp = self
11538 .commands()
11539 .compile_deferred_nv
11540 .expect("vkCompileDeferredNV not loaded");
11541 check(unsafe { fp(self.handle(), pipeline, shader) })
11542 }
11543 ///Wraps [`vkCreateAccelerationStructureNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateAccelerationStructureNV.html).
11544 /**
11545 Provided by **VK_NV_ray_tracing**.*/
11546 ///
11547 ///# Errors
11548 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
11549 ///- `VK_ERROR_UNKNOWN`
11550 ///- `VK_ERROR_VALIDATION_FAILED`
11551 ///
11552 ///# Safety
11553 ///- `device` (self) must be valid and not destroyed.
11554 ///
11555 ///# Panics
11556 ///Panics if `vkCreateAccelerationStructureNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11557 ///
11558 ///# Usage Notes
11559 ///
11560 ///Creates an NV ray tracing acceleration structure. This is the
11561 ///legacy NV path; prefer `create_acceleration_structure_khr` for
11562 ///new code.
11563 ///
11564 ///The NV acceleration structure owns its memory implicitly, bind
11565 ///memory with `bind_acceleration_structure_memory_nv`. Destroy with
11566 ///`destroy_acceleration_structure_nv`.
11567 ///
11568 ///Requires `VK_NV_ray_tracing`.
11569 pub unsafe fn create_acceleration_structure_nv(
11570 &self,
11571 p_create_info: &AccelerationStructureCreateInfoNV,
11572 allocator: Option<&AllocationCallbacks>,
11573 ) -> VkResult<AccelerationStructureNV> {
11574 let fp = self
11575 .commands()
11576 .create_acceleration_structure_nv
11577 .expect("vkCreateAccelerationStructureNV not loaded");
11578 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
11579 let mut out = unsafe { core::mem::zeroed() };
11580 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
11581 Ok(out)
11582 }
11583 ///Wraps [`vkCmdBindInvocationMaskHUAWEI`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindInvocationMaskHUAWEI.html).
11584 /**
11585 Provided by **VK_HUAWEI_invocation_mask**.*/
11586 ///
11587 ///# Safety
11588 ///- `commandBuffer` (self) must be valid and not destroyed.
11589 ///- `commandBuffer` must be externally synchronized.
11590 ///
11591 ///# Panics
11592 ///Panics if `vkCmdBindInvocationMaskHUAWEI` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11593 ///
11594 ///# Usage Notes
11595 ///
11596 ///Binds an image view as an invocation mask for ray tracing. The
11597 ///mask selectively enables or disables ray generation shader
11598 ///invocations per pixel, allowing efficient partial-screen ray
11599 ///tracing on Huawei GPUs.
11600 ///
11601 ///Requires `VK_HUAWEI_invocation_mask`.
11602 pub unsafe fn cmd_bind_invocation_mask_huawei(
11603 &self,
11604 command_buffer: CommandBuffer,
11605 image_view: ImageView,
11606 image_layout: ImageLayout,
11607 ) {
11608 let fp = self
11609 .commands()
11610 .cmd_bind_invocation_mask_huawei
11611 .expect("vkCmdBindInvocationMaskHUAWEI not loaded");
11612 unsafe { fp(command_buffer, image_view, image_layout) };
11613 }
11614 ///Wraps [`vkDestroyAccelerationStructureKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyAccelerationStructureKHR.html).
11615 /**
11616 Provided by **VK_KHR_acceleration_structure**.*/
11617 ///
11618 ///# Safety
11619 ///- `device` (self) must be valid and not destroyed.
11620 ///- `accelerationStructure` must be externally synchronized.
11621 ///
11622 ///# Panics
11623 ///Panics if `vkDestroyAccelerationStructureKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11624 ///
11625 ///# Usage Notes
11626 ///
11627 ///Destroys an acceleration structure. The structure must not be
11628 ///referenced by any pending ray tracing command or TLAS build.
11629 ///
11630 ///Destroying the acceleration structure does not free the backing
11631 ///buffer, destroy or reclaim it separately.
11632 pub unsafe fn destroy_acceleration_structure_khr(
11633 &self,
11634 acceleration_structure: AccelerationStructureKHR,
11635 allocator: Option<&AllocationCallbacks>,
11636 ) {
11637 let fp = self
11638 .commands()
11639 .destroy_acceleration_structure_khr
11640 .expect("vkDestroyAccelerationStructureKHR not loaded");
11641 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
11642 unsafe { fp(self.handle(), acceleration_structure, alloc_ptr) };
11643 }
11644 ///Wraps [`vkDestroyAccelerationStructureNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyAccelerationStructureNV.html).
11645 /**
11646 Provided by **VK_NV_ray_tracing**.*/
11647 ///
11648 ///# Safety
11649 ///- `device` (self) must be valid and not destroyed.
11650 ///- `accelerationStructure` must be externally synchronized.
11651 ///
11652 ///# Panics
11653 ///Panics if `vkDestroyAccelerationStructureNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11654 ///
11655 ///# Usage Notes
11656 ///
11657 ///Destroys an NV acceleration structure created with
11658 ///`create_acceleration_structure_nv`. The structure must not be
11659 ///referenced by any pending command.
11660 ///
11661 ///Requires `VK_NV_ray_tracing`.
11662 pub unsafe fn destroy_acceleration_structure_nv(
11663 &self,
11664 acceleration_structure: AccelerationStructureNV,
11665 allocator: Option<&AllocationCallbacks>,
11666 ) {
11667 let fp = self
11668 .commands()
11669 .destroy_acceleration_structure_nv
11670 .expect("vkDestroyAccelerationStructureNV not loaded");
11671 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
11672 unsafe { fp(self.handle(), acceleration_structure, alloc_ptr) };
11673 }
11674 ///Wraps [`vkGetAccelerationStructureMemoryRequirementsNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetAccelerationStructureMemoryRequirementsNV.html).
11675 /**
11676 Provided by **VK_NV_ray_tracing**.*/
11677 ///
11678 ///# Safety
11679 ///- `device` (self) must be valid and not destroyed.
11680 ///
11681 ///# Panics
11682 ///Panics if `vkGetAccelerationStructureMemoryRequirementsNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11683 ///
11684 ///# Usage Notes
11685 ///
11686 ///Queries the memory requirements for an NV acceleration structure,
11687 ///including the scratch memory needed for builds and updates. Use
11688 ///the result to allocate and bind memory before building.
11689 ///
11690 ///Requires `VK_NV_ray_tracing`.
11691 pub unsafe fn get_acceleration_structure_memory_requirements_nv(
11692 &self,
11693 p_info: &AccelerationStructureMemoryRequirementsInfoNV,
11694 ) -> MemoryRequirements2KHR {
11695 let fp = self
11696 .commands()
11697 .get_acceleration_structure_memory_requirements_nv
11698 .expect("vkGetAccelerationStructureMemoryRequirementsNV not loaded");
11699 let mut out = unsafe { core::mem::zeroed() };
11700 unsafe { fp(self.handle(), p_info, &mut out) };
11701 out
11702 }
11703 ///Wraps [`vkBindAccelerationStructureMemoryNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBindAccelerationStructureMemoryNV.html).
11704 /**
11705 Provided by **VK_NV_ray_tracing**.*/
11706 ///
11707 ///# Errors
11708 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
11709 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
11710 ///- `VK_ERROR_UNKNOWN`
11711 ///- `VK_ERROR_VALIDATION_FAILED`
11712 ///
11713 ///# Safety
11714 ///- `device` (self) must be valid and not destroyed.
11715 ///
11716 ///# Panics
11717 ///Panics if `vkBindAccelerationStructureMemoryNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11718 ///
11719 ///# Usage Notes
11720 ///
11721 ///Binds device memory to one or more NV acceleration structures.
11722 ///Must be called before the structure can be used in a build or
11723 ///trace command.
11724 ///
11725 ///Requires `VK_NV_ray_tracing`.
11726 pub unsafe fn bind_acceleration_structure_memory_nv(
11727 &self,
11728 p_bind_infos: &[BindAccelerationStructureMemoryInfoNV],
11729 ) -> VkResult<()> {
11730 let fp = self
11731 .commands()
11732 .bind_acceleration_structure_memory_nv
11733 .expect("vkBindAccelerationStructureMemoryNV not loaded");
11734 check(unsafe {
11735 fp(
11736 self.handle(),
11737 p_bind_infos.len() as u32,
11738 p_bind_infos.as_ptr(),
11739 )
11740 })
11741 }
11742 ///Wraps [`vkCmdCopyAccelerationStructureNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyAccelerationStructureNV.html).
11743 /**
11744 Provided by **VK_NV_ray_tracing**.*/
11745 ///
11746 ///# Safety
11747 ///- `commandBuffer` (self) must be valid and not destroyed.
11748 ///- `commandBuffer` must be externally synchronized.
11749 ///
11750 ///# Panics
11751 ///Panics if `vkCmdCopyAccelerationStructureNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11752 ///
11753 ///# Usage Notes
11754 ///
11755 ///Copies or compacts an NV acceleration structure. Use `CLONE` mode
11756 ///for a full copy, or `COMPACT` to produce a smaller copy after
11757 ///querying the compacted size.
11758 ///
11759 ///Requires `VK_NV_ray_tracing`.
11760 pub unsafe fn cmd_copy_acceleration_structure_nv(
11761 &self,
11762 command_buffer: CommandBuffer,
11763 dst: AccelerationStructureNV,
11764 src: AccelerationStructureNV,
11765 mode: CopyAccelerationStructureModeKHR,
11766 ) {
11767 let fp = self
11768 .commands()
11769 .cmd_copy_acceleration_structure_nv
11770 .expect("vkCmdCopyAccelerationStructureNV not loaded");
11771 unsafe { fp(command_buffer, dst, src, mode) };
11772 }
11773 ///Wraps [`vkCmdCopyAccelerationStructureKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyAccelerationStructureKHR.html).
11774 /**
11775 Provided by **VK_KHR_acceleration_structure**.*/
11776 ///
11777 ///# Safety
11778 ///- `commandBuffer` (self) must be valid and not destroyed.
11779 ///- `commandBuffer` must be externally synchronized.
11780 ///
11781 ///# Panics
11782 ///Panics if `vkCmdCopyAccelerationStructureKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11783 ///
11784 ///# Usage Notes
11785 ///
11786 ///Copies an acceleration structure. Modes:
11787 ///
11788 ///- `COPY_ACCELERATION_STRUCTURE_MODE_CLONE`: full copy. The
11789 /// destination must be at least as large as the source.
11790 ///- `COPY_ACCELERATION_STRUCTURE_MODE_COMPACT`: copies into a smaller
11791 /// buffer after a compaction query. Use this to reclaim memory after
11792 /// building.
11793 ///
11794 ///**Compaction workflow**:
11795 ///
11796 ///1. Build with `BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION`.
11797 ///2. Query compacted size with
11798 /// `cmd_write_acceleration_structures_properties_khr`.
11799 ///3. Create a new, smaller backing buffer.
11800 ///4. Copy with `MODE_COMPACT`.
11801 ///
11802 ///Compaction typically saves 50–70% of BLAS memory.
11803 pub unsafe fn cmd_copy_acceleration_structure_khr(
11804 &self,
11805 command_buffer: CommandBuffer,
11806 p_info: &CopyAccelerationStructureInfoKHR,
11807 ) {
11808 let fp = self
11809 .commands()
11810 .cmd_copy_acceleration_structure_khr
11811 .expect("vkCmdCopyAccelerationStructureKHR not loaded");
11812 unsafe { fp(command_buffer, p_info) };
11813 }
11814 ///Wraps [`vkCopyAccelerationStructureKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCopyAccelerationStructureKHR.html).
11815 /**
11816 Provided by **VK_KHR_acceleration_structure**.*/
11817 ///
11818 ///# Errors
11819 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
11820 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
11821 ///- `VK_ERROR_UNKNOWN`
11822 ///- `VK_ERROR_VALIDATION_FAILED`
11823 ///
11824 ///# Safety
11825 ///- `device` (self) must be valid and not destroyed.
11826 ///
11827 ///# Panics
11828 ///Panics if `vkCopyAccelerationStructureKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11829 ///
11830 ///# Usage Notes
11831 ///
11832 ///Host-side acceleration structure copy. The CPU counterpart to
11833 ///`cmd_copy_acceleration_structure_khr`. Supports the same clone and
11834 ///compact modes.
11835 ///
11836 ///Requires the `acceleration_structure_host_commands` feature.
11837 pub unsafe fn copy_acceleration_structure_khr(
11838 &self,
11839 deferred_operation: DeferredOperationKHR,
11840 p_info: &CopyAccelerationStructureInfoKHR,
11841 ) -> VkResult<()> {
11842 let fp = self
11843 .commands()
11844 .copy_acceleration_structure_khr
11845 .expect("vkCopyAccelerationStructureKHR not loaded");
11846 check(unsafe { fp(self.handle(), deferred_operation, p_info) })
11847 }
11848 ///Wraps [`vkCmdCopyAccelerationStructureToMemoryKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyAccelerationStructureToMemoryKHR.html).
11849 /**
11850 Provided by **VK_KHR_acceleration_structure**.*/
11851 ///
11852 ///# Safety
11853 ///- `commandBuffer` (self) must be valid and not destroyed.
11854 ///- `commandBuffer` must be externally synchronized.
11855 ///
11856 ///# Panics
11857 ///Panics if `vkCmdCopyAccelerationStructureToMemoryKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11858 ///
11859 ///# Usage Notes
11860 ///
11861 ///Serializes an acceleration structure into a buffer for storage or
11862 ///transfer. The serialized format is opaque and driver-specific, it
11863 ///can only be deserialized on the same driver and hardware.
11864 ///
11865 ///Use this for:
11866 ///
11867 ///- Saving acceleration structures to disk for faster subsequent loads.
11868 ///- Transferring structures between devices in a device group.
11869 ///
11870 ///Deserialize with `cmd_copy_memory_to_acceleration_structure_khr`.
11871 pub unsafe fn cmd_copy_acceleration_structure_to_memory_khr(
11872 &self,
11873 command_buffer: CommandBuffer,
11874 p_info: &CopyAccelerationStructureToMemoryInfoKHR,
11875 ) {
11876 let fp = self
11877 .commands()
11878 .cmd_copy_acceleration_structure_to_memory_khr
11879 .expect("vkCmdCopyAccelerationStructureToMemoryKHR not loaded");
11880 unsafe { fp(command_buffer, p_info) };
11881 }
11882 ///Wraps [`vkCopyAccelerationStructureToMemoryKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCopyAccelerationStructureToMemoryKHR.html).
11883 /**
11884 Provided by **VK_KHR_acceleration_structure**.*/
11885 ///
11886 ///# Errors
11887 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
11888 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
11889 ///- `VK_ERROR_UNKNOWN`
11890 ///- `VK_ERROR_VALIDATION_FAILED`
11891 ///
11892 ///# Safety
11893 ///- `device` (self) must be valid and not destroyed.
11894 ///
11895 ///# Panics
11896 ///Panics if `vkCopyAccelerationStructureToMemoryKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11897 ///
11898 ///# Usage Notes
11899 ///
11900 ///Host-side acceleration structure serialization. The CPU counterpart
11901 ///to `cmd_copy_acceleration_structure_to_memory_khr`.
11902 ///
11903 ///Requires the `acceleration_structure_host_commands` feature.
11904 pub unsafe fn copy_acceleration_structure_to_memory_khr(
11905 &self,
11906 deferred_operation: DeferredOperationKHR,
11907 p_info: &CopyAccelerationStructureToMemoryInfoKHR,
11908 ) -> VkResult<()> {
11909 let fp = self
11910 .commands()
11911 .copy_acceleration_structure_to_memory_khr
11912 .expect("vkCopyAccelerationStructureToMemoryKHR not loaded");
11913 check(unsafe { fp(self.handle(), deferred_operation, p_info) })
11914 }
11915 ///Wraps [`vkCmdCopyMemoryToAccelerationStructureKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMemoryToAccelerationStructureKHR.html).
11916 /**
11917 Provided by **VK_KHR_acceleration_structure**.*/
11918 ///
11919 ///# Safety
11920 ///- `commandBuffer` (self) must be valid and not destroyed.
11921 ///- `commandBuffer` must be externally synchronized.
11922 ///
11923 ///# Panics
11924 ///Panics if `vkCmdCopyMemoryToAccelerationStructureKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11925 ///
11926 ///# Usage Notes
11927 ///
11928 ///Deserializes an acceleration structure from a buffer that was
11929 ///previously written by
11930 ///`cmd_copy_acceleration_structure_to_memory_khr`.
11931 ///
11932 ///The data must have been serialized on the same driver and hardware
11933 ///(check `acceleration_structure_uuid` compatibility before loading).
11934 ///
11935 ///After deserialization the acceleration structure is ready for use
11936 ///in ray tracing commands.
11937 pub unsafe fn cmd_copy_memory_to_acceleration_structure_khr(
11938 &self,
11939 command_buffer: CommandBuffer,
11940 p_info: &CopyMemoryToAccelerationStructureInfoKHR,
11941 ) {
11942 let fp = self
11943 .commands()
11944 .cmd_copy_memory_to_acceleration_structure_khr
11945 .expect("vkCmdCopyMemoryToAccelerationStructureKHR not loaded");
11946 unsafe { fp(command_buffer, p_info) };
11947 }
11948 ///Wraps [`vkCopyMemoryToAccelerationStructureKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCopyMemoryToAccelerationStructureKHR.html).
11949 /**
11950 Provided by **VK_KHR_acceleration_structure**.*/
11951 ///
11952 ///# Errors
11953 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
11954 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
11955 ///- `VK_ERROR_UNKNOWN`
11956 ///- `VK_ERROR_VALIDATION_FAILED`
11957 ///
11958 ///# Safety
11959 ///- `device` (self) must be valid and not destroyed.
11960 ///
11961 ///# Panics
11962 ///Panics if `vkCopyMemoryToAccelerationStructureKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11963 ///
11964 ///# Usage Notes
11965 ///
11966 ///Host-side acceleration structure deserialization. The CPU counterpart
11967 ///to `cmd_copy_memory_to_acceleration_structure_khr`.
11968 ///
11969 ///Requires the `acceleration_structure_host_commands` feature.
11970 pub unsafe fn copy_memory_to_acceleration_structure_khr(
11971 &self,
11972 deferred_operation: DeferredOperationKHR,
11973 p_info: &CopyMemoryToAccelerationStructureInfoKHR,
11974 ) -> VkResult<()> {
11975 let fp = self
11976 .commands()
11977 .copy_memory_to_acceleration_structure_khr
11978 .expect("vkCopyMemoryToAccelerationStructureKHR not loaded");
11979 check(unsafe { fp(self.handle(), deferred_operation, p_info) })
11980 }
11981 ///Wraps [`vkCmdWriteAccelerationStructuresPropertiesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWriteAccelerationStructuresPropertiesKHR.html).
11982 /**
11983 Provided by **VK_KHR_acceleration_structure**.*/
11984 ///
11985 ///# Safety
11986 ///- `commandBuffer` (self) must be valid and not destroyed.
11987 ///- `commandBuffer` must be externally synchronized.
11988 ///
11989 ///# Panics
11990 ///Panics if `vkCmdWriteAccelerationStructuresPropertiesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
11991 ///
11992 ///# Usage Notes
11993 ///
11994 ///Writes acceleration structure properties into a query pool. The
11995 ///primary use is querying `QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE`
11996 ///after a build to determine the compacted size before copying.
11997 ///
11998 ///**Compaction workflow**:
11999 ///
12000 ///1. Build with `ALLOW_COMPACTION`.
12001 ///2. `cmd_write_acceleration_structures_properties_khr` with
12002 /// `COMPACTED_SIZE` query type.
12003 ///3. Read the result from the query pool.
12004 ///4. Create a smaller buffer and copy with `MODE_COMPACT`.
12005 ///
12006 ///Also supports `QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE`
12007 ///for estimating serialization buffer requirements.
12008 pub unsafe fn cmd_write_acceleration_structures_properties_khr(
12009 &self,
12010 command_buffer: CommandBuffer,
12011 p_acceleration_structures: &[AccelerationStructureKHR],
12012 query_type: QueryType,
12013 query_pool: QueryPool,
12014 first_query: u32,
12015 ) {
12016 let fp = self
12017 .commands()
12018 .cmd_write_acceleration_structures_properties_khr
12019 .expect("vkCmdWriteAccelerationStructuresPropertiesKHR not loaded");
12020 unsafe {
12021 fp(
12022 command_buffer,
12023 p_acceleration_structures.len() as u32,
12024 p_acceleration_structures.as_ptr(),
12025 query_type,
12026 query_pool,
12027 first_query,
12028 )
12029 };
12030 }
12031 ///Wraps [`vkCmdWriteAccelerationStructuresPropertiesNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWriteAccelerationStructuresPropertiesNV.html).
12032 /**
12033 Provided by **VK_NV_ray_tracing**.*/
12034 ///
12035 ///# Safety
12036 ///- `commandBuffer` (self) must be valid and not destroyed.
12037 ///- `commandBuffer` must be externally synchronized.
12038 ///
12039 ///# Panics
12040 ///Panics if `vkCmdWriteAccelerationStructuresPropertiesNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12041 ///
12042 ///# Usage Notes
12043 ///
12044 ///Writes acceleration structure properties (such as compacted size)
12045 ///into a query pool. Use this after a build to determine the
12046 ///compacted size before calling `cmd_copy_acceleration_structure_nv`
12047 ///with `COMPACT` mode.
12048 ///
12049 ///Requires `VK_NV_ray_tracing`.
12050 pub unsafe fn cmd_write_acceleration_structures_properties_nv(
12051 &self,
12052 command_buffer: CommandBuffer,
12053 p_acceleration_structures: &[AccelerationStructureNV],
12054 query_type: QueryType,
12055 query_pool: QueryPool,
12056 first_query: u32,
12057 ) {
12058 let fp = self
12059 .commands()
12060 .cmd_write_acceleration_structures_properties_nv
12061 .expect("vkCmdWriteAccelerationStructuresPropertiesNV not loaded");
12062 unsafe {
12063 fp(
12064 command_buffer,
12065 p_acceleration_structures.len() as u32,
12066 p_acceleration_structures.as_ptr(),
12067 query_type,
12068 query_pool,
12069 first_query,
12070 )
12071 };
12072 }
12073 ///Wraps [`vkCmdBuildAccelerationStructureNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBuildAccelerationStructureNV.html).
12074 /**
12075 Provided by **VK_NV_ray_tracing**.*/
12076 ///
12077 ///# Safety
12078 ///- `commandBuffer` (self) must be valid and not destroyed.
12079 ///- `commandBuffer` must be externally synchronized.
12080 ///
12081 ///# Panics
12082 ///Panics if `vkCmdBuildAccelerationStructureNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12083 ///
12084 ///# Usage Notes
12085 ///
12086 ///Builds or updates an NV acceleration structure from geometry data.
12087 ///Set `update` to non-zero to refit an existing structure in place
12088 ///(faster but lower quality than a full rebuild).
12089 ///
12090 ///A scratch buffer is required; query its size with
12091 ///`get_acceleration_structure_memory_requirements_nv`.
12092 ///
12093 ///Requires `VK_NV_ray_tracing`.
12094 pub unsafe fn cmd_build_acceleration_structure_nv(
12095 &self,
12096 command_buffer: CommandBuffer,
12097 p_info: &AccelerationStructureInfoNV,
12098 instance_data: Buffer,
12099 instance_offset: u64,
12100 update: bool,
12101 dst: AccelerationStructureNV,
12102 src: AccelerationStructureNV,
12103 scratch: Buffer,
12104 scratch_offset: u64,
12105 ) {
12106 let fp = self
12107 .commands()
12108 .cmd_build_acceleration_structure_nv
12109 .expect("vkCmdBuildAccelerationStructureNV not loaded");
12110 unsafe {
12111 fp(
12112 command_buffer,
12113 p_info,
12114 instance_data,
12115 instance_offset,
12116 update as u32,
12117 dst,
12118 src,
12119 scratch,
12120 scratch_offset,
12121 )
12122 };
12123 }
12124 ///Wraps [`vkWriteAccelerationStructuresPropertiesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkWriteAccelerationStructuresPropertiesKHR.html).
12125 /**
12126 Provided by **VK_KHR_acceleration_structure**.*/
12127 ///
12128 ///# Errors
12129 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
12130 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
12131 ///- `VK_ERROR_UNKNOWN`
12132 ///- `VK_ERROR_VALIDATION_FAILED`
12133 ///
12134 ///# Safety
12135 ///- `device` (self) must be valid and not destroyed.
12136 ///
12137 ///# Panics
12138 ///Panics if `vkWriteAccelerationStructuresPropertiesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12139 ///
12140 ///# Usage Notes
12141 ///
12142 ///Host-side query of acceleration structure properties. The CPU
12143 ///counterpart to `cmd_write_acceleration_structures_properties_khr`.
12144 ///
12145 ///Writes results directly to a host buffer rather than a query pool.
12146 ///Supports the same query types: compacted size and serialization
12147 ///size.
12148 ///
12149 ///Requires the `acceleration_structure_host_commands` feature.
12150 pub unsafe fn write_acceleration_structures_properties_khr(
12151 &self,
12152 p_acceleration_structures: &[AccelerationStructureKHR],
12153 query_type: QueryType,
12154 data_size: usize,
12155 p_data: *mut core::ffi::c_void,
12156 stride: usize,
12157 ) -> VkResult<()> {
12158 let fp = self
12159 .commands()
12160 .write_acceleration_structures_properties_khr
12161 .expect("vkWriteAccelerationStructuresPropertiesKHR not loaded");
12162 check(unsafe {
12163 fp(
12164 self.handle(),
12165 p_acceleration_structures.len() as u32,
12166 p_acceleration_structures.as_ptr(),
12167 query_type,
12168 data_size,
12169 p_data,
12170 stride,
12171 )
12172 })
12173 }
12174 ///Wraps [`vkCmdTraceRaysKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdTraceRaysKHR.html).
12175 /**
12176 Provided by **VK_KHR_ray_tracing_pipeline**.*/
12177 ///
12178 ///# Safety
12179 ///- `commandBuffer` (self) must be valid and not destroyed.
12180 ///- `commandBuffer` must be externally synchronized.
12181 ///
12182 ///# Panics
12183 ///Panics if `vkCmdTraceRaysKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12184 ///
12185 ///# Usage Notes
12186 ///
12187 ///Dispatches rays into the scene. This is the primary ray tracing
12188 ///dispatch command, the ray tracing equivalent of `cmd_draw` or
12189 ///`cmd_dispatch`.
12190 ///
12191 ///Each of the four shader binding table (SBT) regions points to a
12192 ///device memory region containing shader group handles:
12193 ///
12194 ///- **Raygen**: exactly one entry, the ray generation shader.
12195 ///- **Miss**: shaders invoked when a ray hits nothing.
12196 ///- **Hit**: shader groups invoked on ray-geometry intersection.
12197 ///- **Callable**: shaders invoked explicitly from other stages.
12198 ///
12199 ///The `width`, `height`, and `depth` parameters define the 3D launch
12200 ///dimensions. Each invocation gets a unique `gl_LaunchIDEXT`. For
12201 ///a fullscreen ray trace, use the render target resolution with
12202 ///`depth = 1`.
12203 ///
12204 ///The SBT entries must be built from handles retrieved with
12205 ///`get_ray_tracing_shader_group_handles_khr`, stored in a buffer
12206 ///with `BUFFER_USAGE_SHADER_BINDING_TABLE`. Each region's `stride`
12207 ///must be a multiple of `shaderGroupHandleAlignment` and the base
12208 ///address must be aligned to `shaderGroupBaseAlignment`.
12209 pub unsafe fn cmd_trace_rays_khr(
12210 &self,
12211 command_buffer: CommandBuffer,
12212 p_raygen_shader_binding_table: &StridedDeviceAddressRegionKHR,
12213 p_miss_shader_binding_table: &StridedDeviceAddressRegionKHR,
12214 p_hit_shader_binding_table: &StridedDeviceAddressRegionKHR,
12215 p_callable_shader_binding_table: &StridedDeviceAddressRegionKHR,
12216 width: u32,
12217 height: u32,
12218 depth: u32,
12219 ) {
12220 let fp = self
12221 .commands()
12222 .cmd_trace_rays_khr
12223 .expect("vkCmdTraceRaysKHR not loaded");
12224 unsafe {
12225 fp(
12226 command_buffer,
12227 p_raygen_shader_binding_table,
12228 p_miss_shader_binding_table,
12229 p_hit_shader_binding_table,
12230 p_callable_shader_binding_table,
12231 width,
12232 height,
12233 depth,
12234 )
12235 };
12236 }
12237 ///Wraps [`vkCmdTraceRaysNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdTraceRaysNV.html).
12238 /**
12239 Provided by **VK_NV_ray_tracing**.*/
12240 ///
12241 ///# Safety
12242 ///- `commandBuffer` (self) must be valid and not destroyed.
12243 ///- `commandBuffer` must be externally synchronized.
12244 ///
12245 ///# Panics
12246 ///Panics if `vkCmdTraceRaysNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12247 ///
12248 ///# Usage Notes
12249 ///
12250 ///Dispatches a ray tracing workload using the NV ray tracing
12251 ///pipeline. Takes shader binding table buffer/offset/stride for
12252 ///each shader stage (raygen, miss, closest hit, callable) and the
12253 ///dispatch dimensions.
12254 ///
12255 ///This is the legacy NV path; prefer `cmd_trace_rays_khr` for new
12256 ///code.
12257 ///
12258 ///Requires `VK_NV_ray_tracing`.
12259 pub unsafe fn cmd_trace_rays_nv(
12260 &self,
12261 command_buffer: CommandBuffer,
12262 raygen_shader_binding_table_buffer: Buffer,
12263 raygen_shader_binding_offset: u64,
12264 miss_shader_binding_table_buffer: Buffer,
12265 miss_shader_binding_offset: u64,
12266 miss_shader_binding_stride: u64,
12267 hit_shader_binding_table_buffer: Buffer,
12268 hit_shader_binding_offset: u64,
12269 hit_shader_binding_stride: u64,
12270 callable_shader_binding_table_buffer: Buffer,
12271 callable_shader_binding_offset: u64,
12272 callable_shader_binding_stride: u64,
12273 width: u32,
12274 height: u32,
12275 depth: u32,
12276 ) {
12277 let fp = self
12278 .commands()
12279 .cmd_trace_rays_nv
12280 .expect("vkCmdTraceRaysNV not loaded");
12281 unsafe {
12282 fp(
12283 command_buffer,
12284 raygen_shader_binding_table_buffer,
12285 raygen_shader_binding_offset,
12286 miss_shader_binding_table_buffer,
12287 miss_shader_binding_offset,
12288 miss_shader_binding_stride,
12289 hit_shader_binding_table_buffer,
12290 hit_shader_binding_offset,
12291 hit_shader_binding_stride,
12292 callable_shader_binding_table_buffer,
12293 callable_shader_binding_offset,
12294 callable_shader_binding_stride,
12295 width,
12296 height,
12297 depth,
12298 )
12299 };
12300 }
12301 ///Wraps [`vkGetRayTracingShaderGroupHandlesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetRayTracingShaderGroupHandlesKHR.html).
12302 /**
12303 Provided by **VK_KHR_ray_tracing_pipeline**.*/
12304 ///
12305 ///# Errors
12306 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
12307 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
12308 ///- `VK_ERROR_UNKNOWN`
12309 ///- `VK_ERROR_VALIDATION_FAILED`
12310 ///
12311 ///# Safety
12312 ///- `device` (self) must be valid and not destroyed.
12313 ///
12314 ///# Panics
12315 ///Panics if `vkGetRayTracingShaderGroupHandlesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12316 ///
12317 ///# Usage Notes
12318 ///
12319 ///Retrieves opaque shader group handles from a ray tracing pipeline.
12320 ///These handles are copied into GPU-visible buffers to build the
12321 ///**shader binding table** (SBT) that `cmd_trace_rays_khr` indexes
12322 ///into.
12323 ///
12324 ///Each handle is `shaderGroupHandleSize` bytes (query from
12325 ///`PhysicalDeviceRayTracingPipelinePropertiesKHR`, typically 32
12326 ///bytes). The `p_data` buffer must be at least
12327 ///`group_count * shaderGroupHandleSize` bytes.
12328 ///
12329 ///`first_group` and `group_count` index into the `groups` array
12330 ///from `RayTracingPipelineCreateInfoKHR`. Handles are written
12331 ///sequentially, group `first_group` first, then
12332 ///`first_group + 1`, and so on.
12333 ///
12334 ///After retrieving handles, copy them into a buffer with
12335 ///`BUFFER_USAGE_SHADER_BINDING_TABLE` at the correct stride and
12336 ///alignment for each SBT region.
12337 pub unsafe fn get_ray_tracing_shader_group_handles_khr(
12338 &self,
12339 pipeline: Pipeline,
12340 first_group: u32,
12341 group_count: u32,
12342 data_size: usize,
12343 p_data: *mut core::ffi::c_void,
12344 ) -> VkResult<()> {
12345 let fp = self
12346 .commands()
12347 .get_ray_tracing_shader_group_handles_khr
12348 .expect("vkGetRayTracingShaderGroupHandlesKHR not loaded");
12349 check(unsafe {
12350 fp(
12351 self.handle(),
12352 pipeline,
12353 first_group,
12354 group_count,
12355 data_size,
12356 p_data,
12357 )
12358 })
12359 }
12360 ///Wraps [`vkGetRayTracingCaptureReplayShaderGroupHandlesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetRayTracingCaptureReplayShaderGroupHandlesKHR.html).
12361 /**
12362 Provided by **VK_KHR_ray_tracing_pipeline**.*/
12363 ///
12364 ///# Errors
12365 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
12366 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
12367 ///- `VK_ERROR_UNKNOWN`
12368 ///- `VK_ERROR_VALIDATION_FAILED`
12369 ///
12370 ///# Safety
12371 ///- `device` (self) must be valid and not destroyed.
12372 ///
12373 ///# Panics
12374 ///Panics if `vkGetRayTracingCaptureReplayShaderGroupHandlesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12375 ///
12376 ///# Usage Notes
12377 ///
12378 ///Retrieves opaque capture/replay handles for shader groups. These
12379 ///handles allow recreating a ray tracing pipeline with identical
12380 ///shader group assignments on a subsequent run, enabling
12381 ///deterministic replay of GPU traces.
12382 ///
12383 ///Use this for tools, profilers, and capture-replay frameworks.
12384 ///The handles are passed back via
12385 ///`RayTracingShaderGroupCreateInfoKHR::shader_group_capture_replay_handle`
12386 ///when recreating the pipeline.
12387 ///
12388 ///The pipeline must have been created with
12389 ///`PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY`.
12390 ///Requires the `rayTracingPipelineShaderGroupHandleCaptureReplay`
12391 ///device feature.
12392 ///
12393 ///The buffer layout is the same as
12394 ///`get_ray_tracing_shader_group_handles_khr`, sequential handles
12395 ///of `shaderGroupHandleSize` bytes each.
12396 pub unsafe fn get_ray_tracing_capture_replay_shader_group_handles_khr(
12397 &self,
12398 pipeline: Pipeline,
12399 first_group: u32,
12400 group_count: u32,
12401 data_size: usize,
12402 p_data: *mut core::ffi::c_void,
12403 ) -> VkResult<()> {
12404 let fp = self
12405 .commands()
12406 .get_ray_tracing_capture_replay_shader_group_handles_khr
12407 .expect("vkGetRayTracingCaptureReplayShaderGroupHandlesKHR not loaded");
12408 check(unsafe {
12409 fp(
12410 self.handle(),
12411 pipeline,
12412 first_group,
12413 group_count,
12414 data_size,
12415 p_data,
12416 )
12417 })
12418 }
12419 ///Wraps [`vkGetAccelerationStructureHandleNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetAccelerationStructureHandleNV.html).
12420 /**
12421 Provided by **VK_NV_ray_tracing**.*/
12422 ///
12423 ///# Errors
12424 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
12425 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
12426 ///- `VK_ERROR_UNKNOWN`
12427 ///- `VK_ERROR_VALIDATION_FAILED`
12428 ///
12429 ///# Safety
12430 ///- `device` (self) must be valid and not destroyed.
12431 ///
12432 ///# Panics
12433 ///Panics if `vkGetAccelerationStructureHandleNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12434 ///
12435 ///# Usage Notes
12436 ///
12437 ///Retrieves an opaque handle for an NV acceleration structure. This
12438 ///handle is used when building a top-level acceleration structure
12439 ///that references bottom-level structures.
12440 ///
12441 ///Requires `VK_NV_ray_tracing`.
12442 pub unsafe fn get_acceleration_structure_handle_nv(
12443 &self,
12444 acceleration_structure: AccelerationStructureNV,
12445 data_size: usize,
12446 p_data: *mut core::ffi::c_void,
12447 ) -> VkResult<()> {
12448 let fp = self
12449 .commands()
12450 .get_acceleration_structure_handle_nv
12451 .expect("vkGetAccelerationStructureHandleNV not loaded");
12452 check(unsafe { fp(self.handle(), acceleration_structure, data_size, p_data) })
12453 }
12454 ///Wraps [`vkCreateRayTracingPipelinesNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateRayTracingPipelinesNV.html).
12455 /**
12456 Provided by **VK_NV_ray_tracing**.*/
12457 ///
12458 ///# Errors
12459 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
12460 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
12461 ///- `VK_ERROR_INVALID_SHADER_NV`
12462 ///- `VK_ERROR_UNKNOWN`
12463 ///- `VK_ERROR_VALIDATION_FAILED`
12464 ///
12465 ///# Safety
12466 ///- `device` (self) must be valid and not destroyed.
12467 ///- `pipelineCache` must be externally synchronized.
12468 ///
12469 ///# Panics
12470 ///Panics if `vkCreateRayTracingPipelinesNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12471 ///
12472 ///# Usage Notes
12473 ///
12474 ///Creates one or more ray tracing pipelines using the NV model.
12475 ///This is the legacy NV path; prefer
12476 ///`create_ray_tracing_pipelines_khr` for new code.
12477 ///
12478 ///Supports a pipeline cache for faster subsequent creation.
12479 ///
12480 ///Requires `VK_NV_ray_tracing`.
12481 pub unsafe fn create_ray_tracing_pipelines_nv(
12482 &self,
12483 pipeline_cache: PipelineCache,
12484 p_create_infos: &[RayTracingPipelineCreateInfoNV],
12485 allocator: Option<&AllocationCallbacks>,
12486 ) -> VkResult<Vec<Pipeline>> {
12487 let fp = self
12488 .commands()
12489 .create_ray_tracing_pipelines_nv
12490 .expect("vkCreateRayTracingPipelinesNV not loaded");
12491 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
12492 let count = p_create_infos.len();
12493 let mut out = vec![unsafe { core::mem::zeroed() }; count];
12494 check(unsafe {
12495 fp(
12496 self.handle(),
12497 pipeline_cache,
12498 p_create_infos.len() as u32,
12499 p_create_infos.as_ptr(),
12500 alloc_ptr,
12501 out.as_mut_ptr(),
12502 )
12503 })?;
12504 Ok(out)
12505 }
12506 ///Wraps [`vkCreateRayTracingPipelinesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateRayTracingPipelinesKHR.html).
12507 /**
12508 Provided by **VK_KHR_ray_tracing_pipeline**.*/
12509 ///
12510 ///# Errors
12511 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
12512 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
12513 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS`
12514 ///- `VK_ERROR_UNKNOWN`
12515 ///- `VK_ERROR_VALIDATION_FAILED`
12516 ///
12517 ///# Safety
12518 ///- `device` (self) must be valid and not destroyed.
12519 ///- `pipelineCache` must be externally synchronized.
12520 ///
12521 ///# Panics
12522 ///Panics if `vkCreateRayTracingPipelinesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12523 ///
12524 ///# Usage Notes
12525 ///
12526 ///Creates one or more ray tracing pipelines. A ray tracing pipeline
12527 ///contains the shader stages (ray generation, miss, closest hit,
12528 ///any hit, intersection, callable) and shader groups that define
12529 ///how rays interact with geometry.
12530 ///
12531 ///Unlike graphics pipelines, ray tracing pipelines organize shaders
12532 ///into **groups**:
12533 ///
12534 ///- **General**: ray generation, miss, or callable shaders.
12535 ///- **Triangles hit**: closest hit + optional any hit for triangles.
12536 ///- **Procedural hit**: intersection + closest hit + optional any hit
12537 /// for custom geometry (AABBs).
12538 ///
12539 ///Pass a `DeferredOperationKHR` handle to compile asynchronously,
12540 ///the call returns `OPERATION_DEFERRED_KHR` and the pipeline handles
12541 ///are not valid until the deferred operation completes. Pass a null
12542 ///handle for synchronous creation.
12543 ///
12544 ///Supports `pipeline_cache` for faster creation on subsequent runs
12545 ///and `base_pipeline_handle` / `base_pipeline_index` for derivative
12546 ///pipelines when `PIPELINE_CREATE_DERIVATIVE` is set.
12547 ///
12548 ///After creation, retrieve shader group handles with
12549 ///`get_ray_tracing_shader_group_handles_khr` to build the shader
12550 ///binding table.
12551 pub unsafe fn create_ray_tracing_pipelines_khr(
12552 &self,
12553 deferred_operation: DeferredOperationKHR,
12554 pipeline_cache: PipelineCache,
12555 p_create_infos: &[RayTracingPipelineCreateInfoKHR],
12556 allocator: Option<&AllocationCallbacks>,
12557 ) -> VkResult<Vec<Pipeline>> {
12558 let fp = self
12559 .commands()
12560 .create_ray_tracing_pipelines_khr
12561 .expect("vkCreateRayTracingPipelinesKHR not loaded");
12562 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
12563 let count = p_create_infos.len();
12564 let mut out = vec![unsafe { core::mem::zeroed() }; count];
12565 check(unsafe {
12566 fp(
12567 self.handle(),
12568 deferred_operation,
12569 pipeline_cache,
12570 p_create_infos.len() as u32,
12571 p_create_infos.as_ptr(),
12572 alloc_ptr,
12573 out.as_mut_ptr(),
12574 )
12575 })?;
12576 Ok(out)
12577 }
12578 ///Wraps [`vkCmdTraceRaysIndirectKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdTraceRaysIndirectKHR.html).
12579 /**
12580 Provided by **VK_KHR_ray_tracing_pipeline**.*/
12581 ///
12582 ///# Safety
12583 ///- `commandBuffer` (self) must be valid and not destroyed.
12584 ///- `commandBuffer` must be externally synchronized.
12585 ///
12586 ///# Panics
12587 ///Panics if `vkCmdTraceRaysIndirectKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12588 ///
12589 ///# Usage Notes
12590 ///
12591 ///Dispatches rays with launch dimensions read from a GPU buffer.
12592 ///Identical to `cmd_trace_rays_khr` except the `width`, `height`,
12593 ///and `depth` are sourced from a `TraceRaysIndirectCommandKHR`
12594 ///struct at `indirect_device_address`.
12595 ///
12596 ///This enables the GPU to determine ray dispatch dimensions without
12597 ///a CPU round-trip, useful when the dispatch size depends on prior
12598 ///GPU work such as culling, tile classification, or adaptive
12599 ///sampling.
12600 ///
12601 ///The indirect buffer must have been created with
12602 ///`BUFFER_USAGE_INDIRECT_BUFFER` and the address must be aligned
12603 ///to 4 bytes. The SBT parameters are still provided directly on
12604 ///the CPU side.
12605 ///
12606 ///Requires the `rayTracingPipelineTraceRaysIndirect` feature.
12607 pub unsafe fn cmd_trace_rays_indirect_khr(
12608 &self,
12609 command_buffer: CommandBuffer,
12610 p_raygen_shader_binding_table: &StridedDeviceAddressRegionKHR,
12611 p_miss_shader_binding_table: &StridedDeviceAddressRegionKHR,
12612 p_hit_shader_binding_table: &StridedDeviceAddressRegionKHR,
12613 p_callable_shader_binding_table: &StridedDeviceAddressRegionKHR,
12614 indirect_device_address: u64,
12615 ) {
12616 let fp = self
12617 .commands()
12618 .cmd_trace_rays_indirect_khr
12619 .expect("vkCmdTraceRaysIndirectKHR not loaded");
12620 unsafe {
12621 fp(
12622 command_buffer,
12623 p_raygen_shader_binding_table,
12624 p_miss_shader_binding_table,
12625 p_hit_shader_binding_table,
12626 p_callable_shader_binding_table,
12627 indirect_device_address,
12628 )
12629 };
12630 }
12631 ///Wraps [`vkCmdTraceRaysIndirect2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdTraceRaysIndirect2KHR.html).
12632 /**
12633 Provided by **VK_KHR_ray_tracing_maintenance1**.*/
12634 ///
12635 ///# Safety
12636 ///- `commandBuffer` (self) must be valid and not destroyed.
12637 ///- `commandBuffer` must be externally synchronized.
12638 ///
12639 ///# Panics
12640 ///Panics if `vkCmdTraceRaysIndirect2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12641 ///
12642 ///# Usage Notes
12643 ///
12644 ///Fully indirect ray dispatch, both the shader binding table
12645 ///addresses and the launch dimensions are read from a GPU buffer.
12646 ///This is the most flexible ray tracing dispatch.
12647 ///
12648 ///The `indirect_device_address` points to a
12649 ///`TraceRaysIndirectCommand2KHR` struct on the device, which
12650 ///contains all four SBT regions (raygen, miss, hit, callable) plus
12651 ///the `width`, `height`, and `depth`.
12652 ///
12653 ///This allows the GPU to dynamically select which shaders to use
12654 ///and how many rays to launch, enabling advanced techniques like
12655 ///GPU-driven material sorting or multi-pass ray tracing without
12656 ///CPU synchronization.
12657 ///
12658 ///Provided by `VK_KHR_ray_tracing_maintenance1`, not the base
12659 ///ray tracing pipeline extension. Requires the
12660 ///`rayTracingPipelineTraceRaysIndirect2` feature.
12661 pub unsafe fn cmd_trace_rays_indirect2_khr(
12662 &self,
12663 command_buffer: CommandBuffer,
12664 indirect_device_address: u64,
12665 ) {
12666 let fp = self
12667 .commands()
12668 .cmd_trace_rays_indirect2_khr
12669 .expect("vkCmdTraceRaysIndirect2KHR not loaded");
12670 unsafe { fp(command_buffer, indirect_device_address) };
12671 }
12672 ///Wraps [`vkGetClusterAccelerationStructureBuildSizesNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetClusterAccelerationStructureBuildSizesNV.html).
12673 /**
12674 Provided by **VK_NV_cluster_acceleration_structure**.*/
12675 ///
12676 ///# Safety
12677 ///- `device` (self) must be valid and not destroyed.
12678 ///
12679 ///# Panics
12680 ///Panics if `vkGetClusterAccelerationStructureBuildSizesNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12681 ///
12682 ///# Usage Notes
12683 ///
12684 ///Queries the buffer sizes needed to build a cluster acceleration
12685 ///structure. Use the returned sizes to allocate the destination
12686 ///and scratch buffers before building.
12687 ///
12688 ///Requires `VK_NV_cluster_acceleration_structure`.
12689 pub unsafe fn get_cluster_acceleration_structure_build_sizes_nv(
12690 &self,
12691 p_info: &ClusterAccelerationStructureInputInfoNV,
12692 p_size_info: &mut AccelerationStructureBuildSizesInfoKHR,
12693 ) {
12694 let fp = self
12695 .commands()
12696 .get_cluster_acceleration_structure_build_sizes_nv
12697 .expect("vkGetClusterAccelerationStructureBuildSizesNV not loaded");
12698 unsafe { fp(self.handle(), p_info, p_size_info) };
12699 }
12700 ///Wraps [`vkCmdBuildClusterAccelerationStructureIndirectNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBuildClusterAccelerationStructureIndirectNV.html).
12701 /**
12702 Provided by **VK_NV_cluster_acceleration_structure**.*/
12703 ///
12704 ///# Safety
12705 ///- `commandBuffer` (self) must be valid and not destroyed.
12706 ///- `commandBuffer` must be externally synchronized.
12707 ///
12708 ///# Panics
12709 ///Panics if `vkCmdBuildClusterAccelerationStructureIndirectNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12710 ///
12711 ///# Usage Notes
12712 ///
12713 ///Builds a cluster acceleration structure using indirect parameters.
12714 ///Cluster acceleration structures organize geometry into spatial
12715 ///clusters for more efficient ray traversal on NVIDIA hardware.
12716 ///
12717 ///Requires `VK_NV_cluster_acceleration_structure`.
12718 pub unsafe fn cmd_build_cluster_acceleration_structure_indirect_nv(
12719 &self,
12720 command_buffer: CommandBuffer,
12721 p_command_infos: &ClusterAccelerationStructureCommandsInfoNV,
12722 ) {
12723 let fp = self
12724 .commands()
12725 .cmd_build_cluster_acceleration_structure_indirect_nv
12726 .expect("vkCmdBuildClusterAccelerationStructureIndirectNV not loaded");
12727 unsafe { fp(command_buffer, p_command_infos) };
12728 }
12729 ///Wraps [`vkGetDeviceAccelerationStructureCompatibilityKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceAccelerationStructureCompatibilityKHR.html).
12730 /**
12731 Provided by **VK_KHR_acceleration_structure**.*/
12732 ///
12733 ///# Safety
12734 ///- `device` (self) must be valid and not destroyed.
12735 ///
12736 ///# Panics
12737 ///Panics if `vkGetDeviceAccelerationStructureCompatibilityKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12738 ///
12739 ///# Usage Notes
12740 ///
12741 ///Checks whether a serialized acceleration structure (from
12742 ///`copy_acceleration_structure_to_memory_khr`) is compatible with
12743 ///this device and can be deserialized.
12744 ///
12745 ///Returns `ACCELERATION_STRUCTURE_COMPATIBILITY_COMPATIBLE` if the
12746 ///data can be loaded, or `INCOMPATIBLE` if not. Incompatibility
12747 ///typically means the data was serialized on different hardware or a
12748 ///different driver version.
12749 ///
12750 ///Check compatibility before attempting deserialization to avoid
12751 ///errors.
12752 pub unsafe fn get_device_acceleration_structure_compatibility_khr(
12753 &self,
12754 p_version_info: &AccelerationStructureVersionInfoKHR,
12755 ) -> AccelerationStructureCompatibilityKHR {
12756 let fp = self
12757 .commands()
12758 .get_device_acceleration_structure_compatibility_khr
12759 .expect("vkGetDeviceAccelerationStructureCompatibilityKHR not loaded");
12760 let mut out = unsafe { core::mem::zeroed() };
12761 unsafe { fp(self.handle(), p_version_info, &mut out) };
12762 out
12763 }
12764 ///Wraps [`vkGetRayTracingShaderGroupStackSizeKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetRayTracingShaderGroupStackSizeKHR.html).
12765 /**
12766 Provided by **VK_KHR_ray_tracing_pipeline**.*/
12767 ///
12768 ///# Safety
12769 ///- `device` (self) must be valid and not destroyed.
12770 ///
12771 ///# Panics
12772 ///Panics if `vkGetRayTracingShaderGroupStackSizeKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12773 ///
12774 ///# Usage Notes
12775 ///
12776 ///Queries the stack size contribution of a single shader within a
12777 ///shader group. The result is used to compute the total pipeline
12778 ///stack size for `cmd_set_ray_tracing_pipeline_stack_size_khr`.
12779 ///
12780 ///`group` indexes into the shader groups array from pipeline
12781 ///creation. `group_shader` selects which shader within the group:
12782 ///`GENERAL`, `CLOSEST_HIT`, `ANY_HIT`, or `INTERSECTION`.
12783 ///
12784 ///The default pipeline stack size is computed automatically at
12785 ///creation time, but it assumes worst-case recursion. If you know
12786 ///your actual `maxPipelineRayRecursionDepth` is lower, query
12787 ///individual stack sizes and compute a tighter total to reduce
12788 ///scratch memory usage.
12789 ///
12790 ///Stack size computation formula (from spec):
12791 ///
12792 ///`raygen + max(closesthit + intersection, miss, callable) * maxRecursionDepth`
12793 ///
12794 ///Call this per-shader, aggregate across all groups, then set the
12795 ///result with `cmd_set_ray_tracing_pipeline_stack_size_khr`.
12796 pub unsafe fn get_ray_tracing_shader_group_stack_size_khr(
12797 &self,
12798 pipeline: Pipeline,
12799 group: u32,
12800 group_shader: ShaderGroupShaderKHR,
12801 ) {
12802 let fp = self
12803 .commands()
12804 .get_ray_tracing_shader_group_stack_size_khr
12805 .expect("vkGetRayTracingShaderGroupStackSizeKHR not loaded");
12806 unsafe { fp(self.handle(), pipeline, group, group_shader) };
12807 }
12808 ///Wraps [`vkCmdSetRayTracingPipelineStackSizeKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetRayTracingPipelineStackSizeKHR.html).
12809 /**
12810 Provided by **VK_KHR_ray_tracing_pipeline**.*/
12811 ///
12812 ///# Safety
12813 ///- `commandBuffer` (self) must be valid and not destroyed.
12814 ///- `commandBuffer` must be externally synchronized.
12815 ///
12816 ///# Panics
12817 ///Panics if `vkCmdSetRayTracingPipelineStackSizeKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12818 ///
12819 ///# Usage Notes
12820 ///
12821 ///Overrides the default ray tracing pipeline stack size for the
12822 ///bound pipeline. The stack is scratch memory used during shader
12823 ///execution and recursion.
12824 ///
12825 ///The default stack size (set at pipeline creation) assumes
12826 ///worst-case recursion depth across all shader groups. If your
12827 ///application uses a lower effective recursion depth or only a
12828 ///subset of shader groups, setting a smaller stack size reduces
12829 ///per-invocation memory usage and may improve occupancy.
12830 ///
12831 ///Compute the required size by querying individual shader
12832 ///contributions with `get_ray_tracing_shader_group_stack_size_khr`
12833 ///and applying the recursion formula from the spec.
12834 ///
12835 ///This is a dynamic state command, it takes effect for subsequent
12836 ///`cmd_trace_rays_khr` calls within the same command buffer.
12837 ///Binding a new pipeline resets the stack size to the pipeline's
12838 ///default.
12839 pub unsafe fn cmd_set_ray_tracing_pipeline_stack_size_khr(
12840 &self,
12841 command_buffer: CommandBuffer,
12842 pipeline_stack_size: u32,
12843 ) {
12844 let fp = self
12845 .commands()
12846 .cmd_set_ray_tracing_pipeline_stack_size_khr
12847 .expect("vkCmdSetRayTracingPipelineStackSizeKHR not loaded");
12848 unsafe { fp(command_buffer, pipeline_stack_size) };
12849 }
12850 ///Wraps [`vkGetImageViewHandleNVX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageViewHandleNVX.html).
12851 /**
12852 Provided by **VK_NVX_image_view_handle**.*/
12853 ///
12854 ///# Safety
12855 ///- `device` (self) must be valid and not destroyed.
12856 ///
12857 ///# Panics
12858 ///Panics if `vkGetImageViewHandleNVX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12859 ///
12860 ///# Usage Notes
12861 ///
12862 ///Returns a 32-bit handle for an image view that can be used as a
12863 ///bindless descriptor index. Use with `get_image_view_address_nvx`
12864 ///for fully bindless texture access.
12865 ///
12866 ///Requires `VK_NVX_image_view_handle`.
12867 pub unsafe fn get_image_view_handle_nvx(&self, p_info: &ImageViewHandleInfoNVX) {
12868 let fp = self
12869 .commands()
12870 .get_image_view_handle_nvx
12871 .expect("vkGetImageViewHandleNVX not loaded");
12872 unsafe { fp(self.handle(), p_info) };
12873 }
12874 ///Wraps [`vkGetImageViewHandle64NVX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageViewHandle64NVX.html).
12875 /**
12876 Provided by **VK_NVX_image_view_handle**.*/
12877 ///
12878 ///# Safety
12879 ///- `device` (self) must be valid and not destroyed.
12880 ///
12881 ///# Panics
12882 ///Panics if `vkGetImageViewHandle64NVX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12883 ///
12884 ///# Usage Notes
12885 ///
12886 ///Returns a 64-bit handle for an image view. The 64-bit variant
12887 ///accommodates larger descriptor heaps than the 32-bit
12888 ///`get_image_view_handle_nvx`.
12889 ///
12890 ///Requires `VK_NVX_image_view_handle`.
12891 pub unsafe fn get_image_view_handle64_nvx(&self, p_info: &ImageViewHandleInfoNVX) {
12892 let fp = self
12893 .commands()
12894 .get_image_view_handle64_nvx
12895 .expect("vkGetImageViewHandle64NVX not loaded");
12896 unsafe { fp(self.handle(), p_info) };
12897 }
12898 ///Wraps [`vkGetImageViewAddressNVX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageViewAddressNVX.html).
12899 /**
12900 Provided by **VK_NVX_image_view_handle**.*/
12901 ///
12902 ///# Errors
12903 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
12904 ///- `VK_ERROR_UNKNOWN`
12905 ///- `VK_ERROR_VALIDATION_FAILED`
12906 ///
12907 ///# Safety
12908 ///- `device` (self) must be valid and not destroyed.
12909 ///
12910 ///# Panics
12911 ///Panics if `vkGetImageViewAddressNVX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12912 ///
12913 ///# Usage Notes
12914 ///
12915 ///Queries the device address and size of an image view's descriptor
12916 ///data. The address can be used for raw pointer-based descriptor
12917 ///access in shaders.
12918 ///
12919 ///Requires `VK_NVX_image_view_handle`.
12920 pub unsafe fn get_image_view_address_nvx(
12921 &self,
12922 image_view: ImageView,
12923 p_properties: &mut ImageViewAddressPropertiesNVX,
12924 ) -> VkResult<()> {
12925 let fp = self
12926 .commands()
12927 .get_image_view_address_nvx
12928 .expect("vkGetImageViewAddressNVX not loaded");
12929 check(unsafe { fp(self.handle(), image_view, p_properties) })
12930 }
12931 ///Wraps [`vkGetDeviceCombinedImageSamplerIndexNVX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceCombinedImageSamplerIndexNVX.html).
12932 /**
12933 Provided by **VK_NVX_image_view_handle**.*/
12934 ///
12935 ///# Safety
12936 ///- `device` (self) must be valid and not destroyed.
12937 ///
12938 ///# Panics
12939 ///Panics if `vkGetDeviceCombinedImageSamplerIndexNVX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12940 ///
12941 ///# Usage Notes
12942 ///
12943 ///Returns the combined image-sampler descriptor index for a given
12944 ///image view and sampler pair. Used for bindless combined image-
12945 ///sampler access.
12946 ///
12947 ///Requires `VK_NVX_image_view_handle`.
12948 pub unsafe fn get_device_combined_image_sampler_index_nvx(
12949 &self,
12950 image_view_index: u64,
12951 sampler_index: u64,
12952 ) {
12953 let fp = self
12954 .commands()
12955 .get_device_combined_image_sampler_index_nvx
12956 .expect("vkGetDeviceCombinedImageSamplerIndexNVX not loaded");
12957 unsafe { fp(self.handle(), image_view_index, sampler_index) };
12958 }
12959 ///Wraps [`vkGetDeviceGroupSurfacePresentModes2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceGroupSurfacePresentModes2EXT.html).
12960 /**
12961 Provided by **VK_EXT_full_screen_exclusive**.*/
12962 ///
12963 ///# Errors
12964 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
12965 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
12966 ///- `VK_ERROR_SURFACE_LOST_KHR`
12967 ///- `VK_ERROR_UNKNOWN`
12968 ///- `VK_ERROR_VALIDATION_FAILED`
12969 ///
12970 ///# Safety
12971 ///- `device` (self) must be valid and not destroyed.
12972 ///
12973 ///# Panics
12974 ///Panics if `vkGetDeviceGroupSurfacePresentModes2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
12975 ///
12976 ///# Usage Notes
12977 ///
12978 ///Queries the supported present modes for a device group and surface,
12979 ///using the extended surface info structure. This is the
12980 ///`VK_EXT_full_screen_exclusive` variant of
12981 ///`get_device_group_surface_present_modes_khr`, allowing full-screen
12982 ///exclusive configuration to be factored into the query.
12983 ///
12984 ///Requires `VK_EXT_full_screen_exclusive`. Windows only.
12985 pub unsafe fn get_device_group_surface_present_modes2_ext(
12986 &self,
12987 p_surface_info: &PhysicalDeviceSurfaceInfo2KHR,
12988 ) -> VkResult<DeviceGroupPresentModeFlagsKHR> {
12989 let fp = self
12990 .commands()
12991 .get_device_group_surface_present_modes2_ext
12992 .expect("vkGetDeviceGroupSurfacePresentModes2EXT not loaded");
12993 let mut out = unsafe { core::mem::zeroed() };
12994 check(unsafe { fp(self.handle(), p_surface_info, &mut out) })?;
12995 Ok(out)
12996 }
12997 ///Wraps [`vkAcquireFullScreenExclusiveModeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAcquireFullScreenExclusiveModeEXT.html).
12998 /**
12999 Provided by **VK_EXT_full_screen_exclusive**.*/
13000 ///
13001 ///# Errors
13002 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13003 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
13004 ///- `VK_ERROR_INITIALIZATION_FAILED`
13005 ///- `VK_ERROR_SURFACE_LOST_KHR`
13006 ///- `VK_ERROR_UNKNOWN`
13007 ///- `VK_ERROR_VALIDATION_FAILED`
13008 ///
13009 ///# Safety
13010 ///- `device` (self) must be valid and not destroyed.
13011 ///
13012 ///# Panics
13013 ///Panics if `vkAcquireFullScreenExclusiveModeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13014 ///
13015 ///# Usage Notes
13016 ///
13017 ///Acquires full-screen exclusive mode for a swapchain, giving the
13018 ///application direct control over the display output. This can
13019 ///reduce latency and enable adaptive sync.
13020 ///
13021 ///The swapchain must have been created with
13022 ///`SurfaceFullScreenExclusiveInfoEXT` in its pNext chain.
13023 ///Release with `release_full_screen_exclusive_mode_ext`.
13024 ///
13025 ///Requires `VK_EXT_full_screen_exclusive`. Windows only.
13026 pub unsafe fn acquire_full_screen_exclusive_mode_ext(
13027 &self,
13028 swapchain: SwapchainKHR,
13029 ) -> VkResult<()> {
13030 let fp = self
13031 .commands()
13032 .acquire_full_screen_exclusive_mode_ext
13033 .expect("vkAcquireFullScreenExclusiveModeEXT not loaded");
13034 check(unsafe { fp(self.handle(), swapchain) })
13035 }
13036 ///Wraps [`vkReleaseFullScreenExclusiveModeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkReleaseFullScreenExclusiveModeEXT.html).
13037 /**
13038 Provided by **VK_EXT_full_screen_exclusive**.*/
13039 ///
13040 ///# Errors
13041 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13042 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
13043 ///- `VK_ERROR_SURFACE_LOST_KHR`
13044 ///- `VK_ERROR_UNKNOWN`
13045 ///- `VK_ERROR_VALIDATION_FAILED`
13046 ///
13047 ///# Safety
13048 ///- `device` (self) must be valid and not destroyed.
13049 ///
13050 ///# Panics
13051 ///Panics if `vkReleaseFullScreenExclusiveModeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13052 ///
13053 ///# Usage Notes
13054 ///
13055 ///Releases full-screen exclusive mode previously acquired with
13056 ///`acquire_full_screen_exclusive_mode_ext`. The swapchain returns
13057 ///to shared/composed presentation.
13058 ///
13059 ///Requires `VK_EXT_full_screen_exclusive`. Windows only.
13060 pub unsafe fn release_full_screen_exclusive_mode_ext(
13061 &self,
13062 swapchain: SwapchainKHR,
13063 ) -> VkResult<()> {
13064 let fp = self
13065 .commands()
13066 .release_full_screen_exclusive_mode_ext
13067 .expect("vkReleaseFullScreenExclusiveModeEXT not loaded");
13068 check(unsafe { fp(self.handle(), swapchain) })
13069 }
13070 ///Wraps [`vkAcquireProfilingLockKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAcquireProfilingLockKHR.html).
13071 /**
13072 Provided by **VK_KHR_performance_query**.*/
13073 ///
13074 ///# Errors
13075 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13076 ///- `VK_TIMEOUT`
13077 ///- `VK_ERROR_UNKNOWN`
13078 ///- `VK_ERROR_VALIDATION_FAILED`
13079 ///
13080 ///# Safety
13081 ///- `device` (self) must be valid and not destroyed.
13082 ///
13083 ///# Panics
13084 ///Panics if `vkAcquireProfilingLockKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13085 ///
13086 ///# Usage Notes
13087 ///
13088 ///Acquires the device profiling lock, which must be held while
13089 ///submitting command buffers that contain performance queries.
13090 ///Only one thread can hold the lock at a time.
13091 ///
13092 ///The `AcquireProfilingLockInfoKHR` specifies a timeout in
13093 ///nanoseconds. Returns `TIMEOUT` if the lock cannot be acquired
13094 ///within that period.
13095 ///
13096 ///Release with `release_profiling_lock_khr` when profiling
13097 ///submission is complete.
13098 ///
13099 ///Requires `VK_KHR_performance_query`.
13100 pub unsafe fn acquire_profiling_lock_khr(
13101 &self,
13102 p_info: &AcquireProfilingLockInfoKHR,
13103 ) -> VkResult<()> {
13104 let fp = self
13105 .commands()
13106 .acquire_profiling_lock_khr
13107 .expect("vkAcquireProfilingLockKHR not loaded");
13108 check(unsafe { fp(self.handle(), p_info) })
13109 }
13110 ///Wraps [`vkReleaseProfilingLockKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkReleaseProfilingLockKHR.html).
13111 /**
13112 Provided by **VK_KHR_performance_query**.*/
13113 ///
13114 ///# Safety
13115 ///- `device` (self) must be valid and not destroyed.
13116 ///
13117 ///# Panics
13118 ///Panics if `vkReleaseProfilingLockKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13119 ///
13120 ///# Usage Notes
13121 ///
13122 ///Releases the device profiling lock previously acquired with
13123 ///`acquire_profiling_lock_khr`. Must be called after all command
13124 ///buffers containing performance queries have been submitted.
13125 ///
13126 ///Requires `VK_KHR_performance_query`.
13127 pub unsafe fn release_profiling_lock_khr(&self) {
13128 let fp = self
13129 .commands()
13130 .release_profiling_lock_khr
13131 .expect("vkReleaseProfilingLockKHR not loaded");
13132 unsafe { fp(self.handle()) };
13133 }
13134 ///Wraps [`vkGetImageDrmFormatModifierPropertiesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageDrmFormatModifierPropertiesEXT.html).
13135 /**
13136 Provided by **VK_EXT_image_drm_format_modifier**.*/
13137 ///
13138 ///# Errors
13139 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13140 ///- `VK_ERROR_UNKNOWN`
13141 ///- `VK_ERROR_VALIDATION_FAILED`
13142 ///
13143 ///# Safety
13144 ///- `device` (self) must be valid and not destroyed.
13145 ///
13146 ///# Panics
13147 ///Panics if `vkGetImageDrmFormatModifierPropertiesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13148 ///
13149 ///# Usage Notes
13150 ///
13151 ///Queries which DRM format modifier was selected for an image
13152 ///created with `VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT`. The
13153 ///chosen modifier determines the memory layout and is needed
13154 ///when sharing the image with other DRM/KMS clients.
13155 ///
13156 ///Requires `VK_EXT_image_drm_format_modifier`.
13157 pub unsafe fn get_image_drm_format_modifier_properties_ext(
13158 &self,
13159 image: Image,
13160 p_properties: &mut ImageDrmFormatModifierPropertiesEXT,
13161 ) -> VkResult<()> {
13162 let fp = self
13163 .commands()
13164 .get_image_drm_format_modifier_properties_ext
13165 .expect("vkGetImageDrmFormatModifierPropertiesEXT not loaded");
13166 check(unsafe { fp(self.handle(), image, p_properties) })
13167 }
13168 ///Wraps [`vkGetBufferOpaqueCaptureAddress`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetBufferOpaqueCaptureAddress.html).
13169 /**
13170 Provided by **VK_BASE_VERSION_1_2**.*/
13171 ///
13172 ///# Safety
13173 ///- `device` (self) must be valid and not destroyed.
13174 ///
13175 ///# Panics
13176 ///Panics if `vkGetBufferOpaqueCaptureAddress` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13177 ///
13178 ///# Usage Notes
13179 ///
13180 ///Returns an opaque capture address for a buffer that was created with
13181 ///`BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY`. This address is used
13182 ///to recreate the buffer at the same virtual address in a replay
13183 ///session (e.g. for GPU crash dump replay or deterministic replay
13184 ///tools).
13185 ///
13186 ///Most applications do not need this, it is primarily for debugging
13187 ///and profiling tools. Use `get_buffer_device_address` for runtime
13188 ///buffer address access.
13189 pub unsafe fn get_buffer_opaque_capture_address(&self, p_info: &BufferDeviceAddressInfo) {
13190 let fp = self
13191 .commands()
13192 .get_buffer_opaque_capture_address
13193 .expect("vkGetBufferOpaqueCaptureAddress not loaded");
13194 unsafe { fp(self.handle(), p_info) };
13195 }
13196 ///Wraps [`vkGetBufferDeviceAddress`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetBufferDeviceAddress.html).
13197 /**
13198 Provided by **VK_BASE_VERSION_1_2**.*/
13199 ///
13200 ///# Safety
13201 ///- `device` (self) must be valid and not destroyed.
13202 ///
13203 ///# Panics
13204 ///Panics if `vkGetBufferDeviceAddress` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13205 ///
13206 ///# Usage Notes
13207 ///
13208 ///Returns a 64-bit GPU virtual address for a buffer. This address can
13209 ///be passed to shaders via push constants or descriptors, enabling
13210 ///direct pointer-style access to buffer data from GPU code.
13211 ///
13212 ///The buffer must have been created with
13213 ///`BUFFER_USAGE_SHADER_DEVICE_ADDRESS` and the
13214 ///`buffer_device_address` feature must be enabled.
13215 ///
13216 ///**Use cases**:
13217 ///
13218 ///- **Bindless rendering**: pass buffer addresses in a storage buffer
13219 /// or push constant instead of binding individual descriptors.
13220 ///- **Acceleration structures**: ray tracing BLASes and TLASes
13221 /// reference geometry buffers by device address.
13222 ///- **GPU-driven pipelines**: indirect command generators read vertex
13223 /// and index data by address.
13224 ///
13225 ///The address remains valid for the lifetime of the buffer. If the
13226 ///buffer was created with
13227 ///`BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY`, the address can be
13228 ///captured and replayed across sessions.
13229 pub unsafe fn get_buffer_device_address(&self, p_info: &BufferDeviceAddressInfo) {
13230 let fp = self
13231 .commands()
13232 .get_buffer_device_address
13233 .expect("vkGetBufferDeviceAddress not loaded");
13234 unsafe { fp(self.handle(), p_info) };
13235 }
13236 ///Wraps [`vkInitializePerformanceApiINTEL`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkInitializePerformanceApiINTEL.html).
13237 /**
13238 Provided by **VK_INTEL_performance_query**.*/
13239 ///
13240 ///# Errors
13241 ///- `VK_ERROR_TOO_MANY_OBJECTS`
13242 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13243 ///- `VK_ERROR_UNKNOWN`
13244 ///- `VK_ERROR_VALIDATION_FAILED`
13245 ///
13246 ///# Safety
13247 ///- `device` (self) must be valid and not destroyed.
13248 ///
13249 ///# Panics
13250 ///Panics if `vkInitializePerformanceApiINTEL` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13251 ///
13252 ///# Usage Notes
13253 ///
13254 ///Initializes the Intel performance query API on a device. Must be
13255 ///called before using any other Intel performance query commands.
13256 ///Uninitialize with `uninitialize_performance_api_intel`.
13257 ///
13258 ///Requires `VK_INTEL_performance_query`.
13259 pub unsafe fn initialize_performance_api_intel(
13260 &self,
13261 p_initialize_info: &InitializePerformanceApiInfoINTEL,
13262 ) -> VkResult<()> {
13263 let fp = self
13264 .commands()
13265 .initialize_performance_api_intel
13266 .expect("vkInitializePerformanceApiINTEL not loaded");
13267 check(unsafe { fp(self.handle(), p_initialize_info) })
13268 }
13269 ///Wraps [`vkUninitializePerformanceApiINTEL`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkUninitializePerformanceApiINTEL.html).
13270 /**
13271 Provided by **VK_INTEL_performance_query**.*/
13272 ///
13273 ///# Safety
13274 ///- `device` (self) must be valid and not destroyed.
13275 ///
13276 ///# Panics
13277 ///Panics if `vkUninitializePerformanceApiINTEL` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13278 ///
13279 ///# Usage Notes
13280 ///
13281 ///Shuts down the Intel performance query API on a device, releasing
13282 ///any internal resources. Call when performance profiling is
13283 ///complete.
13284 ///
13285 ///Requires `VK_INTEL_performance_query`.
13286 pub unsafe fn uninitialize_performance_api_intel(&self) {
13287 let fp = self
13288 .commands()
13289 .uninitialize_performance_api_intel
13290 .expect("vkUninitializePerformanceApiINTEL not loaded");
13291 unsafe { fp(self.handle()) };
13292 }
13293 ///Wraps [`vkCmdSetPerformanceMarkerINTEL`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetPerformanceMarkerINTEL.html).
13294 /**
13295 Provided by **VK_INTEL_performance_query**.*/
13296 ///
13297 ///# Errors
13298 ///- `VK_ERROR_TOO_MANY_OBJECTS`
13299 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13300 ///- `VK_ERROR_UNKNOWN`
13301 ///- `VK_ERROR_VALIDATION_FAILED`
13302 ///
13303 ///# Safety
13304 ///- `commandBuffer` (self) must be valid and not destroyed.
13305 ///- `commandBuffer` must be externally synchronized.
13306 ///
13307 ///# Panics
13308 ///Panics if `vkCmdSetPerformanceMarkerINTEL` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13309 ///
13310 ///# Usage Notes
13311 ///
13312 ///Sets a performance marker in the command buffer to delimit a
13313 ///region of interest for Intel GPU profiling. Counters sampled
13314 ///between markers are attributed to the marked region.
13315 ///
13316 ///Requires `VK_INTEL_performance_query`.
13317 pub unsafe fn cmd_set_performance_marker_intel(
13318 &self,
13319 command_buffer: CommandBuffer,
13320 p_marker_info: &PerformanceMarkerInfoINTEL,
13321 ) -> VkResult<()> {
13322 let fp = self
13323 .commands()
13324 .cmd_set_performance_marker_intel
13325 .expect("vkCmdSetPerformanceMarkerINTEL not loaded");
13326 check(unsafe { fp(command_buffer, p_marker_info) })
13327 }
13328 ///Wraps [`vkCmdSetPerformanceStreamMarkerINTEL`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetPerformanceStreamMarkerINTEL.html).
13329 /**
13330 Provided by **VK_INTEL_performance_query**.*/
13331 ///
13332 ///# Errors
13333 ///- `VK_ERROR_TOO_MANY_OBJECTS`
13334 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13335 ///- `VK_ERROR_UNKNOWN`
13336 ///- `VK_ERROR_VALIDATION_FAILED`
13337 ///
13338 ///# Safety
13339 ///- `commandBuffer` (self) must be valid and not destroyed.
13340 ///- `commandBuffer` must be externally synchronized.
13341 ///
13342 ///# Panics
13343 ///Panics if `vkCmdSetPerformanceStreamMarkerINTEL` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13344 ///
13345 ///# Usage Notes
13346 ///
13347 ///Sets a performance stream marker in the command buffer. Stream
13348 ///markers identify points in the command stream for correlating
13349 ///performance counter data with specific GPU work.
13350 ///
13351 ///Requires `VK_INTEL_performance_query`.
13352 pub unsafe fn cmd_set_performance_stream_marker_intel(
13353 &self,
13354 command_buffer: CommandBuffer,
13355 p_marker_info: &PerformanceStreamMarkerInfoINTEL,
13356 ) -> VkResult<()> {
13357 let fp = self
13358 .commands()
13359 .cmd_set_performance_stream_marker_intel
13360 .expect("vkCmdSetPerformanceStreamMarkerINTEL not loaded");
13361 check(unsafe { fp(command_buffer, p_marker_info) })
13362 }
13363 ///Wraps [`vkCmdSetPerformanceOverrideINTEL`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetPerformanceOverrideINTEL.html).
13364 /**
13365 Provided by **VK_INTEL_performance_query**.*/
13366 ///
13367 ///# Errors
13368 ///- `VK_ERROR_TOO_MANY_OBJECTS`
13369 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13370 ///- `VK_ERROR_UNKNOWN`
13371 ///- `VK_ERROR_VALIDATION_FAILED`
13372 ///
13373 ///# Safety
13374 ///- `commandBuffer` (self) must be valid and not destroyed.
13375 ///- `commandBuffer` must be externally synchronized.
13376 ///
13377 ///# Panics
13378 ///Panics if `vkCmdSetPerformanceOverrideINTEL` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13379 ///
13380 ///# Usage Notes
13381 ///
13382 ///Overrides hardware performance settings for the remainder of the
13383 ///command buffer (e.g., forcing specific EU thread counts). Used
13384 ///for controlled profiling experiments.
13385 ///
13386 ///Requires `VK_INTEL_performance_query`.
13387 pub unsafe fn cmd_set_performance_override_intel(
13388 &self,
13389 command_buffer: CommandBuffer,
13390 p_override_info: &PerformanceOverrideInfoINTEL,
13391 ) -> VkResult<()> {
13392 let fp = self
13393 .commands()
13394 .cmd_set_performance_override_intel
13395 .expect("vkCmdSetPerformanceOverrideINTEL not loaded");
13396 check(unsafe { fp(command_buffer, p_override_info) })
13397 }
13398 ///Wraps [`vkAcquirePerformanceConfigurationINTEL`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAcquirePerformanceConfigurationINTEL.html).
13399 /**
13400 Provided by **VK_INTEL_performance_query**.*/
13401 ///
13402 ///# Errors
13403 ///- `VK_ERROR_TOO_MANY_OBJECTS`
13404 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13405 ///- `VK_ERROR_UNKNOWN`
13406 ///- `VK_ERROR_VALIDATION_FAILED`
13407 ///
13408 ///# Safety
13409 ///- `device` (self) must be valid and not destroyed.
13410 ///
13411 ///# Panics
13412 ///Panics if `vkAcquirePerformanceConfigurationINTEL` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13413 ///
13414 ///# Usage Notes
13415 ///
13416 ///Acquires a performance configuration that enables specific
13417 ///hardware counters for profiling. Apply to a queue with
13418 ///`queue_set_performance_configuration_intel`. Release with
13419 ///`release_performance_configuration_intel`.
13420 ///
13421 ///Requires `VK_INTEL_performance_query`.
13422 pub unsafe fn acquire_performance_configuration_intel(
13423 &self,
13424 p_acquire_info: &PerformanceConfigurationAcquireInfoINTEL,
13425 ) -> VkResult<PerformanceConfigurationINTEL> {
13426 let fp = self
13427 .commands()
13428 .acquire_performance_configuration_intel
13429 .expect("vkAcquirePerformanceConfigurationINTEL not loaded");
13430 let mut out = unsafe { core::mem::zeroed() };
13431 check(unsafe { fp(self.handle(), p_acquire_info, &mut out) })?;
13432 Ok(out)
13433 }
13434 ///Wraps [`vkReleasePerformanceConfigurationINTEL`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkReleasePerformanceConfigurationINTEL.html).
13435 /**
13436 Provided by **VK_INTEL_performance_query**.*/
13437 ///
13438 ///# Errors
13439 ///- `VK_ERROR_TOO_MANY_OBJECTS`
13440 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13441 ///- `VK_ERROR_UNKNOWN`
13442 ///- `VK_ERROR_VALIDATION_FAILED`
13443 ///
13444 ///# Safety
13445 ///- `device` (self) must be valid and not destroyed.
13446 ///- `configuration` must be externally synchronized.
13447 ///
13448 ///# Panics
13449 ///Panics if `vkReleasePerformanceConfigurationINTEL` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13450 ///
13451 ///# Usage Notes
13452 ///
13453 ///Releases a performance configuration acquired with
13454 ///`acquire_performance_configuration_intel`.
13455 ///
13456 ///Requires `VK_INTEL_performance_query`.
13457 pub unsafe fn release_performance_configuration_intel(
13458 &self,
13459 configuration: PerformanceConfigurationINTEL,
13460 ) -> VkResult<()> {
13461 let fp = self
13462 .commands()
13463 .release_performance_configuration_intel
13464 .expect("vkReleasePerformanceConfigurationINTEL not loaded");
13465 check(unsafe { fp(self.handle(), configuration) })
13466 }
13467 ///Wraps [`vkQueueSetPerformanceConfigurationINTEL`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueSetPerformanceConfigurationINTEL.html).
13468 /**
13469 Provided by **VK_INTEL_performance_query**.*/
13470 ///
13471 ///# Errors
13472 ///- `VK_ERROR_TOO_MANY_OBJECTS`
13473 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13474 ///- `VK_ERROR_UNKNOWN`
13475 ///- `VK_ERROR_VALIDATION_FAILED`
13476 ///
13477 ///# Safety
13478 ///- `queue` (self) must be valid and not destroyed.
13479 ///- `queue` must be externally synchronized.
13480 ///
13481 ///# Panics
13482 ///Panics if `vkQueueSetPerformanceConfigurationINTEL` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13483 ///
13484 ///# Usage Notes
13485 ///
13486 ///Applies a performance configuration to a queue, enabling the
13487 ///selected hardware counters for all subsequent submissions to
13488 ///that queue.
13489 ///
13490 ///Requires `VK_INTEL_performance_query`.
13491 pub unsafe fn queue_set_performance_configuration_intel(
13492 &self,
13493 queue: Queue,
13494 configuration: PerformanceConfigurationINTEL,
13495 ) -> VkResult<()> {
13496 let fp = self
13497 .commands()
13498 .queue_set_performance_configuration_intel
13499 .expect("vkQueueSetPerformanceConfigurationINTEL not loaded");
13500 check(unsafe { fp(queue, configuration) })
13501 }
13502 ///Wraps [`vkGetPerformanceParameterINTEL`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPerformanceParameterINTEL.html).
13503 /**
13504 Provided by **VK_INTEL_performance_query**.*/
13505 ///
13506 ///# Errors
13507 ///- `VK_ERROR_TOO_MANY_OBJECTS`
13508 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13509 ///- `VK_ERROR_UNKNOWN`
13510 ///- `VK_ERROR_VALIDATION_FAILED`
13511 ///
13512 ///# Safety
13513 ///- `device` (self) must be valid and not destroyed.
13514 ///
13515 ///# Panics
13516 ///Panics if `vkGetPerformanceParameterINTEL` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13517 ///
13518 ///# Usage Notes
13519 ///
13520 ///Queries a performance parameter value from the Intel driver, such
13521 ///as GPU clock frequency or EU count. Useful for normalizing
13522 ///profiling results.
13523 ///
13524 ///Requires `VK_INTEL_performance_query`.
13525 pub unsafe fn get_performance_parameter_intel(
13526 &self,
13527 parameter: PerformanceParameterTypeINTEL,
13528 ) -> VkResult<PerformanceValueINTEL> {
13529 let fp = self
13530 .commands()
13531 .get_performance_parameter_intel
13532 .expect("vkGetPerformanceParameterINTEL not loaded");
13533 let mut out = unsafe { core::mem::zeroed() };
13534 check(unsafe { fp(self.handle(), parameter, &mut out) })?;
13535 Ok(out)
13536 }
13537 ///Wraps [`vkGetDeviceMemoryOpaqueCaptureAddress`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceMemoryOpaqueCaptureAddress.html).
13538 /**
13539 Provided by **VK_BASE_VERSION_1_2**.*/
13540 ///
13541 ///# Safety
13542 ///- `device` (self) must be valid and not destroyed.
13543 ///
13544 ///# Panics
13545 ///Panics if `vkGetDeviceMemoryOpaqueCaptureAddress` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13546 ///
13547 ///# Usage Notes
13548 ///
13549 ///Returns an opaque capture address for a device memory allocation
13550 ///that was created with
13551 ///`MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY`. Used in conjunction
13552 ///with `get_buffer_opaque_capture_address` to replay buffer address
13553 ///assignments.
13554 ///
13555 ///This is a debugging/replay tool feature. Most applications do not
13556 ///need this.
13557 pub unsafe fn get_device_memory_opaque_capture_address(
13558 &self,
13559 p_info: &DeviceMemoryOpaqueCaptureAddressInfo,
13560 ) {
13561 let fp = self
13562 .commands()
13563 .get_device_memory_opaque_capture_address
13564 .expect("vkGetDeviceMemoryOpaqueCaptureAddress not loaded");
13565 unsafe { fp(self.handle(), p_info) };
13566 }
13567 ///Wraps [`vkGetPipelineExecutablePropertiesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPipelineExecutablePropertiesKHR.html).
13568 /**
13569 Provided by **VK_KHR_pipeline_executable_properties**.*/
13570 ///
13571 ///# Errors
13572 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13573 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
13574 ///- `VK_ERROR_UNKNOWN`
13575 ///- `VK_ERROR_VALIDATION_FAILED`
13576 ///
13577 ///# Safety
13578 ///- `device` (self) must be valid and not destroyed.
13579 ///
13580 ///# Panics
13581 ///Panics if `vkGetPipelineExecutablePropertiesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13582 ///
13583 ///# Usage Notes
13584 ///
13585 ///Lists the executable components within a pipeline. A single
13586 ///pipeline may contain multiple executables, for example, a
13587 ///graphics pipeline typically has separate vertex and fragment
13588 ///shader executables.
13589 ///
13590 ///Each returned `PipelineExecutablePropertiesKHR` contains a name,
13591 ///description, and shader stage flags identifying the executable.
13592 ///Use these to index into `get_pipeline_executable_statistics_khr`
13593 ///and `get_pipeline_executable_internal_representations_khr`.
13594 ///
13595 ///The pipeline must have been created with
13596 ///`PIPELINE_CREATE_CAPTURE_STATISTICS` or
13597 ///`PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS`. This is a
13598 ///debugging and profiling tool, not intended for shipping builds.
13599 pub unsafe fn get_pipeline_executable_properties_khr(
13600 &self,
13601 p_pipeline_info: &PipelineInfoKHR,
13602 ) -> VkResult<Vec<PipelineExecutablePropertiesKHR>> {
13603 let fp = self
13604 .commands()
13605 .get_pipeline_executable_properties_khr
13606 .expect("vkGetPipelineExecutablePropertiesKHR not loaded");
13607 enumerate_two_call(|count, data| unsafe { fp(self.handle(), p_pipeline_info, count, data) })
13608 }
13609 ///Wraps [`vkGetPipelineExecutableStatisticsKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPipelineExecutableStatisticsKHR.html).
13610 /**
13611 Provided by **VK_KHR_pipeline_executable_properties**.*/
13612 ///
13613 ///# Errors
13614 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13615 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
13616 ///- `VK_ERROR_UNKNOWN`
13617 ///- `VK_ERROR_VALIDATION_FAILED`
13618 ///
13619 ///# Safety
13620 ///- `device` (self) must be valid and not destroyed.
13621 ///
13622 ///# Panics
13623 ///Panics if `vkGetPipelineExecutableStatisticsKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13624 ///
13625 ///# Usage Notes
13626 ///
13627 ///Retrieves compiler statistics for a specific pipeline executable.
13628 ///Statistics include metrics like register usage, instruction count,
13629 ///scratch memory, and other driver-specific values.
13630 ///
13631 ///Identify the executable by index from
13632 ///`get_pipeline_executable_properties_khr` via
13633 ///`PipelineExecutableInfoKHR`.
13634 ///
13635 ///Each statistic has a name, description, format (bool, int, float,
13636 ///or string), and value. The available statistics are
13637 ///driver-specific, different vendors report different metrics.
13638 ///
13639 ///The pipeline must have been created with
13640 ///`PIPELINE_CREATE_CAPTURE_STATISTICS`. This is a profiling tool
13641 ///for shader optimization, use it to compare register pressure
13642 ///or instruction counts across shader variants.
13643 pub unsafe fn get_pipeline_executable_statistics_khr(
13644 &self,
13645 p_executable_info: &PipelineExecutableInfoKHR,
13646 ) -> VkResult<Vec<PipelineExecutableStatisticKHR>> {
13647 let fp = self
13648 .commands()
13649 .get_pipeline_executable_statistics_khr
13650 .expect("vkGetPipelineExecutableStatisticsKHR not loaded");
13651 enumerate_two_call(|count, data| unsafe {
13652 fp(self.handle(), p_executable_info, count, data)
13653 })
13654 }
13655 ///Wraps [`vkGetPipelineExecutableInternalRepresentationsKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPipelineExecutableInternalRepresentationsKHR.html).
13656 /**
13657 Provided by **VK_KHR_pipeline_executable_properties**.*/
13658 ///
13659 ///# Errors
13660 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13661 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
13662 ///- `VK_ERROR_UNKNOWN`
13663 ///- `VK_ERROR_VALIDATION_FAILED`
13664 ///
13665 ///# Safety
13666 ///- `device` (self) must be valid and not destroyed.
13667 ///
13668 ///# Panics
13669 ///Panics if `vkGetPipelineExecutableInternalRepresentationsKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13670 ///
13671 ///# Usage Notes
13672 ///
13673 ///Retrieves internal representations (IR) of a pipeline executable.
13674 ///These are driver-specific intermediate or final shader
13675 ///representations, for example, SPIR-V, vendor IR, or GPU ISA
13676 ///disassembly.
13677 ///
13678 ///Each representation has a name, description, and opaque data
13679 ///blob. Whether the data is human-readable text or binary depends
13680 ///on `is_text` in the returned structure.
13681 ///
13682 ///The pipeline must have been created with
13683 ///`PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS`. Enabling
13684 ///this flag may disable optimizations, so only use it for
13685 ///debugging and shader analysis, not in production.
13686 ///
13687 ///Identify the executable by index from
13688 ///`get_pipeline_executable_properties_khr`.
13689 pub unsafe fn get_pipeline_executable_internal_representations_khr(
13690 &self,
13691 p_executable_info: &PipelineExecutableInfoKHR,
13692 ) -> VkResult<Vec<PipelineExecutableInternalRepresentationKHR>> {
13693 let fp = self
13694 .commands()
13695 .get_pipeline_executable_internal_representations_khr
13696 .expect("vkGetPipelineExecutableInternalRepresentationsKHR not loaded");
13697 enumerate_two_call(|count, data| unsafe {
13698 fp(self.handle(), p_executable_info, count, data)
13699 })
13700 }
13701 ///Wraps [`vkCmdSetLineStipple`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetLineStipple.html).
13702 /**
13703 Provided by **VK_GRAPHICS_VERSION_1_4**.*/
13704 ///
13705 ///# Safety
13706 ///- `commandBuffer` (self) must be valid and not destroyed.
13707 ///- `commandBuffer` must be externally synchronized.
13708 ///
13709 ///# Panics
13710 ///Panics if `vkCmdSetLineStipple` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13711 ///
13712 ///# Usage Notes
13713 ///
13714 ///Dynamically sets the line stipple pattern and repeat factor. Only
13715 ///takes effect if the pipeline was created with
13716 ///`DYNAMIC_STATE_LINE_STIPPLE`.
13717 ///
13718 ///The `stipple_factor` (1–256) controls how many pixels each bit of
13719 ///the pattern spans. The `stipple_pattern` is a 16-bit bitmask where
13720 ///each bit represents a pixel, 1 is drawn, 0 is discarded.
13721 ///
13722 ///Line stippling requires `VK_EXT_line_rasterization` and the
13723 ///`stippled_*_lines` device features, depending on which line
13724 ///rasterisation mode you use.
13725 ///
13726 ///Core dynamic state in Vulkan 1.4.
13727 pub unsafe fn cmd_set_line_stipple(
13728 &self,
13729 command_buffer: CommandBuffer,
13730 line_stipple_factor: u32,
13731 line_stipple_pattern: u16,
13732 ) {
13733 let fp = self
13734 .commands()
13735 .cmd_set_line_stipple
13736 .expect("vkCmdSetLineStipple not loaded");
13737 unsafe { fp(command_buffer, line_stipple_factor, line_stipple_pattern) };
13738 }
13739 ///Wraps [`vkGetFaultData`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetFaultData.html).
13740 /**
13741 Provided by **VKSC_VERSION_1_0**.*/
13742 ///
13743 ///# Errors
13744 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13745 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
13746 ///- `VK_ERROR_UNKNOWN`
13747 ///- `VK_ERROR_VALIDATION_FAILED`
13748 ///
13749 ///# Safety
13750 ///- `device` (self) must be valid and not destroyed.
13751 ///
13752 ///# Panics
13753 ///Panics if `vkGetFaultData` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13754 ///
13755 ///# Usage Notes
13756 ///
13757 ///Queries recorded fault data from the device. Part of Vulkan SC
13758 ///(Safety Critical) for fault reporting in safety-certified
13759 ///environments. Uses the two-call idiom. The
13760 ///`fault_query_behavior` controls whether queried faults are
13761 ///cleared. Also reports the count of unrecorded faults that
13762 ///overflowed the internal buffer.
13763 ///
13764 ///Requires Vulkan SC.
13765 pub unsafe fn get_fault_data(
13766 &self,
13767 fault_query_behavior: FaultQueryBehavior,
13768 p_unrecorded_faults: *mut u32,
13769 ) -> VkResult<Vec<FaultData>> {
13770 let fp = self
13771 .commands()
13772 .get_fault_data
13773 .expect("vkGetFaultData not loaded");
13774 enumerate_two_call(|count, data| unsafe {
13775 fp(
13776 self.handle(),
13777 fault_query_behavior,
13778 p_unrecorded_faults,
13779 count,
13780 data,
13781 )
13782 })
13783 }
13784 ///Wraps [`vkCreateAccelerationStructureKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateAccelerationStructureKHR.html).
13785 /**
13786 Provided by **VK_KHR_acceleration_structure**.*/
13787 ///
13788 ///# Errors
13789 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13790 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
13791 ///- `VK_ERROR_UNKNOWN`
13792 ///- `VK_ERROR_VALIDATION_FAILED`
13793 ///
13794 ///# Safety
13795 ///- `device` (self) must be valid and not destroyed.
13796 ///
13797 ///# Panics
13798 ///Panics if `vkCreateAccelerationStructureKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13799 ///
13800 ///# Usage Notes
13801 ///
13802 ///Creates an acceleration structure for hardware ray tracing. An
13803 ///acceleration structure is a spatial data structure (typically a BVH)
13804 ///that the GPU traverses during ray intersection tests.
13805 ///
13806 ///**Two levels**:
13807 ///
13808 ///- **Bottom-level (BLAS)**: contains geometry (triangles or AABBs).
13809 /// Create one per mesh or mesh group.
13810 ///- **Top-level (TLAS)**: contains instances that reference BLASes
13811 /// with per-instance transforms. Create one per scene.
13812 ///
13813 ///The acceleration structure needs a backing buffer created with
13814 ///`BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE`. Query the required
13815 ///size with `get_acceleration_structure_build_sizes_khr` first.
13816 ///
13817 ///After creation, build the structure with
13818 ///`cmd_build_acceleration_structures_khr`. The structure is not usable
13819 ///for tracing until built.
13820 pub unsafe fn create_acceleration_structure_khr(
13821 &self,
13822 p_create_info: &AccelerationStructureCreateInfoKHR,
13823 allocator: Option<&AllocationCallbacks>,
13824 ) -> VkResult<AccelerationStructureKHR> {
13825 let fp = self
13826 .commands()
13827 .create_acceleration_structure_khr
13828 .expect("vkCreateAccelerationStructureKHR not loaded");
13829 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
13830 let mut out = unsafe { core::mem::zeroed() };
13831 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
13832 Ok(out)
13833 }
13834 ///Wraps [`vkCmdBuildAccelerationStructuresKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBuildAccelerationStructuresKHR.html).
13835 /**
13836 Provided by **VK_KHR_acceleration_structure**.*/
13837 ///
13838 ///# Safety
13839 ///- `commandBuffer` (self) must be valid and not destroyed.
13840 ///- `commandBuffer` must be externally synchronized.
13841 ///
13842 ///# Panics
13843 ///Panics if `vkCmdBuildAccelerationStructuresKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13844 ///
13845 ///# Usage Notes
13846 ///
13847 ///Records a GPU-side acceleration structure build or update. This is
13848 ///the primary way to build BLASes and TLASes for ray tracing.
13849 ///
13850 ///**Build vs update**: an initial build creates the structure from
13851 ///scratch. An update (`BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE`)
13852 ///modifies an existing structure in-place, which is faster but
13853 ///produces lower traversal quality. Use updates for dynamic geometry
13854 ///(e.g. animated characters) and full rebuilds when geometry changes
13855 ///significantly.
13856 ///
13857 ///**Scratch buffer**: builds require a temporary scratch buffer.
13858 ///Query the required size with
13859 ///`get_acceleration_structure_build_sizes_khr` and create a buffer
13860 ///with `BUFFER_USAGE_STORAGE_BUFFER`.
13861 ///
13862 ///Multiple builds can be batched in a single call. The driver may
13863 ///execute them in parallel.
13864 ///
13865 ///Must be recorded outside a render pass.
13866 pub unsafe fn cmd_build_acceleration_structures_khr(
13867 &self,
13868 command_buffer: CommandBuffer,
13869 p_infos: &[AccelerationStructureBuildGeometryInfoKHR],
13870 pp_build_range_infos: *const *const AccelerationStructureBuildRangeInfoKHR,
13871 ) {
13872 let fp = self
13873 .commands()
13874 .cmd_build_acceleration_structures_khr
13875 .expect("vkCmdBuildAccelerationStructuresKHR not loaded");
13876 unsafe {
13877 fp(
13878 command_buffer,
13879 p_infos.len() as u32,
13880 p_infos.as_ptr(),
13881 pp_build_range_infos,
13882 )
13883 };
13884 }
13885 ///Wraps [`vkCmdBuildAccelerationStructuresIndirectKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBuildAccelerationStructuresIndirectKHR.html).
13886 /**
13887 Provided by **VK_KHR_acceleration_structure**.*/
13888 ///
13889 ///# Safety
13890 ///- `commandBuffer` (self) must be valid and not destroyed.
13891 ///- `commandBuffer` must be externally synchronized.
13892 ///
13893 ///# Panics
13894 ///Panics if `vkCmdBuildAccelerationStructuresIndirectKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13895 ///
13896 ///# Usage Notes
13897 ///
13898 ///GPU-side acceleration structure build with indirect parameters. The
13899 ///primitive counts and build ranges are read from GPU buffers rather
13900 ///than specified on the CPU.
13901 ///
13902 ///This enables fully GPU-driven scene management where a compute
13903 ///shader determines which geometry to include and writes the build
13904 ///parameters.
13905 ///
13906 ///Requires the `acceleration_structure_indirect_build` feature.
13907 pub unsafe fn cmd_build_acceleration_structures_indirect_khr(
13908 &self,
13909 command_buffer: CommandBuffer,
13910 p_infos: &[AccelerationStructureBuildGeometryInfoKHR],
13911 p_indirect_device_addresses: &[u64],
13912 p_indirect_strides: &[u32],
13913 pp_max_primitive_counts: *const *const u32,
13914 ) {
13915 let fp = self
13916 .commands()
13917 .cmd_build_acceleration_structures_indirect_khr
13918 .expect("vkCmdBuildAccelerationStructuresIndirectKHR not loaded");
13919 unsafe {
13920 fp(
13921 command_buffer,
13922 p_infos.len() as u32,
13923 p_infos.as_ptr(),
13924 p_indirect_device_addresses.as_ptr(),
13925 p_indirect_strides.as_ptr(),
13926 pp_max_primitive_counts,
13927 )
13928 };
13929 }
13930 ///Wraps [`vkBuildAccelerationStructuresKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBuildAccelerationStructuresKHR.html).
13931 /**
13932 Provided by **VK_KHR_acceleration_structure**.*/
13933 ///
13934 ///# Errors
13935 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
13936 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
13937 ///- `VK_ERROR_UNKNOWN`
13938 ///- `VK_ERROR_VALIDATION_FAILED`
13939 ///
13940 ///# Safety
13941 ///- `device` (self) must be valid and not destroyed.
13942 ///
13943 ///# Panics
13944 ///Panics if `vkBuildAccelerationStructuresKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13945 ///
13946 ///# Usage Notes
13947 ///
13948 ///Builds or updates acceleration structures on the **host** (CPU).
13949 ///This is the CPU-side alternative to
13950 ///`cmd_build_acceleration_structures_khr`.
13951 ///
13952 ///Host builds are useful for offline processing, tools, or when GPU
13953 ///build capacity is limited. However, GPU builds are significantly
13954 ///faster for real-time applications.
13955 ///
13956 ///Requires the `acceleration_structure_host_commands` feature.
13957 pub unsafe fn build_acceleration_structures_khr(
13958 &self,
13959 deferred_operation: DeferredOperationKHR,
13960 p_infos: &[AccelerationStructureBuildGeometryInfoKHR],
13961 pp_build_range_infos: *const *const AccelerationStructureBuildRangeInfoKHR,
13962 ) -> VkResult<()> {
13963 let fp = self
13964 .commands()
13965 .build_acceleration_structures_khr
13966 .expect("vkBuildAccelerationStructuresKHR not loaded");
13967 check(unsafe {
13968 fp(
13969 self.handle(),
13970 deferred_operation,
13971 p_infos.len() as u32,
13972 p_infos.as_ptr(),
13973 pp_build_range_infos,
13974 )
13975 })
13976 }
13977 ///Wraps [`vkGetAccelerationStructureDeviceAddressKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetAccelerationStructureDeviceAddressKHR.html).
13978 /**
13979 Provided by **VK_KHR_acceleration_structure**.*/
13980 ///
13981 ///# Safety
13982 ///- `device` (self) must be valid and not destroyed.
13983 ///
13984 ///# Panics
13985 ///Panics if `vkGetAccelerationStructureDeviceAddressKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
13986 ///
13987 ///# Usage Notes
13988 ///
13989 ///Returns the GPU device address of an acceleration structure. This
13990 ///address is used when building a TLAS, each instance in the TLAS
13991 ///references a BLAS by its device address.
13992 ///
13993 ///The address remains valid for the lifetime of the acceleration
13994 ///structure.
13995 pub unsafe fn get_acceleration_structure_device_address_khr(
13996 &self,
13997 p_info: &AccelerationStructureDeviceAddressInfoKHR,
13998 ) {
13999 let fp = self
14000 .commands()
14001 .get_acceleration_structure_device_address_khr
14002 .expect("vkGetAccelerationStructureDeviceAddressKHR not loaded");
14003 unsafe { fp(self.handle(), p_info) };
14004 }
14005 ///Wraps [`vkCreateDeferredOperationKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateDeferredOperationKHR.html).
14006 /**
14007 Provided by **VK_KHR_deferred_host_operations**.*/
14008 ///
14009 ///# Errors
14010 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
14011 ///- `VK_ERROR_UNKNOWN`
14012 ///- `VK_ERROR_VALIDATION_FAILED`
14013 ///
14014 ///# Safety
14015 ///- `device` (self) must be valid and not destroyed.
14016 ///
14017 ///# Panics
14018 ///Panics if `vkCreateDeferredOperationKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14019 ///
14020 ///# Usage Notes
14021 ///
14022 ///Creates a deferred operation handle. Deferred operations allow
14023 ///expensive host-side work (such as ray tracing pipeline compilation)
14024 ///to be split across multiple CPU threads.
14025 ///
14026 ///The typical workflow:
14027 ///
14028 ///1. Create a deferred operation with this command.
14029 ///2. Pass the handle to a deferrable command (e.g.,
14030 /// `create_ray_tracing_pipelines_khr`). If deferred, it returns
14031 /// `OPERATION_DEFERRED_KHR`.
14032 ///3. Query `get_deferred_operation_max_concurrency_khr` to learn
14033 /// how many threads can contribute.
14034 ///4. Call `deferred_operation_join_khr` from each worker thread.
14035 ///5. Once all joins return `SUCCESS`, retrieve the result with
14036 /// `get_deferred_operation_result_khr`.
14037 ///6. Destroy the handle with `destroy_deferred_operation_khr`.
14038 ///
14039 ///The handle itself is lightweight, it is just a token for tracking
14040 ///the deferred work.
14041 pub unsafe fn create_deferred_operation_khr(
14042 &self,
14043 allocator: Option<&AllocationCallbacks>,
14044 ) -> VkResult<DeferredOperationKHR> {
14045 let fp = self
14046 .commands()
14047 .create_deferred_operation_khr
14048 .expect("vkCreateDeferredOperationKHR not loaded");
14049 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
14050 let mut out = unsafe { core::mem::zeroed() };
14051 check(unsafe { fp(self.handle(), alloc_ptr, &mut out) })?;
14052 Ok(out)
14053 }
14054 ///Wraps [`vkDestroyDeferredOperationKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyDeferredOperationKHR.html).
14055 /**
14056 Provided by **VK_KHR_deferred_host_operations**.*/
14057 ///
14058 ///# Safety
14059 ///- `device` (self) must be valid and not destroyed.
14060 ///- `operation` must be externally synchronized.
14061 ///
14062 ///# Panics
14063 ///Panics if `vkDestroyDeferredOperationKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14064 ///
14065 ///# Usage Notes
14066 ///
14067 ///Destroys a deferred operation handle. The operation must have
14068 ///completed before destruction, either all joining threads returned
14069 ///`SUCCESS` or `THREAD_DONE_KHR`, or the operation was never
14070 ///deferred.
14071 ///
14072 ///Do not destroy while threads are still joined to the operation.
14073 pub unsafe fn destroy_deferred_operation_khr(
14074 &self,
14075 operation: DeferredOperationKHR,
14076 allocator: Option<&AllocationCallbacks>,
14077 ) {
14078 let fp = self
14079 .commands()
14080 .destroy_deferred_operation_khr
14081 .expect("vkDestroyDeferredOperationKHR not loaded");
14082 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
14083 unsafe { fp(self.handle(), operation, alloc_ptr) };
14084 }
14085 ///Wraps [`vkGetDeferredOperationMaxConcurrencyKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeferredOperationMaxConcurrencyKHR.html).
14086 /**
14087 Provided by **VK_KHR_deferred_host_operations**.*/
14088 ///
14089 ///# Safety
14090 ///- `device` (self) must be valid and not destroyed.
14091 ///
14092 ///# Panics
14093 ///Panics if `vkGetDeferredOperationMaxConcurrencyKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14094 ///
14095 ///# Usage Notes
14096 ///
14097 ///Returns the maximum number of threads that can usefully join this
14098 ///deferred operation. Spawning more threads than this value wastes
14099 ///resources, additional joins will return `THREAD_IDLE_KHR`.
14100 ///
14101 ///The returned value may decrease over time as work completes, so
14102 ///query it just before spawning worker threads.
14103 ///
14104 ///A return value of zero means the operation is already complete
14105 ///or requires no additional threads.
14106 pub unsafe fn get_deferred_operation_max_concurrency_khr(
14107 &self,
14108 operation: DeferredOperationKHR,
14109 ) {
14110 let fp = self
14111 .commands()
14112 .get_deferred_operation_max_concurrency_khr
14113 .expect("vkGetDeferredOperationMaxConcurrencyKHR not loaded");
14114 unsafe { fp(self.handle(), operation) };
14115 }
14116 ///Wraps [`vkGetDeferredOperationResultKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeferredOperationResultKHR.html).
14117 /**
14118 Provided by **VK_KHR_deferred_host_operations**.*/
14119 ///
14120 ///# Errors
14121 ///- `VK_ERROR_UNKNOWN`
14122 ///- `VK_ERROR_VALIDATION_FAILED`
14123 ///
14124 ///# Safety
14125 ///- `device` (self) must be valid and not destroyed.
14126 ///
14127 ///# Panics
14128 ///Panics if `vkGetDeferredOperationResultKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14129 ///
14130 ///# Usage Notes
14131 ///
14132 ///Returns the result of a completed deferred operation. The returned
14133 ///`VkResult` is the same value that the original deferrable command
14134 ///would have returned if it had executed synchronously.
14135 ///
14136 ///Only call this after the operation has fully completed (all joins
14137 ///returned `SUCCESS` or `THREAD_DONE_KHR`). Calling on an
14138 ///in-progress operation returns `NOT_READY`.
14139 ///
14140 ///For example, if `create_ray_tracing_pipelines_khr` was deferred,
14141 ///this returns whether pipeline creation succeeded or failed.
14142 pub unsafe fn get_deferred_operation_result_khr(
14143 &self,
14144 operation: DeferredOperationKHR,
14145 ) -> VkResult<()> {
14146 let fp = self
14147 .commands()
14148 .get_deferred_operation_result_khr
14149 .expect("vkGetDeferredOperationResultKHR not loaded");
14150 check(unsafe { fp(self.handle(), operation) })
14151 }
14152 ///Wraps [`vkDeferredOperationJoinKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDeferredOperationJoinKHR.html).
14153 /**
14154 Provided by **VK_KHR_deferred_host_operations**.*/
14155 ///
14156 ///# Errors
14157 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
14158 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
14159 ///- `VK_ERROR_UNKNOWN`
14160 ///- `VK_ERROR_VALIDATION_FAILED`
14161 ///
14162 ///# Safety
14163 ///- `device` (self) must be valid and not destroyed.
14164 ///
14165 ///# Panics
14166 ///Panics if `vkDeferredOperationJoinKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14167 ///
14168 ///# Usage Notes
14169 ///
14170 ///Joins the calling thread to a deferred operation, contributing
14171 ///CPU time to its completion. Multiple threads can join the same
14172 ///operation concurrently.
14173 ///
14174 ///Return values:
14175 ///
14176 ///- `SUCCESS`, the operation completed. The calling thread was
14177 /// the last one needed.
14178 ///- `THREAD_DONE_KHR`, this thread's contribution is finished,
14179 /// but the operation may still be in progress on other threads.
14180 ///- `THREAD_IDLE_KHR`, the operation has enough threads; this
14181 /// one was not needed. Retry later or move on.
14182 ///
14183 ///Call this in a loop per thread until it returns `SUCCESS` or
14184 ///`THREAD_DONE_KHR`. After all threads finish, check the final
14185 ///result with `get_deferred_operation_result_khr`.
14186 ///
14187 ///The number of useful threads is bounded by
14188 ///`get_deferred_operation_max_concurrency_khr`.
14189 pub unsafe fn deferred_operation_join_khr(
14190 &self,
14191 operation: DeferredOperationKHR,
14192 ) -> VkResult<()> {
14193 let fp = self
14194 .commands()
14195 .deferred_operation_join_khr
14196 .expect("vkDeferredOperationJoinKHR not loaded");
14197 check(unsafe { fp(self.handle(), operation) })
14198 }
14199 ///Wraps [`vkGetPipelineIndirectMemoryRequirementsNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPipelineIndirectMemoryRequirementsNV.html).
14200 /**
14201 Provided by **VK_NV_device_generated_commands_compute**.*/
14202 ///
14203 ///# Safety
14204 ///- `device` (self) must be valid and not destroyed.
14205 ///
14206 ///# Panics
14207 ///Panics if `vkGetPipelineIndirectMemoryRequirementsNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14208 ///
14209 ///# Usage Notes
14210 ///
14211 ///Queries the memory requirements for storing a compute pipeline's
14212 ///indirect dispatch metadata. Allocate a buffer of this size and
14213 ///pass it when creating the pipeline for device-generated compute
14214 ///dispatch.
14215 ///
14216 ///Requires `VK_NV_device_generated_commands_compute`.
14217 pub unsafe fn get_pipeline_indirect_memory_requirements_nv(
14218 &self,
14219 p_create_info: &ComputePipelineCreateInfo,
14220 p_memory_requirements: &mut MemoryRequirements2,
14221 ) {
14222 let fp = self
14223 .commands()
14224 .get_pipeline_indirect_memory_requirements_nv
14225 .expect("vkGetPipelineIndirectMemoryRequirementsNV not loaded");
14226 unsafe { fp(self.handle(), p_create_info, p_memory_requirements) };
14227 }
14228 ///Wraps [`vkGetPipelineIndirectDeviceAddressNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPipelineIndirectDeviceAddressNV.html).
14229 /**
14230 Provided by **VK_NV_device_generated_commands_compute**.*/
14231 ///
14232 ///# Safety
14233 ///- `device` (self) must be valid and not destroyed.
14234 ///
14235 ///# Panics
14236 ///Panics if `vkGetPipelineIndirectDeviceAddressNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14237 ///
14238 ///# Usage Notes
14239 ///
14240 ///Returns the device address of a compute pipeline's indirect
14241 ///dispatch metadata. The GPU writes to this address to select
14242 ///which pipeline to dispatch in device-generated compute workflows.
14243 ///
14244 ///Requires `VK_NV_device_generated_commands_compute`.
14245 pub unsafe fn get_pipeline_indirect_device_address_nv(
14246 &self,
14247 p_info: &PipelineIndirectDeviceAddressInfoNV,
14248 ) {
14249 let fp = self
14250 .commands()
14251 .get_pipeline_indirect_device_address_nv
14252 .expect("vkGetPipelineIndirectDeviceAddressNV not loaded");
14253 unsafe { fp(self.handle(), p_info) };
14254 }
14255 ///Wraps [`vkAntiLagUpdateAMD`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAntiLagUpdateAMD.html).
14256 /**
14257 Provided by **VK_AMD_anti_lag**.*/
14258 ///
14259 ///# Safety
14260 ///- `device` (self) must be valid and not destroyed.
14261 ///
14262 ///# Panics
14263 ///Panics if `vkAntiLagUpdateAMD` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14264 ///
14265 ///# Usage Notes
14266 ///
14267 ///Submits anti-lag timing data to reduce input-to-display latency.
14268 ///Called once per frame with presentation timing hints so the driver
14269 ///can pace GPU work to minimise latency.
14270 ///
14271 ///Requires `VK_AMD_anti_lag`.
14272 pub unsafe fn anti_lag_update_amd(&self, p_data: &AntiLagDataAMD) {
14273 let fp = self
14274 .commands()
14275 .anti_lag_update_amd
14276 .expect("vkAntiLagUpdateAMD not loaded");
14277 unsafe { fp(self.handle(), p_data) };
14278 }
14279 ///Wraps [`vkCmdSetCullMode`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetCullMode.html).
14280 /**
14281 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14282 ///
14283 ///# Safety
14284 ///- `commandBuffer` (self) must be valid and not destroyed.
14285 ///- `commandBuffer` must be externally synchronized.
14286 ///
14287 ///# Panics
14288 ///Panics if `vkCmdSetCullMode` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14289 ///
14290 ///# Usage Notes
14291 ///
14292 ///Dynamically sets the triangle culling mode. Only takes effect if
14293 ///the pipeline was created with `DYNAMIC_STATE_CULL_MODE`.
14294 ///
14295 ///Values: `CULL_MODE_NONE`, `CULL_MODE_FRONT`, `CULL_MODE_BACK`,
14296 ///`CULL_MODE_FRONT_AND_BACK`.
14297 ///
14298 ///Common pattern: set `CULL_MODE_BACK` for opaque geometry and
14299 ///`CULL_MODE_NONE` for double-sided or transparent materials, without
14300 ///needing separate pipelines.
14301 ///
14302 ///Core dynamic state in Vulkan 1.3.
14303 pub unsafe fn cmd_set_cull_mode(
14304 &self,
14305 command_buffer: CommandBuffer,
14306 cull_mode: CullModeFlags,
14307 ) {
14308 let fp = self
14309 .commands()
14310 .cmd_set_cull_mode
14311 .expect("vkCmdSetCullMode not loaded");
14312 unsafe { fp(command_buffer, cull_mode) };
14313 }
14314 ///Wraps [`vkCmdSetFrontFace`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetFrontFace.html).
14315 /**
14316 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14317 ///
14318 ///# Safety
14319 ///- `commandBuffer` (self) must be valid and not destroyed.
14320 ///- `commandBuffer` must be externally synchronized.
14321 ///
14322 ///# Panics
14323 ///Panics if `vkCmdSetFrontFace` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14324 ///
14325 ///# Usage Notes
14326 ///
14327 ///Dynamically sets which triangle winding order is considered
14328 ///front-facing. Only takes effect if the pipeline was created with
14329 ///`DYNAMIC_STATE_FRONT_FACE`.
14330 ///
14331 ///Values: `FRONT_FACE_COUNTER_CLOCKWISE` (the Vulkan default) or
14332 ///`FRONT_FACE_CLOCKWISE`.
14333 ///
14334 ///Useful when rendering mirrored or reflected geometry where the
14335 ///winding order is flipped, without needing a separate pipeline.
14336 ///
14337 ///Core dynamic state in Vulkan 1.3.
14338 pub unsafe fn cmd_set_front_face(&self, command_buffer: CommandBuffer, front_face: FrontFace) {
14339 let fp = self
14340 .commands()
14341 .cmd_set_front_face
14342 .expect("vkCmdSetFrontFace not loaded");
14343 unsafe { fp(command_buffer, front_face) };
14344 }
14345 ///Wraps [`vkCmdSetPrimitiveTopology`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetPrimitiveTopology.html).
14346 /**
14347 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14348 ///
14349 ///# Safety
14350 ///- `commandBuffer` (self) must be valid and not destroyed.
14351 ///- `commandBuffer` must be externally synchronized.
14352 ///
14353 ///# Panics
14354 ///Panics if `vkCmdSetPrimitiveTopology` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14355 ///
14356 ///# Usage Notes
14357 ///
14358 ///Dynamically sets the primitive topology. Only takes effect if the
14359 ///pipeline was created with `DYNAMIC_STATE_PRIMITIVE_TOPOLOGY`.
14360 ///
14361 ///Values include `POINT_LIST`, `LINE_LIST`, `LINE_STRIP`,
14362 ///`TRIANGLE_LIST`, `TRIANGLE_STRIP`, `TRIANGLE_FAN`,
14363 ///`LINE_LIST_WITH_ADJACENCY`, `PATCH_LIST`, etc.
14364 ///
14365 ///The dynamic topology must be in the same topology class as the
14366 ///pipeline's static topology (e.g. you can switch between
14367 ///`TRIANGLE_LIST` and `TRIANGLE_STRIP` since both are triangle
14368 ///topologies, but not between `TRIANGLE_LIST` and `LINE_LIST`).
14369 ///
14370 ///Core dynamic state in Vulkan 1.3.
14371 pub unsafe fn cmd_set_primitive_topology(
14372 &self,
14373 command_buffer: CommandBuffer,
14374 primitive_topology: PrimitiveTopology,
14375 ) {
14376 let fp = self
14377 .commands()
14378 .cmd_set_primitive_topology
14379 .expect("vkCmdSetPrimitiveTopology not loaded");
14380 unsafe { fp(command_buffer, primitive_topology) };
14381 }
14382 ///Wraps [`vkCmdSetViewportWithCount`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetViewportWithCount.html).
14383 /**
14384 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14385 ///
14386 ///# Safety
14387 ///- `commandBuffer` (self) must be valid and not destroyed.
14388 ///- `commandBuffer` must be externally synchronized.
14389 ///
14390 ///# Panics
14391 ///Panics if `vkCmdSetViewportWithCount` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14392 ///
14393 ///# Usage Notes
14394 ///
14395 ///Dynamically sets both the viewports and the viewport count. Only
14396 ///takes effect if the pipeline was created with
14397 ///`DYNAMIC_STATE_VIEWPORT_WITH_COUNT`.
14398 ///
14399 ///Unlike `cmd_set_viewport` (which requires the count to match the
14400 ///pipeline's static `viewport_count`), this command also sets the
14401 ///count dynamically. The viewport count must match the scissor count
14402 ///set by `cmd_set_scissor_with_count`.
14403 ///
14404 ///Core dynamic state in Vulkan 1.3.
14405 pub unsafe fn cmd_set_viewport_with_count(
14406 &self,
14407 command_buffer: CommandBuffer,
14408 p_viewports: &[Viewport],
14409 ) {
14410 let fp = self
14411 .commands()
14412 .cmd_set_viewport_with_count
14413 .expect("vkCmdSetViewportWithCount not loaded");
14414 unsafe {
14415 fp(
14416 command_buffer,
14417 p_viewports.len() as u32,
14418 p_viewports.as_ptr(),
14419 )
14420 };
14421 }
14422 ///Wraps [`vkCmdSetScissorWithCount`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetScissorWithCount.html).
14423 /**
14424 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14425 ///
14426 ///# Safety
14427 ///- `commandBuffer` (self) must be valid and not destroyed.
14428 ///- `commandBuffer` must be externally synchronized.
14429 ///
14430 ///# Panics
14431 ///Panics if `vkCmdSetScissorWithCount` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14432 ///
14433 ///# Usage Notes
14434 ///
14435 ///Dynamically sets both the scissor rectangles and the scissor count.
14436 ///Only takes effect if the pipeline was created with
14437 ///`DYNAMIC_STATE_SCISSOR_WITH_COUNT`.
14438 ///
14439 ///Unlike `cmd_set_scissor` (which requires the count to match the
14440 ///pipeline's static `viewport_count`), this command also sets the
14441 ///count dynamically. The scissor count must match the viewport count
14442 ///set by `cmd_set_viewport_with_count`.
14443 ///
14444 ///Core dynamic state in Vulkan 1.3.
14445 pub unsafe fn cmd_set_scissor_with_count(
14446 &self,
14447 command_buffer: CommandBuffer,
14448 p_scissors: &[Rect2D],
14449 ) {
14450 let fp = self
14451 .commands()
14452 .cmd_set_scissor_with_count
14453 .expect("vkCmdSetScissorWithCount not loaded");
14454 unsafe { fp(command_buffer, p_scissors.len() as u32, p_scissors.as_ptr()) };
14455 }
14456 ///Wraps [`vkCmdBindIndexBuffer2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindIndexBuffer2.html).
14457 /**
14458 Provided by **VK_GRAPHICS_VERSION_1_4**.*/
14459 ///
14460 ///# Safety
14461 ///- `commandBuffer` (self) must be valid and not destroyed.
14462 ///- `commandBuffer` must be externally synchronized.
14463 ///
14464 ///# Panics
14465 ///Panics if `vkCmdBindIndexBuffer2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14466 ///
14467 ///# Usage Notes
14468 ///
14469 ///Vulkan 1.4 version of `cmd_bind_index_buffer` that additionally
14470 ///accepts a `size` parameter specifying the valid range of the index
14471 ///buffer. This enables the driver to perform bounds checking.
14472 ///
14473 ///Pass `VK_WHOLE_SIZE` for the size to use the remainder of the buffer
14474 ///from the offset.
14475 ///
14476 ///Prefer this over `cmd_bind_index_buffer` when targeting Vulkan 1.4+.
14477 pub unsafe fn cmd_bind_index_buffer2(
14478 &self,
14479 command_buffer: CommandBuffer,
14480 buffer: Buffer,
14481 offset: u64,
14482 size: u64,
14483 index_type: IndexType,
14484 ) {
14485 let fp = self
14486 .commands()
14487 .cmd_bind_index_buffer2
14488 .expect("vkCmdBindIndexBuffer2 not loaded");
14489 unsafe { fp(command_buffer, buffer, offset, size, index_type) };
14490 }
14491 ///Wraps [`vkCmdBindVertexBuffers2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindVertexBuffers2.html).
14492 /**
14493 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14494 ///
14495 ///# Safety
14496 ///- `commandBuffer` (self) must be valid and not destroyed.
14497 ///- `commandBuffer` must be externally synchronized.
14498 ///
14499 ///# Panics
14500 ///Panics if `vkCmdBindVertexBuffers2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14501 ///
14502 ///# Usage Notes
14503 ///
14504 ///Vulkan 1.3 version of `cmd_bind_vertex_buffers` that additionally
14505 ///accepts optional buffer sizes and strides.
14506 ///
14507 ///**Sizes**: if provided, the driver knows where each buffer ends and
14508 ///can perform bounds checking. Pass null to use the full buffer size.
14509 ///
14510 ///**Strides**: if provided, overrides the stride specified in the
14511 ///pipeline's vertex input state. This enables dynamic vertex stride
14512 ///without creating separate pipeline permutations. Pass null to use
14513 ///the pipeline's static stride.
14514 ///
14515 ///Prefer this over `cmd_bind_vertex_buffers` when targeting
14516 ///Vulkan 1.3+.
14517 pub unsafe fn cmd_bind_vertex_buffers2(
14518 &self,
14519 command_buffer: CommandBuffer,
14520 first_binding: u32,
14521 p_buffers: &[Buffer],
14522 p_offsets: &[u64],
14523 p_sizes: &[u64],
14524 p_strides: &[u64],
14525 ) {
14526 let fp = self
14527 .commands()
14528 .cmd_bind_vertex_buffers2
14529 .expect("vkCmdBindVertexBuffers2 not loaded");
14530 unsafe {
14531 fp(
14532 command_buffer,
14533 first_binding,
14534 p_buffers.len() as u32,
14535 p_buffers.as_ptr(),
14536 p_offsets.as_ptr(),
14537 p_sizes.as_ptr(),
14538 p_strides.as_ptr(),
14539 )
14540 };
14541 }
14542 ///Wraps [`vkCmdSetDepthTestEnable`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthTestEnable.html).
14543 /**
14544 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14545 ///
14546 ///# Safety
14547 ///- `commandBuffer` (self) must be valid and not destroyed.
14548 ///- `commandBuffer` must be externally synchronized.
14549 ///
14550 ///# Panics
14551 ///Panics if `vkCmdSetDepthTestEnable` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14552 ///
14553 ///# Usage Notes
14554 ///
14555 ///Dynamically enables or disables depth testing. Only takes effect if
14556 ///the pipeline was created with `DYNAMIC_STATE_DEPTH_TEST_ENABLE`.
14557 ///
14558 ///When disabled, all fragments pass the depth test regardless of the
14559 ///depth buffer contents. Useful for UI overlays, skyboxes, or
14560 ///full-screen post-processing passes.
14561 ///
14562 ///Core dynamic state in Vulkan 1.3.
14563 pub unsafe fn cmd_set_depth_test_enable(
14564 &self,
14565 command_buffer: CommandBuffer,
14566 depth_test_enable: bool,
14567 ) {
14568 let fp = self
14569 .commands()
14570 .cmd_set_depth_test_enable
14571 .expect("vkCmdSetDepthTestEnable not loaded");
14572 unsafe { fp(command_buffer, depth_test_enable as u32) };
14573 }
14574 ///Wraps [`vkCmdSetDepthWriteEnable`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthWriteEnable.html).
14575 /**
14576 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14577 ///
14578 ///# Safety
14579 ///- `commandBuffer` (self) must be valid and not destroyed.
14580 ///- `commandBuffer` must be externally synchronized.
14581 ///
14582 ///# Panics
14583 ///Panics if `vkCmdSetDepthWriteEnable` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14584 ///
14585 ///# Usage Notes
14586 ///
14587 ///Dynamically enables or disables writes to the depth buffer. Only
14588 ///takes effect if the pipeline was created with
14589 ///`DYNAMIC_STATE_DEPTH_WRITE_ENABLE`.
14590 ///
14591 ///Disable depth writes when:
14592 ///
14593 ///- Drawing transparent objects (they should test against depth but
14594 /// not write to it).
14595 ///- Drawing skyboxes after the opaque pass.
14596 ///- Performing post-processing with depth reads but no depth output.
14597 ///
14598 ///Depth testing and depth writing are independent controls, you can
14599 ///test without writing, or write without testing.
14600 ///
14601 ///Core dynamic state in Vulkan 1.3.
14602 pub unsafe fn cmd_set_depth_write_enable(
14603 &self,
14604 command_buffer: CommandBuffer,
14605 depth_write_enable: bool,
14606 ) {
14607 let fp = self
14608 .commands()
14609 .cmd_set_depth_write_enable
14610 .expect("vkCmdSetDepthWriteEnable not loaded");
14611 unsafe { fp(command_buffer, depth_write_enable as u32) };
14612 }
14613 ///Wraps [`vkCmdSetDepthCompareOp`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthCompareOp.html).
14614 /**
14615 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14616 ///
14617 ///# Safety
14618 ///- `commandBuffer` (self) must be valid and not destroyed.
14619 ///- `commandBuffer` must be externally synchronized.
14620 ///
14621 ///# Panics
14622 ///Panics if `vkCmdSetDepthCompareOp` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14623 ///
14624 ///# Usage Notes
14625 ///
14626 ///Dynamically sets the depth comparison operator. Only takes effect if
14627 ///the pipeline was created with `DYNAMIC_STATE_DEPTH_COMPARE_OP`.
14628 ///
14629 ///Values: `COMPARE_OP_LESS` (the common default for forward rendering),
14630 ///`COMPARE_OP_GREATER` (for reverse-Z), `COMPARE_OP_LESS_OR_EQUAL`,
14631 ///`COMPARE_OP_ALWAYS`, etc.
14632 ///
14633 ///**Reverse-Z**: using a reversed depth buffer (near=1.0, far=0.0)
14634 ///with `COMPARE_OP_GREATER` provides better floating-point precision
14635 ///distribution across the depth range. This is the recommended setup
14636 ///for modern rendering.
14637 ///
14638 ///Core dynamic state in Vulkan 1.3.
14639 pub unsafe fn cmd_set_depth_compare_op(
14640 &self,
14641 command_buffer: CommandBuffer,
14642 depth_compare_op: CompareOp,
14643 ) {
14644 let fp = self
14645 .commands()
14646 .cmd_set_depth_compare_op
14647 .expect("vkCmdSetDepthCompareOp not loaded");
14648 unsafe { fp(command_buffer, depth_compare_op) };
14649 }
14650 ///Wraps [`vkCmdSetDepthBoundsTestEnable`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthBoundsTestEnable.html).
14651 /**
14652 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14653 ///
14654 ///# Safety
14655 ///- `commandBuffer` (self) must be valid and not destroyed.
14656 ///- `commandBuffer` must be externally synchronized.
14657 ///
14658 ///# Panics
14659 ///Panics if `vkCmdSetDepthBoundsTestEnable` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14660 ///
14661 ///# Usage Notes
14662 ///
14663 ///Dynamically enables or disables the depth bounds test. Only takes
14664 ///effect if the pipeline was created with
14665 ///`DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE`.
14666 ///
14667 ///When enabled, fragments are discarded if the existing depth buffer
14668 ///value falls outside the range set by `cmd_set_depth_bounds`. When
14669 ///disabled, the test is skipped.
14670 ///
14671 ///Requires the `depth_bounds` device feature.
14672 ///
14673 ///Core dynamic state in Vulkan 1.3.
14674 pub unsafe fn cmd_set_depth_bounds_test_enable(
14675 &self,
14676 command_buffer: CommandBuffer,
14677 depth_bounds_test_enable: bool,
14678 ) {
14679 let fp = self
14680 .commands()
14681 .cmd_set_depth_bounds_test_enable
14682 .expect("vkCmdSetDepthBoundsTestEnable not loaded");
14683 unsafe { fp(command_buffer, depth_bounds_test_enable as u32) };
14684 }
14685 ///Wraps [`vkCmdSetStencilTestEnable`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetStencilTestEnable.html).
14686 /**
14687 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14688 ///
14689 ///# Safety
14690 ///- `commandBuffer` (self) must be valid and not destroyed.
14691 ///- `commandBuffer` must be externally synchronized.
14692 ///
14693 ///# Panics
14694 ///Panics if `vkCmdSetStencilTestEnable` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14695 ///
14696 ///# Usage Notes
14697 ///
14698 ///Dynamically enables or disables stencil testing. Only takes effect
14699 ///if the pipeline was created with
14700 ///`DYNAMIC_STATE_STENCIL_TEST_ENABLE`.
14701 ///
14702 ///When disabled, fragments pass the stencil test unconditionally and
14703 ///no stencil writes occur.
14704 ///
14705 ///Core dynamic state in Vulkan 1.3.
14706 pub unsafe fn cmd_set_stencil_test_enable(
14707 &self,
14708 command_buffer: CommandBuffer,
14709 stencil_test_enable: bool,
14710 ) {
14711 let fp = self
14712 .commands()
14713 .cmd_set_stencil_test_enable
14714 .expect("vkCmdSetStencilTestEnable not loaded");
14715 unsafe { fp(command_buffer, stencil_test_enable as u32) };
14716 }
14717 ///Wraps [`vkCmdSetStencilOp`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetStencilOp.html).
14718 /**
14719 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14720 ///
14721 ///# Safety
14722 ///- `commandBuffer` (self) must be valid and not destroyed.
14723 ///- `commandBuffer` must be externally synchronized.
14724 ///
14725 ///# Panics
14726 ///Panics if `vkCmdSetStencilOp` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14727 ///
14728 ///# Usage Notes
14729 ///
14730 ///Dynamically sets the stencil operations for front-facing,
14731 ///back-facing, or both face sets. Only takes effect if the pipeline
14732 ///was created with `DYNAMIC_STATE_STENCIL_OP`.
14733 ///
14734 ///Sets four values per face:
14735 ///
14736 ///- **`fail_op`**: action when the stencil test fails.
14737 ///- **`pass_op`**: action when both stencil and depth tests pass.
14738 ///- **`depth_fail_op`**: action when stencil passes but depth fails.
14739 ///- **`compare_op`**: the stencil comparison function.
14740 ///
14741 ///Common operations: `KEEP`, `REPLACE`, `INCREMENT_AND_CLAMP`,
14742 ///`DECREMENT_AND_CLAMP`, `INVERT`, `ZERO`.
14743 ///
14744 ///Core dynamic state in Vulkan 1.3.
14745 pub unsafe fn cmd_set_stencil_op(
14746 &self,
14747 command_buffer: CommandBuffer,
14748 face_mask: StencilFaceFlags,
14749 fail_op: StencilOp,
14750 pass_op: StencilOp,
14751 depth_fail_op: StencilOp,
14752 compare_op: CompareOp,
14753 ) {
14754 let fp = self
14755 .commands()
14756 .cmd_set_stencil_op
14757 .expect("vkCmdSetStencilOp not loaded");
14758 unsafe {
14759 fp(
14760 command_buffer,
14761 face_mask,
14762 fail_op,
14763 pass_op,
14764 depth_fail_op,
14765 compare_op,
14766 )
14767 };
14768 }
14769 ///Wraps [`vkCmdSetPatchControlPointsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetPatchControlPointsEXT.html).
14770 /**
14771 Provided by **VK_EXT_extended_dynamic_state2**.*/
14772 ///
14773 ///# Safety
14774 ///- `commandBuffer` (self) must be valid and not destroyed.
14775 ///- `commandBuffer` must be externally synchronized.
14776 ///
14777 ///# Panics
14778 ///Panics if `vkCmdSetPatchControlPointsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14779 ///
14780 ///# Usage Notes
14781 ///
14782 ///Dynamically sets the number of control points per patch for
14783 ///tessellation. Overrides the value specified at pipeline creation.
14784 ///
14785 ///Typical values: 3 (triangles), 4 (quads), 16 (bicubic patches).
14786 ///The maximum is `maxTessellationPatchSize` (at least 32).
14787 ///
14788 ///Requires the `extendedDynamicState2PatchControlPoints` feature.
14789 ///
14790 ///Provided by `VK_EXT_extended_dynamic_state2`.
14791 pub unsafe fn cmd_set_patch_control_points_ext(
14792 &self,
14793 command_buffer: CommandBuffer,
14794 patch_control_points: u32,
14795 ) {
14796 let fp = self
14797 .commands()
14798 .cmd_set_patch_control_points_ext
14799 .expect("vkCmdSetPatchControlPointsEXT not loaded");
14800 unsafe { fp(command_buffer, patch_control_points) };
14801 }
14802 ///Wraps [`vkCmdSetRasterizerDiscardEnable`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetRasterizerDiscardEnable.html).
14803 /**
14804 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14805 ///
14806 ///# Safety
14807 ///- `commandBuffer` (self) must be valid and not destroyed.
14808 ///- `commandBuffer` must be externally synchronized.
14809 ///
14810 ///# Panics
14811 ///Panics if `vkCmdSetRasterizerDiscardEnable` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14812 ///
14813 ///# Usage Notes
14814 ///
14815 ///Dynamically enables or disables rasterizer discard. Only takes
14816 ///effect if the pipeline was created with
14817 ///`DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE`.
14818 ///
14819 ///When enabled, primitives are discarded before rasterisation, no
14820 ///fragments are generated and no colour/depth output is produced. The
14821 ///vertex and geometry shader stages still execute.
14822 ///
14823 ///Use cases:
14824 ///
14825 ///- **Transform feedback only**: capture transformed vertices without
14826 /// rendering.
14827 ///- **Occlusion pre-pass**: skip fragment shading when only the depth
14828 /// or stencil output matters (though depth writes still require
14829 /// rasterisation).
14830 ///
14831 ///Core dynamic state in Vulkan 1.3.
14832 pub unsafe fn cmd_set_rasterizer_discard_enable(
14833 &self,
14834 command_buffer: CommandBuffer,
14835 rasterizer_discard_enable: bool,
14836 ) {
14837 let fp = self
14838 .commands()
14839 .cmd_set_rasterizer_discard_enable
14840 .expect("vkCmdSetRasterizerDiscardEnable not loaded");
14841 unsafe { fp(command_buffer, rasterizer_discard_enable as u32) };
14842 }
14843 ///Wraps [`vkCmdSetDepthBiasEnable`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthBiasEnable.html).
14844 /**
14845 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14846 ///
14847 ///# Safety
14848 ///- `commandBuffer` (self) must be valid and not destroyed.
14849 ///- `commandBuffer` must be externally synchronized.
14850 ///
14851 ///# Panics
14852 ///Panics if `vkCmdSetDepthBiasEnable` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14853 ///
14854 ///# Usage Notes
14855 ///
14856 ///Dynamically enables or disables depth bias. Only takes effect if the
14857 ///pipeline was created with `DYNAMIC_STATE_DEPTH_BIAS_ENABLE`.
14858 ///
14859 ///When enabled, the depth bias values set by `cmd_set_depth_bias` are
14860 ///applied to fragment depth values. When disabled, no bias is applied
14861 ///regardless of the bias values.
14862 ///
14863 ///Useful for toggling shadow map bias without separate pipelines.
14864 ///
14865 ///Core dynamic state in Vulkan 1.3.
14866 pub unsafe fn cmd_set_depth_bias_enable(
14867 &self,
14868 command_buffer: CommandBuffer,
14869 depth_bias_enable: bool,
14870 ) {
14871 let fp = self
14872 .commands()
14873 .cmd_set_depth_bias_enable
14874 .expect("vkCmdSetDepthBiasEnable not loaded");
14875 unsafe { fp(command_buffer, depth_bias_enable as u32) };
14876 }
14877 ///Wraps [`vkCmdSetLogicOpEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetLogicOpEXT.html).
14878 /**
14879 Provided by **VK_EXT_extended_dynamic_state2**.*/
14880 ///
14881 ///# Safety
14882 ///- `commandBuffer` (self) must be valid and not destroyed.
14883 ///- `commandBuffer` must be externally synchronized.
14884 ///
14885 ///# Panics
14886 ///Panics if `vkCmdSetLogicOpEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14887 ///
14888 ///# Usage Notes
14889 ///
14890 ///Dynamically sets the logic operation used for color blending.
14891 ///Logic ops (AND, OR, XOR, etc.) operate on the raw integer bit
14892 ///patterns of the fragment and framebuffer values.
14893 ///
14894 ///Only effective when logic op is enabled in the pipeline
14895 ///(`logicOpEnable`). Requires the `extendedDynamicState2LogicOp`
14896 ///feature.
14897 ///
14898 ///Provided by `VK_EXT_extended_dynamic_state2`.
14899 pub unsafe fn cmd_set_logic_op_ext(&self, command_buffer: CommandBuffer, logic_op: LogicOp) {
14900 let fp = self
14901 .commands()
14902 .cmd_set_logic_op_ext
14903 .expect("vkCmdSetLogicOpEXT not loaded");
14904 unsafe { fp(command_buffer, logic_op) };
14905 }
14906 ///Wraps [`vkCmdSetPrimitiveRestartEnable`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetPrimitiveRestartEnable.html).
14907 /**
14908 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
14909 ///
14910 ///# Safety
14911 ///- `commandBuffer` (self) must be valid and not destroyed.
14912 ///- `commandBuffer` must be externally synchronized.
14913 ///
14914 ///# Panics
14915 ///Panics if `vkCmdSetPrimitiveRestartEnable` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14916 ///
14917 ///# Usage Notes
14918 ///
14919 ///Dynamically enables or disables primitive restart. Only takes effect
14920 ///if the pipeline was created with
14921 ///`DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE`.
14922 ///
14923 ///When enabled, a special index value (0xFFFF for UINT16, 0xFFFFFFFF
14924 ///for UINT32) in the index buffer ends the current primitive and
14925 ///starts a new one. This lets you draw multiple triangle strips or
14926 ///line strips from a single draw call without degenerate triangles.
14927 ///
14928 ///Only meaningful for strip topologies (`TRIANGLE_STRIP`,
14929 ///`LINE_STRIP`, `TRIANGLE_FAN`, etc.).
14930 ///
14931 ///Core dynamic state in Vulkan 1.3.
14932 pub unsafe fn cmd_set_primitive_restart_enable(
14933 &self,
14934 command_buffer: CommandBuffer,
14935 primitive_restart_enable: bool,
14936 ) {
14937 let fp = self
14938 .commands()
14939 .cmd_set_primitive_restart_enable
14940 .expect("vkCmdSetPrimitiveRestartEnable not loaded");
14941 unsafe { fp(command_buffer, primitive_restart_enable as u32) };
14942 }
14943 ///Wraps [`vkCmdSetTessellationDomainOriginEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetTessellationDomainOriginEXT.html).
14944 /**
14945 Provided by **VK_EXT_extended_dynamic_state3**.*/
14946 ///
14947 ///# Safety
14948 ///- `commandBuffer` (self) must be valid and not destroyed.
14949 ///- `commandBuffer` must be externally synchronized.
14950 ///
14951 ///# Panics
14952 ///Panics if `vkCmdSetTessellationDomainOriginEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14953 ///
14954 ///# Usage Notes
14955 ///
14956 ///Dynamically sets the tessellation domain origin:
14957 ///- `UPPER_LEFT`: Vulkan default, (0,0) is the upper-left corner.
14958 ///- `LOWER_LEFT`: OpenGL convention, (0,0) is the lower-left.
14959 ///
14960 ///Affects how tessellation coordinates are interpreted. Useful when
14961 ///porting OpenGL tessellation shaders.
14962 ///
14963 ///Provided by `VK_EXT_extended_dynamic_state3`.
14964 pub unsafe fn cmd_set_tessellation_domain_origin_ext(
14965 &self,
14966 command_buffer: CommandBuffer,
14967 domain_origin: TessellationDomainOrigin,
14968 ) {
14969 let fp = self
14970 .commands()
14971 .cmd_set_tessellation_domain_origin_ext
14972 .expect("vkCmdSetTessellationDomainOriginEXT not loaded");
14973 unsafe { fp(command_buffer, domain_origin) };
14974 }
14975 ///Wraps [`vkCmdSetDepthClampEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthClampEnableEXT.html).
14976 /**
14977 Provided by **VK_EXT_extended_dynamic_state3**.*/
14978 ///
14979 ///# Safety
14980 ///- `commandBuffer` (self) must be valid and not destroyed.
14981 ///- `commandBuffer` must be externally synchronized.
14982 ///
14983 ///# Panics
14984 ///Panics if `vkCmdSetDepthClampEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
14985 ///
14986 ///# Usage Notes
14987 ///
14988 ///Dynamically enables or disables depth clamping. When enabled,
14989 ///fragments outside the near/far depth range are clamped instead
14990 ///of being clipped.
14991 ///
14992 ///Useful for shadow mapping and other techniques where clipping
14993 ///at the near/far plane is undesirable.
14994 ///
14995 ///Requires the `depthClamp` device feature.
14996 ///
14997 ///Provided by `VK_EXT_extended_dynamic_state3`.
14998 pub unsafe fn cmd_set_depth_clamp_enable_ext(
14999 &self,
15000 command_buffer: CommandBuffer,
15001 depth_clamp_enable: bool,
15002 ) {
15003 let fp = self
15004 .commands()
15005 .cmd_set_depth_clamp_enable_ext
15006 .expect("vkCmdSetDepthClampEnableEXT not loaded");
15007 unsafe { fp(command_buffer, depth_clamp_enable as u32) };
15008 }
15009 ///Wraps [`vkCmdSetPolygonModeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetPolygonModeEXT.html).
15010 /**
15011 Provided by **VK_EXT_extended_dynamic_state3**.*/
15012 ///
15013 ///# Safety
15014 ///- `commandBuffer` (self) must be valid and not destroyed.
15015 ///- `commandBuffer` must be externally synchronized.
15016 ///
15017 ///# Panics
15018 ///Panics if `vkCmdSetPolygonModeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15019 ///
15020 ///# Usage Notes
15021 ///
15022 ///Dynamically sets the polygon rasterization mode:
15023 ///- `FILL`: normal filled triangles (default).
15024 ///- `LINE`: wireframe rendering.
15025 ///- `POINT`: vertices only.
15026 ///
15027 ///`LINE` and `POINT` require the `fillModeNonSolid` device feature.
15028 ///
15029 ///Provided by `VK_EXT_extended_dynamic_state3`.
15030 pub unsafe fn cmd_set_polygon_mode_ext(
15031 &self,
15032 command_buffer: CommandBuffer,
15033 polygon_mode: PolygonMode,
15034 ) {
15035 let fp = self
15036 .commands()
15037 .cmd_set_polygon_mode_ext
15038 .expect("vkCmdSetPolygonModeEXT not loaded");
15039 unsafe { fp(command_buffer, polygon_mode) };
15040 }
15041 ///Wraps [`vkCmdSetRasterizationSamplesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetRasterizationSamplesEXT.html).
15042 /**
15043 Provided by **VK_EXT_extended_dynamic_state3**.*/
15044 ///
15045 ///# Safety
15046 ///- `commandBuffer` (self) must be valid and not destroyed.
15047 ///- `commandBuffer` must be externally synchronized.
15048 ///
15049 ///# Panics
15050 ///Panics if `vkCmdSetRasterizationSamplesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15051 ///
15052 ///# Usage Notes
15053 ///
15054 ///Dynamically sets the number of rasterization samples
15055 ///(multisampling level). Overrides the sample count specified
15056 ///at pipeline creation.
15057 ///
15058 ///The sample count must be compatible with the render pass
15059 ///attachments.
15060 ///
15061 ///Provided by `VK_EXT_extended_dynamic_state3`.
15062 pub unsafe fn cmd_set_rasterization_samples_ext(
15063 &self,
15064 command_buffer: CommandBuffer,
15065 rasterization_samples: SampleCountFlagBits,
15066 ) {
15067 let fp = self
15068 .commands()
15069 .cmd_set_rasterization_samples_ext
15070 .expect("vkCmdSetRasterizationSamplesEXT not loaded");
15071 unsafe { fp(command_buffer, rasterization_samples) };
15072 }
15073 ///Wraps [`vkCmdSetSampleMaskEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetSampleMaskEXT.html).
15074 /**
15075 Provided by **VK_EXT_extended_dynamic_state3**.*/
15076 ///
15077 ///# Safety
15078 ///- `commandBuffer` (self) must be valid and not destroyed.
15079 ///- `commandBuffer` must be externally synchronized.
15080 ///
15081 ///# Panics
15082 ///Panics if `vkCmdSetSampleMaskEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15083 ///
15084 ///# Usage Notes
15085 ///
15086 ///Dynamically sets the sample mask. The sample mask is ANDed with
15087 ///the coverage mask to determine which samples are written. Bits
15088 ///that are zero disable the corresponding sample.
15089 ///
15090 ///The slice length must match `ceil(rasterizationSamples / 32)`.
15091 ///
15092 ///Provided by `VK_EXT_extended_dynamic_state3`.
15093 pub unsafe fn cmd_set_sample_mask_ext(
15094 &self,
15095 command_buffer: CommandBuffer,
15096 samples: SampleCountFlagBits,
15097 p_sample_mask: Option<&u32>,
15098 ) {
15099 let fp = self
15100 .commands()
15101 .cmd_set_sample_mask_ext
15102 .expect("vkCmdSetSampleMaskEXT not loaded");
15103 let p_sample_mask_ptr = p_sample_mask.map_or(core::ptr::null(), core::ptr::from_ref);
15104 unsafe { fp(command_buffer, samples, p_sample_mask_ptr) };
15105 }
15106 ///Wraps [`vkCmdSetAlphaToCoverageEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetAlphaToCoverageEnableEXT.html).
15107 /**
15108 Provided by **VK_EXT_extended_dynamic_state3**.*/
15109 ///
15110 ///# Safety
15111 ///- `commandBuffer` (self) must be valid and not destroyed.
15112 ///- `commandBuffer` must be externally synchronized.
15113 ///
15114 ///# Panics
15115 ///Panics if `vkCmdSetAlphaToCoverageEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15116 ///
15117 ///# Usage Notes
15118 ///
15119 ///Dynamically enables or disables alpha-to-coverage multisample
15120 ///mode. When enabled, the fragment's alpha value determines which
15121 ///samples are covered, providing order-independent transparency
15122 ///for foliage, fences, etc.
15123 ///
15124 ///Provided by `VK_EXT_extended_dynamic_state3`.
15125 pub unsafe fn cmd_set_alpha_to_coverage_enable_ext(
15126 &self,
15127 command_buffer: CommandBuffer,
15128 alpha_to_coverage_enable: bool,
15129 ) {
15130 let fp = self
15131 .commands()
15132 .cmd_set_alpha_to_coverage_enable_ext
15133 .expect("vkCmdSetAlphaToCoverageEnableEXT not loaded");
15134 unsafe { fp(command_buffer, alpha_to_coverage_enable as u32) };
15135 }
15136 ///Wraps [`vkCmdSetAlphaToOneEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetAlphaToOneEnableEXT.html).
15137 /**
15138 Provided by **VK_EXT_extended_dynamic_state3**.*/
15139 ///
15140 ///# Safety
15141 ///- `commandBuffer` (self) must be valid and not destroyed.
15142 ///- `commandBuffer` must be externally synchronized.
15143 ///
15144 ///# Panics
15145 ///Panics if `vkCmdSetAlphaToOneEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15146 ///
15147 ///# Usage Notes
15148 ///
15149 ///Dynamically enables or disables alpha-to-one mode. When enabled,
15150 ///the fragment's alpha value is replaced with 1.0 after
15151 ///alpha-to-coverage processing.
15152 ///
15153 ///Requires the `alphaToOne` device feature.
15154 ///
15155 ///Provided by `VK_EXT_extended_dynamic_state3`.
15156 pub unsafe fn cmd_set_alpha_to_one_enable_ext(
15157 &self,
15158 command_buffer: CommandBuffer,
15159 alpha_to_one_enable: bool,
15160 ) {
15161 let fp = self
15162 .commands()
15163 .cmd_set_alpha_to_one_enable_ext
15164 .expect("vkCmdSetAlphaToOneEnableEXT not loaded");
15165 unsafe { fp(command_buffer, alpha_to_one_enable as u32) };
15166 }
15167 ///Wraps [`vkCmdSetLogicOpEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetLogicOpEnableEXT.html).
15168 /**
15169 Provided by **VK_EXT_extended_dynamic_state3**.*/
15170 ///
15171 ///# Safety
15172 ///- `commandBuffer` (self) must be valid and not destroyed.
15173 ///- `commandBuffer` must be externally synchronized.
15174 ///
15175 ///# Panics
15176 ///Panics if `vkCmdSetLogicOpEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15177 ///
15178 ///# Usage Notes
15179 ///
15180 ///Dynamically enables or disables logic operations for color
15181 ///blending. When enabled, fragments are combined with framebuffer
15182 ///values using the logic op set by `cmd_set_logic_op_ext` instead
15183 ///of standard blend equations.
15184 ///
15185 ///Logic ops operate on integer bit patterns. They have no effect
15186 ///on floating-point color attachments.
15187 ///
15188 ///Provided by `VK_EXT_extended_dynamic_state3`.
15189 pub unsafe fn cmd_set_logic_op_enable_ext(
15190 &self,
15191 command_buffer: CommandBuffer,
15192 logic_op_enable: bool,
15193 ) {
15194 let fp = self
15195 .commands()
15196 .cmd_set_logic_op_enable_ext
15197 .expect("vkCmdSetLogicOpEnableEXT not loaded");
15198 unsafe { fp(command_buffer, logic_op_enable as u32) };
15199 }
15200 ///Wraps [`vkCmdSetColorBlendEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetColorBlendEnableEXT.html).
15201 /**
15202 Provided by **VK_EXT_extended_dynamic_state3**.*/
15203 ///
15204 ///# Safety
15205 ///- `commandBuffer` (self) must be valid and not destroyed.
15206 ///- `commandBuffer` must be externally synchronized.
15207 ///
15208 ///# Panics
15209 ///Panics if `vkCmdSetColorBlendEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15210 ///
15211 ///# Usage Notes
15212 ///
15213 ///Dynamically enables or disables color blending for each color
15214 ///attachment. Pass a slice of `Bool32` values, one per attachment
15215 ///starting at `first_attachment`.
15216 ///
15217 ///When blending is disabled for an attachment, the fragment color
15218 ///is written directly (no src/dst blending).
15219 ///
15220 ///Provided by `VK_EXT_extended_dynamic_state3`.
15221 pub unsafe fn cmd_set_color_blend_enable_ext(
15222 &self,
15223 command_buffer: CommandBuffer,
15224 first_attachment: u32,
15225 p_color_blend_enables: &[u32],
15226 ) {
15227 let fp = self
15228 .commands()
15229 .cmd_set_color_blend_enable_ext
15230 .expect("vkCmdSetColorBlendEnableEXT not loaded");
15231 unsafe {
15232 fp(
15233 command_buffer,
15234 first_attachment,
15235 p_color_blend_enables.len() as u32,
15236 p_color_blend_enables.as_ptr(),
15237 )
15238 };
15239 }
15240 ///Wraps [`vkCmdSetColorBlendEquationEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetColorBlendEquationEXT.html).
15241 /**
15242 Provided by **VK_EXT_extended_dynamic_state3**.*/
15243 ///
15244 ///# Safety
15245 ///- `commandBuffer` (self) must be valid and not destroyed.
15246 ///- `commandBuffer` must be externally synchronized.
15247 ///
15248 ///# Panics
15249 ///Panics if `vkCmdSetColorBlendEquationEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15250 ///
15251 ///# Usage Notes
15252 ///
15253 ///Dynamically sets the blend equation (src factor, dst factor,
15254 ///blend op) for each color attachment. Each `ColorBlendEquationEXT`
15255 ///specifies both the color and alpha blend parameters.
15256 ///
15257 ///Overrides the values set at pipeline creation. Only effective for
15258 ///attachments where blending is enabled.
15259 ///
15260 ///Provided by `VK_EXT_extended_dynamic_state3`.
15261 pub unsafe fn cmd_set_color_blend_equation_ext(
15262 &self,
15263 command_buffer: CommandBuffer,
15264 first_attachment: u32,
15265 p_color_blend_equations: &[ColorBlendEquationEXT],
15266 ) {
15267 let fp = self
15268 .commands()
15269 .cmd_set_color_blend_equation_ext
15270 .expect("vkCmdSetColorBlendEquationEXT not loaded");
15271 unsafe {
15272 fp(
15273 command_buffer,
15274 first_attachment,
15275 p_color_blend_equations.len() as u32,
15276 p_color_blend_equations.as_ptr(),
15277 )
15278 };
15279 }
15280 ///Wraps [`vkCmdSetColorWriteMaskEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetColorWriteMaskEXT.html).
15281 /**
15282 Provided by **VK_EXT_extended_dynamic_state3**.*/
15283 ///
15284 ///# Safety
15285 ///- `commandBuffer` (self) must be valid and not destroyed.
15286 ///- `commandBuffer` must be externally synchronized.
15287 ///
15288 ///# Panics
15289 ///Panics if `vkCmdSetColorWriteMaskEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15290 ///
15291 ///# Usage Notes
15292 ///
15293 ///Dynamically sets the color write mask for each color attachment.
15294 ///Each `ColorComponentFlags` value controls which channels (R, G,
15295 ///B, A) are written for the corresponding attachment.
15296 ///
15297 ///Provided by `VK_EXT_extended_dynamic_state3`.
15298 pub unsafe fn cmd_set_color_write_mask_ext(
15299 &self,
15300 command_buffer: CommandBuffer,
15301 first_attachment: u32,
15302 p_color_write_masks: &[ColorComponentFlags],
15303 ) {
15304 let fp = self
15305 .commands()
15306 .cmd_set_color_write_mask_ext
15307 .expect("vkCmdSetColorWriteMaskEXT not loaded");
15308 unsafe {
15309 fp(
15310 command_buffer,
15311 first_attachment,
15312 p_color_write_masks.len() as u32,
15313 p_color_write_masks.as_ptr(),
15314 )
15315 };
15316 }
15317 ///Wraps [`vkCmdSetRasterizationStreamEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetRasterizationStreamEXT.html).
15318 /**
15319 Provided by **VK_EXT_extended_dynamic_state3**.*/
15320 ///
15321 ///# Safety
15322 ///- `commandBuffer` (self) must be valid and not destroyed.
15323 ///- `commandBuffer` must be externally synchronized.
15324 ///
15325 ///# Panics
15326 ///Panics if `vkCmdSetRasterizationStreamEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15327 ///
15328 ///# Usage Notes
15329 ///
15330 ///Dynamically sets which vertex stream is used for rasterization
15331 ///when transform feedback is active. Stream 0 is always rasterized
15332 ///by default; other streams can be selected with this command.
15333 ///
15334 ///Requires `VK_EXT_transform_feedback` and the
15335 ///`geometryStreams` feature.
15336 ///
15337 ///Provided by `VK_EXT_extended_dynamic_state3`.
15338 pub unsafe fn cmd_set_rasterization_stream_ext(
15339 &self,
15340 command_buffer: CommandBuffer,
15341 rasterization_stream: u32,
15342 ) {
15343 let fp = self
15344 .commands()
15345 .cmd_set_rasterization_stream_ext
15346 .expect("vkCmdSetRasterizationStreamEXT not loaded");
15347 unsafe { fp(command_buffer, rasterization_stream) };
15348 }
15349 ///Wraps [`vkCmdSetConservativeRasterizationModeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetConservativeRasterizationModeEXT.html).
15350 /**
15351 Provided by **VK_EXT_extended_dynamic_state3**.*/
15352 ///
15353 ///# Safety
15354 ///- `commandBuffer` (self) must be valid and not destroyed.
15355 ///- `commandBuffer` must be externally synchronized.
15356 ///
15357 ///# Panics
15358 ///Panics if `vkCmdSetConservativeRasterizationModeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15359 ///
15360 ///# Usage Notes
15361 ///
15362 ///Dynamically sets the conservative rasterization mode:
15363 ///- `DISABLED`: normal rasterization.
15364 ///- `OVERESTIMATE`: a fragment is generated if the primitive
15365 /// overlaps any part of the pixel.
15366 ///- `UNDERESTIMATE`: a fragment is generated only if the pixel
15367 /// is fully covered.
15368 ///
15369 ///Requires `VK_EXT_conservative_rasterization`.
15370 ///
15371 ///Provided by `VK_EXT_extended_dynamic_state3`.
15372 pub unsafe fn cmd_set_conservative_rasterization_mode_ext(
15373 &self,
15374 command_buffer: CommandBuffer,
15375 conservative_rasterization_mode: ConservativeRasterizationModeEXT,
15376 ) {
15377 let fp = self
15378 .commands()
15379 .cmd_set_conservative_rasterization_mode_ext
15380 .expect("vkCmdSetConservativeRasterizationModeEXT not loaded");
15381 unsafe { fp(command_buffer, conservative_rasterization_mode) };
15382 }
15383 ///Wraps [`vkCmdSetExtraPrimitiveOverestimationSizeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetExtraPrimitiveOverestimationSizeEXT.html).
15384 /**
15385 Provided by **VK_EXT_extended_dynamic_state3**.*/
15386 ///
15387 ///# Safety
15388 ///- `commandBuffer` (self) must be valid and not destroyed.
15389 ///- `commandBuffer` must be externally synchronized.
15390 ///
15391 ///# Panics
15392 ///Panics if `vkCmdSetExtraPrimitiveOverestimationSizeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15393 ///
15394 ///# Usage Notes
15395 ///
15396 ///Dynamically sets the extra overestimation size for conservative
15397 ///rasterization. This expands the primitive by additional pixels
15398 ///beyond the minimum overestimation guaranteed by the implementation.
15399 ///
15400 ///The value is in units of pixels. 0.0 means no extra
15401 ///overestimation beyond the implementation minimum.
15402 ///
15403 ///Requires `VK_EXT_conservative_rasterization`.
15404 ///
15405 ///Provided by `VK_EXT_extended_dynamic_state3`.
15406 pub unsafe fn cmd_set_extra_primitive_overestimation_size_ext(
15407 &self,
15408 command_buffer: CommandBuffer,
15409 extra_primitive_overestimation_size: f32,
15410 ) {
15411 let fp = self
15412 .commands()
15413 .cmd_set_extra_primitive_overestimation_size_ext
15414 .expect("vkCmdSetExtraPrimitiveOverestimationSizeEXT not loaded");
15415 unsafe { fp(command_buffer, extra_primitive_overestimation_size) };
15416 }
15417 ///Wraps [`vkCmdSetDepthClipEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthClipEnableEXT.html).
15418 /**
15419 Provided by **VK_EXT_extended_dynamic_state3**.*/
15420 ///
15421 ///# Safety
15422 ///- `commandBuffer` (self) must be valid and not destroyed.
15423 ///- `commandBuffer` must be externally synchronized.
15424 ///
15425 ///# Panics
15426 ///Panics if `vkCmdSetDepthClipEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15427 ///
15428 ///# Usage Notes
15429 ///
15430 ///Dynamically enables or disables depth clipping. When disabled,
15431 ///primitives are not clipped against the near and far planes
15432 ///(equivalent to `depthClampEnable`, but controlled separately).
15433 ///
15434 ///Requires `VK_EXT_depth_clip_enable` and the `depthClipEnable`
15435 ///feature.
15436 ///
15437 ///Provided by `VK_EXT_extended_dynamic_state3`.
15438 pub unsafe fn cmd_set_depth_clip_enable_ext(
15439 &self,
15440 command_buffer: CommandBuffer,
15441 depth_clip_enable: bool,
15442 ) {
15443 let fp = self
15444 .commands()
15445 .cmd_set_depth_clip_enable_ext
15446 .expect("vkCmdSetDepthClipEnableEXT not loaded");
15447 unsafe { fp(command_buffer, depth_clip_enable as u32) };
15448 }
15449 ///Wraps [`vkCmdSetSampleLocationsEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetSampleLocationsEnableEXT.html).
15450 /**
15451 Provided by **VK_EXT_extended_dynamic_state3**.*/
15452 ///
15453 ///# Safety
15454 ///- `commandBuffer` (self) must be valid and not destroyed.
15455 ///- `commandBuffer` must be externally synchronized.
15456 ///
15457 ///# Panics
15458 ///Panics if `vkCmdSetSampleLocationsEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15459 ///
15460 ///# Usage Notes
15461 ///
15462 ///Dynamically enables or disables custom sample locations. When
15463 ///enabled, the sample positions used for multisampling are taken
15464 ///from the locations set by `cmd_set_sample_locations_ext` instead
15465 ///of the implementation defaults.
15466 ///
15467 ///Requires `VK_EXT_sample_locations`.
15468 ///
15469 ///Provided by `VK_EXT_extended_dynamic_state3`.
15470 pub unsafe fn cmd_set_sample_locations_enable_ext(
15471 &self,
15472 command_buffer: CommandBuffer,
15473 sample_locations_enable: bool,
15474 ) {
15475 let fp = self
15476 .commands()
15477 .cmd_set_sample_locations_enable_ext
15478 .expect("vkCmdSetSampleLocationsEnableEXT not loaded");
15479 unsafe { fp(command_buffer, sample_locations_enable as u32) };
15480 }
15481 ///Wraps [`vkCmdSetColorBlendAdvancedEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetColorBlendAdvancedEXT.html).
15482 /**
15483 Provided by **VK_EXT_extended_dynamic_state3**.*/
15484 ///
15485 ///# Safety
15486 ///- `commandBuffer` (self) must be valid and not destroyed.
15487 ///- `commandBuffer` must be externally synchronized.
15488 ///
15489 ///# Panics
15490 ///Panics if `vkCmdSetColorBlendAdvancedEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15491 ///
15492 ///# Usage Notes
15493 ///
15494 ///Dynamically sets advanced blend parameters per color attachment.
15495 ///Each `ColorBlendAdvancedEXT` specifies the advanced blend
15496 ///operation, whether src/dst are premultiplied, and the blend
15497 ///overlap mode (uncorrelated, disjoint, conjoint).
15498 ///
15499 ///Only applies when using advanced blend operations (not the
15500 ///standard blend factors). Requires `VK_EXT_blend_operation_advanced`.
15501 ///
15502 ///Provided by `VK_EXT_extended_dynamic_state3`.
15503 pub unsafe fn cmd_set_color_blend_advanced_ext(
15504 &self,
15505 command_buffer: CommandBuffer,
15506 first_attachment: u32,
15507 p_color_blend_advanced: &[ColorBlendAdvancedEXT],
15508 ) {
15509 let fp = self
15510 .commands()
15511 .cmd_set_color_blend_advanced_ext
15512 .expect("vkCmdSetColorBlendAdvancedEXT not loaded");
15513 unsafe {
15514 fp(
15515 command_buffer,
15516 first_attachment,
15517 p_color_blend_advanced.len() as u32,
15518 p_color_blend_advanced.as_ptr(),
15519 )
15520 };
15521 }
15522 ///Wraps [`vkCmdSetProvokingVertexModeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetProvokingVertexModeEXT.html).
15523 /**
15524 Provided by **VK_EXT_extended_dynamic_state3**.*/
15525 ///
15526 ///# Safety
15527 ///- `commandBuffer` (self) must be valid and not destroyed.
15528 ///- `commandBuffer` must be externally synchronized.
15529 ///
15530 ///# Panics
15531 ///Panics if `vkCmdSetProvokingVertexModeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15532 ///
15533 ///# Usage Notes
15534 ///
15535 ///Dynamically sets which vertex in a primitive is the provoking
15536 ///vertex (the vertex whose flat-shaded attributes are used):
15537 ///- `FIRST_VERTEX`: first vertex of the primitive (Vulkan default).
15538 ///- `LAST_VERTEX`: last vertex (OpenGL convention).
15539 ///
15540 ///Requires `VK_EXT_provoking_vertex` and the
15541 ///`provokingVertexLast` feature for `LAST_VERTEX` mode.
15542 ///
15543 ///Provided by `VK_EXT_extended_dynamic_state3`.
15544 pub unsafe fn cmd_set_provoking_vertex_mode_ext(
15545 &self,
15546 command_buffer: CommandBuffer,
15547 provoking_vertex_mode: ProvokingVertexModeEXT,
15548 ) {
15549 let fp = self
15550 .commands()
15551 .cmd_set_provoking_vertex_mode_ext
15552 .expect("vkCmdSetProvokingVertexModeEXT not loaded");
15553 unsafe { fp(command_buffer, provoking_vertex_mode) };
15554 }
15555 ///Wraps [`vkCmdSetLineRasterizationModeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetLineRasterizationModeEXT.html).
15556 /**
15557 Provided by **VK_EXT_extended_dynamic_state3**.*/
15558 ///
15559 ///# Safety
15560 ///- `commandBuffer` (self) must be valid and not destroyed.
15561 ///- `commandBuffer` must be externally synchronized.
15562 ///
15563 ///# Panics
15564 ///Panics if `vkCmdSetLineRasterizationModeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15565 ///
15566 ///# Usage Notes
15567 ///
15568 ///Dynamically sets the line rasterization mode:
15569 ///- `DEFAULT`: implementation default.
15570 ///- `RECTANGULAR`: lines are rasterized as parallelograms (Vulkan
15571 /// default).
15572 ///- `BRESENHAM`: pixel-exact Bresenham lines.
15573 ///- `RECTANGULAR_SMOOTH`: antialiased rectangular lines.
15574 ///
15575 ///Requires `VK_EXT_line_rasterization` and the corresponding
15576 ///device feature for the chosen mode.
15577 ///
15578 ///Provided by `VK_EXT_extended_dynamic_state3`.
15579 pub unsafe fn cmd_set_line_rasterization_mode_ext(
15580 &self,
15581 command_buffer: CommandBuffer,
15582 line_rasterization_mode: LineRasterizationModeEXT,
15583 ) {
15584 let fp = self
15585 .commands()
15586 .cmd_set_line_rasterization_mode_ext
15587 .expect("vkCmdSetLineRasterizationModeEXT not loaded");
15588 unsafe { fp(command_buffer, line_rasterization_mode) };
15589 }
15590 ///Wraps [`vkCmdSetLineStippleEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetLineStippleEnableEXT.html).
15591 /**
15592 Provided by **VK_EXT_extended_dynamic_state3**.*/
15593 ///
15594 ///# Safety
15595 ///- `commandBuffer` (self) must be valid and not destroyed.
15596 ///- `commandBuffer` must be externally synchronized.
15597 ///
15598 ///# Panics
15599 ///Panics if `vkCmdSetLineStippleEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15600 ///
15601 ///# Usage Notes
15602 ///
15603 ///Dynamically enables or disables line stippling. When enabled,
15604 ///lines are drawn with a repeating pattern defined by
15605 ///`cmd_set_line_stipple` (core 1.4) or `cmd_set_line_stipple_ext`.
15606 ///
15607 ///Requires `VK_EXT_line_rasterization` and the `stippledLineEnable`
15608 ///feature for the active line rasterization mode.
15609 ///
15610 ///Provided by `VK_EXT_extended_dynamic_state3`.
15611 pub unsafe fn cmd_set_line_stipple_enable_ext(
15612 &self,
15613 command_buffer: CommandBuffer,
15614 stippled_line_enable: bool,
15615 ) {
15616 let fp = self
15617 .commands()
15618 .cmd_set_line_stipple_enable_ext
15619 .expect("vkCmdSetLineStippleEnableEXT not loaded");
15620 unsafe { fp(command_buffer, stippled_line_enable as u32) };
15621 }
15622 ///Wraps [`vkCmdSetDepthClipNegativeOneToOneEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthClipNegativeOneToOneEXT.html).
15623 /**
15624 Provided by **VK_EXT_extended_dynamic_state3**.*/
15625 ///
15626 ///# Safety
15627 ///- `commandBuffer` (self) must be valid and not destroyed.
15628 ///- `commandBuffer` must be externally synchronized.
15629 ///
15630 ///# Panics
15631 ///Panics if `vkCmdSetDepthClipNegativeOneToOneEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15632 ///
15633 ///# Usage Notes
15634 ///
15635 ///Dynamically sets the depth clip range convention:
15636 ///- `true`: NDC depth range is [-1, 1] (OpenGL convention).
15637 ///- `false`: NDC depth range is [0, 1] (Vulkan default).
15638 ///
15639 ///Useful for porting OpenGL content or using reversed-Z with
15640 ///OpenGL-style projections.
15641 ///
15642 ///Requires `VK_EXT_depth_clip_control` and the
15643 ///`depthClipControl` feature.
15644 ///
15645 ///Provided by `VK_EXT_extended_dynamic_state3`.
15646 pub unsafe fn cmd_set_depth_clip_negative_one_to_one_ext(
15647 &self,
15648 command_buffer: CommandBuffer,
15649 negative_one_to_one: bool,
15650 ) {
15651 let fp = self
15652 .commands()
15653 .cmd_set_depth_clip_negative_one_to_one_ext
15654 .expect("vkCmdSetDepthClipNegativeOneToOneEXT not loaded");
15655 unsafe { fp(command_buffer, negative_one_to_one as u32) };
15656 }
15657 ///Wraps [`vkCmdSetViewportWScalingEnableNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetViewportWScalingEnableNV.html).
15658 /**
15659 Provided by **VK_EXT_extended_dynamic_state3**.*/
15660 ///
15661 ///# Safety
15662 ///- `commandBuffer` (self) must be valid and not destroyed.
15663 ///- `commandBuffer` must be externally synchronized.
15664 ///
15665 ///# Panics
15666 ///Panics if `vkCmdSetViewportWScalingEnableNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15667 ///
15668 ///# Usage Notes
15669 ///
15670 ///Dynamically enables or disables viewport W scaling. When enabled,
15671 ///the x and y viewport coordinates are divided by an additional
15672 ///per-viewport W scaling factor, which can be used for lens-matched
15673 ///shading in VR.
15674 ///
15675 ///Part of `VK_NV_clip_space_w_scaling`.
15676 ///
15677 ///Provided by `VK_EXT_extended_dynamic_state3`.
15678 pub unsafe fn cmd_set_viewport_w_scaling_enable_nv(
15679 &self,
15680 command_buffer: CommandBuffer,
15681 viewport_w_scaling_enable: bool,
15682 ) {
15683 let fp = self
15684 .commands()
15685 .cmd_set_viewport_w_scaling_enable_nv
15686 .expect("vkCmdSetViewportWScalingEnableNV not loaded");
15687 unsafe { fp(command_buffer, viewport_w_scaling_enable as u32) };
15688 }
15689 ///Wraps [`vkCmdSetViewportSwizzleNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetViewportSwizzleNV.html).
15690 /**
15691 Provided by **VK_EXT_extended_dynamic_state3**.*/
15692 ///
15693 ///# Safety
15694 ///- `commandBuffer` (self) must be valid and not destroyed.
15695 ///- `commandBuffer` must be externally synchronized.
15696 ///
15697 ///# Panics
15698 ///Panics if `vkCmdSetViewportSwizzleNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15699 ///
15700 ///# Usage Notes
15701 ///
15702 ///Dynamically sets the viewport swizzle for each viewport. A
15703 ///swizzle remaps each output component (x, y, z, w) to any input
15704 ///component, optionally negated.
15705 ///
15706 ///Useful for single-pass cubemap rendering and other multi-view
15707 ///projection tricks.
15708 ///
15709 ///Part of `VK_NV_viewport_swizzle`.
15710 ///
15711 ///Provided by `VK_EXT_extended_dynamic_state3`.
15712 pub unsafe fn cmd_set_viewport_swizzle_nv(
15713 &self,
15714 command_buffer: CommandBuffer,
15715 first_viewport: u32,
15716 p_viewport_swizzles: &[ViewportSwizzleNV],
15717 ) {
15718 let fp = self
15719 .commands()
15720 .cmd_set_viewport_swizzle_nv
15721 .expect("vkCmdSetViewportSwizzleNV not loaded");
15722 unsafe {
15723 fp(
15724 command_buffer,
15725 first_viewport,
15726 p_viewport_swizzles.len() as u32,
15727 p_viewport_swizzles.as_ptr(),
15728 )
15729 };
15730 }
15731 ///Wraps [`vkCmdSetCoverageToColorEnableNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetCoverageToColorEnableNV.html).
15732 /**
15733 Provided by **VK_EXT_extended_dynamic_state3**.*/
15734 ///
15735 ///# Safety
15736 ///- `commandBuffer` (self) must be valid and not destroyed.
15737 ///- `commandBuffer` must be externally synchronized.
15738 ///
15739 ///# Panics
15740 ///Panics if `vkCmdSetCoverageToColorEnableNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15741 ///
15742 ///# Usage Notes
15743 ///
15744 ///Dynamically enables or disables coverage-to-color mode. When
15745 ///enabled, the fragment coverage mask is written to a specified
15746 ///color attachment instead of (or in addition to) the normal color
15747 ///output.
15748 ///
15749 ///Part of `VK_NV_fragment_coverage_to_color`.
15750 ///
15751 ///Provided by `VK_EXT_extended_dynamic_state3`.
15752 pub unsafe fn cmd_set_coverage_to_color_enable_nv(
15753 &self,
15754 command_buffer: CommandBuffer,
15755 coverage_to_color_enable: bool,
15756 ) {
15757 let fp = self
15758 .commands()
15759 .cmd_set_coverage_to_color_enable_nv
15760 .expect("vkCmdSetCoverageToColorEnableNV not loaded");
15761 unsafe { fp(command_buffer, coverage_to_color_enable as u32) };
15762 }
15763 ///Wraps [`vkCmdSetCoverageToColorLocationNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetCoverageToColorLocationNV.html).
15764 /**
15765 Provided by **VK_EXT_extended_dynamic_state3**.*/
15766 ///
15767 ///# Safety
15768 ///- `commandBuffer` (self) must be valid and not destroyed.
15769 ///- `commandBuffer` must be externally synchronized.
15770 ///
15771 ///# Panics
15772 ///Panics if `vkCmdSetCoverageToColorLocationNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15773 ///
15774 ///# Usage Notes
15775 ///
15776 ///Dynamically sets which color attachment receives the coverage
15777 ///mask when coverage-to-color is enabled.
15778 ///
15779 ///Only effective when `cmd_set_coverage_to_color_enable_nv` is true.
15780 ///
15781 ///Part of `VK_NV_fragment_coverage_to_color`.
15782 ///
15783 ///Provided by `VK_EXT_extended_dynamic_state3`.
15784 pub unsafe fn cmd_set_coverage_to_color_location_nv(
15785 &self,
15786 command_buffer: CommandBuffer,
15787 coverage_to_color_location: u32,
15788 ) {
15789 let fp = self
15790 .commands()
15791 .cmd_set_coverage_to_color_location_nv
15792 .expect("vkCmdSetCoverageToColorLocationNV not loaded");
15793 unsafe { fp(command_buffer, coverage_to_color_location) };
15794 }
15795 ///Wraps [`vkCmdSetCoverageModulationModeNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetCoverageModulationModeNV.html).
15796 /**
15797 Provided by **VK_EXT_extended_dynamic_state3**.*/
15798 ///
15799 ///# Safety
15800 ///- `commandBuffer` (self) must be valid and not destroyed.
15801 ///- `commandBuffer` must be externally synchronized.
15802 ///
15803 ///# Panics
15804 ///Panics if `vkCmdSetCoverageModulationModeNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15805 ///
15806 ///# Usage Notes
15807 ///
15808 ///Dynamically sets how the coverage mask is combined with the
15809 ///fragment's color. Modes include `NONE`, `RGB`, `ALPHA`, and
15810 ///`RGBA`.
15811 ///
15812 ///Part of the NV coverage modulation feature used with
15813 ///`VK_NV_framebuffer_mixed_samples`.
15814 ///
15815 ///Provided by `VK_EXT_extended_dynamic_state3`.
15816 pub unsafe fn cmd_set_coverage_modulation_mode_nv(
15817 &self,
15818 command_buffer: CommandBuffer,
15819 coverage_modulation_mode: CoverageModulationModeNV,
15820 ) {
15821 let fp = self
15822 .commands()
15823 .cmd_set_coverage_modulation_mode_nv
15824 .expect("vkCmdSetCoverageModulationModeNV not loaded");
15825 unsafe { fp(command_buffer, coverage_modulation_mode) };
15826 }
15827 ///Wraps [`vkCmdSetCoverageModulationTableEnableNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetCoverageModulationTableEnableNV.html).
15828 /**
15829 Provided by **VK_EXT_extended_dynamic_state3**.*/
15830 ///
15831 ///# Safety
15832 ///- `commandBuffer` (self) must be valid and not destroyed.
15833 ///- `commandBuffer` must be externally synchronized.
15834 ///
15835 ///# Panics
15836 ///Panics if `vkCmdSetCoverageModulationTableEnableNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15837 ///
15838 ///# Usage Notes
15839 ///
15840 ///Dynamically enables or disables the coverage modulation lookup
15841 ///table. When enabled, the coverage value indexes into a table set
15842 ///by `cmd_set_coverage_modulation_table_nv` instead of using the
15843 ///default linear modulation.
15844 ///
15845 ///Part of `VK_NV_framebuffer_mixed_samples`.
15846 ///
15847 ///Provided by `VK_EXT_extended_dynamic_state3`.
15848 pub unsafe fn cmd_set_coverage_modulation_table_enable_nv(
15849 &self,
15850 command_buffer: CommandBuffer,
15851 coverage_modulation_table_enable: bool,
15852 ) {
15853 let fp = self
15854 .commands()
15855 .cmd_set_coverage_modulation_table_enable_nv
15856 .expect("vkCmdSetCoverageModulationTableEnableNV not loaded");
15857 unsafe { fp(command_buffer, coverage_modulation_table_enable as u32) };
15858 }
15859 ///Wraps [`vkCmdSetCoverageModulationTableNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetCoverageModulationTableNV.html).
15860 /**
15861 Provided by **VK_EXT_extended_dynamic_state3**.*/
15862 ///
15863 ///# Safety
15864 ///- `commandBuffer` (self) must be valid and not destroyed.
15865 ///- `commandBuffer` must be externally synchronized.
15866 ///
15867 ///# Panics
15868 ///Panics if `vkCmdSetCoverageModulationTableNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15869 ///
15870 ///# Usage Notes
15871 ///
15872 ///Dynamically sets the coverage modulation lookup table. Each entry
15873 ///maps a coverage sample count to a modulation factor (0.0–1.0).
15874 ///
15875 ///Only used when coverage modulation table is enabled via
15876 ///`cmd_set_coverage_modulation_table_enable_nv`.
15877 ///
15878 ///Part of `VK_NV_framebuffer_mixed_samples`.
15879 ///
15880 ///Provided by `VK_EXT_extended_dynamic_state3`.
15881 pub unsafe fn cmd_set_coverage_modulation_table_nv(
15882 &self,
15883 command_buffer: CommandBuffer,
15884 p_coverage_modulation_table: &[f32],
15885 ) {
15886 let fp = self
15887 .commands()
15888 .cmd_set_coverage_modulation_table_nv
15889 .expect("vkCmdSetCoverageModulationTableNV not loaded");
15890 unsafe {
15891 fp(
15892 command_buffer,
15893 p_coverage_modulation_table.len() as u32,
15894 p_coverage_modulation_table.as_ptr(),
15895 )
15896 };
15897 }
15898 ///Wraps [`vkCmdSetShadingRateImageEnableNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetShadingRateImageEnableNV.html).
15899 /**
15900 Provided by **VK_EXT_extended_dynamic_state3**.*/
15901 ///
15902 ///# Safety
15903 ///- `commandBuffer` (self) must be valid and not destroyed.
15904 ///- `commandBuffer` must be externally synchronized.
15905 ///
15906 ///# Panics
15907 ///Panics if `vkCmdSetShadingRateImageEnableNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15908 ///
15909 ///# Usage Notes
15910 ///
15911 ///Dynamically enables or disables the shading rate image. When
15912 ///enabled, fragment shading rate is read from a shading rate image
15913 ///attachment instead of using a uniform rate.
15914 ///
15915 ///Part of `VK_NV_shading_rate_image`.
15916 ///
15917 ///Provided by `VK_EXT_extended_dynamic_state3`.
15918 pub unsafe fn cmd_set_shading_rate_image_enable_nv(
15919 &self,
15920 command_buffer: CommandBuffer,
15921 shading_rate_image_enable: bool,
15922 ) {
15923 let fp = self
15924 .commands()
15925 .cmd_set_shading_rate_image_enable_nv
15926 .expect("vkCmdSetShadingRateImageEnableNV not loaded");
15927 unsafe { fp(command_buffer, shading_rate_image_enable as u32) };
15928 }
15929 ///Wraps [`vkCmdSetCoverageReductionModeNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetCoverageReductionModeNV.html).
15930 /**
15931 Provided by **VK_EXT_extended_dynamic_state3**.*/
15932 ///
15933 ///# Safety
15934 ///- `commandBuffer` (self) must be valid and not destroyed.
15935 ///- `commandBuffer` must be externally synchronized.
15936 ///
15937 ///# Panics
15938 ///Panics if `vkCmdSetCoverageReductionModeNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15939 ///
15940 ///# Usage Notes
15941 ///
15942 ///Dynamically sets the coverage reduction mode, which controls how
15943 ///the multisampled coverage mask is reduced to a color sample mask
15944 ///when the number of color samples is less than the rasterization
15945 ///samples.
15946 ///
15947 ///Part of `VK_NV_coverage_reduction_mode`.
15948 ///
15949 ///Provided by `VK_EXT_extended_dynamic_state3`.
15950 pub unsafe fn cmd_set_coverage_reduction_mode_nv(
15951 &self,
15952 command_buffer: CommandBuffer,
15953 coverage_reduction_mode: CoverageReductionModeNV,
15954 ) {
15955 let fp = self
15956 .commands()
15957 .cmd_set_coverage_reduction_mode_nv
15958 .expect("vkCmdSetCoverageReductionModeNV not loaded");
15959 unsafe { fp(command_buffer, coverage_reduction_mode) };
15960 }
15961 ///Wraps [`vkCmdSetRepresentativeFragmentTestEnableNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetRepresentativeFragmentTestEnableNV.html).
15962 /**
15963 Provided by **VK_EXT_extended_dynamic_state3**.*/
15964 ///
15965 ///# Safety
15966 ///- `commandBuffer` (self) must be valid and not destroyed.
15967 ///- `commandBuffer` must be externally synchronized.
15968 ///
15969 ///# Panics
15970 ///Panics if `vkCmdSetRepresentativeFragmentTestEnableNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
15971 ///
15972 ///# Usage Notes
15973 ///
15974 ///Dynamically enables or disables the representative fragment test.
15975 ///When enabled, only one fragment per pixel is shaded (the
15976 ///"representative" fragment), and the rest are discarded early.
15977 ///
15978 ///Useful for visibility-only passes (e.g., occlusion culling)
15979 ///where full shading is unnecessary.
15980 ///
15981 ///Part of `VK_NV_representative_fragment_test`.
15982 ///
15983 ///Provided by `VK_EXT_extended_dynamic_state3`.
15984 pub unsafe fn cmd_set_representative_fragment_test_enable_nv(
15985 &self,
15986 command_buffer: CommandBuffer,
15987 representative_fragment_test_enable: bool,
15988 ) {
15989 let fp = self
15990 .commands()
15991 .cmd_set_representative_fragment_test_enable_nv
15992 .expect("vkCmdSetRepresentativeFragmentTestEnableNV not loaded");
15993 unsafe { fp(command_buffer, representative_fragment_test_enable as u32) };
15994 }
15995 ///Wraps [`vkCreatePrivateDataSlot`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreatePrivateDataSlot.html).
15996 /**
15997 Provided by **VK_BASE_VERSION_1_3**.*/
15998 ///
15999 ///# Errors
16000 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
16001 ///- `VK_ERROR_UNKNOWN`
16002 ///- `VK_ERROR_VALIDATION_FAILED`
16003 ///
16004 ///# Safety
16005 ///- `device` (self) must be valid and not destroyed.
16006 ///
16007 ///# Panics
16008 ///Panics if `vkCreatePrivateDataSlot` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16009 ///
16010 ///# Usage Notes
16011 ///
16012 ///Creates a private data slot that can be used to attach arbitrary
16013 ///application-defined `u64` values to any Vulkan object. Private data
16014 ///is a lightweight alternative to external hash maps for per-object
16015 ///metadata.
16016 ///
16017 ///Each slot represents one "key" that can be set on any object via
16018 ///`set_private_data` and read back via `get_private_data`.
16019 ///
16020 ///Use cases:
16021 ///
16022 ///- Tagging objects with debug IDs.
16023 ///- Associating application-specific state without a separate lookup
16024 /// table.
16025 ///- Layer and tool implementations that need per-object bookkeeping.
16026 ///
16027 ///Private data slots are cheap. The slot itself is just an index;
16028 ///the per-object storage is allocated lazily by the driver.
16029 pub unsafe fn create_private_data_slot(
16030 &self,
16031 p_create_info: &PrivateDataSlotCreateInfo,
16032 allocator: Option<&AllocationCallbacks>,
16033 ) -> VkResult<PrivateDataSlot> {
16034 let fp = self
16035 .commands()
16036 .create_private_data_slot
16037 .expect("vkCreatePrivateDataSlot not loaded");
16038 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
16039 let mut out = unsafe { core::mem::zeroed() };
16040 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
16041 Ok(out)
16042 }
16043 ///Wraps [`vkDestroyPrivateDataSlot`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyPrivateDataSlot.html).
16044 /**
16045 Provided by **VK_BASE_VERSION_1_3**.*/
16046 ///
16047 ///# Safety
16048 ///- `device` (self) must be valid and not destroyed.
16049 ///- `privateDataSlot` must be externally synchronized.
16050 ///
16051 ///# Panics
16052 ///Panics if `vkDestroyPrivateDataSlot` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16053 ///
16054 ///# Usage Notes
16055 ///
16056 ///Destroys a private data slot. Any data previously stored via
16057 ///`set_private_data` with this slot is discarded. Objects that had
16058 ///data set are not affected, they continue to exist normally.
16059 pub unsafe fn destroy_private_data_slot(
16060 &self,
16061 private_data_slot: PrivateDataSlot,
16062 allocator: Option<&AllocationCallbacks>,
16063 ) {
16064 let fp = self
16065 .commands()
16066 .destroy_private_data_slot
16067 .expect("vkDestroyPrivateDataSlot not loaded");
16068 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
16069 unsafe { fp(self.handle(), private_data_slot, alloc_ptr) };
16070 }
16071 ///Wraps [`vkSetPrivateData`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetPrivateData.html).
16072 /**
16073 Provided by **VK_BASE_VERSION_1_3**.*/
16074 ///
16075 ///# Errors
16076 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
16077 ///- `VK_ERROR_UNKNOWN`
16078 ///- `VK_ERROR_VALIDATION_FAILED`
16079 ///
16080 ///# Safety
16081 ///- `device` (self) must be valid and not destroyed.
16082 ///
16083 ///# Panics
16084 ///Panics if `vkSetPrivateData` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16085 ///
16086 ///# Usage Notes
16087 ///
16088 ///Stores a `u64` value on any Vulkan object for the given private data
16089 ///slot. Overwrites any previously stored value for this object/slot
16090 ///pair.
16091 ///
16092 ///Private data is per-device, the slot must have been created from
16093 ///the same device that owns the object. Setting data on an object from
16094 ///a different device is undefined behaviour.
16095 ///
16096 ///To clear the association, set the value to 0 or destroy the slot.
16097 pub unsafe fn set_private_data(
16098 &self,
16099 object_type: ObjectType,
16100 object_handle: u64,
16101 private_data_slot: PrivateDataSlot,
16102 data: u64,
16103 ) -> VkResult<()> {
16104 let fp = self
16105 .commands()
16106 .set_private_data
16107 .expect("vkSetPrivateData not loaded");
16108 check(unsafe {
16109 fp(
16110 self.handle(),
16111 object_type,
16112 object_handle,
16113 private_data_slot,
16114 data,
16115 )
16116 })
16117 }
16118 ///Wraps [`vkGetPrivateData`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPrivateData.html).
16119 /**
16120 Provided by **VK_BASE_VERSION_1_3**.*/
16121 ///
16122 ///# Safety
16123 ///- `device` (self) must be valid and not destroyed.
16124 ///
16125 ///# Panics
16126 ///Panics if `vkGetPrivateData` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16127 ///
16128 ///# Usage Notes
16129 ///
16130 ///Retrieves the `u64` value previously stored on a Vulkan object with
16131 ///`set_private_data` for the given private data slot. Returns 0 if no
16132 ///data was set for this object/slot combination.
16133 ///
16134 ///This is a lightweight per-object metadata lookup with no hash table
16135 ///overhead. See `create_private_data_slot` for usage patterns.
16136 pub unsafe fn get_private_data(
16137 &self,
16138 object_type: ObjectType,
16139 object_handle: u64,
16140 private_data_slot: PrivateDataSlot,
16141 ) -> u64 {
16142 let fp = self
16143 .commands()
16144 .get_private_data
16145 .expect("vkGetPrivateData not loaded");
16146 let mut out = unsafe { core::mem::zeroed() };
16147 unsafe {
16148 fp(
16149 self.handle(),
16150 object_type,
16151 object_handle,
16152 private_data_slot,
16153 &mut out,
16154 )
16155 };
16156 out
16157 }
16158 ///Wraps [`vkCmdCopyBuffer2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyBuffer2.html).
16159 /**
16160 Provided by **VK_BASE_VERSION_1_3**.*/
16161 ///
16162 ///# Safety
16163 ///- `commandBuffer` (self) must be valid and not destroyed.
16164 ///- `commandBuffer` must be externally synchronized.
16165 ///
16166 ///# Panics
16167 ///Panics if `vkCmdCopyBuffer2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16168 ///
16169 ///# Usage Notes
16170 ///
16171 ///Vulkan 1.3 version of `cmd_copy_buffer` that uses an extensible
16172 ///`CopyBufferInfo2` struct. Functionally identical to the 1.0 version
16173 ///but supports future extensions via pNext.
16174 ///
16175 ///Prefer this over `cmd_copy_buffer` when targeting Vulkan 1.3+.
16176 pub unsafe fn cmd_copy_buffer2(
16177 &self,
16178 command_buffer: CommandBuffer,
16179 p_copy_buffer_info: &CopyBufferInfo2,
16180 ) {
16181 let fp = self
16182 .commands()
16183 .cmd_copy_buffer2
16184 .expect("vkCmdCopyBuffer2 not loaded");
16185 unsafe { fp(command_buffer, p_copy_buffer_info) };
16186 }
16187 ///Wraps [`vkCmdCopyImage2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyImage2.html).
16188 /**
16189 Provided by **VK_BASE_VERSION_1_3**.*/
16190 ///
16191 ///# Safety
16192 ///- `commandBuffer` (self) must be valid and not destroyed.
16193 ///- `commandBuffer` must be externally synchronized.
16194 ///
16195 ///# Panics
16196 ///Panics if `vkCmdCopyImage2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16197 ///
16198 ///# Usage Notes
16199 ///
16200 ///Vulkan 1.3 version of `cmd_copy_image` that uses an extensible
16201 ///`CopyImageInfo2` struct.
16202 ///
16203 ///Functionally identical to the 1.0 version. Prefer this when
16204 ///targeting Vulkan 1.3+.
16205 pub unsafe fn cmd_copy_image2(
16206 &self,
16207 command_buffer: CommandBuffer,
16208 p_copy_image_info: &CopyImageInfo2,
16209 ) {
16210 let fp = self
16211 .commands()
16212 .cmd_copy_image2
16213 .expect("vkCmdCopyImage2 not loaded");
16214 unsafe { fp(command_buffer, p_copy_image_info) };
16215 }
16216 ///Wraps [`vkCmdBlitImage2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBlitImage2.html).
16217 /**
16218 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
16219 ///
16220 ///# Safety
16221 ///- `commandBuffer` (self) must be valid and not destroyed.
16222 ///- `commandBuffer` must be externally synchronized.
16223 ///
16224 ///# Panics
16225 ///Panics if `vkCmdBlitImage2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16226 ///
16227 ///# Usage Notes
16228 ///
16229 ///Vulkan 1.3 version of `cmd_blit_image` that uses an extensible
16230 ///`BlitImageInfo2` struct.
16231 ///
16232 ///Chain `BlitImageCubicWeightsInfoQCOM` for cubic filtering on
16233 ///Qualcomm hardware. Otherwise functionally identical to
16234 ///`cmd_blit_image`.
16235 ///
16236 ///Prefer this when targeting Vulkan 1.3+.
16237 pub unsafe fn cmd_blit_image2(
16238 &self,
16239 command_buffer: CommandBuffer,
16240 p_blit_image_info: &BlitImageInfo2,
16241 ) {
16242 let fp = self
16243 .commands()
16244 .cmd_blit_image2
16245 .expect("vkCmdBlitImage2 not loaded");
16246 unsafe { fp(command_buffer, p_blit_image_info) };
16247 }
16248 ///Wraps [`vkCmdCopyBufferToImage2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyBufferToImage2.html).
16249 /**
16250 Provided by **VK_BASE_VERSION_1_3**.*/
16251 ///
16252 ///# Safety
16253 ///- `commandBuffer` (self) must be valid and not destroyed.
16254 ///- `commandBuffer` must be externally synchronized.
16255 ///
16256 ///# Panics
16257 ///Panics if `vkCmdCopyBufferToImage2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16258 ///
16259 ///# Usage Notes
16260 ///
16261 ///Vulkan 1.3 version of `cmd_copy_buffer_to_image` that uses an
16262 ///extensible `CopyBufferToImageInfo2` struct.
16263 ///
16264 ///Functionally identical to the 1.0 version. Prefer this when
16265 ///targeting Vulkan 1.3+.
16266 pub unsafe fn cmd_copy_buffer_to_image2(
16267 &self,
16268 command_buffer: CommandBuffer,
16269 p_copy_buffer_to_image_info: &CopyBufferToImageInfo2,
16270 ) {
16271 let fp = self
16272 .commands()
16273 .cmd_copy_buffer_to_image2
16274 .expect("vkCmdCopyBufferToImage2 not loaded");
16275 unsafe { fp(command_buffer, p_copy_buffer_to_image_info) };
16276 }
16277 ///Wraps [`vkCmdCopyImageToBuffer2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyImageToBuffer2.html).
16278 /**
16279 Provided by **VK_BASE_VERSION_1_3**.*/
16280 ///
16281 ///# Safety
16282 ///- `commandBuffer` (self) must be valid and not destroyed.
16283 ///- `commandBuffer` must be externally synchronized.
16284 ///
16285 ///# Panics
16286 ///Panics if `vkCmdCopyImageToBuffer2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16287 ///
16288 ///# Usage Notes
16289 ///
16290 ///Vulkan 1.3 version of `cmd_copy_image_to_buffer` that uses an
16291 ///extensible `CopyImageToBufferInfo2` struct.
16292 ///
16293 ///Functionally identical to the 1.0 version. Prefer this when
16294 ///targeting Vulkan 1.3+.
16295 pub unsafe fn cmd_copy_image_to_buffer2(
16296 &self,
16297 command_buffer: CommandBuffer,
16298 p_copy_image_to_buffer_info: &CopyImageToBufferInfo2,
16299 ) {
16300 let fp = self
16301 .commands()
16302 .cmd_copy_image_to_buffer2
16303 .expect("vkCmdCopyImageToBuffer2 not loaded");
16304 unsafe { fp(command_buffer, p_copy_image_to_buffer_info) };
16305 }
16306 ///Wraps [`vkCmdResolveImage2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdResolveImage2.html).
16307 /**
16308 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
16309 ///
16310 ///# Safety
16311 ///- `commandBuffer` (self) must be valid and not destroyed.
16312 ///- `commandBuffer` must be externally synchronized.
16313 ///
16314 ///# Panics
16315 ///Panics if `vkCmdResolveImage2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16316 ///
16317 ///# Usage Notes
16318 ///
16319 ///Vulkan 1.3 version of `cmd_resolve_image` that uses an extensible
16320 ///`ResolveImageInfo2` struct.
16321 ///
16322 ///Functionally identical to `cmd_resolve_image`. Prefer this when
16323 ///targeting Vulkan 1.3+.
16324 pub unsafe fn cmd_resolve_image2(
16325 &self,
16326 command_buffer: CommandBuffer,
16327 p_resolve_image_info: &ResolveImageInfo2,
16328 ) {
16329 let fp = self
16330 .commands()
16331 .cmd_resolve_image2
16332 .expect("vkCmdResolveImage2 not loaded");
16333 unsafe { fp(command_buffer, p_resolve_image_info) };
16334 }
16335 ///Wraps [`vkCmdRefreshObjectsKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdRefreshObjectsKHR.html).
16336 ///
16337 ///# Safety
16338 ///- `commandBuffer` (self) must be valid and not destroyed.
16339 ///- `commandBuffer` must be externally synchronized.
16340 ///
16341 ///# Panics
16342 ///Panics if `vkCmdRefreshObjectsKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16343 ///
16344 ///# Usage Notes
16345 ///
16346 ///Refreshes a set of Vulkan objects managed by a refreshable object
16347 ///type, resetting their internal state. Used in safety-critical
16348 ///Vulkan SC environments to periodically refresh objects and detect
16349 ///hardware faults.
16350 ///
16351 ///Not relevant for desktop Vulkan. This is part of the
16352 ///`VK_KHR_object_refresh` extension used in automotive and embedded
16353 ///safety-critical environments.
16354 pub unsafe fn cmd_refresh_objects_khr(
16355 &self,
16356 command_buffer: CommandBuffer,
16357 p_refresh_objects: &RefreshObjectListKHR,
16358 ) {
16359 let fp = self
16360 .commands()
16361 .cmd_refresh_objects_khr
16362 .expect("vkCmdRefreshObjectsKHR not loaded");
16363 unsafe { fp(command_buffer, p_refresh_objects) };
16364 }
16365 ///Wraps [`vkCmdSetFragmentShadingRateKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetFragmentShadingRateKHR.html).
16366 /**
16367 Provided by **VK_KHR_fragment_shading_rate**.*/
16368 ///
16369 ///# Safety
16370 ///- `commandBuffer` (self) must be valid and not destroyed.
16371 ///- `commandBuffer` must be externally synchronized.
16372 ///
16373 ///# Panics
16374 ///Panics if `vkCmdSetFragmentShadingRateKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16375 ///
16376 ///# Usage Notes
16377 ///
16378 ///Sets the pipeline fragment shading rate and combiner operations
16379 ///as dynamic state. This controls how many pixels each fragment
16380 ///shader invocation covers, larger fragment sizes reduce shading
16381 ///cost at the expense of detail.
16382 ///
16383 ///`p_fragment_size` specifies the fragment size (e.g., 1x1, 1x2,
16384 ///2x2, 2x4, 4x4). Not all sizes are supported, query
16385 ///`get_physical_device_fragment_shading_rates_khr` for the list.
16386 ///
16387 ///`combiner_ops` defines how the pipeline rate, primitive rate
16388 ///(from the vertex shader), and attachment rate (from a shading
16389 ///rate image) are combined to produce the final rate.
16390 ///
16391 ///Requires `VK_KHR_fragment_shading_rate` and the
16392 ///`pipelineFragmentShadingRate` device feature.
16393 pub unsafe fn cmd_set_fragment_shading_rate_khr(
16394 &self,
16395 command_buffer: CommandBuffer,
16396 p_fragment_size: &Extent2D,
16397 combiner_ops: FragmentShadingRateCombinerOpKHR,
16398 ) {
16399 let fp = self
16400 .commands()
16401 .cmd_set_fragment_shading_rate_khr
16402 .expect("vkCmdSetFragmentShadingRateKHR not loaded");
16403 unsafe { fp(command_buffer, p_fragment_size, combiner_ops) };
16404 }
16405 ///Wraps [`vkCmdSetFragmentShadingRateEnumNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetFragmentShadingRateEnumNV.html).
16406 /**
16407 Provided by **VK_NV_fragment_shading_rate_enums**.*/
16408 ///
16409 ///# Safety
16410 ///- `commandBuffer` (self) must be valid and not destroyed.
16411 ///- `commandBuffer` must be externally synchronized.
16412 ///
16413 ///# Panics
16414 ///Panics if `vkCmdSetFragmentShadingRateEnumNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16415 ///
16416 ///# Usage Notes
16417 ///
16418 ///Dynamically sets the fragment shading rate using the NV-specific
16419 ///enum values. Provides finer control than the KHR variant,
16420 ///including support for supersample and no-invocations rates.
16421 ///
16422 ///Requires `VK_NV_fragment_shading_rate_enums`.
16423 pub unsafe fn cmd_set_fragment_shading_rate_enum_nv(
16424 &self,
16425 command_buffer: CommandBuffer,
16426 shading_rate: FragmentShadingRateNV,
16427 combiner_ops: FragmentShadingRateCombinerOpKHR,
16428 ) {
16429 let fp = self
16430 .commands()
16431 .cmd_set_fragment_shading_rate_enum_nv
16432 .expect("vkCmdSetFragmentShadingRateEnumNV not loaded");
16433 unsafe { fp(command_buffer, shading_rate, combiner_ops) };
16434 }
16435 ///Wraps [`vkGetAccelerationStructureBuildSizesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetAccelerationStructureBuildSizesKHR.html).
16436 /**
16437 Provided by **VK_KHR_acceleration_structure**.*/
16438 ///
16439 ///# Safety
16440 ///- `device` (self) must be valid and not destroyed.
16441 ///
16442 ///# Panics
16443 ///Panics if `vkGetAccelerationStructureBuildSizesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16444 ///
16445 ///# Usage Notes
16446 ///
16447 ///Queries the buffer sizes needed to build an acceleration structure:
16448 ///the final structure size, the scratch buffer size for builds, and
16449 ///the scratch buffer size for updates.
16450 ///
16451 ///Call this before creating the acceleration structure and scratch
16452 ///buffers. The `max_primitive_counts` parameter specifies the maximum
16453 ///number of primitives per geometry, the returned sizes are
16454 ///worst-case guarantees for those counts.
16455 ///
16456 ///The actual built size may be smaller. For BLASes, build with
16457 ///`ALLOW_COMPACTION` and query the compacted size afterwards to
16458 ///reclaim excess memory.
16459 pub unsafe fn get_acceleration_structure_build_sizes_khr(
16460 &self,
16461 build_type: AccelerationStructureBuildTypeKHR,
16462 p_build_info: &AccelerationStructureBuildGeometryInfoKHR,
16463 p_max_primitive_counts: *const u32,
16464 p_size_info: &mut AccelerationStructureBuildSizesInfoKHR,
16465 ) {
16466 let fp = self
16467 .commands()
16468 .get_acceleration_structure_build_sizes_khr
16469 .expect("vkGetAccelerationStructureBuildSizesKHR not loaded");
16470 unsafe {
16471 fp(
16472 self.handle(),
16473 build_type,
16474 p_build_info,
16475 p_max_primitive_counts,
16476 p_size_info,
16477 )
16478 };
16479 }
16480 ///Wraps [`vkCmdSetVertexInputEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetVertexInputEXT.html).
16481 /**
16482 Provided by **VK_EXT_vertex_input_dynamic_state**.*/
16483 ///
16484 ///# Safety
16485 ///- `commandBuffer` (self) must be valid and not destroyed.
16486 ///- `commandBuffer` must be externally synchronized.
16487 ///
16488 ///# Panics
16489 ///Panics if `vkCmdSetVertexInputEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16490 ///
16491 ///# Usage Notes
16492 ///
16493 ///Dynamically sets the complete vertex input state: bindings
16494 ///(stride, input rate) and attributes (location, format, offset).
16495 ///
16496 ///Replaces `VertexInputBindingDescription` and
16497 ///`VertexInputAttributeDescription` from pipeline creation. Pass
16498 ///arrays of `VertexInputBindingDescription2EXT` and
16499 ///`VertexInputAttributeDescription2EXT`.
16500 ///
16501 ///Provided by `VK_EXT_vertex_input_dynamic_state`.
16502 pub unsafe fn cmd_set_vertex_input_ext(
16503 &self,
16504 command_buffer: CommandBuffer,
16505 p_vertex_binding_descriptions: &[VertexInputBindingDescription2EXT],
16506 p_vertex_attribute_descriptions: &[VertexInputAttributeDescription2EXT],
16507 ) {
16508 let fp = self
16509 .commands()
16510 .cmd_set_vertex_input_ext
16511 .expect("vkCmdSetVertexInputEXT not loaded");
16512 unsafe {
16513 fp(
16514 command_buffer,
16515 p_vertex_binding_descriptions.len() as u32,
16516 p_vertex_binding_descriptions.as_ptr(),
16517 p_vertex_attribute_descriptions.len() as u32,
16518 p_vertex_attribute_descriptions.as_ptr(),
16519 )
16520 };
16521 }
16522 ///Wraps [`vkCmdSetColorWriteEnableEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetColorWriteEnableEXT.html).
16523 /**
16524 Provided by **VK_EXT_color_write_enable**.*/
16525 ///
16526 ///# Safety
16527 ///- `commandBuffer` (self) must be valid and not destroyed.
16528 ///- `commandBuffer` must be externally synchronized.
16529 ///
16530 ///# Panics
16531 ///Panics if `vkCmdSetColorWriteEnableEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16532 ///
16533 ///# Usage Notes
16534 ///
16535 ///Dynamically enables or disables color writing for each color
16536 ///attachment. Pass a slice of `Bool32` values, one per attachment.
16537 ///
16538 ///When color write is disabled for an attachment, no color output
16539 ///is written regardless of blend state.
16540 ///
16541 ///Unlike `cmd_set_color_write_mask_ext` (which controls per-channel
16542 ///masking), this is a simple on/off toggle per attachment.
16543 ///
16544 ///Provided by `VK_EXT_color_write_enable`.
16545 pub unsafe fn cmd_set_color_write_enable_ext(
16546 &self,
16547 command_buffer: CommandBuffer,
16548 p_color_write_enables: &[u32],
16549 ) {
16550 let fp = self
16551 .commands()
16552 .cmd_set_color_write_enable_ext
16553 .expect("vkCmdSetColorWriteEnableEXT not loaded");
16554 unsafe {
16555 fp(
16556 command_buffer,
16557 p_color_write_enables.len() as u32,
16558 p_color_write_enables.as_ptr(),
16559 )
16560 };
16561 }
16562 ///Wraps [`vkCmdSetEvent2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetEvent2.html).
16563 /**
16564 Provided by **VK_COMPUTE_VERSION_1_3**.*/
16565 ///
16566 ///# Safety
16567 ///- `commandBuffer` (self) must be valid and not destroyed.
16568 ///- `commandBuffer` must be externally synchronized.
16569 ///
16570 ///# Panics
16571 ///Panics if `vkCmdSetEvent2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16572 ///
16573 ///# Usage Notes
16574 ///
16575 ///Vulkan 1.3 version of `cmd_set_event` that takes a `DependencyInfo`
16576 ///describing the memory dependencies, rather than just a stage mask.
16577 ///
16578 ///This provides more precise dependency information to the driver and
16579 ///supports 64-bit stage and access flags. The dependency info specifies
16580 ///exactly what memory accesses and pipeline stages are involved, which
16581 ///can reduce unnecessary stalls.
16582 ///
16583 ///Prefer this over `cmd_set_event` when targeting Vulkan 1.3+.
16584 pub unsafe fn cmd_set_event2(
16585 &self,
16586 command_buffer: CommandBuffer,
16587 event: Event,
16588 p_dependency_info: &DependencyInfo,
16589 ) {
16590 let fp = self
16591 .commands()
16592 .cmd_set_event2
16593 .expect("vkCmdSetEvent2 not loaded");
16594 unsafe { fp(command_buffer, event, p_dependency_info) };
16595 }
16596 ///Wraps [`vkCmdResetEvent2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdResetEvent2.html).
16597 /**
16598 Provided by **VK_COMPUTE_VERSION_1_3**.*/
16599 ///
16600 ///# Safety
16601 ///- `commandBuffer` (self) must be valid and not destroyed.
16602 ///- `commandBuffer` must be externally synchronized.
16603 ///
16604 ///# Panics
16605 ///Panics if `vkCmdResetEvent2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16606 ///
16607 ///# Usage Notes
16608 ///
16609 ///Vulkan 1.3 version of `cmd_reset_event` that uses 64-bit pipeline
16610 ///stage flags. Supports newer stages not available in the original
16611 ///32-bit field.
16612 ///
16613 ///Prefer this over `cmd_reset_event` when targeting Vulkan 1.3+.
16614 pub unsafe fn cmd_reset_event2(
16615 &self,
16616 command_buffer: CommandBuffer,
16617 event: Event,
16618 stage_mask: PipelineStageFlags2,
16619 ) {
16620 let fp = self
16621 .commands()
16622 .cmd_reset_event2
16623 .expect("vkCmdResetEvent2 not loaded");
16624 unsafe { fp(command_buffer, event, stage_mask) };
16625 }
16626 ///Wraps [`vkCmdWaitEvents2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWaitEvents2.html).
16627 /**
16628 Provided by **VK_COMPUTE_VERSION_1_3**.*/
16629 ///
16630 ///# Safety
16631 ///- `commandBuffer` (self) must be valid and not destroyed.
16632 ///- `commandBuffer` must be externally synchronized.
16633 ///
16634 ///# Panics
16635 ///Panics if `vkCmdWaitEvents2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16636 ///
16637 ///# Usage Notes
16638 ///
16639 ///Vulkan 1.3 version of `cmd_wait_events` that takes per-event
16640 ///`DependencyInfo` structs instead of global stage masks and barriers.
16641 ///
16642 ///Each event can have its own set of memory barriers and stage masks,
16643 ///giving the driver more precise information about what each event
16644 ///protects.
16645 ///
16646 ///Prefer this over `cmd_wait_events` when targeting Vulkan 1.3+.
16647 pub unsafe fn cmd_wait_events2(
16648 &self,
16649 command_buffer: CommandBuffer,
16650 p_events: &[Event],
16651 p_dependency_infos: &[DependencyInfo],
16652 ) {
16653 let fp = self
16654 .commands()
16655 .cmd_wait_events2
16656 .expect("vkCmdWaitEvents2 not loaded");
16657 unsafe {
16658 fp(
16659 command_buffer,
16660 p_events.len() as u32,
16661 p_events.as_ptr(),
16662 p_dependency_infos.as_ptr(),
16663 )
16664 };
16665 }
16666 ///Wraps [`vkCmdPipelineBarrier2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPipelineBarrier2.html).
16667 /**
16668 Provided by **VK_BASE_VERSION_1_3**.*/
16669 ///
16670 ///# Safety
16671 ///- `commandBuffer` (self) must be valid and not destroyed.
16672 ///- `commandBuffer` must be externally synchronized.
16673 ///
16674 ///# Panics
16675 ///Panics if `vkCmdPipelineBarrier2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16676 ///
16677 ///# Usage Notes
16678 ///
16679 ///Vulkan 1.3 version of `cmd_pipeline_barrier` that uses
16680 ///`DependencyInfo` with `MemoryBarrier2`, `BufferMemoryBarrier2`, and
16681 ///`ImageMemoryBarrier2` structs.
16682 ///
16683 ///The key improvement over the 1.0 version is that stage and access
16684 ///masks are specified **per barrier** rather than globally for the
16685 ///entire call. This gives the driver more precise dependency
16686 ///information, which can reduce unnecessary stalls.
16687 ///
16688 ///The 1.3 barrier structs also use 64-bit stage and access flags,
16689 ///supporting stages and access types that do not fit in the original
16690 ///32-bit fields (e.g. ray tracing, mesh shading).
16691 ///
16692 ///Prefer this over `cmd_pipeline_barrier` when targeting Vulkan 1.3+.
16693 pub unsafe fn cmd_pipeline_barrier2(
16694 &self,
16695 command_buffer: CommandBuffer,
16696 p_dependency_info: &DependencyInfo,
16697 ) {
16698 let fp = self
16699 .commands()
16700 .cmd_pipeline_barrier2
16701 .expect("vkCmdPipelineBarrier2 not loaded");
16702 unsafe { fp(command_buffer, p_dependency_info) };
16703 }
16704 ///Wraps [`vkQueueSubmit2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueSubmit2.html).
16705 /**
16706 Provided by **VK_BASE_VERSION_1_3**.*/
16707 ///
16708 ///# Errors
16709 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
16710 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
16711 ///- `VK_ERROR_DEVICE_LOST`
16712 ///- `VK_ERROR_UNKNOWN`
16713 ///- `VK_ERROR_VALIDATION_FAILED`
16714 ///
16715 ///# Safety
16716 ///- `queue` (self) must be valid and not destroyed.
16717 ///- `queue` must be externally synchronized.
16718 ///- `fence` must be externally synchronized.
16719 ///
16720 ///# Panics
16721 ///Panics if `vkQueueSubmit2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16722 ///
16723 ///# Usage Notes
16724 ///
16725 ///Vulkan 1.3 version of `queue_submit` that uses `SubmitInfo2` with
16726 ///per-semaphore stage masks and 64-bit pipeline stage flags.
16727 ///
16728 ///Key improvements over `queue_submit`:
16729 ///
16730 ///- **Per-semaphore stage masks**: each wait semaphore has its own
16731 /// stage mask in `SemaphoreSubmitInfo`, instead of a parallel array.
16732 /// Clearer and less error-prone.
16733 ///- **64-bit stages**: supports newer pipeline stages.
16734 ///- **Timeline semaphores**: timeline values are embedded in
16735 /// `SemaphoreSubmitInfo` instead of requiring a separate pNext
16736 /// chain.
16737 ///
16738 ///Prefer this over `queue_submit` when targeting Vulkan 1.3+. The
16739 ///fence parameter works identically.
16740 pub unsafe fn queue_submit2(
16741 &self,
16742 queue: Queue,
16743 p_submits: &[SubmitInfo2],
16744 fence: Fence,
16745 ) -> VkResult<()> {
16746 let fp = self
16747 .commands()
16748 .queue_submit2
16749 .expect("vkQueueSubmit2 not loaded");
16750 check(unsafe { fp(queue, p_submits.len() as u32, p_submits.as_ptr(), fence) })
16751 }
16752 ///Wraps [`vkCmdWriteTimestamp2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWriteTimestamp2.html).
16753 /**
16754 Provided by **VK_BASE_VERSION_1_3**.*/
16755 ///
16756 ///# Safety
16757 ///- `commandBuffer` (self) must be valid and not destroyed.
16758 ///- `commandBuffer` must be externally synchronized.
16759 ///
16760 ///# Panics
16761 ///Panics if `vkCmdWriteTimestamp2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16762 ///
16763 ///# Usage Notes
16764 ///
16765 ///Vulkan 1.3 version of `cmd_write_timestamp` that uses 64-bit
16766 ///pipeline stage flags (`PipelineStageFlags2`).
16767 ///
16768 ///The wider stage flags support newer stages like
16769 ///`PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_KHR` and
16770 ///`PIPELINE_STAGE_2_MESH_SHADER_BIT_EXT` that do not fit in the
16771 ///original 32-bit field.
16772 ///
16773 ///Prefer this over `cmd_write_timestamp` when targeting Vulkan 1.3+.
16774 pub unsafe fn cmd_write_timestamp2(
16775 &self,
16776 command_buffer: CommandBuffer,
16777 stage: PipelineStageFlags2,
16778 query_pool: QueryPool,
16779 query: u32,
16780 ) {
16781 let fp = self
16782 .commands()
16783 .cmd_write_timestamp2
16784 .expect("vkCmdWriteTimestamp2 not loaded");
16785 unsafe { fp(command_buffer, stage, query_pool, query) };
16786 }
16787 ///Wraps [`vkCmdWriteBufferMarker2AMD`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWriteBufferMarker2AMD.html).
16788 /**
16789 Provided by **VK_AMD_buffer_marker**.*/
16790 ///
16791 ///# Safety
16792 ///- `commandBuffer` (self) must be valid and not destroyed.
16793 ///- `commandBuffer` must be externally synchronized.
16794 ///
16795 ///# Panics
16796 ///Panics if `vkCmdWriteBufferMarker2AMD` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16797 ///
16798 ///# Usage Notes
16799 ///
16800 ///Extended version of `cmd_write_buffer_marker_amd` that uses
16801 ///`PipelineStageFlags2` for the stage mask. Supports the full
16802 ///synchronization2 stage flags.
16803 ///
16804 ///Requires `VK_AMD_buffer_marker` + `VK_KHR_synchronization2`.
16805 pub unsafe fn cmd_write_buffer_marker2_amd(
16806 &self,
16807 command_buffer: CommandBuffer,
16808 stage: PipelineStageFlags2,
16809 dst_buffer: Buffer,
16810 dst_offset: u64,
16811 marker: u32,
16812 ) {
16813 let fp = self
16814 .commands()
16815 .cmd_write_buffer_marker2_amd
16816 .expect("vkCmdWriteBufferMarker2AMD not loaded");
16817 unsafe { fp(command_buffer, stage, dst_buffer, dst_offset, marker) };
16818 }
16819 ///Wraps [`vkGetQueueCheckpointData2NV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetQueueCheckpointData2NV.html).
16820 /**
16821 Provided by **VK_NV_device_diagnostic_checkpoints**.*/
16822 ///
16823 ///# Safety
16824 ///- `queue` (self) must be valid and not destroyed.
16825 ///
16826 ///# Panics
16827 ///Panics if `vkGetQueueCheckpointData2NV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16828 ///
16829 ///# Usage Notes
16830 ///
16831 ///Extended version of `get_queue_checkpoint_data_nv` that returns
16832 ///pipeline stage information alongside the checkpoint markers.
16833 ///Use for finer-grained post-mortem debugging after device loss.
16834 ///
16835 ///Requires `VK_NV_device_diagnostic_checkpoints` +
16836 ///`VK_KHR_synchronization2`.
16837 pub unsafe fn get_queue_checkpoint_data2_nv(&self, queue: Queue) -> Vec<CheckpointData2NV> {
16838 let fp = self
16839 .commands()
16840 .get_queue_checkpoint_data2_nv
16841 .expect("vkGetQueueCheckpointData2NV not loaded");
16842 fill_two_call(|count, data| unsafe { fp(queue, count, data) })
16843 }
16844 ///Wraps [`vkCopyMemoryToImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCopyMemoryToImage.html).
16845 /**
16846 Provided by **VK_BASE_VERSION_1_4**.*/
16847 ///
16848 ///# Errors
16849 ///- `VK_ERROR_INITIALIZATION_FAILED`
16850 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
16851 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
16852 ///- `VK_ERROR_MEMORY_MAP_FAILED`
16853 ///- `VK_ERROR_UNKNOWN`
16854 ///- `VK_ERROR_VALIDATION_FAILED`
16855 ///
16856 ///# Safety
16857 ///- `device` (self) must be valid and not destroyed.
16858 ///
16859 ///# Panics
16860 ///Panics if `vkCopyMemoryToImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16861 ///
16862 ///# Usage Notes
16863 ///
16864 ///Vulkan 1.4 host-side image upload. Copies texel data from a host
16865 ///memory pointer directly into an image without a staging buffer or
16866 ///command buffer.
16867 ///
16868 ///The image must be in `GENERAL` layout and must have been created
16869 ///with `HOST_TRANSFER` usage. The copy happens synchronously.
16870 ///
16871 ///This simplifies upload workflows that previously required a staging
16872 ///buffer + `cmd_copy_buffer_to_image` + layout transitions. However,
16873 ///the image must support host transfer and be in `GENERAL` layout,
16874 ///which may not be optimal for subsequent GPU reads.
16875 pub unsafe fn copy_memory_to_image(
16876 &self,
16877 p_copy_memory_to_image_info: &CopyMemoryToImageInfo,
16878 ) -> VkResult<()> {
16879 let fp = self
16880 .commands()
16881 .copy_memory_to_image
16882 .expect("vkCopyMemoryToImage not loaded");
16883 check(unsafe { fp(self.handle(), p_copy_memory_to_image_info) })
16884 }
16885 ///Wraps [`vkCopyImageToMemory`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCopyImageToMemory.html).
16886 /**
16887 Provided by **VK_BASE_VERSION_1_4**.*/
16888 ///
16889 ///# Errors
16890 ///- `VK_ERROR_INITIALIZATION_FAILED`
16891 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
16892 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
16893 ///- `VK_ERROR_MEMORY_MAP_FAILED`
16894 ///- `VK_ERROR_UNKNOWN`
16895 ///- `VK_ERROR_VALIDATION_FAILED`
16896 ///
16897 ///# Safety
16898 ///- `device` (self) must be valid and not destroyed.
16899 ///
16900 ///# Panics
16901 ///Panics if `vkCopyImageToMemory` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16902 ///
16903 ///# Usage Notes
16904 ///
16905 ///Vulkan 1.4 host-side image readback. Copies texel data from an
16906 ///image directly to a host memory pointer without a staging buffer or
16907 ///command buffer.
16908 ///
16909 ///The image must be in `GENERAL` layout and must have been created
16910 ///with `HOST_TRANSFER` usage. The copy happens synchronously.
16911 ///
16912 ///This simplifies CPU readback workflows that previously required a
16913 ///staging buffer + `cmd_copy_image_to_buffer` + fence wait + map.
16914 ///However, it requires the image to support host transfer, which not
16915 ///all implementations or formats support.
16916 pub unsafe fn copy_image_to_memory(
16917 &self,
16918 p_copy_image_to_memory_info: &CopyImageToMemoryInfo,
16919 ) -> VkResult<()> {
16920 let fp = self
16921 .commands()
16922 .copy_image_to_memory
16923 .expect("vkCopyImageToMemory not loaded");
16924 check(unsafe { fp(self.handle(), p_copy_image_to_memory_info) })
16925 }
16926 ///Wraps [`vkCopyImageToImage`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCopyImageToImage.html).
16927 /**
16928 Provided by **VK_BASE_VERSION_1_4**.*/
16929 ///
16930 ///# Errors
16931 ///- `VK_ERROR_INITIALIZATION_FAILED`
16932 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
16933 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
16934 ///- `VK_ERROR_MEMORY_MAP_FAILED`
16935 ///- `VK_ERROR_UNKNOWN`
16936 ///- `VK_ERROR_VALIDATION_FAILED`
16937 ///
16938 ///# Safety
16939 ///- `device` (self) must be valid and not destroyed.
16940 ///
16941 ///# Panics
16942 ///Panics if `vkCopyImageToImage` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16943 ///
16944 ///# Usage Notes
16945 ///
16946 ///Vulkan 1.4 host-side image-to-image copy. Copies texel data between
16947 ///two images from the CPU without recording a command buffer.
16948 ///
16949 ///Both images must be in `GENERAL` layout and must have been created
16950 ///with `HOST_TRANSFER` usage. The copy happens synchronously on the
16951 ///calling thread.
16952 ///
16953 ///Use cases are limited to CPU-side image manipulation (e.g. test
16954 ///utilities, offline processing). For GPU-side copies in a render
16955 ///loop, `cmd_copy_image2` is the standard path.
16956 pub unsafe fn copy_image_to_image(
16957 &self,
16958 p_copy_image_to_image_info: &CopyImageToImageInfo,
16959 ) -> VkResult<()> {
16960 let fp = self
16961 .commands()
16962 .copy_image_to_image
16963 .expect("vkCopyImageToImage not loaded");
16964 check(unsafe { fp(self.handle(), p_copy_image_to_image_info) })
16965 }
16966 ///Wraps [`vkTransitionImageLayout`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkTransitionImageLayout.html).
16967 /**
16968 Provided by **VK_BASE_VERSION_1_4**.*/
16969 ///
16970 ///# Errors
16971 ///- `VK_ERROR_INITIALIZATION_FAILED`
16972 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
16973 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
16974 ///- `VK_ERROR_MEMORY_MAP_FAILED`
16975 ///- `VK_ERROR_UNKNOWN`
16976 ///- `VK_ERROR_VALIDATION_FAILED`
16977 ///
16978 ///# Safety
16979 ///- `device` (self) must be valid and not destroyed.
16980 ///
16981 ///# Panics
16982 ///Panics if `vkTransitionImageLayout` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
16983 ///
16984 ///# Usage Notes
16985 ///
16986 ///Vulkan 1.4 host-side image layout transition. Transitions an image
16987 ///between layouts from the CPU without recording a command buffer.
16988 ///
16989 ///The image must have been created with `HOST_TRANSFER` usage. The
16990 ///transition happens synchronously on the calling thread.
16991 ///
16992 ///This simplifies workflows where you need to transition an image
16993 ///layout outside of a command buffer, for example, transitioning a
16994 ///newly created host-transfer image from `UNDEFINED` to `GENERAL`
16995 ///before performing host-side copies.
16996 ///
16997 ///For GPU-side layout transitions (the common case), use
16998 ///`cmd_pipeline_barrier2` with an image memory barrier.
16999 pub unsafe fn transition_image_layout(
17000 &self,
17001 p_transitions: &[HostImageLayoutTransitionInfo],
17002 ) -> VkResult<()> {
17003 let fp = self
17004 .commands()
17005 .transition_image_layout
17006 .expect("vkTransitionImageLayout not loaded");
17007 check(unsafe {
17008 fp(
17009 self.handle(),
17010 p_transitions.len() as u32,
17011 p_transitions.as_ptr(),
17012 )
17013 })
17014 }
17015 ///Wraps [`vkGetCommandPoolMemoryConsumption`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetCommandPoolMemoryConsumption.html).
17016 /**
17017 Provided by **VKSC_VERSION_1_0**.*/
17018 ///
17019 ///# Safety
17020 ///- `device` (self) must be valid and not destroyed.
17021 ///- `commandPool` must be externally synchronized.
17022 ///- `commandBuffer` must be externally synchronized.
17023 ///
17024 ///# Panics
17025 ///Panics if `vkGetCommandPoolMemoryConsumption` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17026 ///
17027 ///# Usage Notes
17028 ///
17029 ///Queries the memory consumption of a command pool or a specific
17030 ///command buffer within it. Part of Vulkan SC (Safety Critical)
17031 ///for tracking resource budgets in safety-certified environments.
17032 ///Pass a null command buffer to query the entire pool.
17033 ///
17034 ///Requires Vulkan SC.
17035 pub unsafe fn get_command_pool_memory_consumption(
17036 &self,
17037 command_pool: CommandPool,
17038 command_buffer: CommandBuffer,
17039 p_consumption: &mut CommandPoolMemoryConsumption,
17040 ) {
17041 let fp = self
17042 .commands()
17043 .get_command_pool_memory_consumption
17044 .expect("vkGetCommandPoolMemoryConsumption not loaded");
17045 unsafe { fp(self.handle(), command_pool, command_buffer, p_consumption) };
17046 }
17047 ///Wraps [`vkCreateVideoSessionKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateVideoSessionKHR.html).
17048 /**
17049 Provided by **VK_KHR_video_queue**.*/
17050 ///
17051 ///# Errors
17052 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
17053 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
17054 ///- `VK_ERROR_INITIALIZATION_FAILED`
17055 ///- `VK_ERROR_VIDEO_STD_VERSION_NOT_SUPPORTED_KHR`
17056 ///- `VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR`
17057 ///- `VK_ERROR_UNKNOWN`
17058 ///- `VK_ERROR_VALIDATION_FAILED`
17059 ///
17060 ///# Safety
17061 ///- `device` (self) must be valid and not destroyed.
17062 ///
17063 ///# Panics
17064 ///Panics if `vkCreateVideoSessionKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17065 ///
17066 ///# Usage Notes
17067 ///
17068 ///Creates a video session for hardware-accelerated video decoding
17069 ///or encoding. The session defines the video codec profile,
17070 ///resolution range, format, and maximum reference picture count.
17071 ///
17072 ///Key fields in `VideoSessionCreateInfoKHR`:
17073 ///
17074 ///- `video_profile`: codec (H.264, H.265, AV1) and profile/level.
17075 ///- `max_coded_extent`: maximum frame resolution.
17076 ///- `picture_format` / `reference_picture_format`: image formats
17077 /// for decoded pictures and DPB (decoded picture buffer) slots.
17078 ///- `max_dpb_slots` / `max_active_reference_pictures`: reference
17079 /// frame capacity.
17080 ///
17081 ///After creation, query memory requirements with
17082 ///`get_video_session_memory_requirements_khr`, allocate and bind
17083 ///memory with `bind_video_session_memory_khr`, then create session
17084 ///parameters with `create_video_session_parameters_khr`.
17085 pub unsafe fn create_video_session_khr(
17086 &self,
17087 p_create_info: &VideoSessionCreateInfoKHR,
17088 allocator: Option<&AllocationCallbacks>,
17089 ) -> VkResult<VideoSessionKHR> {
17090 let fp = self
17091 .commands()
17092 .create_video_session_khr
17093 .expect("vkCreateVideoSessionKHR not loaded");
17094 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
17095 let mut out = unsafe { core::mem::zeroed() };
17096 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
17097 Ok(out)
17098 }
17099 ///Wraps [`vkDestroyVideoSessionKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyVideoSessionKHR.html).
17100 /**
17101 Provided by **VK_KHR_video_queue**.*/
17102 ///
17103 ///# Safety
17104 ///- `device` (self) must be valid and not destroyed.
17105 ///- `videoSession` must be externally synchronized.
17106 ///
17107 ///# Panics
17108 ///Panics if `vkDestroyVideoSessionKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17109 ///
17110 ///# Usage Notes
17111 ///
17112 ///Destroys a video session and releases its internal resources.
17113 ///Any video session parameters created against this session become
17114 ///invalid, destroy them first.
17115 ///
17116 ///All command buffers referencing this session must have completed
17117 ///execution before destruction.
17118 pub unsafe fn destroy_video_session_khr(
17119 &self,
17120 video_session: VideoSessionKHR,
17121 allocator: Option<&AllocationCallbacks>,
17122 ) {
17123 let fp = self
17124 .commands()
17125 .destroy_video_session_khr
17126 .expect("vkDestroyVideoSessionKHR not loaded");
17127 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
17128 unsafe { fp(self.handle(), video_session, alloc_ptr) };
17129 }
17130 ///Wraps [`vkCreateVideoSessionParametersKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateVideoSessionParametersKHR.html).
17131 /**
17132 Provided by **VK_KHR_video_queue**.*/
17133 ///
17134 ///# Errors
17135 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
17136 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
17137 ///- `VK_ERROR_INITIALIZATION_FAILED`
17138 ///- `VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR`
17139 ///- `VK_ERROR_UNKNOWN`
17140 ///- `VK_ERROR_VALIDATION_FAILED`
17141 ///
17142 ///# Safety
17143 ///- `device` (self) must be valid and not destroyed.
17144 ///
17145 ///# Panics
17146 ///Panics if `vkCreateVideoSessionParametersKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17147 ///
17148 ///# Usage Notes
17149 ///
17150 ///Creates a video session parameters object that holds codec-specific
17151 ///parameter sets (SPS, PPS for H.264/H.265, sequence headers for
17152 ///AV1). These are referenced during decode/encode operations.
17153 ///
17154 ///Chain the appropriate codec-specific struct into `pNext`:
17155 ///
17156 ///- `VideoDecodeH264SessionParametersCreateInfoKHR` for H.264 decode.
17157 ///- `VideoDecodeH265SessionParametersCreateInfoKHR` for H.265 decode.
17158 ///- `VideoEncodeH264SessionParametersCreateInfoKHR` for H.264 encode.
17159 ///
17160 ///Parameters can be added incrementally with
17161 ///`update_video_session_parameters_khr`. A template parameter object
17162 ///can be specified to inherit existing parameters.
17163 pub unsafe fn create_video_session_parameters_khr(
17164 &self,
17165 p_create_info: &VideoSessionParametersCreateInfoKHR,
17166 allocator: Option<&AllocationCallbacks>,
17167 ) -> VkResult<VideoSessionParametersKHR> {
17168 let fp = self
17169 .commands()
17170 .create_video_session_parameters_khr
17171 .expect("vkCreateVideoSessionParametersKHR not loaded");
17172 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
17173 let mut out = unsafe { core::mem::zeroed() };
17174 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
17175 Ok(out)
17176 }
17177 ///Wraps [`vkUpdateVideoSessionParametersKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkUpdateVideoSessionParametersKHR.html).
17178 /**
17179 Provided by **VK_KHR_video_queue**.*/
17180 ///
17181 ///# Errors
17182 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
17183 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
17184 ///- `VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR`
17185 ///- `VK_ERROR_UNKNOWN`
17186 ///- `VK_ERROR_VALIDATION_FAILED`
17187 ///
17188 ///# Safety
17189 ///- `device` (self) must be valid and not destroyed.
17190 ///
17191 ///# Panics
17192 ///Panics if `vkUpdateVideoSessionParametersKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17193 ///
17194 ///# Usage Notes
17195 ///
17196 ///Adds new codec-specific parameter sets to an existing video
17197 ///session parameters object. For example, adding new SPS/PPS
17198 ///entries for H.264 as they are encountered in the bitstream.
17199 ///
17200 ///Chain the codec-specific update struct into the `pNext` of
17201 ///`VideoSessionParametersUpdateInfoKHR`. The `update_sequence_count`
17202 ///must increment monotonically with each update.
17203 ///
17204 ///Parameters cannot be removed or modified, only new entries can
17205 ///be added. If a parameter set with the same ID already exists,
17206 ///the update fails.
17207 pub unsafe fn update_video_session_parameters_khr(
17208 &self,
17209 video_session_parameters: VideoSessionParametersKHR,
17210 p_update_info: &VideoSessionParametersUpdateInfoKHR,
17211 ) -> VkResult<()> {
17212 let fp = self
17213 .commands()
17214 .update_video_session_parameters_khr
17215 .expect("vkUpdateVideoSessionParametersKHR not loaded");
17216 check(unsafe { fp(self.handle(), video_session_parameters, p_update_info) })
17217 }
17218 ///Wraps [`vkGetEncodedVideoSessionParametersKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetEncodedVideoSessionParametersKHR.html).
17219 /**
17220 Provided by **VK_KHR_video_encode_queue**.*/
17221 ///
17222 ///# Errors
17223 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
17224 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
17225 ///- `VK_ERROR_UNKNOWN`
17226 ///- `VK_ERROR_VALIDATION_FAILED`
17227 ///
17228 ///# Safety
17229 ///- `device` (self) must be valid and not destroyed.
17230 ///
17231 ///# Panics
17232 ///Panics if `vkGetEncodedVideoSessionParametersKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17233 ///
17234 ///# Usage Notes
17235 ///
17236 ///Retrieves the encoded (serialized) form of video session
17237 ///parameters, typically codec headers (SPS/PPS for H.264/H.265,
17238 ///sequence header for AV1) that must be prepended to the encoded
17239 ///bitstream.
17240 ///
17241 ///Uses the two-call pattern: call with null `p_data` to query
17242 ///the size, allocate, then call again to fill the buffer.
17243 ///
17244 ///The `p_feedback_info` output indicates whether the driver
17245 ///modified or overrode any parameters relative to what was
17246 ///requested (check `has_overrides`).
17247 ///
17248 ///This data is the codec parameter payload that decoders need to
17249 ///initialize before processing encoded frames.
17250 pub unsafe fn get_encoded_video_session_parameters_khr(
17251 &self,
17252 p_video_session_parameters_info: &VideoEncodeSessionParametersGetInfoKHR,
17253 p_feedback_info: &mut VideoEncodeSessionParametersFeedbackInfoKHR,
17254 p_data: *mut core::ffi::c_void,
17255 ) -> VkResult<usize> {
17256 let fp = self
17257 .commands()
17258 .get_encoded_video_session_parameters_khr
17259 .expect("vkGetEncodedVideoSessionParametersKHR not loaded");
17260 let mut out = unsafe { core::mem::zeroed() };
17261 check(unsafe {
17262 fp(
17263 self.handle(),
17264 p_video_session_parameters_info,
17265 p_feedback_info,
17266 &mut out,
17267 p_data,
17268 )
17269 })?;
17270 Ok(out)
17271 }
17272 ///Wraps [`vkDestroyVideoSessionParametersKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyVideoSessionParametersKHR.html).
17273 /**
17274 Provided by **VK_KHR_video_queue**.*/
17275 ///
17276 ///# Safety
17277 ///- `device` (self) must be valid and not destroyed.
17278 ///- `videoSessionParameters` must be externally synchronized.
17279 ///
17280 ///# Panics
17281 ///Panics if `vkDestroyVideoSessionParametersKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17282 ///
17283 ///# Usage Notes
17284 ///
17285 ///Destroys a video session parameters object. All command buffers
17286 ///referencing these parameters must have completed execution before
17287 ///destruction.
17288 ///
17289 ///The video session itself is not affected, other parameter objects
17290 ///associated with the same session remain valid.
17291 pub unsafe fn destroy_video_session_parameters_khr(
17292 &self,
17293 video_session_parameters: VideoSessionParametersKHR,
17294 allocator: Option<&AllocationCallbacks>,
17295 ) {
17296 let fp = self
17297 .commands()
17298 .destroy_video_session_parameters_khr
17299 .expect("vkDestroyVideoSessionParametersKHR not loaded");
17300 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
17301 unsafe { fp(self.handle(), video_session_parameters, alloc_ptr) };
17302 }
17303 ///Wraps [`vkGetVideoSessionMemoryRequirementsKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetVideoSessionMemoryRequirementsKHR.html).
17304 /**
17305 Provided by **VK_KHR_video_queue**.*/
17306 ///
17307 ///# Errors
17308 ///- `VK_ERROR_UNKNOWN`
17309 ///- `VK_ERROR_VALIDATION_FAILED`
17310 ///
17311 ///# Safety
17312 ///- `device` (self) must be valid and not destroyed.
17313 ///
17314 ///# Panics
17315 ///Panics if `vkGetVideoSessionMemoryRequirementsKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17316 ///
17317 ///# Usage Notes
17318 ///
17319 ///Queries the memory requirements for a video session. A video
17320 ///session may require multiple memory bindings (each with different
17321 ///memory type requirements) for internal buffers used during
17322 ///decode/encode.
17323 ///
17324 ///Each returned `VideoSessionMemoryRequirementsKHR` has a
17325 ///`memory_bind_index` and a `MemoryRequirements` describing the
17326 ///size, alignment, and compatible memory types.
17327 ///
17328 ///Allocate a `DeviceMemory` for each requirement and bind them all
17329 ///with `bind_video_session_memory_khr` before using the session.
17330 pub unsafe fn get_video_session_memory_requirements_khr(
17331 &self,
17332 video_session: VideoSessionKHR,
17333 ) -> VkResult<Vec<VideoSessionMemoryRequirementsKHR>> {
17334 let fp = self
17335 .commands()
17336 .get_video_session_memory_requirements_khr
17337 .expect("vkGetVideoSessionMemoryRequirementsKHR not loaded");
17338 enumerate_two_call(|count, data| unsafe { fp(self.handle(), video_session, count, data) })
17339 }
17340 ///Wraps [`vkBindVideoSessionMemoryKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBindVideoSessionMemoryKHR.html).
17341 /**
17342 Provided by **VK_KHR_video_queue**.*/
17343 ///
17344 ///# Errors
17345 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
17346 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
17347 ///- `VK_ERROR_UNKNOWN`
17348 ///- `VK_ERROR_VALIDATION_FAILED`
17349 ///
17350 ///# Safety
17351 ///- `device` (self) must be valid and not destroyed.
17352 ///- `videoSession` must be externally synchronized.
17353 ///
17354 ///# Panics
17355 ///Panics if `vkBindVideoSessionMemoryKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17356 ///
17357 ///# Usage Notes
17358 ///
17359 ///Binds device memory to a video session. Each binding corresponds
17360 ///to a `memory_bind_index` from
17361 ///`get_video_session_memory_requirements_khr`.
17362 ///
17363 ///All required memory bindings must be satisfied before the session
17364 ///can be used in video coding operations. Each
17365 ///`BindVideoSessionMemoryInfoKHR` specifies the bind index, memory
17366 ///object, offset, and size.
17367 ///
17368 ///Memory can only be bound once per index, rebinding is not
17369 ///allowed.
17370 pub unsafe fn bind_video_session_memory_khr(
17371 &self,
17372 video_session: VideoSessionKHR,
17373 p_bind_session_memory_infos: &[BindVideoSessionMemoryInfoKHR],
17374 ) -> VkResult<()> {
17375 let fp = self
17376 .commands()
17377 .bind_video_session_memory_khr
17378 .expect("vkBindVideoSessionMemoryKHR not loaded");
17379 check(unsafe {
17380 fp(
17381 self.handle(),
17382 video_session,
17383 p_bind_session_memory_infos.len() as u32,
17384 p_bind_session_memory_infos.as_ptr(),
17385 )
17386 })
17387 }
17388 ///Wraps [`vkCmdDecodeVideoKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDecodeVideoKHR.html).
17389 /**
17390 Provided by **VK_KHR_video_decode_queue**.*/
17391 ///
17392 ///# Safety
17393 ///- `commandBuffer` (self) must be valid and not destroyed.
17394 ///- `commandBuffer` must be externally synchronized.
17395 ///
17396 ///# Panics
17397 ///Panics if `vkCmdDecodeVideoKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17398 ///
17399 ///# Usage Notes
17400 ///
17401 ///Decodes a single video frame from a compressed bitstream.
17402 ///Must be recorded within a video coding scope
17403 ///(`cmd_begin_video_coding_khr` / `cmd_end_video_coding_khr`).
17404 ///
17405 ///`VideoDecodeInfoKHR` specifies:
17406 ///
17407 ///- `src_buffer` / `src_buffer_offset` / `src_buffer_range`: the
17408 /// bitstream data containing the compressed frame.
17409 ///- `dst_picture_resource`: the output image view for the decoded
17410 /// frame.
17411 ///- `setup_reference_slot`: DPB slot to store this frame for use
17412 /// as a reference by future frames.
17413 ///- `reference_slots`: previously decoded reference frames needed
17414 /// to decode this frame.
17415 ///
17416 ///Chain codec-specific decode info (e.g.,
17417 ///`VideoDecodeH264PictureInfoKHR`) into `pNext`.
17418 pub unsafe fn cmd_decode_video_khr(
17419 &self,
17420 command_buffer: CommandBuffer,
17421 p_decode_info: &VideoDecodeInfoKHR,
17422 ) {
17423 let fp = self
17424 .commands()
17425 .cmd_decode_video_khr
17426 .expect("vkCmdDecodeVideoKHR not loaded");
17427 unsafe { fp(command_buffer, p_decode_info) };
17428 }
17429 ///Wraps [`vkCmdBeginVideoCodingKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginVideoCodingKHR.html).
17430 /**
17431 Provided by **VK_KHR_video_queue**.*/
17432 ///
17433 ///# Safety
17434 ///- `commandBuffer` (self) must be valid and not destroyed.
17435 ///- `commandBuffer` must be externally synchronized.
17436 ///
17437 ///# Panics
17438 ///Panics if `vkCmdBeginVideoCodingKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17439 ///
17440 ///# Usage Notes
17441 ///
17442 ///Begins a video coding scope within a command buffer. All video
17443 ///decode and encode commands must be recorded between
17444 ///`cmd_begin_video_coding_khr` and `cmd_end_video_coding_khr`.
17445 ///
17446 ///`VideoBeginCodingInfoKHR` specifies:
17447 ///
17448 ///- `video_session`: the session to use.
17449 ///- `video_session_parameters`: codec parameters (SPS/PPS, etc.).
17450 ///- `reference_slots`: DPB (decoded picture buffer) slots and their
17451 /// associated image views for reference pictures.
17452 ///
17453 ///The command buffer must be allocated from a queue family that
17454 ///supports the appropriate video operations (decode or encode),
17455 ///as reported by `QueueFamilyVideoPropertiesKHR`.
17456 pub unsafe fn cmd_begin_video_coding_khr(
17457 &self,
17458 command_buffer: CommandBuffer,
17459 p_begin_info: &VideoBeginCodingInfoKHR,
17460 ) {
17461 let fp = self
17462 .commands()
17463 .cmd_begin_video_coding_khr
17464 .expect("vkCmdBeginVideoCodingKHR not loaded");
17465 unsafe { fp(command_buffer, p_begin_info) };
17466 }
17467 ///Wraps [`vkCmdControlVideoCodingKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdControlVideoCodingKHR.html).
17468 /**
17469 Provided by **VK_KHR_video_queue**.*/
17470 ///
17471 ///# Safety
17472 ///- `commandBuffer` (self) must be valid and not destroyed.
17473 ///- `commandBuffer` must be externally synchronized.
17474 ///
17475 ///# Panics
17476 ///Panics if `vkCmdControlVideoCodingKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17477 ///
17478 ///# Usage Notes
17479 ///
17480 ///Issues control commands within a video coding scope. Used to
17481 ///reset the video session state or set encode quality/rate control
17482 ///parameters.
17483 ///
17484 ///`VideoCodingControlInfoKHR` flags include:
17485 ///
17486 ///- `RESET`: resets the video session to a clean state, clearing
17487 /// all DPB slots and internal codec state.
17488 ///- `ENCODE_RATE_CONTROL`: applies rate control settings (chain
17489 /// `VideoEncodeRateControlInfoKHR` into `pNext`).
17490 ///- `ENCODE_QUALITY_LEVEL`: sets the encode quality level.
17491 ///
17492 ///Must be recorded between `cmd_begin_video_coding_khr` and
17493 ///`cmd_end_video_coding_khr`.
17494 pub unsafe fn cmd_control_video_coding_khr(
17495 &self,
17496 command_buffer: CommandBuffer,
17497 p_coding_control_info: &VideoCodingControlInfoKHR,
17498 ) {
17499 let fp = self
17500 .commands()
17501 .cmd_control_video_coding_khr
17502 .expect("vkCmdControlVideoCodingKHR not loaded");
17503 unsafe { fp(command_buffer, p_coding_control_info) };
17504 }
17505 ///Wraps [`vkCmdEndVideoCodingKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndVideoCodingKHR.html).
17506 /**
17507 Provided by **VK_KHR_video_queue**.*/
17508 ///
17509 ///# Safety
17510 ///- `commandBuffer` (self) must be valid and not destroyed.
17511 ///- `commandBuffer` must be externally synchronized.
17512 ///
17513 ///# Panics
17514 ///Panics if `vkCmdEndVideoCodingKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17515 ///
17516 ///# Usage Notes
17517 ///
17518 ///Ends a video coding scope previously started with
17519 ///`cmd_begin_video_coding_khr`. After this call, video decode and
17520 ///encode commands can no longer be recorded until a new scope is
17521 ///started.
17522 ///
17523 ///The `VideoEndCodingInfoKHR` struct is currently reserved for
17524 ///future use (no flags defined).
17525 pub unsafe fn cmd_end_video_coding_khr(
17526 &self,
17527 command_buffer: CommandBuffer,
17528 p_end_coding_info: &VideoEndCodingInfoKHR,
17529 ) {
17530 let fp = self
17531 .commands()
17532 .cmd_end_video_coding_khr
17533 .expect("vkCmdEndVideoCodingKHR not loaded");
17534 unsafe { fp(command_buffer, p_end_coding_info) };
17535 }
17536 ///Wraps [`vkCmdEncodeVideoKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEncodeVideoKHR.html).
17537 /**
17538 Provided by **VK_KHR_video_encode_queue**.*/
17539 ///
17540 ///# Safety
17541 ///- `commandBuffer` (self) must be valid and not destroyed.
17542 ///- `commandBuffer` must be externally synchronized.
17543 ///
17544 ///# Panics
17545 ///Panics if `vkCmdEncodeVideoKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17546 ///
17547 ///# Usage Notes
17548 ///
17549 ///Encodes a single video frame into a compressed bitstream.
17550 ///Must be recorded within a video coding scope
17551 ///(`cmd_begin_video_coding_khr` / `cmd_end_video_coding_khr`).
17552 ///
17553 ///`VideoEncodeInfoKHR` specifies:
17554 ///
17555 ///- `dst_buffer` / `dst_buffer_offset` / `dst_buffer_range`: where
17556 /// to write the compressed output.
17557 ///- `src_picture_resource`: the input image view to encode.
17558 ///- `setup_reference_slot`: DPB slot to store the reconstructed
17559 /// frame for future reference.
17560 ///- `reference_slots`: reference frames for inter-prediction.
17561 ///
17562 ///Chain codec-specific encode info (e.g.,
17563 ///`VideoEncodeH264PictureInfoKHR`) into `pNext`. Configure rate
17564 ///control beforehand with `cmd_control_video_coding_khr`.
17565 pub unsafe fn cmd_encode_video_khr(
17566 &self,
17567 command_buffer: CommandBuffer,
17568 p_encode_info: &VideoEncodeInfoKHR,
17569 ) {
17570 let fp = self
17571 .commands()
17572 .cmd_encode_video_khr
17573 .expect("vkCmdEncodeVideoKHR not loaded");
17574 unsafe { fp(command_buffer, p_encode_info) };
17575 }
17576 ///Wraps [`vkCmdDecompressMemoryNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDecompressMemoryNV.html).
17577 /**
17578 Provided by **VK_NV_memory_decompression**.*/
17579 ///
17580 ///# Safety
17581 ///- `commandBuffer` (self) must be valid and not destroyed.
17582 ///- `commandBuffer` must be externally synchronized.
17583 ///
17584 ///# Panics
17585 ///Panics if `vkCmdDecompressMemoryNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17586 ///
17587 ///# Usage Notes
17588 ///
17589 ///Decompresses one or more memory regions on the GPU. Each region
17590 ///specifies source, destination, size, and decompression method.
17591 ///
17592 ///Requires `VK_NV_memory_decompression`.
17593 pub unsafe fn cmd_decompress_memory_nv(
17594 &self,
17595 command_buffer: CommandBuffer,
17596 p_decompress_memory_regions: &[DecompressMemoryRegionNV],
17597 ) {
17598 let fp = self
17599 .commands()
17600 .cmd_decompress_memory_nv
17601 .expect("vkCmdDecompressMemoryNV not loaded");
17602 unsafe {
17603 fp(
17604 command_buffer,
17605 p_decompress_memory_regions.len() as u32,
17606 p_decompress_memory_regions.as_ptr(),
17607 )
17608 };
17609 }
17610 ///Wraps [`vkCmdDecompressMemoryIndirectCountNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDecompressMemoryIndirectCountNV.html).
17611 /**
17612 Provided by **VK_NV_memory_decompression**.*/
17613 ///
17614 ///# Safety
17615 ///- `commandBuffer` (self) must be valid and not destroyed.
17616 ///- `commandBuffer` must be externally synchronized.
17617 ///
17618 ///# Panics
17619 ///Panics if `vkCmdDecompressMemoryIndirectCountNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17620 ///
17621 ///# Usage Notes
17622 ///
17623 ///Indirect-count variant of `cmd_decompress_memory_nv`. Reads the
17624 ///decompression region descriptors and count from GPU buffer
17625 ///addresses, enabling fully GPU-driven decompression.
17626 ///
17627 ///Requires `VK_NV_memory_decompression`.
17628 pub unsafe fn cmd_decompress_memory_indirect_count_nv(
17629 &self,
17630 command_buffer: CommandBuffer,
17631 indirect_commands_address: u64,
17632 indirect_commands_count_address: u64,
17633 stride: u32,
17634 ) {
17635 let fp = self
17636 .commands()
17637 .cmd_decompress_memory_indirect_count_nv
17638 .expect("vkCmdDecompressMemoryIndirectCountNV not loaded");
17639 unsafe {
17640 fp(
17641 command_buffer,
17642 indirect_commands_address,
17643 indirect_commands_count_address,
17644 stride,
17645 )
17646 };
17647 }
17648 ///Wraps [`vkGetPartitionedAccelerationStructuresBuildSizesNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPartitionedAccelerationStructuresBuildSizesNV.html).
17649 /**
17650 Provided by **VK_NV_partitioned_acceleration_structure**.*/
17651 ///
17652 ///# Safety
17653 ///- `device` (self) must be valid and not destroyed.
17654 ///
17655 ///# Panics
17656 ///Panics if `vkGetPartitionedAccelerationStructuresBuildSizesNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17657 ///
17658 ///# Usage Notes
17659 ///
17660 ///Queries the buffer sizes needed to build a partitioned
17661 ///acceleration structure. Use the returned sizes to allocate
17662 ///destination and scratch buffers.
17663 ///
17664 ///Requires `VK_NV_partitioned_acceleration_structure`.
17665 pub unsafe fn get_partitioned_acceleration_structures_build_sizes_nv(
17666 &self,
17667 p_info: &PartitionedAccelerationStructureInstancesInputNV,
17668 p_size_info: &mut AccelerationStructureBuildSizesInfoKHR,
17669 ) {
17670 let fp = self
17671 .commands()
17672 .get_partitioned_acceleration_structures_build_sizes_nv
17673 .expect("vkGetPartitionedAccelerationStructuresBuildSizesNV not loaded");
17674 unsafe { fp(self.handle(), p_info, p_size_info) };
17675 }
17676 ///Wraps [`vkCmdBuildPartitionedAccelerationStructuresNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBuildPartitionedAccelerationStructuresNV.html).
17677 /**
17678 Provided by **VK_NV_partitioned_acceleration_structure**.*/
17679 ///
17680 ///# Safety
17681 ///- `commandBuffer` (self) must be valid and not destroyed.
17682 ///- `commandBuffer` must be externally synchronized.
17683 ///
17684 ///# Panics
17685 ///Panics if `vkCmdBuildPartitionedAccelerationStructuresNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17686 ///
17687 ///# Usage Notes
17688 ///
17689 ///Builds a partitioned acceleration structure where instances are
17690 ///grouped into independently updatable partitions. This allows
17691 ///updating subsets of the TLAS without rebuilding the entire
17692 ///structure.
17693 ///
17694 ///Requires `VK_NV_partitioned_acceleration_structure`.
17695 pub unsafe fn cmd_build_partitioned_acceleration_structures_nv(
17696 &self,
17697 command_buffer: CommandBuffer,
17698 p_build_info: &BuildPartitionedAccelerationStructureInfoNV,
17699 ) {
17700 let fp = self
17701 .commands()
17702 .cmd_build_partitioned_acceleration_structures_nv
17703 .expect("vkCmdBuildPartitionedAccelerationStructuresNV not loaded");
17704 unsafe { fp(command_buffer, p_build_info) };
17705 }
17706 ///Wraps [`vkCmdDecompressMemoryEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDecompressMemoryEXT.html).
17707 /**
17708 Provided by **VK_EXT_memory_decompression**.*/
17709 ///
17710 ///# Safety
17711 ///- `commandBuffer` (self) must be valid and not destroyed.
17712 ///- `commandBuffer` must be externally synchronized.
17713 ///
17714 ///# Panics
17715 ///Panics if `vkCmdDecompressMemoryEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17716 ///
17717 ///# Usage Notes
17718 ///
17719 ///Decompresses data from one memory region into another on the GPU.
17720 ///The decompression algorithm is specified in the info structure.
17721 ///
17722 ///Useful for loading compressed assets directly on the GPU without
17723 ///a CPU round-trip.
17724 ///
17725 ///Requires `VK_EXT_memory_decompression`.
17726 pub unsafe fn cmd_decompress_memory_ext(
17727 &self,
17728 command_buffer: CommandBuffer,
17729 p_decompress_memory_info_ext: &DecompressMemoryInfoEXT,
17730 ) {
17731 let fp = self
17732 .commands()
17733 .cmd_decompress_memory_ext
17734 .expect("vkCmdDecompressMemoryEXT not loaded");
17735 unsafe { fp(command_buffer, p_decompress_memory_info_ext) };
17736 }
17737 ///Wraps [`vkCmdDecompressMemoryIndirectCountEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDecompressMemoryIndirectCountEXT.html).
17738 /**
17739 Provided by **VK_EXT_memory_decompression**.*/
17740 ///
17741 ///# Safety
17742 ///- `commandBuffer` (self) must be valid and not destroyed.
17743 ///- `commandBuffer` must be externally synchronized.
17744 ///
17745 ///# Panics
17746 ///Panics if `vkCmdDecompressMemoryIndirectCountEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17747 ///
17748 ///# Usage Notes
17749 ///
17750 ///Indirect variant of `cmd_decompress_memory_ext`. Reads the
17751 ///decompression parameters and count from GPU-visible buffer
17752 ///addresses, enabling fully GPU-driven decompression workflows.
17753 ///
17754 ///Requires `VK_EXT_memory_decompression`.
17755 pub unsafe fn cmd_decompress_memory_indirect_count_ext(
17756 &self,
17757 command_buffer: CommandBuffer,
17758 decompression_method: MemoryDecompressionMethodFlagsEXT,
17759 indirect_commands_address: u64,
17760 indirect_commands_count_address: u64,
17761 max_decompression_count: u32,
17762 stride: u32,
17763 ) {
17764 let fp = self
17765 .commands()
17766 .cmd_decompress_memory_indirect_count_ext
17767 .expect("vkCmdDecompressMemoryIndirectCountEXT not loaded");
17768 unsafe {
17769 fp(
17770 command_buffer,
17771 decompression_method,
17772 indirect_commands_address,
17773 indirect_commands_count_address,
17774 max_decompression_count,
17775 stride,
17776 )
17777 };
17778 }
17779 ///Wraps [`vkCreateCuModuleNVX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateCuModuleNVX.html).
17780 /**
17781 Provided by **VK_NVX_binary_import**.*/
17782 ///
17783 ///# Errors
17784 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
17785 ///- `VK_ERROR_INITIALIZATION_FAILED`
17786 ///- `VK_ERROR_UNKNOWN`
17787 ///- `VK_ERROR_VALIDATION_FAILED`
17788 ///
17789 ///# Safety
17790 ///- `device` (self) must be valid and not destroyed.
17791 ///
17792 ///# Panics
17793 ///Panics if `vkCreateCuModuleNVX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17794 ///
17795 ///# Usage Notes
17796 ///
17797 ///Creates a CUDA module from binary data using the legacy NVX
17798 ///path. Prefer `create_cuda_module_nv` for new code.
17799 ///
17800 ///Destroy with `destroy_cu_module_nvx`.
17801 ///
17802 ///Requires `VK_NVX_binary_import`.
17803 pub unsafe fn create_cu_module_nvx(
17804 &self,
17805 p_create_info: &CuModuleCreateInfoNVX,
17806 allocator: Option<&AllocationCallbacks>,
17807 ) -> VkResult<CuModuleNVX> {
17808 let fp = self
17809 .commands()
17810 .create_cu_module_nvx
17811 .expect("vkCreateCuModuleNVX not loaded");
17812 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
17813 let mut out = unsafe { core::mem::zeroed() };
17814 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
17815 Ok(out)
17816 }
17817 ///Wraps [`vkCreateCuFunctionNVX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateCuFunctionNVX.html).
17818 /**
17819 Provided by **VK_NVX_binary_import**.*/
17820 ///
17821 ///# Errors
17822 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
17823 ///- `VK_ERROR_INITIALIZATION_FAILED`
17824 ///- `VK_ERROR_UNKNOWN`
17825 ///- `VK_ERROR_VALIDATION_FAILED`
17826 ///
17827 ///# Safety
17828 ///- `device` (self) must be valid and not destroyed.
17829 ///
17830 ///# Panics
17831 ///Panics if `vkCreateCuFunctionNVX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17832 ///
17833 ///# Usage Notes
17834 ///
17835 ///Creates a CUDA function handle from an NVX binary module. This
17836 ///is the legacy NVX path; prefer `create_cuda_function_nv` for
17837 ///new code.
17838 ///
17839 ///Destroy with `destroy_cu_function_nvx`.
17840 ///
17841 ///Requires `VK_NVX_binary_import`.
17842 pub unsafe fn create_cu_function_nvx(
17843 &self,
17844 p_create_info: &CuFunctionCreateInfoNVX,
17845 allocator: Option<&AllocationCallbacks>,
17846 ) -> VkResult<CuFunctionNVX> {
17847 let fp = self
17848 .commands()
17849 .create_cu_function_nvx
17850 .expect("vkCreateCuFunctionNVX not loaded");
17851 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
17852 let mut out = unsafe { core::mem::zeroed() };
17853 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
17854 Ok(out)
17855 }
17856 ///Wraps [`vkDestroyCuModuleNVX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyCuModuleNVX.html).
17857 /**
17858 Provided by **VK_NVX_binary_import**.*/
17859 ///
17860 ///# Safety
17861 ///- `device` (self) must be valid and not destroyed.
17862 ///
17863 ///# Panics
17864 ///Panics if `vkDestroyCuModuleNVX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17865 ///
17866 ///# Usage Notes
17867 ///
17868 ///Destroys a CUDA module created with `create_cu_module_nvx`.
17869 ///
17870 ///Requires `VK_NVX_binary_import`.
17871 pub unsafe fn destroy_cu_module_nvx(
17872 &self,
17873 module: CuModuleNVX,
17874 allocator: Option<&AllocationCallbacks>,
17875 ) {
17876 let fp = self
17877 .commands()
17878 .destroy_cu_module_nvx
17879 .expect("vkDestroyCuModuleNVX not loaded");
17880 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
17881 unsafe { fp(self.handle(), module, alloc_ptr) };
17882 }
17883 ///Wraps [`vkDestroyCuFunctionNVX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyCuFunctionNVX.html).
17884 /**
17885 Provided by **VK_NVX_binary_import**.*/
17886 ///
17887 ///# Safety
17888 ///- `device` (self) must be valid and not destroyed.
17889 ///
17890 ///# Panics
17891 ///Panics if `vkDestroyCuFunctionNVX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17892 ///
17893 ///# Usage Notes
17894 ///
17895 ///Destroys a CUDA function handle created with
17896 ///`create_cu_function_nvx`.
17897 ///
17898 ///Requires `VK_NVX_binary_import`.
17899 pub unsafe fn destroy_cu_function_nvx(
17900 &self,
17901 function: CuFunctionNVX,
17902 allocator: Option<&AllocationCallbacks>,
17903 ) {
17904 let fp = self
17905 .commands()
17906 .destroy_cu_function_nvx
17907 .expect("vkDestroyCuFunctionNVX not loaded");
17908 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
17909 unsafe { fp(self.handle(), function, alloc_ptr) };
17910 }
17911 ///Wraps [`vkCmdCuLaunchKernelNVX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCuLaunchKernelNVX.html).
17912 /**
17913 Provided by **VK_NVX_binary_import**.*/
17914 ///
17915 ///# Safety
17916 ///- `commandBuffer` (self) must be valid and not destroyed.
17917 ///
17918 ///# Panics
17919 ///Panics if `vkCmdCuLaunchKernelNVX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17920 ///
17921 ///# Usage Notes
17922 ///
17923 ///Launches a CUDA kernel from a Vulkan command buffer using the
17924 ///legacy NVX binary import path. Prefer `cmd_cuda_launch_kernel_nv`
17925 ///for new code.
17926 ///
17927 ///Requires `VK_NVX_binary_import`.
17928 pub unsafe fn cmd_cu_launch_kernel_nvx(
17929 &self,
17930 command_buffer: CommandBuffer,
17931 p_launch_info: &CuLaunchInfoNVX,
17932 ) {
17933 let fp = self
17934 .commands()
17935 .cmd_cu_launch_kernel_nvx
17936 .expect("vkCmdCuLaunchKernelNVX not loaded");
17937 unsafe { fp(command_buffer, p_launch_info) };
17938 }
17939 ///Wraps [`vkGetDescriptorSetLayoutSizeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDescriptorSetLayoutSizeEXT.html).
17940 /**
17941 Provided by **VK_EXT_descriptor_buffer**.*/
17942 ///
17943 ///# Safety
17944 ///- `device` (self) must be valid and not destroyed.
17945 ///
17946 ///# Panics
17947 ///Panics if `vkGetDescriptorSetLayoutSizeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17948 ///
17949 ///# Usage Notes
17950 ///
17951 ///Returns the total byte size required to store all descriptors for
17952 ///the given descriptor set layout in a descriptor buffer.
17953 ///
17954 ///Use this to allocate the correct amount of buffer memory for each
17955 ///descriptor set, then write individual descriptors at offsets
17956 ///obtained from `get_descriptor_set_layout_binding_offset_ext`.
17957 ///
17958 ///Requires `VK_EXT_descriptor_buffer`.
17959 pub unsafe fn get_descriptor_set_layout_size_ext(&self, layout: DescriptorSetLayout) -> u64 {
17960 let fp = self
17961 .commands()
17962 .get_descriptor_set_layout_size_ext
17963 .expect("vkGetDescriptorSetLayoutSizeEXT not loaded");
17964 let mut out = unsafe { core::mem::zeroed() };
17965 unsafe { fp(self.handle(), layout, &mut out) };
17966 out
17967 }
17968 ///Wraps [`vkGetDescriptorSetLayoutBindingOffsetEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDescriptorSetLayoutBindingOffsetEXT.html).
17969 /**
17970 Provided by **VK_EXT_descriptor_buffer**.*/
17971 ///
17972 ///# Safety
17973 ///- `device` (self) must be valid and not destroyed.
17974 ///
17975 ///# Panics
17976 ///Panics if `vkGetDescriptorSetLayoutBindingOffsetEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
17977 ///
17978 ///# Usage Notes
17979 ///
17980 ///Returns the byte offset of a specific binding within the
17981 ///descriptor buffer layout for the given descriptor set layout.
17982 ///
17983 ///Use this to compute where to write a descriptor with
17984 ///`get_descriptor_ext` within the buffer region for a set.
17985 ///
17986 ///Requires `VK_EXT_descriptor_buffer`.
17987 pub unsafe fn get_descriptor_set_layout_binding_offset_ext(
17988 &self,
17989 layout: DescriptorSetLayout,
17990 binding: u32,
17991 ) -> u64 {
17992 let fp = self
17993 .commands()
17994 .get_descriptor_set_layout_binding_offset_ext
17995 .expect("vkGetDescriptorSetLayoutBindingOffsetEXT not loaded");
17996 let mut out = unsafe { core::mem::zeroed() };
17997 unsafe { fp(self.handle(), layout, binding, &mut out) };
17998 out
17999 }
18000 ///Wraps [`vkGetDescriptorEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDescriptorEXT.html).
18001 /**
18002 Provided by **VK_EXT_descriptor_buffer**.*/
18003 ///
18004 ///# Safety
18005 ///- `device` (self) must be valid and not destroyed.
18006 ///
18007 ///# Panics
18008 ///Panics if `vkGetDescriptorEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18009 ///
18010 ///# Usage Notes
18011 ///
18012 ///Writes a descriptor directly into caller-provided memory.
18013 ///`DescriptorGetInfoEXT` specifies the descriptor type and resource
18014 ///(buffer, image, sampler, etc.). The descriptor is written to
18015 ///`p_descriptor` and must be `data_size` bytes.
18016 ///
18017 ///Query the required size per descriptor type with
18018 ///`PhysicalDeviceDescriptorBufferPropertiesEXT`.
18019 ///
18020 ///This is the core operation of descriptor buffers, instead of
18021 ///allocating descriptor sets, you write descriptors directly into
18022 ///mapped buffer memory.
18023 ///
18024 ///Requires `VK_EXT_descriptor_buffer`.
18025 pub unsafe fn get_descriptor_ext(
18026 &self,
18027 p_descriptor_info: &DescriptorGetInfoEXT,
18028 data_size: usize,
18029 p_descriptor: *mut core::ffi::c_void,
18030 ) {
18031 let fp = self
18032 .commands()
18033 .get_descriptor_ext
18034 .expect("vkGetDescriptorEXT not loaded");
18035 unsafe { fp(self.handle(), p_descriptor_info, data_size, p_descriptor) };
18036 }
18037 ///Wraps [`vkCmdBindDescriptorBuffersEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindDescriptorBuffersEXT.html).
18038 /**
18039 Provided by **VK_EXT_descriptor_buffer**.*/
18040 ///
18041 ///# Safety
18042 ///- `commandBuffer` (self) must be valid and not destroyed.
18043 ///- `commandBuffer` must be externally synchronized.
18044 ///
18045 ///# Panics
18046 ///Panics if `vkCmdBindDescriptorBuffersEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18047 ///
18048 ///# Usage Notes
18049 ///
18050 ///Binds one or more descriptor buffers to a command buffer. Each
18051 ///`DescriptorBufferBindingInfoEXT` specifies a buffer address and
18052 ///usage (resource descriptors, sampler descriptors, or push
18053 ///descriptors).
18054 ///
18055 ///After binding, use `cmd_set_descriptor_buffer_offsets_ext` to
18056 ///point specific descriptor sets at offsets within the bound buffers.
18057 ///
18058 ///Descriptor buffers are an alternative to descriptor sets/pools
18059 ///that stores descriptors inline in buffer memory.
18060 ///
18061 ///Requires `VK_EXT_descriptor_buffer`.
18062 pub unsafe fn cmd_bind_descriptor_buffers_ext(
18063 &self,
18064 command_buffer: CommandBuffer,
18065 p_binding_infos: &[DescriptorBufferBindingInfoEXT],
18066 ) {
18067 let fp = self
18068 .commands()
18069 .cmd_bind_descriptor_buffers_ext
18070 .expect("vkCmdBindDescriptorBuffersEXT not loaded");
18071 unsafe {
18072 fp(
18073 command_buffer,
18074 p_binding_infos.len() as u32,
18075 p_binding_infos.as_ptr(),
18076 )
18077 };
18078 }
18079 ///Wraps [`vkCmdSetDescriptorBufferOffsetsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDescriptorBufferOffsetsEXT.html).
18080 /**
18081 Provided by **VK_EXT_descriptor_buffer**.*/
18082 ///
18083 ///# Safety
18084 ///- `commandBuffer` (self) must be valid and not destroyed.
18085 ///- `commandBuffer` must be externally synchronized.
18086 ///
18087 ///# Panics
18088 ///Panics if `vkCmdSetDescriptorBufferOffsetsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18089 ///
18090 ///# Usage Notes
18091 ///
18092 ///Sets the offsets into bound descriptor buffers for one or more
18093 ///descriptor set slots. Each pair of (buffer_index, offset) maps
18094 ///a descriptor set to a region of a previously bound descriptor
18095 ///buffer.
18096 ///
18097 ///Must be called after `cmd_bind_descriptor_buffers_ext`.
18098 ///
18099 ///For the pNext-extensible variant, see
18100 ///`cmd_set_descriptor_buffer_offsets2_ext`.
18101 ///
18102 ///Requires `VK_EXT_descriptor_buffer`.
18103 pub unsafe fn cmd_set_descriptor_buffer_offsets_ext(
18104 &self,
18105 command_buffer: CommandBuffer,
18106 pipeline_bind_point: PipelineBindPoint,
18107 layout: PipelineLayout,
18108 first_set: u32,
18109 p_buffer_indices: &[u32],
18110 p_offsets: &[u64],
18111 ) {
18112 let fp = self
18113 .commands()
18114 .cmd_set_descriptor_buffer_offsets_ext
18115 .expect("vkCmdSetDescriptorBufferOffsetsEXT not loaded");
18116 unsafe {
18117 fp(
18118 command_buffer,
18119 pipeline_bind_point,
18120 layout,
18121 first_set,
18122 p_buffer_indices.len() as u32,
18123 p_buffer_indices.as_ptr(),
18124 p_offsets.as_ptr(),
18125 )
18126 };
18127 }
18128 ///Wraps [`vkCmdBindDescriptorBufferEmbeddedSamplersEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindDescriptorBufferEmbeddedSamplersEXT.html).
18129 /**
18130 Provided by **VK_EXT_descriptor_buffer**.*/
18131 ///
18132 ///# Safety
18133 ///- `commandBuffer` (self) must be valid and not destroyed.
18134 ///- `commandBuffer` must be externally synchronized.
18135 ///
18136 ///# Panics
18137 ///Panics if `vkCmdBindDescriptorBufferEmbeddedSamplersEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18138 ///
18139 ///# Usage Notes
18140 ///
18141 ///Binds embedded immutable samplers from a descriptor set layout
18142 ///that was created with `CREATE_EMBEDDED_IMMUTABLE_SAMPLERS_BIT`.
18143 ///These samplers are baked into the layout and do not need buffer
18144 ///memory.
18145 ///
18146 ///Specify the `pipeline_bind_point`, `layout`, and `set` index.
18147 ///
18148 ///For the pNext-extensible variant, see
18149 ///`cmd_bind_descriptor_buffer_embedded_samplers2_ext`.
18150 ///
18151 ///Requires `VK_EXT_descriptor_buffer`.
18152 pub unsafe fn cmd_bind_descriptor_buffer_embedded_samplers_ext(
18153 &self,
18154 command_buffer: CommandBuffer,
18155 pipeline_bind_point: PipelineBindPoint,
18156 layout: PipelineLayout,
18157 set: u32,
18158 ) {
18159 let fp = self
18160 .commands()
18161 .cmd_bind_descriptor_buffer_embedded_samplers_ext
18162 .expect("vkCmdBindDescriptorBufferEmbeddedSamplersEXT not loaded");
18163 unsafe { fp(command_buffer, pipeline_bind_point, layout, set) };
18164 }
18165 ///Wraps [`vkGetBufferOpaqueCaptureDescriptorDataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetBufferOpaqueCaptureDescriptorDataEXT.html).
18166 /**
18167 Provided by **VK_EXT_descriptor_buffer**.*/
18168 ///
18169 ///# Errors
18170 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18171 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
18172 ///- `VK_ERROR_UNKNOWN`
18173 ///- `VK_ERROR_VALIDATION_FAILED`
18174 ///
18175 ///# Safety
18176 ///- `device` (self) must be valid and not destroyed.
18177 ///
18178 ///# Panics
18179 ///Panics if `vkGetBufferOpaqueCaptureDescriptorDataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18180 ///
18181 ///# Usage Notes
18182 ///
18183 ///Retrieves opaque capture data for a buffer descriptor. The
18184 ///returned data can be used to reconstruct the descriptor in a
18185 ///replay or capture/replay scenario.
18186 ///
18187 ///The buffer must have been created with
18188 ///`CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT`.
18189 ///
18190 ///Requires `VK_EXT_descriptor_buffer` and
18191 ///`descriptorBufferCaptureReplay`.
18192 pub unsafe fn get_buffer_opaque_capture_descriptor_data_ext(
18193 &self,
18194 p_info: &BufferCaptureDescriptorDataInfoEXT,
18195 ) -> VkResult<core::ffi::c_void> {
18196 let fp = self
18197 .commands()
18198 .get_buffer_opaque_capture_descriptor_data_ext
18199 .expect("vkGetBufferOpaqueCaptureDescriptorDataEXT not loaded");
18200 let mut out = unsafe { core::mem::zeroed() };
18201 check(unsafe { fp(self.handle(), p_info, &mut out) })?;
18202 Ok(out)
18203 }
18204 ///Wraps [`vkGetImageOpaqueCaptureDescriptorDataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageOpaqueCaptureDescriptorDataEXT.html).
18205 /**
18206 Provided by **VK_EXT_descriptor_buffer**.*/
18207 ///
18208 ///# Errors
18209 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18210 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
18211 ///- `VK_ERROR_UNKNOWN`
18212 ///- `VK_ERROR_VALIDATION_FAILED`
18213 ///
18214 ///# Safety
18215 ///- `device` (self) must be valid and not destroyed.
18216 ///
18217 ///# Panics
18218 ///Panics if `vkGetImageOpaqueCaptureDescriptorDataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18219 ///
18220 ///# Usage Notes
18221 ///
18222 ///Retrieves opaque capture data for an image descriptor. The
18223 ///returned data can be used to reconstruct the descriptor in a
18224 ///capture/replay scenario.
18225 ///
18226 ///The image must have been created with
18227 ///`CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT`.
18228 ///
18229 ///Requires `VK_EXT_descriptor_buffer` and
18230 ///`descriptorBufferCaptureReplay`.
18231 pub unsafe fn get_image_opaque_capture_descriptor_data_ext(
18232 &self,
18233 p_info: &ImageCaptureDescriptorDataInfoEXT,
18234 ) -> VkResult<core::ffi::c_void> {
18235 let fp = self
18236 .commands()
18237 .get_image_opaque_capture_descriptor_data_ext
18238 .expect("vkGetImageOpaqueCaptureDescriptorDataEXT not loaded");
18239 let mut out = unsafe { core::mem::zeroed() };
18240 check(unsafe { fp(self.handle(), p_info, &mut out) })?;
18241 Ok(out)
18242 }
18243 ///Wraps [`vkGetImageViewOpaqueCaptureDescriptorDataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageViewOpaqueCaptureDescriptorDataEXT.html).
18244 /**
18245 Provided by **VK_EXT_descriptor_buffer**.*/
18246 ///
18247 ///# Errors
18248 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18249 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
18250 ///- `VK_ERROR_UNKNOWN`
18251 ///- `VK_ERROR_VALIDATION_FAILED`
18252 ///
18253 ///# Safety
18254 ///- `device` (self) must be valid and not destroyed.
18255 ///
18256 ///# Panics
18257 ///Panics if `vkGetImageViewOpaqueCaptureDescriptorDataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18258 ///
18259 ///# Usage Notes
18260 ///
18261 ///Retrieves opaque capture data for an image view descriptor. The
18262 ///returned data can be used to reconstruct the descriptor in a
18263 ///capture/replay scenario.
18264 ///
18265 ///The image view must have been created with
18266 ///`CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT`.
18267 ///
18268 ///Requires `VK_EXT_descriptor_buffer` and
18269 ///`descriptorBufferCaptureReplay`.
18270 pub unsafe fn get_image_view_opaque_capture_descriptor_data_ext(
18271 &self,
18272 p_info: &ImageViewCaptureDescriptorDataInfoEXT,
18273 ) -> VkResult<core::ffi::c_void> {
18274 let fp = self
18275 .commands()
18276 .get_image_view_opaque_capture_descriptor_data_ext
18277 .expect("vkGetImageViewOpaqueCaptureDescriptorDataEXT not loaded");
18278 let mut out = unsafe { core::mem::zeroed() };
18279 check(unsafe { fp(self.handle(), p_info, &mut out) })?;
18280 Ok(out)
18281 }
18282 ///Wraps [`vkGetSamplerOpaqueCaptureDescriptorDataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSamplerOpaqueCaptureDescriptorDataEXT.html).
18283 /**
18284 Provided by **VK_EXT_descriptor_buffer**.*/
18285 ///
18286 ///# Errors
18287 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18288 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
18289 ///- `VK_ERROR_UNKNOWN`
18290 ///- `VK_ERROR_VALIDATION_FAILED`
18291 ///
18292 ///# Safety
18293 ///- `device` (self) must be valid and not destroyed.
18294 ///
18295 ///# Panics
18296 ///Panics if `vkGetSamplerOpaqueCaptureDescriptorDataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18297 ///
18298 ///# Usage Notes
18299 ///
18300 ///Retrieves opaque capture data for a sampler descriptor. The
18301 ///returned data can be used to reconstruct the descriptor in a
18302 ///capture/replay scenario.
18303 ///
18304 ///The sampler must have been created with
18305 ///`CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT`.
18306 ///
18307 ///Requires `VK_EXT_descriptor_buffer` and
18308 ///`descriptorBufferCaptureReplay`.
18309 pub unsafe fn get_sampler_opaque_capture_descriptor_data_ext(
18310 &self,
18311 p_info: &SamplerCaptureDescriptorDataInfoEXT,
18312 ) -> VkResult<core::ffi::c_void> {
18313 let fp = self
18314 .commands()
18315 .get_sampler_opaque_capture_descriptor_data_ext
18316 .expect("vkGetSamplerOpaqueCaptureDescriptorDataEXT not loaded");
18317 let mut out = unsafe { core::mem::zeroed() };
18318 check(unsafe { fp(self.handle(), p_info, &mut out) })?;
18319 Ok(out)
18320 }
18321 ///Wraps [`vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT.html).
18322 /**
18323 Provided by **VK_EXT_descriptor_buffer**.*/
18324 ///
18325 ///# Errors
18326 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18327 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
18328 ///- `VK_ERROR_UNKNOWN`
18329 ///- `VK_ERROR_VALIDATION_FAILED`
18330 ///
18331 ///# Safety
18332 ///- `device` (self) must be valid and not destroyed.
18333 ///
18334 ///# Panics
18335 ///Panics if `vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18336 ///
18337 ///# Usage Notes
18338 ///
18339 ///Retrieves opaque capture data for an acceleration structure
18340 ///descriptor. The returned data can be used to reconstruct the
18341 ///descriptor in a replay or capture/replay scenario.
18342 ///
18343 ///The acceleration structure must have been created with
18344 ///`CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT`.
18345 ///
18346 ///Requires `VK_EXT_descriptor_buffer` and
18347 ///`descriptorBufferCaptureReplay`.
18348 pub unsafe fn get_acceleration_structure_opaque_capture_descriptor_data_ext(
18349 &self,
18350 p_info: &AccelerationStructureCaptureDescriptorDataInfoEXT,
18351 ) -> VkResult<core::ffi::c_void> {
18352 let fp = self
18353 .commands()
18354 .get_acceleration_structure_opaque_capture_descriptor_data_ext
18355 .expect("vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT not loaded");
18356 let mut out = unsafe { core::mem::zeroed() };
18357 check(unsafe { fp(self.handle(), p_info, &mut out) })?;
18358 Ok(out)
18359 }
18360 ///Wraps [`vkSetDeviceMemoryPriorityEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetDeviceMemoryPriorityEXT.html).
18361 /**
18362 Provided by **VK_EXT_pageable_device_local_memory**.*/
18363 ///
18364 ///# Safety
18365 ///- `device` (self) must be valid and not destroyed.
18366 ///
18367 ///# Panics
18368 ///Panics if `vkSetDeviceMemoryPriorityEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18369 ///
18370 ///# Usage Notes
18371 ///
18372 ///Dynamically updates the priority of a device memory allocation.
18373 ///Higher-priority allocations are less likely to be evicted under
18374 ///memory pressure. Use this to promote frequently accessed
18375 ///resources or demote resources that are no longer critical.
18376 ///
18377 ///Requires `VK_EXT_pageable_device_local_memory`.
18378 pub unsafe fn set_device_memory_priority_ext(&self, memory: DeviceMemory, priority: f32) {
18379 let fp = self
18380 .commands()
18381 .set_device_memory_priority_ext
18382 .expect("vkSetDeviceMemoryPriorityEXT not loaded");
18383 unsafe { fp(self.handle(), memory, priority) };
18384 }
18385 ///Wraps [`vkWaitForPresent2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkWaitForPresent2KHR.html).
18386 /**
18387 Provided by **VK_KHR_present_wait2**.*/
18388 ///
18389 ///# Errors
18390 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18391 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
18392 ///- `VK_ERROR_DEVICE_LOST`
18393 ///- `VK_ERROR_OUT_OF_DATE_KHR`
18394 ///- `VK_ERROR_SURFACE_LOST_KHR`
18395 ///- `VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT`
18396 ///- `VK_ERROR_UNKNOWN`
18397 ///- `VK_ERROR_VALIDATION_FAILED`
18398 ///
18399 ///# Safety
18400 ///- `device` (self) must be valid and not destroyed.
18401 ///- `swapchain` must be externally synchronized.
18402 ///
18403 ///# Panics
18404 ///Panics if `vkWaitForPresent2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18405 ///
18406 ///# Usage Notes
18407 ///
18408 ///Extensible version of `wait_for_present_khr`. Takes a
18409 ///`PresentWait2InfoKHR` struct (with `pNext` support) instead of
18410 ///separate `present_id` and `timeout` parameters.
18411 ///
18412 ///Provided by `VK_KHR_present_wait2`. Otherwise identical in
18413 ///behavior, blocks until the specified present ID completes or
18414 ///the timeout expires.
18415 pub unsafe fn wait_for_present2_khr(
18416 &self,
18417 swapchain: SwapchainKHR,
18418 p_present_wait2_info: &PresentWait2InfoKHR,
18419 ) -> VkResult<()> {
18420 let fp = self
18421 .commands()
18422 .wait_for_present2_khr
18423 .expect("vkWaitForPresent2KHR not loaded");
18424 check(unsafe { fp(self.handle(), swapchain, p_present_wait2_info) })
18425 }
18426 ///Wraps [`vkWaitForPresentKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkWaitForPresentKHR.html).
18427 /**
18428 Provided by **VK_KHR_present_wait**.*/
18429 ///
18430 ///# Errors
18431 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18432 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
18433 ///- `VK_ERROR_DEVICE_LOST`
18434 ///- `VK_ERROR_OUT_OF_DATE_KHR`
18435 ///- `VK_ERROR_SURFACE_LOST_KHR`
18436 ///- `VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT`
18437 ///- `VK_ERROR_UNKNOWN`
18438 ///- `VK_ERROR_VALIDATION_FAILED`
18439 ///
18440 ///# Safety
18441 ///- `device` (self) must be valid and not destroyed.
18442 ///- `swapchain` must be externally synchronized.
18443 ///
18444 ///# Panics
18445 ///Panics if `vkWaitForPresentKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18446 ///
18447 ///# Usage Notes
18448 ///
18449 ///Blocks the calling thread until a specific present operation
18450 ///completes on the display. `present_id` identifies which present
18451 ///to wait for, set it via `PresentIdKHR` chained into
18452 ///`PresentInfoKHR` during `queue_present_khr`.
18453 ///
18454 ///`timeout` is in nanoseconds. Returns `TIMEOUT` if the deadline
18455 ///expires before the present completes, `SUCCESS` if the present
18456 ///finished. Use `u64::MAX` for an indefinite wait.
18457 ///
18458 ///Requires `VK_KHR_present_wait` and `VK_KHR_present_id`.
18459 ///
18460 ///This is useful for frame pacing, wait for the previous frame's
18461 ///present to complete before starting the next frame's work to
18462 ///avoid queuing excessive frames.
18463 pub unsafe fn wait_for_present_khr(
18464 &self,
18465 swapchain: SwapchainKHR,
18466 present_id: u64,
18467 timeout: u64,
18468 ) -> VkResult<()> {
18469 let fp = self
18470 .commands()
18471 .wait_for_present_khr
18472 .expect("vkWaitForPresentKHR not loaded");
18473 check(unsafe { fp(self.handle(), swapchain, present_id, timeout) })
18474 }
18475 ///Wraps [`vkCreateBufferCollectionFUCHSIA`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateBufferCollectionFUCHSIA.html).
18476 /**
18477 Provided by **VK_FUCHSIA_buffer_collection**.*/
18478 ///
18479 ///# Errors
18480 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18481 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
18482 ///- `VK_ERROR_INITIALIZATION_FAILED`
18483 ///- `VK_ERROR_UNKNOWN`
18484 ///- `VK_ERROR_VALIDATION_FAILED`
18485 ///
18486 ///# Safety
18487 ///- `device` (self) must be valid and not destroyed.
18488 ///
18489 ///# Panics
18490 ///Panics if `vkCreateBufferCollectionFUCHSIA` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18491 ///
18492 ///# Usage Notes
18493 ///
18494 ///Creates a Fuchsia buffer collection that negotiates memory
18495 ///constraints between Vulkan and other Fuchsia services (e.g.
18496 ///scenic, camera). Fuchsia OS only. After creation, set buffer
18497 ///or image constraints before allocating.
18498 ///
18499 ///Requires `VK_FUCHSIA_buffer_collection`.
18500 pub unsafe fn create_buffer_collection_fuchsia(
18501 &self,
18502 p_create_info: &BufferCollectionCreateInfoFUCHSIA,
18503 allocator: Option<&AllocationCallbacks>,
18504 ) -> VkResult<BufferCollectionFUCHSIA> {
18505 let fp = self
18506 .commands()
18507 .create_buffer_collection_fuchsia
18508 .expect("vkCreateBufferCollectionFUCHSIA not loaded");
18509 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
18510 let mut out = unsafe { core::mem::zeroed() };
18511 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
18512 Ok(out)
18513 }
18514 ///Wraps [`vkSetBufferCollectionBufferConstraintsFUCHSIA`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetBufferCollectionBufferConstraintsFUCHSIA.html).
18515 /**
18516 Provided by **VK_FUCHSIA_buffer_collection**.*/
18517 ///
18518 ///# Errors
18519 ///- `VK_ERROR_INITIALIZATION_FAILED`
18520 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18521 ///- `VK_ERROR_FORMAT_NOT_SUPPORTED`
18522 ///- `VK_ERROR_UNKNOWN`
18523 ///- `VK_ERROR_VALIDATION_FAILED`
18524 ///
18525 ///# Safety
18526 ///- `device` (self) must be valid and not destroyed.
18527 ///
18528 ///# Panics
18529 ///Panics if `vkSetBufferCollectionBufferConstraintsFUCHSIA` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18530 ///
18531 ///# Usage Notes
18532 ///
18533 ///Sets buffer constraints on a Fuchsia buffer collection. The
18534 ///constraints describe the Vulkan buffer usage requirements that
18535 ///must be negotiated with other collection participants. Fuchsia
18536 ///OS only.
18537 ///
18538 ///Requires `VK_FUCHSIA_buffer_collection`.
18539 pub unsafe fn set_buffer_collection_buffer_constraints_fuchsia(
18540 &self,
18541 collection: BufferCollectionFUCHSIA,
18542 p_buffer_constraints_info: &BufferConstraintsInfoFUCHSIA,
18543 ) -> VkResult<()> {
18544 let fp = self
18545 .commands()
18546 .set_buffer_collection_buffer_constraints_fuchsia
18547 .expect("vkSetBufferCollectionBufferConstraintsFUCHSIA not loaded");
18548 check(unsafe { fp(self.handle(), collection, p_buffer_constraints_info) })
18549 }
18550 ///Wraps [`vkSetBufferCollectionImageConstraintsFUCHSIA`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetBufferCollectionImageConstraintsFUCHSIA.html).
18551 /**
18552 Provided by **VK_FUCHSIA_buffer_collection**.*/
18553 ///
18554 ///# Errors
18555 ///- `VK_ERROR_INITIALIZATION_FAILED`
18556 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18557 ///- `VK_ERROR_FORMAT_NOT_SUPPORTED`
18558 ///- `VK_ERROR_UNKNOWN`
18559 ///- `VK_ERROR_VALIDATION_FAILED`
18560 ///
18561 ///# Safety
18562 ///- `device` (self) must be valid and not destroyed.
18563 ///
18564 ///# Panics
18565 ///Panics if `vkSetBufferCollectionImageConstraintsFUCHSIA` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18566 ///
18567 ///# Usage Notes
18568 ///
18569 ///Sets image constraints on a Fuchsia buffer collection. The
18570 ///constraints describe the Vulkan image format and usage
18571 ///requirements that must be negotiated with other collection
18572 ///participants. Fuchsia OS only.
18573 ///
18574 ///Requires `VK_FUCHSIA_buffer_collection`.
18575 pub unsafe fn set_buffer_collection_image_constraints_fuchsia(
18576 &self,
18577 collection: BufferCollectionFUCHSIA,
18578 p_image_constraints_info: &ImageConstraintsInfoFUCHSIA,
18579 ) -> VkResult<()> {
18580 let fp = self
18581 .commands()
18582 .set_buffer_collection_image_constraints_fuchsia
18583 .expect("vkSetBufferCollectionImageConstraintsFUCHSIA not loaded");
18584 check(unsafe { fp(self.handle(), collection, p_image_constraints_info) })
18585 }
18586 ///Wraps [`vkDestroyBufferCollectionFUCHSIA`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyBufferCollectionFUCHSIA.html).
18587 /**
18588 Provided by **VK_FUCHSIA_buffer_collection**.*/
18589 ///
18590 ///# Safety
18591 ///- `device` (self) must be valid and not destroyed.
18592 ///
18593 ///# Panics
18594 ///Panics if `vkDestroyBufferCollectionFUCHSIA` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18595 ///
18596 ///# Usage Notes
18597 ///
18598 ///Destroys a Fuchsia buffer collection. The collection must not
18599 ///be in use by any pending operations. Fuchsia OS only.
18600 ///
18601 ///Requires `VK_FUCHSIA_buffer_collection`.
18602 pub unsafe fn destroy_buffer_collection_fuchsia(
18603 &self,
18604 collection: BufferCollectionFUCHSIA,
18605 allocator: Option<&AllocationCallbacks>,
18606 ) {
18607 let fp = self
18608 .commands()
18609 .destroy_buffer_collection_fuchsia
18610 .expect("vkDestroyBufferCollectionFUCHSIA not loaded");
18611 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
18612 unsafe { fp(self.handle(), collection, alloc_ptr) };
18613 }
18614 ///Wraps [`vkGetBufferCollectionPropertiesFUCHSIA`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetBufferCollectionPropertiesFUCHSIA.html).
18615 /**
18616 Provided by **VK_FUCHSIA_buffer_collection**.*/
18617 ///
18618 ///# Errors
18619 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18620 ///- `VK_ERROR_INITIALIZATION_FAILED`
18621 ///- `VK_ERROR_UNKNOWN`
18622 ///- `VK_ERROR_VALIDATION_FAILED`
18623 ///
18624 ///# Safety
18625 ///- `device` (self) must be valid and not destroyed.
18626 ///
18627 ///# Panics
18628 ///Panics if `vkGetBufferCollectionPropertiesFUCHSIA` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18629 ///
18630 ///# Usage Notes
18631 ///
18632 ///Queries the negotiated properties of a Fuchsia buffer
18633 ///collection after constraints have been set. Returns memory
18634 ///type index, format, and other details needed for allocation.
18635 ///Fuchsia OS only.
18636 ///
18637 ///Requires `VK_FUCHSIA_buffer_collection`.
18638 pub unsafe fn get_buffer_collection_properties_fuchsia(
18639 &self,
18640 collection: BufferCollectionFUCHSIA,
18641 p_properties: &mut BufferCollectionPropertiesFUCHSIA,
18642 ) -> VkResult<()> {
18643 let fp = self
18644 .commands()
18645 .get_buffer_collection_properties_fuchsia
18646 .expect("vkGetBufferCollectionPropertiesFUCHSIA not loaded");
18647 check(unsafe { fp(self.handle(), collection, p_properties) })
18648 }
18649 ///Wraps [`vkCreateCudaModuleNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateCudaModuleNV.html).
18650 /**
18651 Provided by **VK_NV_cuda_kernel_launch**.*/
18652 ///
18653 ///# Errors
18654 ///- `VK_ERROR_INITIALIZATION_FAILED`
18655 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18656 ///- `VK_ERROR_UNKNOWN`
18657 ///- `VK_ERROR_VALIDATION_FAILED`
18658 ///
18659 ///# Safety
18660 ///- `device` (self) must be valid and not destroyed.
18661 ///
18662 ///# Panics
18663 ///Panics if `vkCreateCudaModuleNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18664 ///
18665 ///# Usage Notes
18666 ///
18667 ///Creates a CUDA module from PTX or cubin data. The module
18668 ///contains one or more kernel entry points that can be extracted
18669 ///with `create_cuda_function_nv`.
18670 ///
18671 ///Destroy with `destroy_cuda_module_nv`.
18672 ///
18673 ///Requires `VK_NV_cuda_kernel_launch`.
18674 pub unsafe fn create_cuda_module_nv(
18675 &self,
18676 p_create_info: &CudaModuleCreateInfoNV,
18677 allocator: Option<&AllocationCallbacks>,
18678 ) -> VkResult<CudaModuleNV> {
18679 let fp = self
18680 .commands()
18681 .create_cuda_module_nv
18682 .expect("vkCreateCudaModuleNV not loaded");
18683 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
18684 let mut out = unsafe { core::mem::zeroed() };
18685 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
18686 Ok(out)
18687 }
18688 ///Wraps [`vkGetCudaModuleCacheNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetCudaModuleCacheNV.html).
18689 /**
18690 Provided by **VK_NV_cuda_kernel_launch**.*/
18691 ///
18692 ///# Errors
18693 ///- `VK_ERROR_INITIALIZATION_FAILED`
18694 ///- `VK_ERROR_UNKNOWN`
18695 ///- `VK_ERROR_VALIDATION_FAILED`
18696 ///
18697 ///# Safety
18698 ///- `device` (self) must be valid and not destroyed.
18699 ///
18700 ///# Panics
18701 ///Panics if `vkGetCudaModuleCacheNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18702 ///
18703 ///# Usage Notes
18704 ///
18705 ///Retrieves the compiled cache data from a CUDA module for
18706 ///serialization. Call once with a null buffer to query the size,
18707 ///then again with an appropriately sized buffer. Feed the data
18708 ///back into `create_cuda_module_nv` on the next run to skip
18709 ///compilation.
18710 ///
18711 ///Requires `VK_NV_cuda_kernel_launch`.
18712 pub unsafe fn get_cuda_module_cache_nv(
18713 &self,
18714 module: CudaModuleNV,
18715 p_cache_data: *mut core::ffi::c_void,
18716 ) -> VkResult<usize> {
18717 let fp = self
18718 .commands()
18719 .get_cuda_module_cache_nv
18720 .expect("vkGetCudaModuleCacheNV not loaded");
18721 let mut out = unsafe { core::mem::zeroed() };
18722 check(unsafe { fp(self.handle(), module, &mut out, p_cache_data) })?;
18723 Ok(out)
18724 }
18725 ///Wraps [`vkCreateCudaFunctionNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateCudaFunctionNV.html).
18726 /**
18727 Provided by **VK_NV_cuda_kernel_launch**.*/
18728 ///
18729 ///# Errors
18730 ///- `VK_ERROR_INITIALIZATION_FAILED`
18731 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
18732 ///- `VK_ERROR_UNKNOWN`
18733 ///- `VK_ERROR_VALIDATION_FAILED`
18734 ///
18735 ///# Safety
18736 ///- `device` (self) must be valid and not destroyed.
18737 ///
18738 ///# Panics
18739 ///Panics if `vkCreateCudaFunctionNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18740 ///
18741 ///# Usage Notes
18742 ///
18743 ///Creates a CUDA function handle from a CUDA module, identifying
18744 ///a specific kernel entry point. Use with
18745 ///`cmd_cuda_launch_kernel_nv` to dispatch the kernel.
18746 ///
18747 ///Destroy with `destroy_cuda_function_nv`.
18748 ///
18749 ///Requires `VK_NV_cuda_kernel_launch`.
18750 pub unsafe fn create_cuda_function_nv(
18751 &self,
18752 p_create_info: &CudaFunctionCreateInfoNV,
18753 allocator: Option<&AllocationCallbacks>,
18754 ) -> VkResult<CudaFunctionNV> {
18755 let fp = self
18756 .commands()
18757 .create_cuda_function_nv
18758 .expect("vkCreateCudaFunctionNV not loaded");
18759 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
18760 let mut out = unsafe { core::mem::zeroed() };
18761 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
18762 Ok(out)
18763 }
18764 ///Wraps [`vkDestroyCudaModuleNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyCudaModuleNV.html).
18765 /**
18766 Provided by **VK_NV_cuda_kernel_launch**.*/
18767 ///
18768 ///# Safety
18769 ///- `device` (self) must be valid and not destroyed.
18770 ///
18771 ///# Panics
18772 ///Panics if `vkDestroyCudaModuleNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18773 ///
18774 ///# Usage Notes
18775 ///
18776 ///Destroys a CUDA module created with `create_cuda_module_nv`.
18777 ///All functions extracted from this module must be destroyed first.
18778 ///
18779 ///Requires `VK_NV_cuda_kernel_launch`.
18780 pub unsafe fn destroy_cuda_module_nv(
18781 &self,
18782 module: CudaModuleNV,
18783 allocator: Option<&AllocationCallbacks>,
18784 ) {
18785 let fp = self
18786 .commands()
18787 .destroy_cuda_module_nv
18788 .expect("vkDestroyCudaModuleNV not loaded");
18789 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
18790 unsafe { fp(self.handle(), module, alloc_ptr) };
18791 }
18792 ///Wraps [`vkDestroyCudaFunctionNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyCudaFunctionNV.html).
18793 /**
18794 Provided by **VK_NV_cuda_kernel_launch**.*/
18795 ///
18796 ///# Safety
18797 ///- `device` (self) must be valid and not destroyed.
18798 ///
18799 ///# Panics
18800 ///Panics if `vkDestroyCudaFunctionNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18801 ///
18802 ///# Usage Notes
18803 ///
18804 ///Destroys a CUDA function handle created with
18805 ///`create_cuda_function_nv`.
18806 ///
18807 ///Requires `VK_NV_cuda_kernel_launch`.
18808 pub unsafe fn destroy_cuda_function_nv(
18809 &self,
18810 function: CudaFunctionNV,
18811 allocator: Option<&AllocationCallbacks>,
18812 ) {
18813 let fp = self
18814 .commands()
18815 .destroy_cuda_function_nv
18816 .expect("vkDestroyCudaFunctionNV not loaded");
18817 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
18818 unsafe { fp(self.handle(), function, alloc_ptr) };
18819 }
18820 ///Wraps [`vkCmdCudaLaunchKernelNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCudaLaunchKernelNV.html).
18821 /**
18822 Provided by **VK_NV_cuda_kernel_launch**.*/
18823 ///
18824 ///# Safety
18825 ///- `commandBuffer` (self) must be valid and not destroyed.
18826 ///
18827 ///# Panics
18828 ///Panics if `vkCmdCudaLaunchKernelNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18829 ///
18830 ///# Usage Notes
18831 ///
18832 ///Launches a CUDA kernel from within a Vulkan command buffer.
18833 ///The kernel is specified by a CUDA function handle created with
18834 ///`create_cuda_function_nv`. Grid dimensions and parameters are
18835 ///provided in the launch info.
18836 ///
18837 ///Requires `VK_NV_cuda_kernel_launch`.
18838 pub unsafe fn cmd_cuda_launch_kernel_nv(
18839 &self,
18840 command_buffer: CommandBuffer,
18841 p_launch_info: &CudaLaunchInfoNV,
18842 ) {
18843 let fp = self
18844 .commands()
18845 .cmd_cuda_launch_kernel_nv
18846 .expect("vkCmdCudaLaunchKernelNV not loaded");
18847 unsafe { fp(command_buffer, p_launch_info) };
18848 }
18849 ///Wraps [`vkCmdBeginRendering`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginRendering.html).
18850 /**
18851 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
18852 ///
18853 ///# Safety
18854 ///- `commandBuffer` (self) must be valid and not destroyed.
18855 ///- `commandBuffer` must be externally synchronized.
18856 ///
18857 ///# Panics
18858 ///Panics if `vkCmdBeginRendering` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18859 ///
18860 ///# Usage Notes
18861 ///
18862 ///Begins dynamic rendering, a Vulkan 1.3 alternative to render pass
18863 ///objects that specifies attachments inline at command recording time.
18864 ///
18865 ///**Advantages over render passes**:
18866 ///
18867 ///- No `RenderPass` or `Framebuffer` objects to create and manage.
18868 ///- Attachments are specified directly as image views in
18869 /// `RenderingInfo`.
18870 ///- Simpler code for applications that do not benefit from tile-based
18871 /// subpass optimisations.
18872 ///
18873 ///**`RenderingInfo`** specifies:
18874 ///
18875 ///- **Colour attachments**: image views, load/store ops, clear values.
18876 ///- **Depth attachment**: optional, with its own load/store ops.
18877 ///- **Stencil attachment**: optional, can share the same image view as
18878 /// depth.
18879 ///- **Render area and layer count**.
18880 ///
18881 ///**Flags**:
18882 ///
18883 ///- `RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS`: draw commands come
18884 /// from secondary command buffers.
18885 ///- `RENDERING_SUSPENDING` / `RENDERING_RESUMING`: split rendering
18886 /// across multiple command buffers.
18887 ///
18888 ///Graphics pipelines used with dynamic rendering must be created with
18889 ///`PipelineRenderingCreateInfo` instead of a render pass handle.
18890 pub unsafe fn cmd_begin_rendering(
18891 &self,
18892 command_buffer: CommandBuffer,
18893 p_rendering_info: &RenderingInfo,
18894 ) {
18895 let fp = self
18896 .commands()
18897 .cmd_begin_rendering
18898 .expect("vkCmdBeginRendering not loaded");
18899 unsafe { fp(command_buffer, p_rendering_info) };
18900 }
18901 ///Wraps [`vkCmdEndRendering`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndRendering.html).
18902 /**
18903 Provided by **VK_GRAPHICS_VERSION_1_3**.*/
18904 ///
18905 ///# Safety
18906 ///- `commandBuffer` (self) must be valid and not destroyed.
18907 ///- `commandBuffer` must be externally synchronized.
18908 ///
18909 ///# Panics
18910 ///Panics if `vkCmdEndRendering` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18911 ///
18912 ///# Usage Notes
18913 ///
18914 ///Ends a dynamic rendering instance started by `cmd_begin_rendering`.
18915 ///Store operations and any resolve operations specified in the
18916 ///`RenderingInfo` are executed at this point.
18917 ///
18918 ///After this call, no draw commands may be recorded until a new
18919 ///rendering or render pass instance is begun.
18920 pub unsafe fn cmd_end_rendering(&self, command_buffer: CommandBuffer) {
18921 let fp = self
18922 .commands()
18923 .cmd_end_rendering
18924 .expect("vkCmdEndRendering not loaded");
18925 unsafe { fp(command_buffer) };
18926 }
18927 ///Wraps [`vkCmdEndRendering2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndRendering2KHR.html).
18928 /**
18929 Provided by **VK_KHR_maintenance10**.*/
18930 ///
18931 ///# Safety
18932 ///- `commandBuffer` (self) must be valid and not destroyed.
18933 ///- `commandBuffer` must be externally synchronized.
18934 ///
18935 ///# Panics
18936 ///Panics if `vkCmdEndRendering2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18937 ///
18938 ///# Usage Notes
18939 ///
18940 ///Extended version of `cmd_end_rendering` (core 1.3) that accepts
18941 ///an optional `RenderingEndInfoKHR` with pNext extensibility.
18942 ///
18943 ///Ends the current dynamic rendering pass. If `p_rendering_end_info`
18944 ///is `None`, behaves identically to `cmd_end_rendering`.
18945 ///
18946 ///Provided by `VK_KHR_maintenance7`.
18947 pub unsafe fn cmd_end_rendering2_khr(
18948 &self,
18949 command_buffer: CommandBuffer,
18950 p_rendering_end_info: Option<&RenderingEndInfoKHR>,
18951 ) {
18952 let fp = self
18953 .commands()
18954 .cmd_end_rendering2_khr
18955 .expect("vkCmdEndRendering2KHR not loaded");
18956 let p_rendering_end_info_ptr =
18957 p_rendering_end_info.map_or(core::ptr::null(), core::ptr::from_ref);
18958 unsafe { fp(command_buffer, p_rendering_end_info_ptr) };
18959 }
18960 ///Wraps [`vkGetDescriptorSetLayoutHostMappingInfoVALVE`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDescriptorSetLayoutHostMappingInfoVALVE.html).
18961 /**
18962 Provided by **VK_VALVE_descriptor_set_host_mapping**.*/
18963 ///
18964 ///# Safety
18965 ///- `device` (self) must be valid and not destroyed.
18966 ///
18967 ///# Panics
18968 ///Panics if `vkGetDescriptorSetLayoutHostMappingInfoVALVE` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18969 ///
18970 ///# Usage Notes
18971 ///
18972 ///Queries the host memory layout for a specific binding within a
18973 ///descriptor set layout. Returns the stride and offset needed to
18974 ///write descriptors directly via the host pointer obtained from
18975 ///`get_descriptor_set_host_mapping_valve`.
18976 ///
18977 ///Requires `VK_VALVE_descriptor_set_host_mapping`.
18978 pub unsafe fn get_descriptor_set_layout_host_mapping_info_valve(
18979 &self,
18980 p_binding_reference: &DescriptorSetBindingReferenceVALVE,
18981 p_host_mapping: &mut DescriptorSetLayoutHostMappingInfoVALVE,
18982 ) {
18983 let fp = self
18984 .commands()
18985 .get_descriptor_set_layout_host_mapping_info_valve
18986 .expect("vkGetDescriptorSetLayoutHostMappingInfoVALVE not loaded");
18987 unsafe { fp(self.handle(), p_binding_reference, p_host_mapping) };
18988 }
18989 ///Wraps [`vkGetDescriptorSetHostMappingVALVE`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDescriptorSetHostMappingVALVE.html).
18990 /**
18991 Provided by **VK_VALVE_descriptor_set_host_mapping**.*/
18992 ///
18993 ///# Safety
18994 ///- `device` (self) must be valid and not destroyed.
18995 ///
18996 ///# Panics
18997 ///Panics if `vkGetDescriptorSetHostMappingVALVE` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
18998 ///
18999 ///# Usage Notes
19000 ///
19001 ///Retrieves a host pointer to the internal memory backing a
19002 ///descriptor set. Allows direct CPU writes to descriptor data,
19003 ///bypassing the normal `update_descriptor_sets` path for lower
19004 ///overhead. The layout must match what was queried with
19005 ///`get_descriptor_set_layout_host_mapping_info_valve`.
19006 ///
19007 ///Requires `VK_VALVE_descriptor_set_host_mapping`.
19008 pub unsafe fn get_descriptor_set_host_mapping_valve(
19009 &self,
19010 descriptor_set: DescriptorSet,
19011 pp_data: *mut *mut core::ffi::c_void,
19012 ) {
19013 let fp = self
19014 .commands()
19015 .get_descriptor_set_host_mapping_valve
19016 .expect("vkGetDescriptorSetHostMappingVALVE not loaded");
19017 unsafe { fp(self.handle(), descriptor_set, pp_data) };
19018 }
19019 ///Wraps [`vkCreateMicromapEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateMicromapEXT.html).
19020 /**
19021 Provided by **VK_EXT_opacity_micromap**.*/
19022 ///
19023 ///# Errors
19024 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19025 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
19026 ///- `VK_ERROR_UNKNOWN`
19027 ///- `VK_ERROR_VALIDATION_FAILED`
19028 ///
19029 ///# Safety
19030 ///- `device` (self) must be valid and not destroyed.
19031 ///
19032 ///# Panics
19033 ///Panics if `vkCreateMicromapEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19034 ///
19035 ///# Usage Notes
19036 ///
19037 ///Creates an opacity micromap object. Micromaps store per-triangle
19038 ///opacity or hit data at sub-triangle granularity, enabling the
19039 ///ray tracing implementation to skip fully transparent micro-
19040 ///triangles without invoking any-hit shaders.
19041 ///
19042 ///The `MicromapCreateInfoEXT` specifies the backing buffer, size,
19043 ///and type (`OPACITY_MICROMAP`).
19044 ///
19045 ///Build with `cmd_build_micromaps_ext` or `build_micromaps_ext`.
19046 ///Destroy with `destroy_micromap_ext`.
19047 ///
19048 ///Requires `VK_EXT_opacity_micromap`.
19049 pub unsafe fn create_micromap_ext(
19050 &self,
19051 p_create_info: &MicromapCreateInfoEXT,
19052 allocator: Option<&AllocationCallbacks>,
19053 ) -> VkResult<MicromapEXT> {
19054 let fp = self
19055 .commands()
19056 .create_micromap_ext
19057 .expect("vkCreateMicromapEXT not loaded");
19058 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
19059 let mut out = unsafe { core::mem::zeroed() };
19060 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
19061 Ok(out)
19062 }
19063 ///Wraps [`vkCmdBuildMicromapsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBuildMicromapsEXT.html).
19064 /**
19065 Provided by **VK_EXT_opacity_micromap**.*/
19066 ///
19067 ///# Safety
19068 ///- `commandBuffer` (self) must be valid and not destroyed.
19069 ///- `commandBuffer` must be externally synchronized.
19070 ///
19071 ///# Panics
19072 ///Panics if `vkCmdBuildMicromapsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19073 ///
19074 ///# Usage Notes
19075 ///
19076 ///Records a GPU-side micromap build into a command buffer. Each
19077 ///`MicromapBuildInfoEXT` specifies the source triangle opacity
19078 ///data, destination micromap, and scratch memory.
19079 ///
19080 ///For the CPU-side equivalent, see `build_micromaps_ext`.
19081 ///
19082 ///Requires `VK_EXT_opacity_micromap`.
19083 pub unsafe fn cmd_build_micromaps_ext(
19084 &self,
19085 command_buffer: CommandBuffer,
19086 p_infos: &[MicromapBuildInfoEXT],
19087 ) {
19088 let fp = self
19089 .commands()
19090 .cmd_build_micromaps_ext
19091 .expect("vkCmdBuildMicromapsEXT not loaded");
19092 unsafe { fp(command_buffer, p_infos.len() as u32, p_infos.as_ptr()) };
19093 }
19094 ///Wraps [`vkBuildMicromapsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBuildMicromapsEXT.html).
19095 /**
19096 Provided by **VK_EXT_opacity_micromap**.*/
19097 ///
19098 ///# Errors
19099 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19100 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
19101 ///- `VK_ERROR_UNKNOWN`
19102 ///- `VK_ERROR_VALIDATION_FAILED`
19103 ///
19104 ///# Safety
19105 ///- `device` (self) must be valid and not destroyed.
19106 ///
19107 ///# Panics
19108 ///Panics if `vkBuildMicromapsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19109 ///
19110 ///# Usage Notes
19111 ///
19112 ///Builds one or more micromaps on the host. This is the CPU-side
19113 ///equivalent of `cmd_build_micromaps_ext`.
19114 ///
19115 ///Each `MicromapBuildInfoEXT` specifies the source triangle data,
19116 ///destination micromap, and scratch memory.
19117 ///
19118 ///Requires `VK_EXT_opacity_micromap` and the
19119 ///`micromapHostCommands` feature.
19120 pub unsafe fn build_micromaps_ext(
19121 &self,
19122 deferred_operation: DeferredOperationKHR,
19123 p_infos: &[MicromapBuildInfoEXT],
19124 ) -> VkResult<()> {
19125 let fp = self
19126 .commands()
19127 .build_micromaps_ext
19128 .expect("vkBuildMicromapsEXT not loaded");
19129 check(unsafe {
19130 fp(
19131 self.handle(),
19132 deferred_operation,
19133 p_infos.len() as u32,
19134 p_infos.as_ptr(),
19135 )
19136 })
19137 }
19138 ///Wraps [`vkDestroyMicromapEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyMicromapEXT.html).
19139 /**
19140 Provided by **VK_EXT_opacity_micromap**.*/
19141 ///
19142 ///# Safety
19143 ///- `device` (self) must be valid and not destroyed.
19144 ///- `micromap` must be externally synchronized.
19145 ///
19146 ///# Panics
19147 ///Panics if `vkDestroyMicromapEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19148 ///
19149 ///# Usage Notes
19150 ///
19151 ///Destroys a micromap created with `create_micromap_ext`. The
19152 ///backing buffer is not freed, the application must manage buffer
19153 ///lifetime separately.
19154 ///
19155 ///Requires `VK_EXT_opacity_micromap`.
19156 pub unsafe fn destroy_micromap_ext(
19157 &self,
19158 micromap: MicromapEXT,
19159 allocator: Option<&AllocationCallbacks>,
19160 ) {
19161 let fp = self
19162 .commands()
19163 .destroy_micromap_ext
19164 .expect("vkDestroyMicromapEXT not loaded");
19165 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
19166 unsafe { fp(self.handle(), micromap, alloc_ptr) };
19167 }
19168 ///Wraps [`vkCmdCopyMicromapEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMicromapEXT.html).
19169 /**
19170 Provided by **VK_EXT_opacity_micromap**.*/
19171 ///
19172 ///# Safety
19173 ///- `commandBuffer` (self) must be valid and not destroyed.
19174 ///- `commandBuffer` must be externally synchronized.
19175 ///
19176 ///# Panics
19177 ///Panics if `vkCmdCopyMicromapEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19178 ///
19179 ///# Usage Notes
19180 ///
19181 ///Copies or compacts a micromap. The `CopyMicromapInfoEXT` specifies
19182 ///source, destination, and mode (`CLONE` or `COMPACT`).
19183 ///
19184 ///Use `COMPACT` after building with `BUILD_ALLOW_COMPACTION` to
19185 ///reduce memory usage. Query the compacted size with
19186 ///`cmd_write_micromaps_properties_ext`.
19187 ///
19188 ///Requires `VK_EXT_opacity_micromap`.
19189 pub unsafe fn cmd_copy_micromap_ext(
19190 &self,
19191 command_buffer: CommandBuffer,
19192 p_info: &CopyMicromapInfoEXT,
19193 ) {
19194 let fp = self
19195 .commands()
19196 .cmd_copy_micromap_ext
19197 .expect("vkCmdCopyMicromapEXT not loaded");
19198 unsafe { fp(command_buffer, p_info) };
19199 }
19200 ///Wraps [`vkCopyMicromapEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCopyMicromapEXT.html).
19201 /**
19202 Provided by **VK_EXT_opacity_micromap**.*/
19203 ///
19204 ///# Errors
19205 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19206 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
19207 ///- `VK_ERROR_UNKNOWN`
19208 ///- `VK_ERROR_VALIDATION_FAILED`
19209 ///
19210 ///# Safety
19211 ///- `device` (self) must be valid and not destroyed.
19212 ///
19213 ///# Panics
19214 ///Panics if `vkCopyMicromapEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19215 ///
19216 ///# Usage Notes
19217 ///
19218 ///Host-side micromap copy or compaction. This is the CPU equivalent
19219 ///of `cmd_copy_micromap_ext`.
19220 ///
19221 ///Requires `VK_EXT_opacity_micromap` and the
19222 ///`micromapHostCommands` feature.
19223 pub unsafe fn copy_micromap_ext(
19224 &self,
19225 deferred_operation: DeferredOperationKHR,
19226 p_info: &CopyMicromapInfoEXT,
19227 ) -> VkResult<()> {
19228 let fp = self
19229 .commands()
19230 .copy_micromap_ext
19231 .expect("vkCopyMicromapEXT not loaded");
19232 check(unsafe { fp(self.handle(), deferred_operation, p_info) })
19233 }
19234 ///Wraps [`vkCmdCopyMicromapToMemoryEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMicromapToMemoryEXT.html).
19235 /**
19236 Provided by **VK_EXT_opacity_micromap**.*/
19237 ///
19238 ///# Safety
19239 ///- `commandBuffer` (self) must be valid and not destroyed.
19240 ///- `commandBuffer` must be externally synchronized.
19241 ///
19242 ///# Panics
19243 ///Panics if `vkCmdCopyMicromapToMemoryEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19244 ///
19245 ///# Usage Notes
19246 ///
19247 ///Serializes a micromap into a buffer for storage or transfer.
19248 ///The `CopyMicromapToMemoryInfoEXT` specifies the source micromap
19249 ///and destination device address.
19250 ///
19251 ///Deserialize with `cmd_copy_memory_to_micromap_ext`.
19252 ///
19253 ///Requires `VK_EXT_opacity_micromap`.
19254 pub unsafe fn cmd_copy_micromap_to_memory_ext(
19255 &self,
19256 command_buffer: CommandBuffer,
19257 p_info: &CopyMicromapToMemoryInfoEXT,
19258 ) {
19259 let fp = self
19260 .commands()
19261 .cmd_copy_micromap_to_memory_ext
19262 .expect("vkCmdCopyMicromapToMemoryEXT not loaded");
19263 unsafe { fp(command_buffer, p_info) };
19264 }
19265 ///Wraps [`vkCopyMicromapToMemoryEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCopyMicromapToMemoryEXT.html).
19266 /**
19267 Provided by **VK_EXT_opacity_micromap**.*/
19268 ///
19269 ///# Errors
19270 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19271 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
19272 ///- `VK_ERROR_UNKNOWN`
19273 ///- `VK_ERROR_VALIDATION_FAILED`
19274 ///
19275 ///# Safety
19276 ///- `device` (self) must be valid and not destroyed.
19277 ///
19278 ///# Panics
19279 ///Panics if `vkCopyMicromapToMemoryEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19280 ///
19281 ///# Usage Notes
19282 ///
19283 ///Host-side serialization of a micromap into a buffer. This is the
19284 ///CPU equivalent of `cmd_copy_micromap_to_memory_ext`.
19285 ///
19286 ///Requires `VK_EXT_opacity_micromap` and the
19287 ///`micromapHostCommands` feature.
19288 pub unsafe fn copy_micromap_to_memory_ext(
19289 &self,
19290 deferred_operation: DeferredOperationKHR,
19291 p_info: &CopyMicromapToMemoryInfoEXT,
19292 ) -> VkResult<()> {
19293 let fp = self
19294 .commands()
19295 .copy_micromap_to_memory_ext
19296 .expect("vkCopyMicromapToMemoryEXT not loaded");
19297 check(unsafe { fp(self.handle(), deferred_operation, p_info) })
19298 }
19299 ///Wraps [`vkCmdCopyMemoryToMicromapEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMemoryToMicromapEXT.html).
19300 /**
19301 Provided by **VK_EXT_opacity_micromap**.*/
19302 ///
19303 ///# Safety
19304 ///- `commandBuffer` (self) must be valid and not destroyed.
19305 ///- `commandBuffer` must be externally synchronized.
19306 ///
19307 ///# Panics
19308 ///Panics if `vkCmdCopyMemoryToMicromapEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19309 ///
19310 ///# Usage Notes
19311 ///
19312 ///Deserializes a micromap from a buffer into a micromap object.
19313 ///This is the reverse of `cmd_copy_micromap_to_memory_ext`.
19314 ///
19315 ///Used for loading previously serialized micromaps from disk or
19316 ///transferring between devices.
19317 ///
19318 ///Requires `VK_EXT_opacity_micromap`.
19319 pub unsafe fn cmd_copy_memory_to_micromap_ext(
19320 &self,
19321 command_buffer: CommandBuffer,
19322 p_info: &CopyMemoryToMicromapInfoEXT,
19323 ) {
19324 let fp = self
19325 .commands()
19326 .cmd_copy_memory_to_micromap_ext
19327 .expect("vkCmdCopyMemoryToMicromapEXT not loaded");
19328 unsafe { fp(command_buffer, p_info) };
19329 }
19330 ///Wraps [`vkCopyMemoryToMicromapEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCopyMemoryToMicromapEXT.html).
19331 /**
19332 Provided by **VK_EXT_opacity_micromap**.*/
19333 ///
19334 ///# Errors
19335 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19336 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
19337 ///- `VK_ERROR_UNKNOWN`
19338 ///- `VK_ERROR_VALIDATION_FAILED`
19339 ///
19340 ///# Safety
19341 ///- `device` (self) must be valid and not destroyed.
19342 ///
19343 ///# Panics
19344 ///Panics if `vkCopyMemoryToMicromapEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19345 ///
19346 ///# Usage Notes
19347 ///
19348 ///Host-side deserialization of a micromap from a buffer. This is
19349 ///the CPU equivalent of `cmd_copy_memory_to_micromap_ext`.
19350 ///
19351 ///Requires `VK_EXT_opacity_micromap` and the
19352 ///`micromapHostCommands` feature.
19353 pub unsafe fn copy_memory_to_micromap_ext(
19354 &self,
19355 deferred_operation: DeferredOperationKHR,
19356 p_info: &CopyMemoryToMicromapInfoEXT,
19357 ) -> VkResult<()> {
19358 let fp = self
19359 .commands()
19360 .copy_memory_to_micromap_ext
19361 .expect("vkCopyMemoryToMicromapEXT not loaded");
19362 check(unsafe { fp(self.handle(), deferred_operation, p_info) })
19363 }
19364 ///Wraps [`vkCmdWriteMicromapsPropertiesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWriteMicromapsPropertiesEXT.html).
19365 /**
19366 Provided by **VK_EXT_opacity_micromap**.*/
19367 ///
19368 ///# Safety
19369 ///- `commandBuffer` (self) must be valid and not destroyed.
19370 ///- `commandBuffer` must be externally synchronized.
19371 ///
19372 ///# Panics
19373 ///Panics if `vkCmdWriteMicromapsPropertiesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19374 ///
19375 ///# Usage Notes
19376 ///
19377 ///Writes micromap properties (e.g., compacted size) to a query pool.
19378 ///Use `QUERY_TYPE_MICROMAP_COMPACTED_SIZE_EXT` to query the size
19379 ///needed for a compacted copy.
19380 ///
19381 ///Requires `VK_EXT_opacity_micromap`.
19382 pub unsafe fn cmd_write_micromaps_properties_ext(
19383 &self,
19384 command_buffer: CommandBuffer,
19385 p_micromaps: &[MicromapEXT],
19386 query_type: QueryType,
19387 query_pool: QueryPool,
19388 first_query: u32,
19389 ) {
19390 let fp = self
19391 .commands()
19392 .cmd_write_micromaps_properties_ext
19393 .expect("vkCmdWriteMicromapsPropertiesEXT not loaded");
19394 unsafe {
19395 fp(
19396 command_buffer,
19397 p_micromaps.len() as u32,
19398 p_micromaps.as_ptr(),
19399 query_type,
19400 query_pool,
19401 first_query,
19402 )
19403 };
19404 }
19405 ///Wraps [`vkWriteMicromapsPropertiesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkWriteMicromapsPropertiesEXT.html).
19406 /**
19407 Provided by **VK_EXT_opacity_micromap**.*/
19408 ///
19409 ///# Errors
19410 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19411 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
19412 ///- `VK_ERROR_UNKNOWN`
19413 ///- `VK_ERROR_VALIDATION_FAILED`
19414 ///
19415 ///# Safety
19416 ///- `device` (self) must be valid and not destroyed.
19417 ///
19418 ///# Panics
19419 ///Panics if `vkWriteMicromapsPropertiesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19420 ///
19421 ///# Usage Notes
19422 ///
19423 ///Host-side query of micromap properties. This is the CPU equivalent
19424 ///of `cmd_write_micromaps_properties_ext`.
19425 ///
19426 ///Typically used to query compacted size
19427 ///(`QUERY_TYPE_MICROMAP_COMPACTED_SIZE_EXT`) without going through
19428 ///a query pool.
19429 ///
19430 ///Requires `VK_EXT_opacity_micromap` and the
19431 ///`micromapHostCommands` feature.
19432 pub unsafe fn write_micromaps_properties_ext(
19433 &self,
19434 p_micromaps: &[MicromapEXT],
19435 query_type: QueryType,
19436 data_size: usize,
19437 p_data: *mut core::ffi::c_void,
19438 stride: usize,
19439 ) -> VkResult<()> {
19440 let fp = self
19441 .commands()
19442 .write_micromaps_properties_ext
19443 .expect("vkWriteMicromapsPropertiesEXT not loaded");
19444 check(unsafe {
19445 fp(
19446 self.handle(),
19447 p_micromaps.len() as u32,
19448 p_micromaps.as_ptr(),
19449 query_type,
19450 data_size,
19451 p_data,
19452 stride,
19453 )
19454 })
19455 }
19456 ///Wraps [`vkGetDeviceMicromapCompatibilityEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceMicromapCompatibilityEXT.html).
19457 /**
19458 Provided by **VK_EXT_opacity_micromap**.*/
19459 ///
19460 ///# Safety
19461 ///- `device` (self) must be valid and not destroyed.
19462 ///
19463 ///# Panics
19464 ///Panics if `vkGetDeviceMicromapCompatibilityEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19465 ///
19466 ///# Usage Notes
19467 ///
19468 ///Checks whether a serialized micromap is compatible with the
19469 ///current device. Returns `COMPATIBLE` or `INCOMPATIBLE`.
19470 ///
19471 ///Use this before deserializing a micromap (via
19472 ///`cmd_copy_memory_to_micromap_ext` or `copy_memory_to_micromap_ext`)
19473 ///to verify it will work on this device.
19474 ///
19475 ///Requires `VK_EXT_opacity_micromap`.
19476 pub unsafe fn get_device_micromap_compatibility_ext(
19477 &self,
19478 p_version_info: &MicromapVersionInfoEXT,
19479 ) -> AccelerationStructureCompatibilityKHR {
19480 let fp = self
19481 .commands()
19482 .get_device_micromap_compatibility_ext
19483 .expect("vkGetDeviceMicromapCompatibilityEXT not loaded");
19484 let mut out = unsafe { core::mem::zeroed() };
19485 unsafe { fp(self.handle(), p_version_info, &mut out) };
19486 out
19487 }
19488 ///Wraps [`vkGetMicromapBuildSizesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMicromapBuildSizesEXT.html).
19489 /**
19490 Provided by **VK_EXT_opacity_micromap**.*/
19491 ///
19492 ///# Safety
19493 ///- `device` (self) must be valid and not destroyed.
19494 ///
19495 ///# Panics
19496 ///Panics if `vkGetMicromapBuildSizesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19497 ///
19498 ///# Usage Notes
19499 ///
19500 ///Queries the memory requirements for building a micromap. Returns
19501 ///the destination micromap size and scratch memory size needed.
19502 ///
19503 ///Provide a `MicromapBuildInfoEXT` with the triangle counts and
19504 ///format. The addresses can be null, only the sizes and counts
19505 ///matter for this query.
19506 ///
19507 ///Use the results to allocate the micromap buffer and scratch buffer
19508 ///before calling `cmd_build_micromaps_ext`.
19509 ///
19510 ///Requires `VK_EXT_opacity_micromap`.
19511 pub unsafe fn get_micromap_build_sizes_ext(
19512 &self,
19513 build_type: AccelerationStructureBuildTypeKHR,
19514 p_build_info: &MicromapBuildInfoEXT,
19515 p_size_info: &mut MicromapBuildSizesInfoEXT,
19516 ) {
19517 let fp = self
19518 .commands()
19519 .get_micromap_build_sizes_ext
19520 .expect("vkGetMicromapBuildSizesEXT not loaded");
19521 unsafe { fp(self.handle(), build_type, p_build_info, p_size_info) };
19522 }
19523 ///Wraps [`vkGetShaderModuleIdentifierEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetShaderModuleIdentifierEXT.html).
19524 /**
19525 Provided by **VK_EXT_shader_module_identifier**.*/
19526 ///
19527 ///# Safety
19528 ///- `device` (self) must be valid and not destroyed.
19529 ///
19530 ///# Panics
19531 ///Panics if `vkGetShaderModuleIdentifierEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19532 ///
19533 ///# Usage Notes
19534 ///
19535 ///Retrieves the identifier for an existing shader module. The
19536 ///identifier can be used for pipeline cache lookups via
19537 ///`PipelineShaderStageModuleIdentifierCreateInfoEXT`.
19538 ///
19539 ///The identifier is deterministic for the same SPIR-V content
19540 ///on the same implementation.
19541 ///
19542 ///Requires `VK_EXT_shader_module_identifier`.
19543 pub unsafe fn get_shader_module_identifier_ext(
19544 &self,
19545 shader_module: ShaderModule,
19546 p_identifier: &mut ShaderModuleIdentifierEXT,
19547 ) {
19548 let fp = self
19549 .commands()
19550 .get_shader_module_identifier_ext
19551 .expect("vkGetShaderModuleIdentifierEXT not loaded");
19552 unsafe { fp(self.handle(), shader_module, p_identifier) };
19553 }
19554 ///Wraps [`vkGetShaderModuleCreateInfoIdentifierEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetShaderModuleCreateInfoIdentifierEXT.html).
19555 /**
19556 Provided by **VK_EXT_shader_module_identifier**.*/
19557 ///
19558 ///# Safety
19559 ///- `device` (self) must be valid and not destroyed.
19560 ///
19561 ///# Panics
19562 ///Panics if `vkGetShaderModuleCreateInfoIdentifierEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19563 ///
19564 ///# Usage Notes
19565 ///
19566 ///Computes an identifier for a shader module from its create info
19567 ///(SPIR-V code) without creating the module. The identifier can be
19568 ///used in `PipelineShaderStageModuleIdentifierCreateInfoEXT` to
19569 ///create pipelines from cached shader data.
19570 ///
19571 ///Useful for pipeline caching workflows where the SPIR-V is
19572 ///available but you want to avoid full module creation.
19573 ///
19574 ///Requires `VK_EXT_shader_module_identifier`.
19575 pub unsafe fn get_shader_module_create_info_identifier_ext(
19576 &self,
19577 p_create_info: &ShaderModuleCreateInfo,
19578 p_identifier: &mut ShaderModuleIdentifierEXT,
19579 ) {
19580 let fp = self
19581 .commands()
19582 .get_shader_module_create_info_identifier_ext
19583 .expect("vkGetShaderModuleCreateInfoIdentifierEXT not loaded");
19584 unsafe { fp(self.handle(), p_create_info, p_identifier) };
19585 }
19586 ///Wraps [`vkGetImageSubresourceLayout2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageSubresourceLayout2.html).
19587 /**
19588 Provided by **VK_BASE_VERSION_1_4**.*/
19589 ///
19590 ///# Safety
19591 ///- `device` (self) must be valid and not destroyed.
19592 ///
19593 ///# Panics
19594 ///Panics if `vkGetImageSubresourceLayout2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19595 ///
19596 ///# Usage Notes
19597 ///
19598 ///Vulkan 1.4 version of `get_image_subresource_layout` that uses
19599 ///extensible structs via pNext.
19600 ///
19601 ///Returns the layout (offset, size, row pitch, array pitch, depth
19602 ///pitch) for a given subresource of an existing image. Chain
19603 ///`ImageCompressionPropertiesEXT` to query fixed-rate compression
19604 ///state.
19605 ///
19606 ///For linear-tiling images, this tells you how to access texels
19607 ///through a mapped pointer. For optimal-tiling images, the layout is
19608 ///opaque and implementation-defined.
19609 pub unsafe fn get_image_subresource_layout2(
19610 &self,
19611 image: Image,
19612 p_subresource: &ImageSubresource2,
19613 p_layout: &mut SubresourceLayout2,
19614 ) {
19615 let fp = self
19616 .commands()
19617 .get_image_subresource_layout2
19618 .expect("vkGetImageSubresourceLayout2 not loaded");
19619 unsafe { fp(self.handle(), image, p_subresource, p_layout) };
19620 }
19621 ///Wraps [`vkGetPipelinePropertiesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPipelinePropertiesEXT.html).
19622 /**
19623 Provided by **VK_EXT_pipeline_properties**.*/
19624 ///
19625 ///# Errors
19626 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19627 ///- `VK_ERROR_UNKNOWN`
19628 ///- `VK_ERROR_VALIDATION_FAILED`
19629 ///
19630 ///# Safety
19631 ///- `device` (self) must be valid and not destroyed.
19632 ///
19633 ///# Panics
19634 ///Panics if `vkGetPipelinePropertiesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19635 ///
19636 ///# Usage Notes
19637 ///
19638 ///Queries properties of a pipeline, such as its pipeline identifier.
19639 ///The identifier can be used to correlate pipelines across processes
19640 ///or with external tools.
19641 ///
19642 ///Requires `VK_EXT_pipeline_properties`.
19643 pub unsafe fn get_pipeline_properties_ext(
19644 &self,
19645 p_pipeline_info: &PipelineInfoEXT,
19646 p_pipeline_properties: &mut BaseOutStructure,
19647 ) -> VkResult<()> {
19648 let fp = self
19649 .commands()
19650 .get_pipeline_properties_ext
19651 .expect("vkGetPipelinePropertiesEXT not loaded");
19652 check(unsafe { fp(self.handle(), p_pipeline_info, p_pipeline_properties) })
19653 }
19654 ///Wraps [`vkExportMetalObjectsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkExportMetalObjectsEXT.html).
19655 /**
19656 Provided by **VK_EXT_metal_objects**.*/
19657 ///
19658 ///# Safety
19659 ///- `device` (self) must be valid and not destroyed.
19660 ///
19661 ///# Panics
19662 ///Panics if `vkExportMetalObjectsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19663 ///
19664 ///# Usage Notes
19665 ///
19666 ///Exports the underlying Metal objects (device, command queue,
19667 ///textures, buffers, etc.) from Vulkan objects. Chain the
19668 ///appropriate export struct into the pNext of the info structure
19669 ///to select which Metal object to retrieve.
19670 ///
19671 ///Useful for Metal interop on Apple platforms where both APIs
19672 ///share the same GPU resources.
19673 ///
19674 ///Requires `VK_EXT_metal_objects`. macOS/iOS only.
19675 pub unsafe fn export_metal_objects_ext(
19676 &self,
19677 p_metal_objects_info: &mut ExportMetalObjectsInfoEXT,
19678 ) {
19679 let fp = self
19680 .commands()
19681 .export_metal_objects_ext
19682 .expect("vkExportMetalObjectsEXT not loaded");
19683 unsafe { fp(self.handle(), p_metal_objects_info) };
19684 }
19685 ///Wraps [`vkCmdBindTileMemoryQCOM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindTileMemoryQCOM.html).
19686 /**
19687 Provided by **VK_QCOM_tile_memory_heap**.*/
19688 ///
19689 ///# Safety
19690 ///- `commandBuffer` (self) must be valid and not destroyed.
19691 ///- `commandBuffer` must be externally synchronized.
19692 ///
19693 ///# Panics
19694 ///Panics if `vkCmdBindTileMemoryQCOM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19695 ///
19696 ///# Usage Notes
19697 ///
19698 ///Binds tile memory for use within a per-tile execution region on
19699 ///Qualcomm tile-based GPUs. Pass `None` to unbind. Tile memory
19700 ///provides fast on-chip scratch storage scoped to each tile.
19701 ///
19702 ///Requires `VK_QCOM_tile_shading`.
19703 pub unsafe fn cmd_bind_tile_memory_qcom(
19704 &self,
19705 command_buffer: CommandBuffer,
19706 p_tile_memory_bind_info: Option<&TileMemoryBindInfoQCOM>,
19707 ) {
19708 let fp = self
19709 .commands()
19710 .cmd_bind_tile_memory_qcom
19711 .expect("vkCmdBindTileMemoryQCOM not loaded");
19712 let p_tile_memory_bind_info_ptr =
19713 p_tile_memory_bind_info.map_or(core::ptr::null(), core::ptr::from_ref);
19714 unsafe { fp(command_buffer, p_tile_memory_bind_info_ptr) };
19715 }
19716 ///Wraps [`vkGetFramebufferTilePropertiesQCOM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetFramebufferTilePropertiesQCOM.html).
19717 /**
19718 Provided by **VK_QCOM_tile_properties**.*/
19719 ///
19720 ///# Errors
19721 ///- `VK_ERROR_UNKNOWN`
19722 ///- `VK_ERROR_VALIDATION_FAILED`
19723 ///
19724 ///# Safety
19725 ///- `device` (self) must be valid and not destroyed.
19726 ///
19727 ///# Panics
19728 ///Panics if `vkGetFramebufferTilePropertiesQCOM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19729 ///
19730 ///# Usage Notes
19731 ///
19732 ///Queries tile properties (tile dimensions and extents) for a
19733 ///framebuffer on Qualcomm tile-based GPUs. Uses the two-call
19734 ///idiom. Useful for optimising rendering to match the hardware
19735 ///tile layout.
19736 ///
19737 ///Requires `VK_QCOM_tile_properties`.
19738 pub unsafe fn get_framebuffer_tile_properties_qcom(
19739 &self,
19740 framebuffer: Framebuffer,
19741 ) -> VkResult<Vec<TilePropertiesQCOM>> {
19742 let fp = self
19743 .commands()
19744 .get_framebuffer_tile_properties_qcom
19745 .expect("vkGetFramebufferTilePropertiesQCOM not loaded");
19746 enumerate_two_call(|count, data| unsafe { fp(self.handle(), framebuffer, count, data) })
19747 }
19748 ///Wraps [`vkGetDynamicRenderingTilePropertiesQCOM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDynamicRenderingTilePropertiesQCOM.html).
19749 /**
19750 Provided by **VK_QCOM_tile_properties**.*/
19751 ///
19752 ///# Errors
19753 ///- `VK_ERROR_UNKNOWN`
19754 ///- `VK_ERROR_VALIDATION_FAILED`
19755 ///
19756 ///# Safety
19757 ///- `device` (self) must be valid and not destroyed.
19758 ///
19759 ///# Panics
19760 ///Panics if `vkGetDynamicRenderingTilePropertiesQCOM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19761 ///
19762 ///# Usage Notes
19763 ///
19764 ///Queries tile properties for a dynamic rendering pass (as opposed
19765 ///to a framebuffer-based render pass). Returns tile dimensions that
19766 ///would be used for the given rendering info on Qualcomm tile-based
19767 ///GPUs.
19768 ///
19769 ///Requires `VK_QCOM_tile_properties`.
19770 pub unsafe fn get_dynamic_rendering_tile_properties_qcom(
19771 &self,
19772 p_rendering_info: &RenderingInfo,
19773 p_properties: &mut TilePropertiesQCOM,
19774 ) -> VkResult<()> {
19775 let fp = self
19776 .commands()
19777 .get_dynamic_rendering_tile_properties_qcom
19778 .expect("vkGetDynamicRenderingTilePropertiesQCOM not loaded");
19779 check(unsafe { fp(self.handle(), p_rendering_info, p_properties) })
19780 }
19781 ///Wraps [`vkCreateOpticalFlowSessionNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateOpticalFlowSessionNV.html).
19782 /**
19783 Provided by **VK_NV_optical_flow**.*/
19784 ///
19785 ///# Errors
19786 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19787 ///- `VK_ERROR_INITIALIZATION_FAILED`
19788 ///- `VK_ERROR_UNKNOWN`
19789 ///- `VK_ERROR_VALIDATION_FAILED`
19790 ///
19791 ///# Safety
19792 ///- `device` (self) must be valid and not destroyed.
19793 ///
19794 ///# Panics
19795 ///Panics if `vkCreateOpticalFlowSessionNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19796 ///
19797 ///# Usage Notes
19798 ///
19799 ///Creates an optical flow session for GPU-accelerated motion
19800 ///estimation between image pairs. Configure the session with image
19801 ///format, resolution, and flow precision in the create info.
19802 ///
19803 ///Destroy with `destroy_optical_flow_session_nv`.
19804 ///
19805 ///Requires `VK_NV_optical_flow`.
19806 pub unsafe fn create_optical_flow_session_nv(
19807 &self,
19808 p_create_info: &OpticalFlowSessionCreateInfoNV,
19809 allocator: Option<&AllocationCallbacks>,
19810 ) -> VkResult<OpticalFlowSessionNV> {
19811 let fp = self
19812 .commands()
19813 .create_optical_flow_session_nv
19814 .expect("vkCreateOpticalFlowSessionNV not loaded");
19815 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
19816 let mut out = unsafe { core::mem::zeroed() };
19817 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
19818 Ok(out)
19819 }
19820 ///Wraps [`vkDestroyOpticalFlowSessionNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyOpticalFlowSessionNV.html).
19821 /**
19822 Provided by **VK_NV_optical_flow**.*/
19823 ///
19824 ///# Safety
19825 ///- `device` (self) must be valid and not destroyed.
19826 ///
19827 ///# Panics
19828 ///Panics if `vkDestroyOpticalFlowSessionNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19829 ///
19830 ///# Usage Notes
19831 ///
19832 ///Destroys an optical flow session created with
19833 ///`create_optical_flow_session_nv`.
19834 ///
19835 ///Requires `VK_NV_optical_flow`.
19836 pub unsafe fn destroy_optical_flow_session_nv(
19837 &self,
19838 session: OpticalFlowSessionNV,
19839 allocator: Option<&AllocationCallbacks>,
19840 ) {
19841 let fp = self
19842 .commands()
19843 .destroy_optical_flow_session_nv
19844 .expect("vkDestroyOpticalFlowSessionNV not loaded");
19845 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
19846 unsafe { fp(self.handle(), session, alloc_ptr) };
19847 }
19848 ///Wraps [`vkBindOpticalFlowSessionImageNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBindOpticalFlowSessionImageNV.html).
19849 /**
19850 Provided by **VK_NV_optical_flow**.*/
19851 ///
19852 ///# Errors
19853 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19854 ///- `VK_ERROR_INITIALIZATION_FAILED`
19855 ///- `VK_ERROR_UNKNOWN`
19856 ///- `VK_ERROR_VALIDATION_FAILED`
19857 ///
19858 ///# Safety
19859 ///- `device` (self) must be valid and not destroyed.
19860 ///
19861 ///# Panics
19862 ///Panics if `vkBindOpticalFlowSessionImageNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19863 ///
19864 ///# Usage Notes
19865 ///
19866 ///Binds an image view to an optical flow session at a specific
19867 ///binding point (reference, target, flow vector output, etc.).
19868 ///All required binding points must be bound before executing the
19869 ///optical flow.
19870 ///
19871 ///Requires `VK_NV_optical_flow`.
19872 pub unsafe fn bind_optical_flow_session_image_nv(
19873 &self,
19874 session: OpticalFlowSessionNV,
19875 binding_point: OpticalFlowSessionBindingPointNV,
19876 view: ImageView,
19877 layout: ImageLayout,
19878 ) -> VkResult<()> {
19879 let fp = self
19880 .commands()
19881 .bind_optical_flow_session_image_nv
19882 .expect("vkBindOpticalFlowSessionImageNV not loaded");
19883 check(unsafe { fp(self.handle(), session, binding_point, view, layout) })
19884 }
19885 ///Wraps [`vkCmdOpticalFlowExecuteNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdOpticalFlowExecuteNV.html).
19886 /**
19887 Provided by **VK_NV_optical_flow**.*/
19888 ///
19889 ///# Safety
19890 ///- `commandBuffer` (self) must be valid and not destroyed.
19891 ///
19892 ///# Panics
19893 ///Panics if `vkCmdOpticalFlowExecuteNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19894 ///
19895 ///# Usage Notes
19896 ///
19897 ///Executes optical flow estimation on the GPU using the bound
19898 ///reference and target images. Results are written to the bound
19899 ///flow vector output image.
19900 ///
19901 ///Requires `VK_NV_optical_flow`.
19902 pub unsafe fn cmd_optical_flow_execute_nv(
19903 &self,
19904 command_buffer: CommandBuffer,
19905 session: OpticalFlowSessionNV,
19906 p_execute_info: &OpticalFlowExecuteInfoNV,
19907 ) {
19908 let fp = self
19909 .commands()
19910 .cmd_optical_flow_execute_nv
19911 .expect("vkCmdOpticalFlowExecuteNV not loaded");
19912 unsafe { fp(command_buffer, session, p_execute_info) };
19913 }
19914 ///Wraps [`vkGetDeviceFaultInfoEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceFaultInfoEXT.html).
19915 /**
19916 Provided by **VK_EXT_device_fault**.*/
19917 ///
19918 ///# Errors
19919 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19920 ///- `VK_ERROR_UNKNOWN`
19921 ///- `VK_ERROR_VALIDATION_FAILED`
19922 ///
19923 ///# Safety
19924 ///- `device` (self) must be valid and not destroyed.
19925 ///
19926 ///# Panics
19927 ///Panics if `vkGetDeviceFaultInfoEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19928 ///
19929 ///# Usage Notes
19930 ///
19931 ///Retrieves diagnostic information after a device-lost error. Call
19932 ///once with a null info pointer to query the fault counts, then
19933 ///again with allocated structures to retrieve the fault details.
19934 ///
19935 ///The returned data is vendor-specific and intended for crash
19936 ///reporting and post-mortem debugging.
19937 ///
19938 ///Requires `VK_EXT_device_fault`.
19939 pub unsafe fn get_device_fault_info_ext(
19940 &self,
19941 p_fault_counts: &mut DeviceFaultCountsEXT,
19942 p_fault_info: &mut DeviceFaultInfoEXT,
19943 ) -> VkResult<()> {
19944 let fp = self
19945 .commands()
19946 .get_device_fault_info_ext
19947 .expect("vkGetDeviceFaultInfoEXT not loaded");
19948 check(unsafe { fp(self.handle(), p_fault_counts, p_fault_info) })
19949 }
19950 ///Wraps [`vkGetDeviceFaultReportsKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceFaultReportsKHR.html).
19951 /**
19952 Provided by **VK_KHR_device_fault**.*/
19953 ///
19954 ///# Errors
19955 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19956 ///- `VK_ERROR_UNKNOWN`
19957 ///- `VK_ERROR_VALIDATION_FAILED`
19958 ///
19959 ///# Safety
19960 ///- `device` (self) must be valid and not destroyed.
19961 ///
19962 ///# Panics
19963 ///Panics if `vkGetDeviceFaultReportsKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
19964 ///
19965 ///# Usage Notes
19966 ///
19967 ///Retrieves fault reports after a device loss (`ERROR_DEVICE_LOST`).
19968 ///Returns a list of `DeviceFaultInfoKHR` structs describing what
19969 ///went wrong, address faults, vendor-specific fault codes, etc.
19970 ///
19971 ///`timeout` specifies how long to wait (in nanoseconds) for the
19972 ///driver to collect fault data. Use `UINT64_MAX` to wait
19973 ///indefinitely.
19974 ///
19975 ///For raw debug data suitable for vendor tools, follow up with
19976 ///`get_device_fault_debug_info_khr`.
19977 ///
19978 ///Requires `VK_KHR_device_fault`.
19979 pub unsafe fn get_device_fault_reports_khr(
19980 &self,
19981 timeout: u64,
19982 ) -> VkResult<Vec<DeviceFaultInfoKHR>> {
19983 let fp = self
19984 .commands()
19985 .get_device_fault_reports_khr
19986 .expect("vkGetDeviceFaultReportsKHR not loaded");
19987 enumerate_two_call(|count, data| unsafe { fp(self.handle(), timeout, count, data) })
19988 }
19989 ///Wraps [`vkGetDeviceFaultDebugInfoKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceFaultDebugInfoKHR.html).
19990 /**
19991 Provided by **VK_KHR_device_fault**.*/
19992 ///
19993 ///# Errors
19994 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
19995 ///- `VK_ERROR_NOT_ENOUGH_SPACE_KHR`
19996 ///- `VK_ERROR_UNKNOWN`
19997 ///- `VK_ERROR_VALIDATION_FAILED`
19998 ///
19999 ///# Safety
20000 ///- `device` (self) must be valid and not destroyed.
20001 ///
20002 ///# Panics
20003 ///Panics if `vkGetDeviceFaultDebugInfoKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20004 ///
20005 ///# Usage Notes
20006 ///
20007 ///Retrieves debug information after a device fault (GPU crash or
20008 ///hang). The returned `DeviceFaultDebugInfoKHR` contains
20009 ///vendor-specific binary data that can be passed to GPU vendor
20010 ///diagnostic tools.
20011 ///
20012 ///Call `get_device_fault_reports_khr` first to get the high-level
20013 ///fault reports; this call provides the raw debug blob.
20014 ///
20015 ///Requires `VK_KHR_device_fault`.
20016 pub unsafe fn get_device_fault_debug_info_khr(
20017 &self,
20018 p_debug_info: &mut DeviceFaultDebugInfoKHR,
20019 ) -> VkResult<()> {
20020 let fp = self
20021 .commands()
20022 .get_device_fault_debug_info_khr
20023 .expect("vkGetDeviceFaultDebugInfoKHR not loaded");
20024 check(unsafe { fp(self.handle(), p_debug_info) })
20025 }
20026 ///Wraps [`vkCmdSetDepthBias2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthBias2EXT.html).
20027 /**
20028 Provided by **VK_EXT_depth_bias_control**.*/
20029 ///
20030 ///# Safety
20031 ///- `commandBuffer` (self) must be valid and not destroyed.
20032 ///- `commandBuffer` must be externally synchronized.
20033 ///
20034 ///# Panics
20035 ///Panics if `vkCmdSetDepthBias2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20036 ///
20037 ///# Usage Notes
20038 ///
20039 ///Extended version of `cmd_set_depth_bias` that takes a
20040 ///`DepthBiasInfoEXT` struct with pNext extensibility. This allows
20041 ///chaining `DepthBiasRepresentationInfoEXT` to control the depth
20042 ///bias representation (least-representable-value vs. float).
20043 ///
20044 ///Requires `VK_EXT_depth_bias_control`.
20045 pub unsafe fn cmd_set_depth_bias2_ext(
20046 &self,
20047 command_buffer: CommandBuffer,
20048 p_depth_bias_info: &DepthBiasInfoEXT,
20049 ) {
20050 let fp = self
20051 .commands()
20052 .cmd_set_depth_bias2_ext
20053 .expect("vkCmdSetDepthBias2EXT not loaded");
20054 unsafe { fp(command_buffer, p_depth_bias_info) };
20055 }
20056 ///Wraps [`vkReleaseSwapchainImagesKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkReleaseSwapchainImagesKHR.html).
20057 /**
20058 Provided by **VK_KHR_swapchain_maintenance1**.*/
20059 ///
20060 ///# Errors
20061 ///- `VK_ERROR_SURFACE_LOST_KHR`
20062 ///- `VK_ERROR_UNKNOWN`
20063 ///- `VK_ERROR_VALIDATION_FAILED`
20064 ///
20065 ///# Safety
20066 ///- `device` (self) must be valid and not destroyed.
20067 ///
20068 ///# Panics
20069 ///Panics if `vkReleaseSwapchainImagesKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20070 ///
20071 ///# Usage Notes
20072 ///
20073 ///Releases acquired swapchain images back to the swapchain without
20074 ///presenting them. Provided by `VK_KHR_swapchain_maintenance1`.
20075 ///
20076 ///Use this when you have acquired an image but decided not to render
20077 ///to it, for example, when aborting a frame due to a resize or
20078 ///error. Without this extension, the only way to return an acquired
20079 ///image is to present it.
20080 ///
20081 ///The released images return to the pool and can be acquired again.
20082 pub unsafe fn release_swapchain_images_khr(
20083 &self,
20084 p_release_info: &ReleaseSwapchainImagesInfoKHR,
20085 ) -> VkResult<()> {
20086 let fp = self
20087 .commands()
20088 .release_swapchain_images_khr
20089 .expect("vkReleaseSwapchainImagesKHR not loaded");
20090 check(unsafe { fp(self.handle(), p_release_info) })
20091 }
20092 ///Wraps [`vkGetDeviceImageSubresourceLayout`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceImageSubresourceLayout.html).
20093 /**
20094 Provided by **VK_BASE_VERSION_1_4**.*/
20095 ///
20096 ///# Safety
20097 ///- `device` (self) must be valid and not destroyed.
20098 ///
20099 ///# Panics
20100 ///Panics if `vkGetDeviceImageSubresourceLayout` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20101 ///
20102 ///# Usage Notes
20103 ///
20104 ///Vulkan 1.4 command that queries the subresource layout for an image
20105 ///**without creating it first**. Returns the offset, size, row pitch,
20106 ///array pitch, and depth pitch for a given subresource of a
20107 ///hypothetical image.
20108 ///
20109 ///Useful for pre-planning host-side memory layouts when using
20110 ///`HOST_TRANSFER` images, or for calculating buffer sizes for staging
20111 ///uploads.
20112 pub unsafe fn get_device_image_subresource_layout(
20113 &self,
20114 p_info: &DeviceImageSubresourceInfo,
20115 p_layout: &mut SubresourceLayout2,
20116 ) {
20117 let fp = self
20118 .commands()
20119 .get_device_image_subresource_layout
20120 .expect("vkGetDeviceImageSubresourceLayout not loaded");
20121 unsafe { fp(self.handle(), p_info, p_layout) };
20122 }
20123 ///Wraps [`vkUnmapMemory2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkUnmapMemory2.html).
20124 /**
20125 Provided by **VK_BASE_VERSION_1_4**.*/
20126 ///
20127 ///# Errors
20128 ///- `VK_ERROR_MEMORY_MAP_FAILED`
20129 ///- `VK_ERROR_UNKNOWN`
20130 ///- `VK_ERROR_VALIDATION_FAILED`
20131 ///
20132 ///# Safety
20133 ///- `device` (self) must be valid and not destroyed.
20134 ///
20135 ///# Panics
20136 ///Panics if `vkUnmapMemory2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20137 ///
20138 ///# Usage Notes
20139 ///
20140 ///Vulkan 1.4 version of `unmap_memory` that uses an extensible
20141 ///`MemoryUnmapInfo` struct. Supports `MEMORY_UNMAP_RESERVE` (if
20142 ///available) to keep the virtual address range reserved after
20143 ///unmapping, useful for placed mappings.
20144 ///
20145 ///For most applications, `unmap_memory` and `unmap_memory2` are
20146 ///equivalent. Prefer this when targeting Vulkan 1.4+.
20147 pub unsafe fn unmap_memory2(&self, p_memory_unmap_info: &MemoryUnmapInfo) -> VkResult<()> {
20148 let fp = self
20149 .commands()
20150 .unmap_memory2
20151 .expect("vkUnmapMemory2 not loaded");
20152 check(unsafe { fp(self.handle(), p_memory_unmap_info) })
20153 }
20154 ///Wraps [`vkCreateShadersEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateShadersEXT.html).
20155 /**
20156 Provided by **VK_EXT_shader_object**.*/
20157 ///
20158 ///# Errors
20159 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20160 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
20161 ///- `VK_ERROR_INITIALIZATION_FAILED`
20162 ///- `VK_ERROR_UNKNOWN`
20163 ///- `VK_ERROR_VALIDATION_FAILED`
20164 ///
20165 ///# Safety
20166 ///- `device` (self) must be valid and not destroyed.
20167 ///
20168 ///# Panics
20169 ///Panics if `vkCreateShadersEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20170 ///
20171 ///# Usage Notes
20172 ///
20173 ///Creates one or more shader objects from SPIR-V code. Shader
20174 ///objects are an alternative to pipelines, instead of baking
20175 ///shaders into monolithic pipeline objects, individual shader
20176 ///stages can be bound independently.
20177 ///
20178 ///Each `ShaderCreateInfoEXT` specifies the stage, code, entry
20179 ///point, and optional specialization constants.
20180 ///
20181 ///Bind with `cmd_bind_shaders_ext`. Destroy with
20182 ///`destroy_shader_ext`.
20183 ///
20184 ///Requires `VK_EXT_shader_object`.
20185 pub unsafe fn create_shaders_ext(
20186 &self,
20187 p_create_infos: &[ShaderCreateInfoEXT],
20188 allocator: Option<&AllocationCallbacks>,
20189 ) -> VkResult<Vec<ShaderEXT>> {
20190 let fp = self
20191 .commands()
20192 .create_shaders_ext
20193 .expect("vkCreateShadersEXT not loaded");
20194 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
20195 let count = p_create_infos.len();
20196 let mut out = vec![unsafe { core::mem::zeroed() }; count];
20197 check(unsafe {
20198 fp(
20199 self.handle(),
20200 p_create_infos.len() as u32,
20201 p_create_infos.as_ptr(),
20202 alloc_ptr,
20203 out.as_mut_ptr(),
20204 )
20205 })?;
20206 Ok(out)
20207 }
20208 ///Wraps [`vkDestroyShaderEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyShaderEXT.html).
20209 /**
20210 Provided by **VK_EXT_shader_object**.*/
20211 ///
20212 ///# Safety
20213 ///- `device` (self) must be valid and not destroyed.
20214 ///- `shader` must be externally synchronized.
20215 ///
20216 ///# Panics
20217 ///Panics if `vkDestroyShaderEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20218 ///
20219 ///# Usage Notes
20220 ///
20221 ///Destroys a shader object created with `create_shaders_ext`.
20222 ///
20223 ///Requires `VK_EXT_shader_object`.
20224 pub unsafe fn destroy_shader_ext(
20225 &self,
20226 shader: ShaderEXT,
20227 allocator: Option<&AllocationCallbacks>,
20228 ) {
20229 let fp = self
20230 .commands()
20231 .destroy_shader_ext
20232 .expect("vkDestroyShaderEXT not loaded");
20233 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
20234 unsafe { fp(self.handle(), shader, alloc_ptr) };
20235 }
20236 ///Wraps [`vkGetShaderBinaryDataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetShaderBinaryDataEXT.html).
20237 /**
20238 Provided by **VK_EXT_shader_object**.*/
20239 ///
20240 ///# Errors
20241 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20242 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
20243 ///- `VK_ERROR_UNKNOWN`
20244 ///- `VK_ERROR_VALIDATION_FAILED`
20245 ///
20246 ///# Safety
20247 ///- `device` (self) must be valid and not destroyed.
20248 ///
20249 ///# Panics
20250 ///Panics if `vkGetShaderBinaryDataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20251 ///
20252 ///# Usage Notes
20253 ///
20254 ///Retrieves the binary representation of a compiled shader object.
20255 ///The binary data can be cached to disk and used to create shader
20256 ///objects without recompiling from SPIR-V on subsequent runs.
20257 ///
20258 ///Call once with a null buffer to query the size, then again with
20259 ///an appropriately sized buffer. Shader binaries are
20260 ///implementation-specific and not portable between devices or
20261 ///driver versions.
20262 ///
20263 ///Requires `VK_EXT_shader_object`.
20264 pub unsafe fn get_shader_binary_data_ext(
20265 &self,
20266 shader: ShaderEXT,
20267 p_data: *mut core::ffi::c_void,
20268 ) -> VkResult<usize> {
20269 let fp = self
20270 .commands()
20271 .get_shader_binary_data_ext
20272 .expect("vkGetShaderBinaryDataEXT not loaded");
20273 let mut out = unsafe { core::mem::zeroed() };
20274 check(unsafe { fp(self.handle(), shader, &mut out, p_data) })?;
20275 Ok(out)
20276 }
20277 ///Wraps [`vkCmdBindShadersEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindShadersEXT.html).
20278 /**
20279 Provided by **VK_EXT_shader_object**.*/
20280 ///
20281 ///# Safety
20282 ///- `commandBuffer` (self) must be valid and not destroyed.
20283 ///- `commandBuffer` must be externally synchronized.
20284 ///
20285 ///# Panics
20286 ///Panics if `vkCmdBindShadersEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20287 ///
20288 ///# Usage Notes
20289 ///
20290 ///Binds shader objects to specified shader stages for subsequent
20291 ///draw or dispatch commands. Pass arrays of stages and
20292 ///corresponding shader handles.
20293 ///
20294 ///To unbind a stage, pass a null handle for that stage. All
20295 ///required stages for the draw/dispatch type must be bound.
20296 ///
20297 ///When using shader objects, you must also set all relevant dynamic
20298 ///state, there is no pipeline to provide defaults.
20299 ///
20300 ///Requires `VK_EXT_shader_object`.
20301 pub unsafe fn cmd_bind_shaders_ext(
20302 &self,
20303 command_buffer: CommandBuffer,
20304 p_stages: &[ShaderStageFlagBits],
20305 p_shaders: &[ShaderEXT],
20306 ) {
20307 let fp = self
20308 .commands()
20309 .cmd_bind_shaders_ext
20310 .expect("vkCmdBindShadersEXT not loaded");
20311 unsafe {
20312 fp(
20313 command_buffer,
20314 p_stages.len() as u32,
20315 p_stages.as_ptr(),
20316 p_shaders.as_ptr(),
20317 )
20318 };
20319 }
20320 ///Wraps [`vkSetSwapchainPresentTimingQueueSizeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetSwapchainPresentTimingQueueSizeEXT.html).
20321 /**
20322 Provided by **VK_EXT_present_timing**.*/
20323 ///
20324 ///# Errors
20325 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20326 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
20327 ///- `VK_ERROR_UNKNOWN`
20328 ///- `VK_ERROR_VALIDATION_FAILED`
20329 ///
20330 ///# Safety
20331 ///- `device` (self) must be valid and not destroyed.
20332 ///- `swapchain` must be externally synchronized.
20333 ///
20334 ///# Panics
20335 ///Panics if `vkSetSwapchainPresentTimingQueueSizeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20336 ///
20337 ///# Usage Notes
20338 ///
20339 ///Sets the maximum number of present timing results the driver
20340 ///will queue for later retrieval via `get_past_presentation_timing_ext`.
20341 ///A larger queue prevents timing data from being lost when the
20342 ///application cannot poll frequently.
20343 ///
20344 ///Requires `VK_EXT_present_timing`.
20345 pub unsafe fn set_swapchain_present_timing_queue_size_ext(
20346 &self,
20347 swapchain: SwapchainKHR,
20348 size: u32,
20349 ) -> VkResult<()> {
20350 let fp = self
20351 .commands()
20352 .set_swapchain_present_timing_queue_size_ext
20353 .expect("vkSetSwapchainPresentTimingQueueSizeEXT not loaded");
20354 check(unsafe { fp(self.handle(), swapchain, size) })
20355 }
20356 ///Wraps [`vkGetSwapchainTimingPropertiesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSwapchainTimingPropertiesEXT.html).
20357 /**
20358 Provided by **VK_EXT_present_timing**.*/
20359 ///
20360 ///# Errors
20361 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20362 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
20363 ///- `VK_ERROR_SURFACE_LOST_KHR`
20364 ///- `VK_ERROR_UNKNOWN`
20365 ///- `VK_ERROR_VALIDATION_FAILED`
20366 ///
20367 ///# Safety
20368 ///- `device` (self) must be valid and not destroyed.
20369 ///- `swapchain` must be externally synchronized.
20370 ///
20371 ///# Panics
20372 ///Panics if `vkGetSwapchainTimingPropertiesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20373 ///
20374 ///# Usage Notes
20375 ///
20376 ///Queries the timing properties of a swapchain, such as the refresh
20377 ///duration and present margin. Use this to calibrate frame pacing
20378 ///and target the display's native refresh interval.
20379 ///
20380 ///Requires `VK_EXT_present_timing`.
20381 pub unsafe fn get_swapchain_timing_properties_ext(
20382 &self,
20383 swapchain: SwapchainKHR,
20384 p_swapchain_timing_properties: &mut SwapchainTimingPropertiesEXT,
20385 ) -> VkResult<u64> {
20386 let fp = self
20387 .commands()
20388 .get_swapchain_timing_properties_ext
20389 .expect("vkGetSwapchainTimingPropertiesEXT not loaded");
20390 let mut out = unsafe { core::mem::zeroed() };
20391 check(unsafe {
20392 fp(
20393 self.handle(),
20394 swapchain,
20395 p_swapchain_timing_properties,
20396 &mut out,
20397 )
20398 })?;
20399 Ok(out)
20400 }
20401 ///Wraps [`vkGetSwapchainTimeDomainPropertiesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSwapchainTimeDomainPropertiesEXT.html).
20402 /**
20403 Provided by **VK_EXT_present_timing**.*/
20404 ///
20405 ///# Errors
20406 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20407 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
20408 ///- `VK_ERROR_SURFACE_LOST_KHR`
20409 ///- `VK_ERROR_UNKNOWN`
20410 ///- `VK_ERROR_VALIDATION_FAILED`
20411 ///
20412 ///# Safety
20413 ///- `device` (self) must be valid and not destroyed.
20414 ///- `swapchain` must be externally synchronized.
20415 ///
20416 ///# Panics
20417 ///Panics if `vkGetSwapchainTimeDomainPropertiesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20418 ///
20419 ///# Usage Notes
20420 ///
20421 ///Queries which time domains the swapchain supports for present
20422 ///timing. Use this to determine whether you can correlate present
20423 ///timestamps with the system clock or device-specific counters.
20424 ///
20425 ///Requires `VK_EXT_present_timing`.
20426 pub unsafe fn get_swapchain_time_domain_properties_ext(
20427 &self,
20428 swapchain: SwapchainKHR,
20429 p_swapchain_time_domain_properties: &mut SwapchainTimeDomainPropertiesEXT,
20430 ) -> VkResult<u64> {
20431 let fp = self
20432 .commands()
20433 .get_swapchain_time_domain_properties_ext
20434 .expect("vkGetSwapchainTimeDomainPropertiesEXT not loaded");
20435 let mut out = unsafe { core::mem::zeroed() };
20436 check(unsafe {
20437 fp(
20438 self.handle(),
20439 swapchain,
20440 p_swapchain_time_domain_properties,
20441 &mut out,
20442 )
20443 })?;
20444 Ok(out)
20445 }
20446 ///Wraps [`vkGetPastPresentationTimingEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPastPresentationTimingEXT.html).
20447 /**
20448 Provided by **VK_EXT_present_timing**.*/
20449 ///
20450 ///# Errors
20451 ///- `VK_ERROR_DEVICE_LOST`
20452 ///- `VK_ERROR_OUT_OF_DATE_KHR`
20453 ///- `VK_ERROR_SURFACE_LOST_KHR`
20454 ///- `VK_ERROR_UNKNOWN`
20455 ///- `VK_ERROR_VALIDATION_FAILED`
20456 ///
20457 ///# Safety
20458 ///- `device` (self) must be valid and not destroyed.
20459 ///
20460 ///# Panics
20461 ///Panics if `vkGetPastPresentationTimingEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20462 ///
20463 ///# Usage Notes
20464 ///
20465 ///Retrieves presentation timing data for previously presented images.
20466 ///Use this to measure actual vs. requested present times and detect
20467 ///missed frames or compositor latency.
20468 ///
20469 ///Requires `VK_EXT_present_timing`.
20470 pub unsafe fn get_past_presentation_timing_ext(
20471 &self,
20472 p_past_presentation_timing_info: &PastPresentationTimingInfoEXT,
20473 p_past_presentation_timing_properties: &mut PastPresentationTimingPropertiesEXT,
20474 ) -> VkResult<()> {
20475 let fp = self
20476 .commands()
20477 .get_past_presentation_timing_ext
20478 .expect("vkGetPastPresentationTimingEXT not loaded");
20479 check(unsafe {
20480 fp(
20481 self.handle(),
20482 p_past_presentation_timing_info,
20483 p_past_presentation_timing_properties,
20484 )
20485 })
20486 }
20487 ///Wraps [`vkGetScreenBufferPropertiesQNX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetScreenBufferPropertiesQNX.html).
20488 /**
20489 Provided by **VK_QNX_external_memory_screen_buffer**.*/
20490 ///
20491 ///# Errors
20492 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20493 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR`
20494 ///- `VK_ERROR_UNKNOWN`
20495 ///- `VK_ERROR_VALIDATION_FAILED`
20496 ///
20497 ///# Safety
20498 ///- `device` (self) must be valid and not destroyed.
20499 ///
20500 ///# Panics
20501 ///Panics if `vkGetScreenBufferPropertiesQNX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20502 ///
20503 ///# Usage Notes
20504 ///
20505 ///Queries Vulkan memory properties for a QNX Screen buffer. Use
20506 ///before importing the buffer as Vulkan memory to determine
20507 ///compatible memory types and size. QNX only.
20508 ///
20509 ///Requires `VK_QNX_external_memory_screen_buffer`.
20510 pub unsafe fn get_screen_buffer_properties_qnx(
20511 &self,
20512 buffer: *const core::ffi::c_void,
20513 p_properties: &mut ScreenBufferPropertiesQNX,
20514 ) -> VkResult<()> {
20515 let fp = self
20516 .commands()
20517 .get_screen_buffer_properties_qnx
20518 .expect("vkGetScreenBufferPropertiesQNX not loaded");
20519 check(unsafe { fp(self.handle(), buffer, p_properties) })
20520 }
20521 ///Wraps [`vkGetExecutionGraphPipelineScratchSizeAMDX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetExecutionGraphPipelineScratchSizeAMDX.html).
20522 /**
20523 Provided by **VK_AMDX_shader_enqueue**.*/
20524 ///
20525 ///# Errors
20526 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20527 ///- `VK_ERROR_UNKNOWN`
20528 ///- `VK_ERROR_VALIDATION_FAILED`
20529 ///
20530 ///# Safety
20531 ///- `device` (self) must be valid and not destroyed.
20532 ///
20533 ///# Panics
20534 ///Panics if `vkGetExecutionGraphPipelineScratchSizeAMDX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20535 ///
20536 ///# Usage Notes
20537 ///
20538 ///Queries the scratch memory size required to execute an execution
20539 ///graph pipeline. Allocate a buffer of at least this size and
20540 ///initialize it with `cmd_initialize_graph_scratch_memory_amdx`
20541 ///before dispatching the graph.
20542 ///
20543 ///Requires `VK_AMDX_shader_enqueue`.
20544 pub unsafe fn get_execution_graph_pipeline_scratch_size_amdx(
20545 &self,
20546 execution_graph: Pipeline,
20547 p_size_info: &mut ExecutionGraphPipelineScratchSizeAMDX,
20548 ) -> VkResult<()> {
20549 let fp = self
20550 .commands()
20551 .get_execution_graph_pipeline_scratch_size_amdx
20552 .expect("vkGetExecutionGraphPipelineScratchSizeAMDX not loaded");
20553 check(unsafe { fp(self.handle(), execution_graph, p_size_info) })
20554 }
20555 ///Wraps [`vkGetExecutionGraphPipelineNodeIndexAMDX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetExecutionGraphPipelineNodeIndexAMDX.html).
20556 /**
20557 Provided by **VK_AMDX_shader_enqueue**.*/
20558 ///
20559 ///# Errors
20560 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20561 ///- `VK_ERROR_UNKNOWN`
20562 ///- `VK_ERROR_VALIDATION_FAILED`
20563 ///
20564 ///# Safety
20565 ///- `device` (self) must be valid and not destroyed.
20566 ///
20567 ///# Panics
20568 ///Panics if `vkGetExecutionGraphPipelineNodeIndexAMDX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20569 ///
20570 ///# Usage Notes
20571 ///
20572 ///Queries the node index for a named shader node in an execution
20573 ///graph pipeline. The index is used when dispatching or enqueuing
20574 ///work to a specific node in the graph.
20575 ///
20576 ///Requires `VK_AMDX_shader_enqueue`.
20577 pub unsafe fn get_execution_graph_pipeline_node_index_amdx(
20578 &self,
20579 execution_graph: Pipeline,
20580 p_node_info: &PipelineShaderStageNodeCreateInfoAMDX,
20581 ) -> VkResult<u32> {
20582 let fp = self
20583 .commands()
20584 .get_execution_graph_pipeline_node_index_amdx
20585 .expect("vkGetExecutionGraphPipelineNodeIndexAMDX not loaded");
20586 let mut out = unsafe { core::mem::zeroed() };
20587 check(unsafe { fp(self.handle(), execution_graph, p_node_info, &mut out) })?;
20588 Ok(out)
20589 }
20590 ///Wraps [`vkCreateExecutionGraphPipelinesAMDX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateExecutionGraphPipelinesAMDX.html).
20591 /**
20592 Provided by **VK_AMDX_shader_enqueue**.*/
20593 ///
20594 ///# Errors
20595 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
20596 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
20597 ///- `VK_ERROR_UNKNOWN`
20598 ///- `VK_ERROR_VALIDATION_FAILED`
20599 ///
20600 ///# Safety
20601 ///- `device` (self) must be valid and not destroyed.
20602 ///- `pipelineCache` must be externally synchronized.
20603 ///
20604 ///# Panics
20605 ///Panics if `vkCreateExecutionGraphPipelinesAMDX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20606 ///
20607 ///# Usage Notes
20608 ///
20609 ///Creates one or more execution graph pipelines for GPU-driven
20610 ///shader dispatch. An execution graph is a DAG of shader nodes
20611 ///where each node can enqueue work to other nodes, enabling complex
20612 ///GPU-driven workflows without CPU round-trips.
20613 ///
20614 ///Requires `VK_AMDX_shader_enqueue`.
20615 pub unsafe fn create_execution_graph_pipelines_amdx(
20616 &self,
20617 pipeline_cache: PipelineCache,
20618 p_create_infos: &[ExecutionGraphPipelineCreateInfoAMDX],
20619 allocator: Option<&AllocationCallbacks>,
20620 ) -> VkResult<Vec<Pipeline>> {
20621 let fp = self
20622 .commands()
20623 .create_execution_graph_pipelines_amdx
20624 .expect("vkCreateExecutionGraphPipelinesAMDX not loaded");
20625 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
20626 let count = p_create_infos.len();
20627 let mut out = vec![unsafe { core::mem::zeroed() }; count];
20628 check(unsafe {
20629 fp(
20630 self.handle(),
20631 pipeline_cache,
20632 p_create_infos.len() as u32,
20633 p_create_infos.as_ptr(),
20634 alloc_ptr,
20635 out.as_mut_ptr(),
20636 )
20637 })?;
20638 Ok(out)
20639 }
20640 ///Wraps [`vkCmdInitializeGraphScratchMemoryAMDX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdInitializeGraphScratchMemoryAMDX.html).
20641 /**
20642 Provided by **VK_AMDX_shader_enqueue**.*/
20643 ///
20644 ///# Safety
20645 ///- `commandBuffer` (self) must be valid and not destroyed.
20646 ///
20647 ///# Panics
20648 ///Panics if `vkCmdInitializeGraphScratchMemoryAMDX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20649 ///
20650 ///# Usage Notes
20651 ///
20652 ///Initializes the scratch memory buffer for an execution graph
20653 ///pipeline. Must be called before any `cmd_dispatch_graph_*_amdx`
20654 ///command that uses this scratch buffer.
20655 ///
20656 ///Requires `VK_AMDX_shader_enqueue`.
20657 pub unsafe fn cmd_initialize_graph_scratch_memory_amdx(
20658 &self,
20659 command_buffer: CommandBuffer,
20660 execution_graph: Pipeline,
20661 scratch: u64,
20662 scratch_size: u64,
20663 ) {
20664 let fp = self
20665 .commands()
20666 .cmd_initialize_graph_scratch_memory_amdx
20667 .expect("vkCmdInitializeGraphScratchMemoryAMDX not loaded");
20668 unsafe { fp(command_buffer, execution_graph, scratch, scratch_size) };
20669 }
20670 ///Wraps [`vkCmdDispatchGraphAMDX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDispatchGraphAMDX.html).
20671 /**
20672 Provided by **VK_AMDX_shader_enqueue**.*/
20673 ///
20674 ///# Safety
20675 ///- `commandBuffer` (self) must be valid and not destroyed.
20676 ///
20677 ///# Panics
20678 ///Panics if `vkCmdDispatchGraphAMDX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20679 ///
20680 ///# Usage Notes
20681 ///
20682 ///Dispatches an execution graph starting from the specified root
20683 ///nodes. The scratch buffer must have been initialized with
20684 ///`cmd_initialize_graph_scratch_memory_amdx`.
20685 ///
20686 ///Requires `VK_AMDX_shader_enqueue`.
20687 pub unsafe fn cmd_dispatch_graph_amdx(
20688 &self,
20689 command_buffer: CommandBuffer,
20690 scratch: u64,
20691 scratch_size: u64,
20692 p_count_info: &DispatchGraphCountInfoAMDX,
20693 ) {
20694 let fp = self
20695 .commands()
20696 .cmd_dispatch_graph_amdx
20697 .expect("vkCmdDispatchGraphAMDX not loaded");
20698 unsafe { fp(command_buffer, scratch, scratch_size, p_count_info) };
20699 }
20700 ///Wraps [`vkCmdDispatchGraphIndirectAMDX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDispatchGraphIndirectAMDX.html).
20701 /**
20702 Provided by **VK_AMDX_shader_enqueue**.*/
20703 ///
20704 ///# Safety
20705 ///- `commandBuffer` (self) must be valid and not destroyed.
20706 ///
20707 ///# Panics
20708 ///Panics if `vkCmdDispatchGraphIndirectAMDX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20709 ///
20710 ///# Usage Notes
20711 ///
20712 ///Indirect variant of `cmd_dispatch_graph_amdx`. Reads the graph
20713 ///dispatch payloads from a GPU buffer while the count info is
20714 ///provided on the CPU side.
20715 ///
20716 ///Requires `VK_AMDX_shader_enqueue`.
20717 pub unsafe fn cmd_dispatch_graph_indirect_amdx(
20718 &self,
20719 command_buffer: CommandBuffer,
20720 scratch: u64,
20721 scratch_size: u64,
20722 p_count_info: &DispatchGraphCountInfoAMDX,
20723 ) {
20724 let fp = self
20725 .commands()
20726 .cmd_dispatch_graph_indirect_amdx
20727 .expect("vkCmdDispatchGraphIndirectAMDX not loaded");
20728 unsafe { fp(command_buffer, scratch, scratch_size, p_count_info) };
20729 }
20730 ///Wraps [`vkCmdDispatchGraphIndirectCountAMDX`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDispatchGraphIndirectCountAMDX.html).
20731 /**
20732 Provided by **VK_AMDX_shader_enqueue**.*/
20733 ///
20734 ///# Safety
20735 ///- `commandBuffer` (self) must be valid and not destroyed.
20736 ///
20737 ///# Panics
20738 ///Panics if `vkCmdDispatchGraphIndirectCountAMDX` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20739 ///
20740 ///# Usage Notes
20741 ///
20742 ///Fully indirect variant of `cmd_dispatch_graph_amdx`. Both the
20743 ///dispatch payloads and the count are read from GPU buffers,
20744 ///enabling fully GPU-driven execution graph dispatch.
20745 ///
20746 ///Requires `VK_AMDX_shader_enqueue`.
20747 pub unsafe fn cmd_dispatch_graph_indirect_count_amdx(
20748 &self,
20749 command_buffer: CommandBuffer,
20750 scratch: u64,
20751 scratch_size: u64,
20752 count_info: u64,
20753 ) {
20754 let fp = self
20755 .commands()
20756 .cmd_dispatch_graph_indirect_count_amdx
20757 .expect("vkCmdDispatchGraphIndirectCountAMDX not loaded");
20758 unsafe { fp(command_buffer, scratch, scratch_size, count_info) };
20759 }
20760 ///Wraps [`vkCmdBindDescriptorSets2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindDescriptorSets2.html).
20761 /**
20762 Provided by **VK_COMPUTE_VERSION_1_4**.*/
20763 ///
20764 ///# Safety
20765 ///- `commandBuffer` (self) must be valid and not destroyed.
20766 ///- `commandBuffer` must be externally synchronized.
20767 ///
20768 ///# Panics
20769 ///Panics if `vkCmdBindDescriptorSets2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20770 ///
20771 ///# Usage Notes
20772 ///
20773 ///Vulkan 1.4 version of `cmd_bind_descriptor_sets` that uses an
20774 ///extensible `BindDescriptorSetsInfo` struct.
20775 ///
20776 ///Functionally equivalent to the 1.0 version. The extensible struct
20777 ///enables future extensions to modify binding behaviour via pNext.
20778 ///
20779 ///Prefer this when targeting Vulkan 1.4+.
20780 pub unsafe fn cmd_bind_descriptor_sets2(
20781 &self,
20782 command_buffer: CommandBuffer,
20783 p_bind_descriptor_sets_info: &BindDescriptorSetsInfo,
20784 ) {
20785 let fp = self
20786 .commands()
20787 .cmd_bind_descriptor_sets2
20788 .expect("vkCmdBindDescriptorSets2 not loaded");
20789 unsafe { fp(command_buffer, p_bind_descriptor_sets_info) };
20790 }
20791 ///Wraps [`vkCmdPushConstants2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPushConstants2.html).
20792 /**
20793 Provided by **VK_COMPUTE_VERSION_1_4**.*/
20794 ///
20795 ///# Safety
20796 ///- `commandBuffer` (self) must be valid and not destroyed.
20797 ///- `commandBuffer` must be externally synchronized.
20798 ///
20799 ///# Panics
20800 ///Panics if `vkCmdPushConstants2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20801 ///
20802 ///# Usage Notes
20803 ///
20804 ///Vulkan 1.4 version of `cmd_push_constants` that uses an extensible
20805 ///`PushConstantsInfo` struct.
20806 ///
20807 ///Functionally equivalent to the 1.0 version. Prefer this when
20808 ///targeting Vulkan 1.4+.
20809 pub unsafe fn cmd_push_constants2(
20810 &self,
20811 command_buffer: CommandBuffer,
20812 p_push_constants_info: &PushConstantsInfo,
20813 ) {
20814 let fp = self
20815 .commands()
20816 .cmd_push_constants2
20817 .expect("vkCmdPushConstants2 not loaded");
20818 unsafe { fp(command_buffer, p_push_constants_info) };
20819 }
20820 ///Wraps [`vkCmdPushDescriptorSet2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPushDescriptorSet2.html).
20821 /**
20822 Provided by **VK_COMPUTE_VERSION_1_4**.*/
20823 ///
20824 ///# Safety
20825 ///- `commandBuffer` (self) must be valid and not destroyed.
20826 ///- `commandBuffer` must be externally synchronized.
20827 ///
20828 ///# Panics
20829 ///Panics if `vkCmdPushDescriptorSet2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20830 ///
20831 ///# Usage Notes
20832 ///
20833 ///Vulkan 1.4 version of `cmd_push_descriptor_set` that uses an
20834 ///extensible `PushDescriptorSetInfo` struct.
20835 ///
20836 ///Functionally equivalent to the base version. Prefer this when
20837 ///targeting Vulkan 1.4+.
20838 pub unsafe fn cmd_push_descriptor_set2(
20839 &self,
20840 command_buffer: CommandBuffer,
20841 p_push_descriptor_set_info: &PushDescriptorSetInfo,
20842 ) {
20843 let fp = self
20844 .commands()
20845 .cmd_push_descriptor_set2
20846 .expect("vkCmdPushDescriptorSet2 not loaded");
20847 unsafe { fp(command_buffer, p_push_descriptor_set_info) };
20848 }
20849 ///Wraps [`vkCmdPushDescriptorSetWithTemplate2`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPushDescriptorSetWithTemplate2.html).
20850 /**
20851 Provided by **VK_COMPUTE_VERSION_1_4**.*/
20852 ///
20853 ///# Safety
20854 ///- `commandBuffer` (self) must be valid and not destroyed.
20855 ///- `commandBuffer` must be externally synchronized.
20856 ///
20857 ///# Panics
20858 ///Panics if `vkCmdPushDescriptorSetWithTemplate2` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20859 ///
20860 ///# Usage Notes
20861 ///
20862 ///Vulkan 1.4 version of `cmd_push_descriptor_set_with_template` that
20863 ///uses an extensible `PushDescriptorSetWithTemplateInfo` struct.
20864 ///
20865 ///Functionally equivalent to the base version. Prefer this when
20866 ///targeting Vulkan 1.4+.
20867 pub unsafe fn cmd_push_descriptor_set_with_template2(
20868 &self,
20869 command_buffer: CommandBuffer,
20870 p_push_descriptor_set_with_template_info: &PushDescriptorSetWithTemplateInfo,
20871 ) {
20872 let fp = self
20873 .commands()
20874 .cmd_push_descriptor_set_with_template2
20875 .expect("vkCmdPushDescriptorSetWithTemplate2 not loaded");
20876 unsafe { fp(command_buffer, p_push_descriptor_set_with_template_info) };
20877 }
20878 ///Wraps [`vkCmdSetDescriptorBufferOffsets2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDescriptorBufferOffsets2EXT.html).
20879 /**
20880 Provided by **VK_KHR_maintenance6**.*/
20881 ///
20882 ///# Safety
20883 ///- `commandBuffer` (self) must be valid and not destroyed.
20884 ///- `commandBuffer` must be externally synchronized.
20885 ///
20886 ///# Panics
20887 ///Panics if `vkCmdSetDescriptorBufferOffsets2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20888 ///
20889 ///# Usage Notes
20890 ///
20891 ///Extended version of `cmd_set_descriptor_buffer_offsets_ext` that
20892 ///takes a `SetDescriptorBufferOffsetsInfoEXT` struct with pNext
20893 ///extensibility.
20894 ///
20895 ///Sets the offsets into bound descriptor buffers for the specified
20896 ///pipeline layout. Each offset points to the start of a descriptor
20897 ///set's data within the bound descriptor buffer.
20898 ///
20899 ///Provided by `VK_KHR_maintenance6` (for the pNext-extensible
20900 ///variant of the `VK_EXT_descriptor_buffer` command).
20901 pub unsafe fn cmd_set_descriptor_buffer_offsets2_ext(
20902 &self,
20903 command_buffer: CommandBuffer,
20904 p_set_descriptor_buffer_offsets_info: &SetDescriptorBufferOffsetsInfoEXT,
20905 ) {
20906 let fp = self
20907 .commands()
20908 .cmd_set_descriptor_buffer_offsets2_ext
20909 .expect("vkCmdSetDescriptorBufferOffsets2EXT not loaded");
20910 unsafe { fp(command_buffer, p_set_descriptor_buffer_offsets_info) };
20911 }
20912 ///Wraps [`vkCmdBindDescriptorBufferEmbeddedSamplers2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindDescriptorBufferEmbeddedSamplers2EXT.html).
20913 /**
20914 Provided by **VK_KHR_maintenance6**.*/
20915 ///
20916 ///# Safety
20917 ///- `commandBuffer` (self) must be valid and not destroyed.
20918 ///- `commandBuffer` must be externally synchronized.
20919 ///
20920 ///# Panics
20921 ///Panics if `vkCmdBindDescriptorBufferEmbeddedSamplers2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20922 ///
20923 ///# Usage Notes
20924 ///
20925 ///Extended version of `cmd_bind_descriptor_buffer_embedded_samplers_ext`
20926 ///that takes a `BindDescriptorBufferEmbeddedSamplersInfoEXT` struct
20927 ///with pNext extensibility.
20928 ///
20929 ///Binds embedded immutable samplers from a descriptor set layout
20930 ///that was created with `CREATE_EMBEDDED_IMMUTABLE_SAMPLERS_BIT`.
20931 ///
20932 ///Provided by `VK_KHR_maintenance6` (for the pNext-extensible
20933 ///variant of the `VK_EXT_descriptor_buffer` command).
20934 pub unsafe fn cmd_bind_descriptor_buffer_embedded_samplers2_ext(
20935 &self,
20936 command_buffer: CommandBuffer,
20937 p_bind_descriptor_buffer_embedded_samplers_info: &BindDescriptorBufferEmbeddedSamplersInfoEXT,
20938 ) {
20939 let fp = self
20940 .commands()
20941 .cmd_bind_descriptor_buffer_embedded_samplers2_ext
20942 .expect("vkCmdBindDescriptorBufferEmbeddedSamplers2EXT not loaded");
20943 unsafe {
20944 fp(
20945 command_buffer,
20946 p_bind_descriptor_buffer_embedded_samplers_info,
20947 )
20948 };
20949 }
20950 ///Wraps [`vkSetLatencySleepModeNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetLatencySleepModeNV.html).
20951 /**
20952 Provided by **VK_NV_low_latency2**.*/
20953 ///
20954 ///# Errors
20955 ///- `VK_ERROR_INITIALIZATION_FAILED`
20956 ///- `VK_ERROR_UNKNOWN`
20957 ///- `VK_ERROR_VALIDATION_FAILED`
20958 ///
20959 ///# Safety
20960 ///- `device` (self) must be valid and not destroyed.
20961 ///
20962 ///# Panics
20963 ///Panics if `vkSetLatencySleepModeNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20964 ///
20965 ///# Usage Notes
20966 ///
20967 ///Configures the NVIDIA Reflex low-latency sleep mode for a
20968 ///swapchain. Enables or disables latency sleep and sets the target
20969 ///sleep duration. Call before `latency_sleep_nv` to activate the
20970 ///system.
20971 ///
20972 ///Requires `VK_NV_low_latency2`.
20973 pub unsafe fn set_latency_sleep_mode_nv(
20974 &self,
20975 swapchain: SwapchainKHR,
20976 p_sleep_mode_info: &LatencySleepModeInfoNV,
20977 ) -> VkResult<()> {
20978 let fp = self
20979 .commands()
20980 .set_latency_sleep_mode_nv
20981 .expect("vkSetLatencySleepModeNV not loaded");
20982 check(unsafe { fp(self.handle(), swapchain, p_sleep_mode_info) })
20983 }
20984 ///Wraps [`vkLatencySleepNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkLatencySleepNV.html).
20985 /**
20986 Provided by **VK_NV_low_latency2**.*/
20987 ///
20988 ///# Errors
20989 ///- `VK_ERROR_UNKNOWN`
20990 ///- `VK_ERROR_VALIDATION_FAILED`
20991 ///
20992 ///# Safety
20993 ///- `device` (self) must be valid and not destroyed.
20994 ///
20995 ///# Panics
20996 ///Panics if `vkLatencySleepNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
20997 ///
20998 ///# Usage Notes
20999 ///
21000 ///Sleeps the calling thread until the optimal time to begin the
21001 ///next frame, as determined by the NVIDIA Reflex low-latency
21002 ///system. Reduces input-to-display latency by preventing the CPU
21003 ///from running too far ahead of the GPU.
21004 ///
21005 ///Requires `VK_NV_low_latency2`.
21006 pub unsafe fn latency_sleep_nv(
21007 &self,
21008 swapchain: SwapchainKHR,
21009 p_sleep_info: &LatencySleepInfoNV,
21010 ) -> VkResult<()> {
21011 let fp = self
21012 .commands()
21013 .latency_sleep_nv
21014 .expect("vkLatencySleepNV not loaded");
21015 check(unsafe { fp(self.handle(), swapchain, p_sleep_info) })
21016 }
21017 ///Wraps [`vkSetLatencyMarkerNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetLatencyMarkerNV.html).
21018 /**
21019 Provided by **VK_NV_low_latency2**.*/
21020 ///
21021 ///# Safety
21022 ///- `device` (self) must be valid and not destroyed.
21023 ///
21024 ///# Panics
21025 ///Panics if `vkSetLatencyMarkerNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21026 ///
21027 ///# Usage Notes
21028 ///
21029 ///Sets a latency marker at a specific point in the frame lifecycle
21030 ///(simulation start, render start, present, etc.). The markers are
21031 ///later retrieved with `get_latency_timings_nv` to measure per-
21032 ///stage latency.
21033 ///
21034 ///Requires `VK_NV_low_latency2`.
21035 pub unsafe fn set_latency_marker_nv(
21036 &self,
21037 swapchain: SwapchainKHR,
21038 p_latency_marker_info: &SetLatencyMarkerInfoNV,
21039 ) {
21040 let fp = self
21041 .commands()
21042 .set_latency_marker_nv
21043 .expect("vkSetLatencyMarkerNV not loaded");
21044 unsafe { fp(self.handle(), swapchain, p_latency_marker_info) };
21045 }
21046 ///Wraps [`vkGetLatencyTimingsNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetLatencyTimingsNV.html).
21047 /**
21048 Provided by **VK_NV_low_latency2**.*/
21049 ///
21050 ///# Safety
21051 ///- `device` (self) must be valid and not destroyed.
21052 ///
21053 ///# Panics
21054 ///Panics if `vkGetLatencyTimingsNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21055 ///
21056 ///# Usage Notes
21057 ///
21058 ///Retrieves per-frame latency timing data for a swapchain. Returns
21059 ///timestamps for each marker set with `set_latency_marker_nv`,
21060 ///enabling measurement of simulation, render, and present latency.
21061 ///
21062 ///Requires `VK_NV_low_latency2`.
21063 pub unsafe fn get_latency_timings_nv(
21064 &self,
21065 swapchain: SwapchainKHR,
21066 p_latency_marker_info: &mut GetLatencyMarkerInfoNV,
21067 ) {
21068 let fp = self
21069 .commands()
21070 .get_latency_timings_nv
21071 .expect("vkGetLatencyTimingsNV not loaded");
21072 unsafe { fp(self.handle(), swapchain, p_latency_marker_info) };
21073 }
21074 ///Wraps [`vkQueueNotifyOutOfBandNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueNotifyOutOfBandNV.html).
21075 /**
21076 Provided by **VK_NV_low_latency2**.*/
21077 ///
21078 ///# Safety
21079 ///- `queue` (self) must be valid and not destroyed.
21080 ///
21081 ///# Panics
21082 ///Panics if `vkQueueNotifyOutOfBandNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21083 ///
21084 ///# Usage Notes
21085 ///
21086 ///Notifies the low-latency system that a queue submission is
21087 ///out-of-band (e.g., a loading or async compute submission that
21088 ///should not be counted toward frame latency tracking).
21089 ///
21090 ///Requires `VK_NV_low_latency2`.
21091 pub unsafe fn queue_notify_out_of_band_nv(
21092 &self,
21093 queue: Queue,
21094 p_queue_type_info: &OutOfBandQueueTypeInfoNV,
21095 ) {
21096 let fp = self
21097 .commands()
21098 .queue_notify_out_of_band_nv
21099 .expect("vkQueueNotifyOutOfBandNV not loaded");
21100 unsafe { fp(queue, p_queue_type_info) };
21101 }
21102 ///Wraps [`vkCmdSetRenderingAttachmentLocations`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetRenderingAttachmentLocations.html).
21103 /**
21104 Provided by **VK_GRAPHICS_VERSION_1_4**.*/
21105 ///
21106 ///# Safety
21107 ///- `commandBuffer` (self) must be valid and not destroyed.
21108 ///- `commandBuffer` must be externally synchronized.
21109 ///
21110 ///# Panics
21111 ///Panics if `vkCmdSetRenderingAttachmentLocations` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21112 ///
21113 ///# Usage Notes
21114 ///
21115 ///Dynamically remaps colour attachment indices within a dynamic
21116 ///rendering instance. Allows fragment shader outputs to target
21117 ///different attachment slots without changing the pipeline.
21118 ///
21119 ///This is useful when the same shader outputs different data to
21120 ///different attachments depending on the rendering pass (e.g.
21121 ///G-buffer vs forward).
21122 ///
21123 ///Requires `dynamic_rendering_local_read` feature. Core in
21124 ///Vulkan 1.4.
21125 pub unsafe fn cmd_set_rendering_attachment_locations(
21126 &self,
21127 command_buffer: CommandBuffer,
21128 p_location_info: &RenderingAttachmentLocationInfo,
21129 ) {
21130 let fp = self
21131 .commands()
21132 .cmd_set_rendering_attachment_locations
21133 .expect("vkCmdSetRenderingAttachmentLocations not loaded");
21134 unsafe { fp(command_buffer, p_location_info) };
21135 }
21136 ///Wraps [`vkCmdSetRenderingInputAttachmentIndices`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetRenderingInputAttachmentIndices.html).
21137 /**
21138 Provided by **VK_GRAPHICS_VERSION_1_4**.*/
21139 ///
21140 ///# Safety
21141 ///- `commandBuffer` (self) must be valid and not destroyed.
21142 ///- `commandBuffer` must be externally synchronized.
21143 ///
21144 ///# Panics
21145 ///Panics if `vkCmdSetRenderingInputAttachmentIndices` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21146 ///
21147 ///# Usage Notes
21148 ///
21149 ///Dynamically remaps input attachment indices within a dynamic
21150 ///rendering instance. Allows fragment shaders to read from different
21151 ///colour or depth/stencil attachments without changing the pipeline.
21152 ///
21153 ///Paired with `cmd_set_rendering_attachment_locations` to enable
21154 ///flexible attachment routing in multi-pass rendering with dynamic
21155 ///rendering.
21156 ///
21157 ///Requires `dynamic_rendering_local_read` feature. Core in
21158 ///Vulkan 1.4.
21159 pub unsafe fn cmd_set_rendering_input_attachment_indices(
21160 &self,
21161 command_buffer: CommandBuffer,
21162 p_input_attachment_index_info: &RenderingInputAttachmentIndexInfo,
21163 ) {
21164 let fp = self
21165 .commands()
21166 .cmd_set_rendering_input_attachment_indices
21167 .expect("vkCmdSetRenderingInputAttachmentIndices not loaded");
21168 unsafe { fp(command_buffer, p_input_attachment_index_info) };
21169 }
21170 ///Wraps [`vkCmdSetDepthClampRangeEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetDepthClampRangeEXT.html).
21171 /**
21172 Provided by **VK_EXT_shader_object**.*/
21173 ///
21174 ///# Safety
21175 ///- `commandBuffer` (self) must be valid and not destroyed.
21176 ///- `commandBuffer` must be externally synchronized.
21177 ///
21178 ///# Panics
21179 ///Panics if `vkCmdSetDepthClampRangeEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21180 ///
21181 ///# Usage Notes
21182 ///
21183 ///Dynamically sets the depth clamp range. When depth clamping is
21184 ///enabled, fragments are clamped to the specified min/max depth
21185 ///values instead of the viewport near/far range.
21186 ///
21187 ///Pass null to use the default viewport depth range for clamping.
21188 ///
21189 ///Requires `VK_EXT_depth_clamp_control` and the
21190 ///`depthClampControl` feature.
21191 pub unsafe fn cmd_set_depth_clamp_range_ext(
21192 &self,
21193 command_buffer: CommandBuffer,
21194 depth_clamp_mode: DepthClampModeEXT,
21195 p_depth_clamp_range: Option<&DepthClampRangeEXT>,
21196 ) {
21197 let fp = self
21198 .commands()
21199 .cmd_set_depth_clamp_range_ext
21200 .expect("vkCmdSetDepthClampRangeEXT not loaded");
21201 let p_depth_clamp_range_ptr =
21202 p_depth_clamp_range.map_or(core::ptr::null(), core::ptr::from_ref);
21203 unsafe { fp(command_buffer, depth_clamp_mode, p_depth_clamp_range_ptr) };
21204 }
21205 ///Wraps [`vkGetMemoryMetalHandleEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryMetalHandleEXT.html).
21206 /**
21207 Provided by **VK_EXT_external_memory_metal**.*/
21208 ///
21209 ///# Errors
21210 ///- `VK_ERROR_TOO_MANY_OBJECTS`
21211 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21212 ///- `VK_ERROR_UNKNOWN`
21213 ///- `VK_ERROR_VALIDATION_FAILED`
21214 ///
21215 ///# Safety
21216 ///- `device` (self) must be valid and not destroyed.
21217 ///
21218 ///# Panics
21219 ///Panics if `vkGetMemoryMetalHandleEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21220 ///
21221 ///# Usage Notes
21222 ///
21223 ///Exports a Vulkan device memory allocation as a Metal resource
21224 ///handle for cross-API interop on Apple platforms.
21225 ///
21226 ///Requires `VK_EXT_external_memory_metal`. macOS/iOS only.
21227 pub unsafe fn get_memory_metal_handle_ext(
21228 &self,
21229 p_get_metal_handle_info: &MemoryGetMetalHandleInfoEXT,
21230 p_handle: *mut *mut core::ffi::c_void,
21231 ) -> VkResult<()> {
21232 let fp = self
21233 .commands()
21234 .get_memory_metal_handle_ext
21235 .expect("vkGetMemoryMetalHandleEXT not loaded");
21236 check(unsafe { fp(self.handle(), p_get_metal_handle_info, p_handle) })
21237 }
21238 ///Wraps [`vkGetMemoryMetalHandlePropertiesEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryMetalHandlePropertiesEXT.html).
21239 /**
21240 Provided by **VK_EXT_external_memory_metal**.*/
21241 ///
21242 ///# Errors
21243 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21244 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE`
21245 ///- `VK_ERROR_UNKNOWN`
21246 ///- `VK_ERROR_VALIDATION_FAILED`
21247 ///
21248 ///# Safety
21249 ///- `device` (self) must be valid and not destroyed.
21250 ///
21251 ///# Panics
21252 ///Panics if `vkGetMemoryMetalHandlePropertiesEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21253 ///
21254 ///# Usage Notes
21255 ///
21256 ///Queries which Vulkan memory types are compatible with importing
21257 ///a Metal resource handle as external memory. Use before allocating
21258 ///device memory to determine valid memory type bits.
21259 ///
21260 ///Requires `VK_EXT_external_memory_metal`. macOS/iOS only.
21261 pub unsafe fn get_memory_metal_handle_properties_ext(
21262 &self,
21263 handle_type: ExternalMemoryHandleTypeFlagBits,
21264 p_handle: *const core::ffi::c_void,
21265 p_memory_metal_handle_properties: &mut MemoryMetalHandlePropertiesEXT,
21266 ) -> VkResult<()> {
21267 let fp = self
21268 .commands()
21269 .get_memory_metal_handle_properties_ext
21270 .expect("vkGetMemoryMetalHandlePropertiesEXT not loaded");
21271 check(unsafe {
21272 fp(
21273 self.handle(),
21274 handle_type,
21275 p_handle,
21276 p_memory_metal_handle_properties,
21277 )
21278 })
21279 }
21280 ///Wraps [`vkConvertCooperativeVectorMatrixNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkConvertCooperativeVectorMatrixNV.html).
21281 /**
21282 Provided by **VK_NV_cooperative_vector**.*/
21283 ///
21284 ///# Errors
21285 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21286 ///- `VK_ERROR_UNKNOWN`
21287 ///- `VK_ERROR_VALIDATION_FAILED`
21288 ///
21289 ///# Safety
21290 ///- `device` (self) must be valid and not destroyed.
21291 ///
21292 ///# Panics
21293 ///Panics if `vkConvertCooperativeVectorMatrixNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21294 ///
21295 ///# Usage Notes
21296 ///
21297 ///Host-side conversion of cooperative vector matrix data between
21298 ///formats or layouts. Use to prepare weight matrices on the CPU
21299 ///before uploading to the GPU for cooperative vector operations.
21300 ///
21301 ///Requires `VK_NV_cooperative_vector`.
21302 pub unsafe fn convert_cooperative_vector_matrix_nv(
21303 &self,
21304 p_info: &ConvertCooperativeVectorMatrixInfoNV,
21305 ) -> VkResult<()> {
21306 let fp = self
21307 .commands()
21308 .convert_cooperative_vector_matrix_nv
21309 .expect("vkConvertCooperativeVectorMatrixNV not loaded");
21310 check(unsafe { fp(self.handle(), p_info) })
21311 }
21312 ///Wraps [`vkCmdConvertCooperativeVectorMatrixNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdConvertCooperativeVectorMatrixNV.html).
21313 /**
21314 Provided by **VK_NV_cooperative_vector**.*/
21315 ///
21316 ///# Safety
21317 ///- `commandBuffer` (self) must be valid and not destroyed.
21318 ///- `commandBuffer` must be externally synchronized.
21319 ///
21320 ///# Panics
21321 ///Panics if `vkCmdConvertCooperativeVectorMatrixNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21322 ///
21323 ///# Usage Notes
21324 ///
21325 ///GPU-side conversion of cooperative vector matrix data between
21326 ///formats or layouts. Converts one or more matrices in a command
21327 ///buffer. Use for repacking weight matrices for neural network
21328 ///inference on the GPU.
21329 ///
21330 ///Requires `VK_NV_cooperative_vector`.
21331 pub unsafe fn cmd_convert_cooperative_vector_matrix_nv(
21332 &self,
21333 command_buffer: CommandBuffer,
21334 p_infos: &[ConvertCooperativeVectorMatrixInfoNV],
21335 ) {
21336 let fp = self
21337 .commands()
21338 .cmd_convert_cooperative_vector_matrix_nv
21339 .expect("vkCmdConvertCooperativeVectorMatrixNV not loaded");
21340 unsafe { fp(command_buffer, p_infos.len() as u32, p_infos.as_ptr()) };
21341 }
21342 ///Wraps [`vkCmdDispatchTileQCOM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDispatchTileQCOM.html).
21343 /**
21344 Provided by **VK_QCOM_tile_shading**.*/
21345 ///
21346 ///# Safety
21347 ///- `commandBuffer` (self) must be valid and not destroyed.
21348 ///
21349 ///# Panics
21350 ///Panics if `vkCmdDispatchTileQCOM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21351 ///
21352 ///# Usage Notes
21353 ///
21354 ///Dispatches compute work within a per-tile execution region on
21355 ///Qualcomm tile-based GPUs. Must be called between
21356 ///`cmd_begin_per_tile_execution_qcom` and
21357 ///`cmd_end_per_tile_execution_qcom`.
21358 ///
21359 ///Requires `VK_QCOM_tile_shading`.
21360 pub unsafe fn cmd_dispatch_tile_qcom(
21361 &self,
21362 command_buffer: CommandBuffer,
21363 p_dispatch_tile_info: &DispatchTileInfoQCOM,
21364 ) {
21365 let fp = self
21366 .commands()
21367 .cmd_dispatch_tile_qcom
21368 .expect("vkCmdDispatchTileQCOM not loaded");
21369 unsafe { fp(command_buffer, p_dispatch_tile_info) };
21370 }
21371 ///Wraps [`vkCmdBeginPerTileExecutionQCOM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginPerTileExecutionQCOM.html).
21372 /**
21373 Provided by **VK_QCOM_tile_shading**.*/
21374 ///
21375 ///# Safety
21376 ///- `commandBuffer` (self) must be valid and not destroyed.
21377 ///
21378 ///# Panics
21379 ///Panics if `vkCmdBeginPerTileExecutionQCOM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21380 ///
21381 ///# Usage Notes
21382 ///
21383 ///Begins a per-tile execution region within a render pass on
21384 ///Qualcomm tile-based GPUs. Commands recorded between this and
21385 ///`cmd_end_per_tile_execution_qcom` are executed once per tile,
21386 ///enabling tile-local compute and shading optimisations.
21387 ///
21388 ///Requires `VK_QCOM_tile_shading`.
21389 pub unsafe fn cmd_begin_per_tile_execution_qcom(
21390 &self,
21391 command_buffer: CommandBuffer,
21392 p_per_tile_begin_info: &PerTileBeginInfoQCOM,
21393 ) {
21394 let fp = self
21395 .commands()
21396 .cmd_begin_per_tile_execution_qcom
21397 .expect("vkCmdBeginPerTileExecutionQCOM not loaded");
21398 unsafe { fp(command_buffer, p_per_tile_begin_info) };
21399 }
21400 ///Wraps [`vkCmdEndPerTileExecutionQCOM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndPerTileExecutionQCOM.html).
21401 /**
21402 Provided by **VK_QCOM_tile_shading**.*/
21403 ///
21404 ///# Safety
21405 ///- `commandBuffer` (self) must be valid and not destroyed.
21406 ///
21407 ///# Panics
21408 ///Panics if `vkCmdEndPerTileExecutionQCOM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21409 ///
21410 ///# Usage Notes
21411 ///
21412 ///Ends a per-tile execution region started by
21413 ///`cmd_begin_per_tile_execution_qcom`. After this call, the
21414 ///command buffer returns to normal (non-tile-local) recording.
21415 ///
21416 ///Requires `VK_QCOM_tile_shading`.
21417 pub unsafe fn cmd_end_per_tile_execution_qcom(
21418 &self,
21419 command_buffer: CommandBuffer,
21420 p_per_tile_end_info: &PerTileEndInfoQCOM,
21421 ) {
21422 let fp = self
21423 .commands()
21424 .cmd_end_per_tile_execution_qcom
21425 .expect("vkCmdEndPerTileExecutionQCOM not loaded");
21426 unsafe { fp(command_buffer, p_per_tile_end_info) };
21427 }
21428 ///Wraps [`vkCreateExternalComputeQueueNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateExternalComputeQueueNV.html).
21429 /**
21430 Provided by **VK_NV_external_compute_queue**.*/
21431 ///
21432 ///# Errors
21433 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21434 ///- `VK_ERROR_TOO_MANY_OBJECTS`
21435 ///- `VK_ERROR_UNKNOWN`
21436 ///- `VK_ERROR_VALIDATION_FAILED`
21437 ///
21438 ///# Safety
21439 ///- `device` (self) must be valid and not destroyed.
21440 ///
21441 ///# Panics
21442 ///Panics if `vkCreateExternalComputeQueueNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21443 ///
21444 ///# Usage Notes
21445 ///
21446 ///Creates an external compute queue that can be used to submit
21447 ///work from outside the Vulkan runtime (e.g., CUDA interop).
21448 ///Destroy with `destroy_external_compute_queue_nv`.
21449 ///
21450 ///Requires `VK_NV_external_compute_queue`.
21451 pub unsafe fn create_external_compute_queue_nv(
21452 &self,
21453 p_create_info: &ExternalComputeQueueCreateInfoNV,
21454 allocator: Option<&AllocationCallbacks>,
21455 ) -> VkResult<ExternalComputeQueueNV> {
21456 let fp = self
21457 .commands()
21458 .create_external_compute_queue_nv
21459 .expect("vkCreateExternalComputeQueueNV not loaded");
21460 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
21461 let mut out = unsafe { core::mem::zeroed() };
21462 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
21463 Ok(out)
21464 }
21465 ///Wraps [`vkDestroyExternalComputeQueueNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyExternalComputeQueueNV.html).
21466 /**
21467 Provided by **VK_NV_external_compute_queue**.*/
21468 ///
21469 ///# Safety
21470 ///- `device` (self) must be valid and not destroyed.
21471 ///
21472 ///# Panics
21473 ///Panics if `vkDestroyExternalComputeQueueNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21474 ///
21475 ///# Usage Notes
21476 ///
21477 ///Destroys an external compute queue created with
21478 ///`create_external_compute_queue_nv`.
21479 ///
21480 ///Requires `VK_NV_external_compute_queue`.
21481 pub unsafe fn destroy_external_compute_queue_nv(
21482 &self,
21483 external_queue: ExternalComputeQueueNV,
21484 allocator: Option<&AllocationCallbacks>,
21485 ) {
21486 let fp = self
21487 .commands()
21488 .destroy_external_compute_queue_nv
21489 .expect("vkDestroyExternalComputeQueueNV not loaded");
21490 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
21491 unsafe { fp(self.handle(), external_queue, alloc_ptr) };
21492 }
21493 ///Wraps [`vkCreateShaderInstrumentationARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateShaderInstrumentationARM.html).
21494 /**
21495 Provided by **VK_ARM_shader_instrumentation**.*/
21496 ///
21497 ///# Errors
21498 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21499 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
21500 ///- `VK_ERROR_UNKNOWN`
21501 ///- `VK_ERROR_VALIDATION_FAILED`
21502 ///
21503 ///# Safety
21504 ///- `device` (self) must be valid and not destroyed.
21505 ///
21506 ///# Panics
21507 ///Panics if `vkCreateShaderInstrumentationARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21508 ///
21509 ///# Usage Notes
21510 ///
21511 ///Creates a shader instrumentation object that configures which
21512 ///metrics to collect during shader execution. The instrumentation
21513 ///is later bound to command buffers with
21514 ///`cmd_begin_shader_instrumentation_arm`.
21515 ///
21516 ///Requires `VK_ARM_shader_instrumentation`.
21517 pub unsafe fn create_shader_instrumentation_arm(
21518 &self,
21519 p_create_info: &ShaderInstrumentationCreateInfoARM,
21520 allocator: Option<&AllocationCallbacks>,
21521 ) -> VkResult<ShaderInstrumentationARM> {
21522 let fp = self
21523 .commands()
21524 .create_shader_instrumentation_arm
21525 .expect("vkCreateShaderInstrumentationARM not loaded");
21526 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
21527 let mut out = unsafe { core::mem::zeroed() };
21528 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
21529 Ok(out)
21530 }
21531 ///Wraps [`vkDestroyShaderInstrumentationARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyShaderInstrumentationARM.html).
21532 /**
21533 Provided by **VK_ARM_shader_instrumentation**.*/
21534 ///
21535 ///# Safety
21536 ///- `device` (self) must be valid and not destroyed.
21537 ///- `instrumentation` must be externally synchronized.
21538 ///
21539 ///# Panics
21540 ///Panics if `vkDestroyShaderInstrumentationARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21541 ///
21542 ///# Usage Notes
21543 ///
21544 ///Destroys a shader instrumentation object. The object must not be
21545 ///in use by any command buffer.
21546 ///
21547 ///Requires `VK_ARM_shader_instrumentation`.
21548 pub unsafe fn destroy_shader_instrumentation_arm(
21549 &self,
21550 instrumentation: ShaderInstrumentationARM,
21551 allocator: Option<&AllocationCallbacks>,
21552 ) {
21553 let fp = self
21554 .commands()
21555 .destroy_shader_instrumentation_arm
21556 .expect("vkDestroyShaderInstrumentationARM not loaded");
21557 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
21558 unsafe { fp(self.handle(), instrumentation, alloc_ptr) };
21559 }
21560 ///Wraps [`vkCmdBeginShaderInstrumentationARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginShaderInstrumentationARM.html).
21561 /**
21562 Provided by **VK_ARM_shader_instrumentation**.*/
21563 ///
21564 ///# Safety
21565 ///- `commandBuffer` (self) must be valid and not destroyed.
21566 ///- `commandBuffer` must be externally synchronized.
21567 ///- `instrumentation` must be externally synchronized.
21568 ///
21569 ///# Panics
21570 ///Panics if `vkCmdBeginShaderInstrumentationARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21571 ///
21572 ///# Usage Notes
21573 ///
21574 ///Begins shader instrumentation collection in a command buffer.
21575 ///All subsequent draw and dispatch commands will collect the
21576 ///metrics configured in the instrumentation object until
21577 ///`cmd_end_shader_instrumentation_arm` is called.
21578 ///
21579 ///Requires `VK_ARM_shader_instrumentation`.
21580 pub unsafe fn cmd_begin_shader_instrumentation_arm(
21581 &self,
21582 command_buffer: CommandBuffer,
21583 instrumentation: ShaderInstrumentationARM,
21584 ) {
21585 let fp = self
21586 .commands()
21587 .cmd_begin_shader_instrumentation_arm
21588 .expect("vkCmdBeginShaderInstrumentationARM not loaded");
21589 unsafe { fp(command_buffer, instrumentation) };
21590 }
21591 ///Wraps [`vkCmdEndShaderInstrumentationARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndShaderInstrumentationARM.html).
21592 /**
21593 Provided by **VK_ARM_shader_instrumentation**.*/
21594 ///
21595 ///# Safety
21596 ///- `commandBuffer` (self) must be valid and not destroyed.
21597 ///- `commandBuffer` must be externally synchronized.
21598 ///
21599 ///# Panics
21600 ///Panics if `vkCmdEndShaderInstrumentationARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21601 ///
21602 ///# Usage Notes
21603 ///
21604 ///Ends shader instrumentation collection in a command buffer.
21605 ///Metrics collected since the matching
21606 ///`cmd_begin_shader_instrumentation_arm` can be retrieved with
21607 ///`get_shader_instrumentation_values_arm` after submission
21608 ///completes.
21609 ///
21610 ///Requires `VK_ARM_shader_instrumentation`.
21611 pub unsafe fn cmd_end_shader_instrumentation_arm(&self, command_buffer: CommandBuffer) {
21612 let fp = self
21613 .commands()
21614 .cmd_end_shader_instrumentation_arm
21615 .expect("vkCmdEndShaderInstrumentationARM not loaded");
21616 unsafe { fp(command_buffer) };
21617 }
21618 ///Wraps [`vkGetShaderInstrumentationValuesARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetShaderInstrumentationValuesARM.html).
21619 /**
21620 Provided by **VK_ARM_shader_instrumentation**.*/
21621 ///
21622 ///# Errors
21623 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21624 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
21625 ///- `VK_ERROR_UNKNOWN`
21626 ///- `VK_ERROR_VALIDATION_FAILED`
21627 ///
21628 ///# Safety
21629 ///- `device` (self) must be valid and not destroyed.
21630 ///
21631 ///# Panics
21632 ///Panics if `vkGetShaderInstrumentationValuesARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21633 ///
21634 ///# Usage Notes
21635 ///
21636 ///Retrieves collected shader instrumentation metric values after
21637 ///instrumented commands have completed execution. Returns metric
21638 ///blocks whose count is written to `p_metric_block_count`. Ensure
21639 ///the instrumented submission has finished before querying.
21640 ///
21641 ///Requires `VK_ARM_shader_instrumentation`.
21642 pub unsafe fn get_shader_instrumentation_values_arm(
21643 &self,
21644 instrumentation: ShaderInstrumentationARM,
21645 p_metric_block_count: *mut u32,
21646 flags: ShaderInstrumentationValuesFlagsARM,
21647 ) -> VkResult<core::ffi::c_void> {
21648 let fp = self
21649 .commands()
21650 .get_shader_instrumentation_values_arm
21651 .expect("vkGetShaderInstrumentationValuesARM not loaded");
21652 let mut out = unsafe { core::mem::zeroed() };
21653 check(unsafe {
21654 fp(
21655 self.handle(),
21656 instrumentation,
21657 p_metric_block_count,
21658 &mut out,
21659 flags,
21660 )
21661 })?;
21662 Ok(out)
21663 }
21664 ///Wraps [`vkClearShaderInstrumentationMetricsARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkClearShaderInstrumentationMetricsARM.html).
21665 /**
21666 Provided by **VK_ARM_shader_instrumentation**.*/
21667 ///
21668 ///# Safety
21669 ///- `device` (self) must be valid and not destroyed.
21670 ///
21671 ///# Panics
21672 ///Panics if `vkClearShaderInstrumentationMetricsARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21673 ///
21674 ///# Usage Notes
21675 ///
21676 ///Resets accumulated metrics for a shader instrumentation object.
21677 ///Call between frames or profiling sessions to start collecting
21678 ///fresh data without destroying and recreating the object.
21679 ///
21680 ///Requires `VK_ARM_shader_instrumentation`.
21681 pub unsafe fn clear_shader_instrumentation_metrics_arm(
21682 &self,
21683 instrumentation: ShaderInstrumentationARM,
21684 ) {
21685 let fp = self
21686 .commands()
21687 .clear_shader_instrumentation_metrics_arm
21688 .expect("vkClearShaderInstrumentationMetricsARM not loaded");
21689 unsafe { fp(self.handle(), instrumentation) };
21690 }
21691 ///Wraps [`vkCreateTensorARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateTensorARM.html).
21692 /**
21693 Provided by **VK_ARM_tensors**.*/
21694 ///
21695 ///# Errors
21696 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21697 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
21698 ///- `VK_ERROR_UNKNOWN`
21699 ///- `VK_ERROR_VALIDATION_FAILED`
21700 ///
21701 ///# Safety
21702 ///- `device` (self) must be valid and not destroyed.
21703 ///
21704 ///# Panics
21705 ///Panics if `vkCreateTensorARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21706 ///
21707 ///# Usage Notes
21708 ///
21709 ///Creates a tensor object for ARM's tensor extension. Tensors are
21710 ///multi-dimensional arrays with a defined format, dimensions, and
21711 ///usage flags. Must be bound to memory before use, similar to
21712 ///images and buffers.
21713 ///
21714 ///Requires `VK_ARM_tensors`.
21715 pub unsafe fn create_tensor_arm(
21716 &self,
21717 p_create_info: &TensorCreateInfoARM,
21718 allocator: Option<&AllocationCallbacks>,
21719 ) -> VkResult<TensorARM> {
21720 let fp = self
21721 .commands()
21722 .create_tensor_arm
21723 .expect("vkCreateTensorARM not loaded");
21724 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
21725 let mut out = unsafe { core::mem::zeroed() };
21726 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
21727 Ok(out)
21728 }
21729 ///Wraps [`vkDestroyTensorARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyTensorARM.html).
21730 /**
21731 Provided by **VK_ARM_tensors**.*/
21732 ///
21733 ///# Safety
21734 ///- `device` (self) must be valid and not destroyed.
21735 ///- `tensor` must be externally synchronized.
21736 ///
21737 ///# Panics
21738 ///Panics if `vkDestroyTensorARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21739 ///
21740 ///# Usage Notes
21741 ///
21742 ///Destroys a tensor object. The tensor must not be in use by any
21743 ///command buffer or referenced by any tensor view.
21744 ///
21745 ///Requires `VK_ARM_tensors`.
21746 pub unsafe fn destroy_tensor_arm(
21747 &self,
21748 tensor: TensorARM,
21749 allocator: Option<&AllocationCallbacks>,
21750 ) {
21751 let fp = self
21752 .commands()
21753 .destroy_tensor_arm
21754 .expect("vkDestroyTensorARM not loaded");
21755 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
21756 unsafe { fp(self.handle(), tensor, alloc_ptr) };
21757 }
21758 ///Wraps [`vkCreateTensorViewARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateTensorViewARM.html).
21759 /**
21760 Provided by **VK_ARM_tensors**.*/
21761 ///
21762 ///# Errors
21763 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21764 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
21765 ///- `VK_ERROR_UNKNOWN`
21766 ///- `VK_ERROR_VALIDATION_FAILED`
21767 ///
21768 ///# Safety
21769 ///- `device` (self) must be valid and not destroyed.
21770 ///
21771 ///# Panics
21772 ///Panics if `vkCreateTensorViewARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21773 ///
21774 ///# Usage Notes
21775 ///
21776 ///Creates a view into a tensor, analogous to image views. A tensor
21777 ///view selects a subset of the tensor's dimensions or reinterprets
21778 ///its format for use in descriptors and shaders.
21779 ///
21780 ///Requires `VK_ARM_tensors`.
21781 pub unsafe fn create_tensor_view_arm(
21782 &self,
21783 p_create_info: &TensorViewCreateInfoARM,
21784 allocator: Option<&AllocationCallbacks>,
21785 ) -> VkResult<TensorViewARM> {
21786 let fp = self
21787 .commands()
21788 .create_tensor_view_arm
21789 .expect("vkCreateTensorViewARM not loaded");
21790 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
21791 let mut out = unsafe { core::mem::zeroed() };
21792 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
21793 Ok(out)
21794 }
21795 ///Wraps [`vkDestroyTensorViewARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyTensorViewARM.html).
21796 /**
21797 Provided by **VK_ARM_tensors**.*/
21798 ///
21799 ///# Safety
21800 ///- `device` (self) must be valid and not destroyed.
21801 ///- `tensorView` must be externally synchronized.
21802 ///
21803 ///# Panics
21804 ///Panics if `vkDestroyTensorViewARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21805 ///
21806 ///# Usage Notes
21807 ///
21808 ///Destroys a tensor view. The view must not be in use by any
21809 ///command buffer or referenced by any descriptor set.
21810 ///
21811 ///Requires `VK_ARM_tensors`.
21812 pub unsafe fn destroy_tensor_view_arm(
21813 &self,
21814 tensor_view: TensorViewARM,
21815 allocator: Option<&AllocationCallbacks>,
21816 ) {
21817 let fp = self
21818 .commands()
21819 .destroy_tensor_view_arm
21820 .expect("vkDestroyTensorViewARM not loaded");
21821 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
21822 unsafe { fp(self.handle(), tensor_view, alloc_ptr) };
21823 }
21824 ///Wraps [`vkGetTensorMemoryRequirementsARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetTensorMemoryRequirementsARM.html).
21825 /**
21826 Provided by **VK_ARM_tensors**.*/
21827 ///
21828 ///# Safety
21829 ///- `device` (self) must be valid and not destroyed.
21830 ///
21831 ///# Panics
21832 ///Panics if `vkGetTensorMemoryRequirementsARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21833 ///
21834 ///# Usage Notes
21835 ///
21836 ///Queries the memory requirements (size, alignment, memory type
21837 ///bits) for an existing tensor object. Call before
21838 ///`bind_tensor_memory_arm` to determine the allocation needed.
21839 ///
21840 ///Requires `VK_ARM_tensors`.
21841 pub unsafe fn get_tensor_memory_requirements_arm(
21842 &self,
21843 p_info: &TensorMemoryRequirementsInfoARM,
21844 p_memory_requirements: &mut MemoryRequirements2,
21845 ) {
21846 let fp = self
21847 .commands()
21848 .get_tensor_memory_requirements_arm
21849 .expect("vkGetTensorMemoryRequirementsARM not loaded");
21850 unsafe { fp(self.handle(), p_info, p_memory_requirements) };
21851 }
21852 ///Wraps [`vkBindTensorMemoryARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBindTensorMemoryARM.html).
21853 /**
21854 Provided by **VK_ARM_tensors**.*/
21855 ///
21856 ///# Errors
21857 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21858 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
21859 ///- `VK_ERROR_UNKNOWN`
21860 ///- `VK_ERROR_VALIDATION_FAILED`
21861 ///
21862 ///# Safety
21863 ///- `device` (self) must be valid and not destroyed.
21864 ///
21865 ///# Panics
21866 ///Panics if `vkBindTensorMemoryARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21867 ///
21868 ///# Usage Notes
21869 ///
21870 ///Binds device memory to one or more tensors. Each bind info
21871 ///specifies the tensor, memory, and offset. Must be called before
21872 ///the tensor is used in any command. Similar to
21873 ///`bind_buffer_memory2` / `bind_image_memory2`.
21874 ///
21875 ///Requires `VK_ARM_tensors`.
21876 pub unsafe fn bind_tensor_memory_arm(
21877 &self,
21878 p_bind_infos: &[BindTensorMemoryInfoARM],
21879 ) -> VkResult<()> {
21880 let fp = self
21881 .commands()
21882 .bind_tensor_memory_arm
21883 .expect("vkBindTensorMemoryARM not loaded");
21884 check(unsafe {
21885 fp(
21886 self.handle(),
21887 p_bind_infos.len() as u32,
21888 p_bind_infos.as_ptr(),
21889 )
21890 })
21891 }
21892 ///Wraps [`vkGetDeviceTensorMemoryRequirementsARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDeviceTensorMemoryRequirementsARM.html).
21893 /**
21894 Provided by **VK_ARM_tensors**.*/
21895 ///
21896 ///# Safety
21897 ///- `device` (self) must be valid and not destroyed.
21898 ///
21899 ///# Panics
21900 ///Panics if `vkGetDeviceTensorMemoryRequirementsARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21901 ///
21902 ///# Usage Notes
21903 ///
21904 ///Queries memory requirements for a tensor described by its create
21905 ///info, without creating the tensor first. Analogous to
21906 ///`get_device_buffer_memory_requirements` /
21907 ///`get_device_image_memory_requirements`.
21908 ///
21909 ///Requires `VK_ARM_tensors`.
21910 pub unsafe fn get_device_tensor_memory_requirements_arm(
21911 &self,
21912 p_info: &DeviceTensorMemoryRequirementsARM,
21913 p_memory_requirements: &mut MemoryRequirements2,
21914 ) {
21915 let fp = self
21916 .commands()
21917 .get_device_tensor_memory_requirements_arm
21918 .expect("vkGetDeviceTensorMemoryRequirementsARM not loaded");
21919 unsafe { fp(self.handle(), p_info, p_memory_requirements) };
21920 }
21921 ///Wraps [`vkCmdCopyTensorARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyTensorARM.html).
21922 /**
21923 Provided by **VK_ARM_tensors**.*/
21924 ///
21925 ///# Safety
21926 ///- `commandBuffer` (self) must be valid and not destroyed.
21927 ///- `commandBuffer` must be externally synchronized.
21928 ///
21929 ///# Panics
21930 ///Panics if `vkCmdCopyTensorARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21931 ///
21932 ///# Usage Notes
21933 ///
21934 ///Copies data between tensors or between a tensor and a buffer.
21935 ///The copy info structure specifies the source and destination
21936 ///regions, similar to `cmd_copy_buffer` or `cmd_copy_image`.
21937 ///
21938 ///Requires `VK_ARM_tensors`.
21939 pub unsafe fn cmd_copy_tensor_arm(
21940 &self,
21941 command_buffer: CommandBuffer,
21942 p_copy_tensor_info: &CopyTensorInfoARM,
21943 ) {
21944 let fp = self
21945 .commands()
21946 .cmd_copy_tensor_arm
21947 .expect("vkCmdCopyTensorARM not loaded");
21948 unsafe { fp(command_buffer, p_copy_tensor_info) };
21949 }
21950 ///Wraps [`vkGetTensorOpaqueCaptureDescriptorDataARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetTensorOpaqueCaptureDescriptorDataARM.html).
21951 /**
21952 Provided by **VK_ARM_tensors**.*/
21953 ///
21954 ///# Errors
21955 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21956 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
21957 ///- `VK_ERROR_UNKNOWN`
21958 ///- `VK_ERROR_VALIDATION_FAILED`
21959 ///
21960 ///# Safety
21961 ///- `device` (self) must be valid and not destroyed.
21962 ///
21963 ///# Panics
21964 ///Panics if `vkGetTensorOpaqueCaptureDescriptorDataARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
21965 ///
21966 ///# Usage Notes
21967 ///
21968 ///Retrieves opaque capture data for a tensor's descriptor, used
21969 ///for descriptor buffer capture and replay. The returned data can
21970 ///be stored and replayed to recreate an equivalent descriptor.
21971 ///
21972 ///Requires `VK_ARM_tensors` + `VK_EXT_descriptor_buffer`.
21973 pub unsafe fn get_tensor_opaque_capture_descriptor_data_arm(
21974 &self,
21975 p_info: &TensorCaptureDescriptorDataInfoARM,
21976 ) -> VkResult<core::ffi::c_void> {
21977 let fp = self
21978 .commands()
21979 .get_tensor_opaque_capture_descriptor_data_arm
21980 .expect("vkGetTensorOpaqueCaptureDescriptorDataARM not loaded");
21981 let mut out = unsafe { core::mem::zeroed() };
21982 check(unsafe { fp(self.handle(), p_info, &mut out) })?;
21983 Ok(out)
21984 }
21985 ///Wraps [`vkGetTensorViewOpaqueCaptureDescriptorDataARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetTensorViewOpaqueCaptureDescriptorDataARM.html).
21986 /**
21987 Provided by **VK_ARM_tensors**.*/
21988 ///
21989 ///# Errors
21990 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
21991 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
21992 ///- `VK_ERROR_UNKNOWN`
21993 ///- `VK_ERROR_VALIDATION_FAILED`
21994 ///
21995 ///# Safety
21996 ///- `device` (self) must be valid and not destroyed.
21997 ///
21998 ///# Panics
21999 ///Panics if `vkGetTensorViewOpaqueCaptureDescriptorDataARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22000 ///
22001 ///# Usage Notes
22002 ///
22003 ///Retrieves opaque capture data for a tensor view's descriptor,
22004 ///used for descriptor buffer capture and replay. Similar to
22005 ///`get_tensor_opaque_capture_descriptor_data_arm` but for tensor
22006 ///views.
22007 ///
22008 ///Requires `VK_ARM_tensors` + `VK_EXT_descriptor_buffer`.
22009 pub unsafe fn get_tensor_view_opaque_capture_descriptor_data_arm(
22010 &self,
22011 p_info: &TensorViewCaptureDescriptorDataInfoARM,
22012 ) -> VkResult<core::ffi::c_void> {
22013 let fp = self
22014 .commands()
22015 .get_tensor_view_opaque_capture_descriptor_data_arm
22016 .expect("vkGetTensorViewOpaqueCaptureDescriptorDataARM not loaded");
22017 let mut out = unsafe { core::mem::zeroed() };
22018 check(unsafe { fp(self.handle(), p_info, &mut out) })?;
22019 Ok(out)
22020 }
22021 ///Wraps [`vkCreateDataGraphPipelinesARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateDataGraphPipelinesARM.html).
22022 /**
22023 Provided by **VK_ARM_data_graph**.*/
22024 ///
22025 ///# Errors
22026 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22027 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22028 ///- `VK_ERROR_UNKNOWN`
22029 ///- `VK_ERROR_VALIDATION_FAILED`
22030 ///
22031 ///# Safety
22032 ///- `device` (self) must be valid and not destroyed.
22033 ///
22034 ///# Panics
22035 ///Panics if `vkCreateDataGraphPipelinesARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22036 ///
22037 ///# Usage Notes
22038 ///
22039 ///Creates one or more data graph pipelines for ARM's data graph
22040 ///extension. Supports deferred compilation via a
22041 ///`DeferredOperationKHR` handle and pipeline caching. Data graph
22042 ///pipelines define GPU-side data processing graphs.
22043 ///
22044 ///Requires `VK_ARM_data_graph`.
22045 pub unsafe fn create_data_graph_pipelines_arm(
22046 &self,
22047 deferred_operation: DeferredOperationKHR,
22048 pipeline_cache: PipelineCache,
22049 p_create_infos: &[DataGraphPipelineCreateInfoARM],
22050 allocator: Option<&AllocationCallbacks>,
22051 ) -> VkResult<Vec<Pipeline>> {
22052 let fp = self
22053 .commands()
22054 .create_data_graph_pipelines_arm
22055 .expect("vkCreateDataGraphPipelinesARM not loaded");
22056 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
22057 let count = p_create_infos.len();
22058 let mut out = vec![unsafe { core::mem::zeroed() }; count];
22059 check(unsafe {
22060 fp(
22061 self.handle(),
22062 deferred_operation,
22063 pipeline_cache,
22064 p_create_infos.len() as u32,
22065 p_create_infos.as_ptr(),
22066 alloc_ptr,
22067 out.as_mut_ptr(),
22068 )
22069 })?;
22070 Ok(out)
22071 }
22072 ///Wraps [`vkCreateDataGraphPipelineSessionARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateDataGraphPipelineSessionARM.html).
22073 /**
22074 Provided by **VK_ARM_data_graph**.*/
22075 ///
22076 ///# Errors
22077 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22078 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22079 ///- `VK_ERROR_UNKNOWN`
22080 ///- `VK_ERROR_VALIDATION_FAILED`
22081 ///
22082 ///# Safety
22083 ///- `device` (self) must be valid and not destroyed.
22084 ///
22085 ///# Panics
22086 ///Panics if `vkCreateDataGraphPipelineSessionARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22087 ///
22088 ///# Usage Notes
22089 ///
22090 ///Creates a session for executing a data graph pipeline. A session
22091 ///holds the runtime state and memory bindings needed to dispatch
22092 ///the graph. Must be bound to memory before dispatch.
22093 ///
22094 ///Requires `VK_ARM_data_graph`.
22095 pub unsafe fn create_data_graph_pipeline_session_arm(
22096 &self,
22097 p_create_info: &DataGraphPipelineSessionCreateInfoARM,
22098 allocator: Option<&AllocationCallbacks>,
22099 ) -> VkResult<DataGraphPipelineSessionARM> {
22100 let fp = self
22101 .commands()
22102 .create_data_graph_pipeline_session_arm
22103 .expect("vkCreateDataGraphPipelineSessionARM not loaded");
22104 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
22105 let mut out = unsafe { core::mem::zeroed() };
22106 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
22107 Ok(out)
22108 }
22109 ///Wraps [`vkGetDataGraphPipelineSessionBindPointRequirementsARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDataGraphPipelineSessionBindPointRequirementsARM.html).
22110 /**
22111 Provided by **VK_ARM_data_graph**.*/
22112 ///
22113 ///# Errors
22114 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22115 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22116 ///- `VK_ERROR_UNKNOWN`
22117 ///- `VK_ERROR_VALIDATION_FAILED`
22118 ///
22119 ///# Safety
22120 ///- `device` (self) must be valid and not destroyed.
22121 ///
22122 ///# Panics
22123 ///Panics if `vkGetDataGraphPipelineSessionBindPointRequirementsARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22124 ///
22125 ///# Usage Notes
22126 ///
22127 ///Queries the memory bind point requirements for a data graph
22128 ///pipeline session. Uses the two-call idiom. Each returned
22129 ///requirement describes a bind point that must be satisfied with
22130 ///`bind_data_graph_pipeline_session_memory_arm` before dispatch.
22131 ///
22132 ///Requires `VK_ARM_data_graph`.
22133 pub unsafe fn get_data_graph_pipeline_session_bind_point_requirements_arm(
22134 &self,
22135 p_info: &DataGraphPipelineSessionBindPointRequirementsInfoARM,
22136 ) -> VkResult<Vec<DataGraphPipelineSessionBindPointRequirementARM>> {
22137 let fp = self
22138 .commands()
22139 .get_data_graph_pipeline_session_bind_point_requirements_arm
22140 .expect("vkGetDataGraphPipelineSessionBindPointRequirementsARM not loaded");
22141 enumerate_two_call(|count, data| unsafe { fp(self.handle(), p_info, count, data) })
22142 }
22143 ///Wraps [`vkGetDataGraphPipelineSessionMemoryRequirementsARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDataGraphPipelineSessionMemoryRequirementsARM.html).
22144 /**
22145 Provided by **VK_ARM_data_graph**.*/
22146 ///
22147 ///# Safety
22148 ///- `device` (self) must be valid and not destroyed.
22149 ///
22150 ///# Panics
22151 ///Panics if `vkGetDataGraphPipelineSessionMemoryRequirementsARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22152 ///
22153 ///# Usage Notes
22154 ///
22155 ///Queries the memory requirements for a specific bind point within
22156 ///a data graph pipeline session. Returns a `MemoryRequirements2`
22157 ///describing the size, alignment, and compatible memory types.
22158 ///
22159 ///Requires `VK_ARM_data_graph`.
22160 pub unsafe fn get_data_graph_pipeline_session_memory_requirements_arm(
22161 &self,
22162 p_info: &DataGraphPipelineSessionMemoryRequirementsInfoARM,
22163 p_memory_requirements: &mut MemoryRequirements2,
22164 ) {
22165 let fp = self
22166 .commands()
22167 .get_data_graph_pipeline_session_memory_requirements_arm
22168 .expect("vkGetDataGraphPipelineSessionMemoryRequirementsARM not loaded");
22169 unsafe { fp(self.handle(), p_info, p_memory_requirements) };
22170 }
22171 ///Wraps [`vkBindDataGraphPipelineSessionMemoryARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkBindDataGraphPipelineSessionMemoryARM.html).
22172 /**
22173 Provided by **VK_ARM_data_graph**.*/
22174 ///
22175 ///# Errors
22176 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22177 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22178 ///- `VK_ERROR_UNKNOWN`
22179 ///- `VK_ERROR_VALIDATION_FAILED`
22180 ///
22181 ///# Safety
22182 ///- `device` (self) must be valid and not destroyed.
22183 ///
22184 ///# Panics
22185 ///Panics if `vkBindDataGraphPipelineSessionMemoryARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22186 ///
22187 ///# Usage Notes
22188 ///
22189 ///Binds device memory to a data graph pipeline session at the bind
22190 ///points returned by
22191 ///`get_data_graph_pipeline_session_bind_point_requirements_arm`.
22192 ///Must be called before dispatching the session.
22193 ///
22194 ///Requires `VK_ARM_data_graph`.
22195 pub unsafe fn bind_data_graph_pipeline_session_memory_arm(
22196 &self,
22197 p_bind_infos: &[BindDataGraphPipelineSessionMemoryInfoARM],
22198 ) -> VkResult<()> {
22199 let fp = self
22200 .commands()
22201 .bind_data_graph_pipeline_session_memory_arm
22202 .expect("vkBindDataGraphPipelineSessionMemoryARM not loaded");
22203 check(unsafe {
22204 fp(
22205 self.handle(),
22206 p_bind_infos.len() as u32,
22207 p_bind_infos.as_ptr(),
22208 )
22209 })
22210 }
22211 ///Wraps [`vkDestroyDataGraphPipelineSessionARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkDestroyDataGraphPipelineSessionARM.html).
22212 /**
22213 Provided by **VK_ARM_data_graph**.*/
22214 ///
22215 ///# Safety
22216 ///- `device` (self) must be valid and not destroyed.
22217 ///- `session` must be externally synchronized.
22218 ///
22219 ///# Panics
22220 ///Panics if `vkDestroyDataGraphPipelineSessionARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22221 ///
22222 ///# Usage Notes
22223 ///
22224 ///Destroys a data graph pipeline session and frees associated host
22225 ///resources. The session must not be in use by any command buffer.
22226 ///
22227 ///Requires `VK_ARM_data_graph`.
22228 pub unsafe fn destroy_data_graph_pipeline_session_arm(
22229 &self,
22230 session: DataGraphPipelineSessionARM,
22231 allocator: Option<&AllocationCallbacks>,
22232 ) {
22233 let fp = self
22234 .commands()
22235 .destroy_data_graph_pipeline_session_arm
22236 .expect("vkDestroyDataGraphPipelineSessionARM not loaded");
22237 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
22238 unsafe { fp(self.handle(), session, alloc_ptr) };
22239 }
22240 ///Wraps [`vkCmdDispatchDataGraphARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDispatchDataGraphARM.html).
22241 /**
22242 Provided by **VK_ARM_data_graph**.*/
22243 ///
22244 ///# Safety
22245 ///- `commandBuffer` (self) must be valid and not destroyed.
22246 ///- `commandBuffer` must be externally synchronized.
22247 ///
22248 ///# Panics
22249 ///Panics if `vkCmdDispatchDataGraphARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22250 ///
22251 ///# Usage Notes
22252 ///
22253 ///Records a data graph pipeline dispatch into a command buffer.
22254 ///The session must have been created and bound to memory before
22255 ///dispatch. Optional dispatch info can configure execution
22256 ///parameters.
22257 ///
22258 ///Requires `VK_ARM_data_graph`.
22259 pub unsafe fn cmd_dispatch_data_graph_arm(
22260 &self,
22261 command_buffer: CommandBuffer,
22262 session: DataGraphPipelineSessionARM,
22263 p_info: Option<&DataGraphPipelineDispatchInfoARM>,
22264 ) {
22265 let fp = self
22266 .commands()
22267 .cmd_dispatch_data_graph_arm
22268 .expect("vkCmdDispatchDataGraphARM not loaded");
22269 let p_info_ptr = p_info.map_or(core::ptr::null(), core::ptr::from_ref);
22270 unsafe { fp(command_buffer, session, p_info_ptr) };
22271 }
22272 ///Wraps [`vkGetDataGraphPipelineAvailablePropertiesARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDataGraphPipelineAvailablePropertiesARM.html).
22273 /**
22274 Provided by **VK_ARM_data_graph**.*/
22275 ///
22276 ///# Errors
22277 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22278 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22279 ///- `VK_ERROR_UNKNOWN`
22280 ///- `VK_ERROR_VALIDATION_FAILED`
22281 ///
22282 ///# Safety
22283 ///- `device` (self) must be valid and not destroyed.
22284 ///
22285 ///# Panics
22286 ///Panics if `vkGetDataGraphPipelineAvailablePropertiesARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22287 ///
22288 ///# Usage Notes
22289 ///
22290 ///Enumerates the queryable properties for a data graph pipeline.
22291 ///Uses the two-call idiom. The returned property descriptors can
22292 ///then be queried with `get_data_graph_pipeline_properties_arm`.
22293 ///
22294 ///Requires `VK_ARM_data_graph`.
22295 pub unsafe fn get_data_graph_pipeline_available_properties_arm(
22296 &self,
22297 p_pipeline_info: &DataGraphPipelineInfoARM,
22298 ) -> VkResult<Vec<DataGraphPipelinePropertyARM>> {
22299 let fp = self
22300 .commands()
22301 .get_data_graph_pipeline_available_properties_arm
22302 .expect("vkGetDataGraphPipelineAvailablePropertiesARM not loaded");
22303 enumerate_two_call(|count, data| unsafe { fp(self.handle(), p_pipeline_info, count, data) })
22304 }
22305 ///Wraps [`vkGetDataGraphPipelinePropertiesARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetDataGraphPipelinePropertiesARM.html).
22306 /**
22307 Provided by **VK_ARM_data_graph**.*/
22308 ///
22309 ///# Errors
22310 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22311 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22312 ///- `VK_ERROR_UNKNOWN`
22313 ///- `VK_ERROR_VALIDATION_FAILED`
22314 ///
22315 ///# Safety
22316 ///- `device` (self) must be valid and not destroyed.
22317 ///
22318 ///# Panics
22319 ///Panics if `vkGetDataGraphPipelinePropertiesARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22320 ///
22321 ///# Usage Notes
22322 ///
22323 ///Queries specific property values for a data graph pipeline.
22324 ///First enumerate available properties with
22325 ///`get_data_graph_pipeline_available_properties_arm`, then query
22326 ///the ones you need.
22327 ///
22328 ///Requires `VK_ARM_data_graph`.
22329 pub unsafe fn get_data_graph_pipeline_properties_arm(
22330 &self,
22331 p_pipeline_info: &DataGraphPipelineInfoARM,
22332 properties_count: u32,
22333 p_properties: *mut DataGraphPipelinePropertyQueryResultARM,
22334 ) -> VkResult<()> {
22335 let fp = self
22336 .commands()
22337 .get_data_graph_pipeline_properties_arm
22338 .expect("vkGetDataGraphPipelinePropertiesARM not loaded");
22339 check(unsafe {
22340 fp(
22341 self.handle(),
22342 p_pipeline_info,
22343 properties_count,
22344 p_properties,
22345 )
22346 })
22347 }
22348 ///Wraps [`vkGetNativeBufferPropertiesOHOS`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetNativeBufferPropertiesOHOS.html).
22349 /**
22350 Provided by **VK_OHOS_external_memory**.*/
22351 ///
22352 ///# Errors
22353 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22354 ///- `VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR`
22355 ///- `VK_ERROR_UNKNOWN`
22356 ///- `VK_ERROR_VALIDATION_FAILED`
22357 ///
22358 ///# Safety
22359 ///- `device` (self) must be valid and not destroyed.
22360 ///
22361 ///# Panics
22362 ///Panics if `vkGetNativeBufferPropertiesOHOS` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22363 ///
22364 ///# Usage Notes
22365 ///
22366 ///Queries Vulkan memory properties (memory type bits, size) for
22367 ///an OHOS native buffer. Use before importing external memory to
22368 ///determine compatible memory types. OHOS only.
22369 ///
22370 ///Requires `VK_OHOS_external_memory`.
22371 pub unsafe fn get_native_buffer_properties_ohos(
22372 &self,
22373 buffer: *const core::ffi::c_void,
22374 p_properties: &mut NativeBufferPropertiesOHOS,
22375 ) -> VkResult<()> {
22376 let fp = self
22377 .commands()
22378 .get_native_buffer_properties_ohos
22379 .expect("vkGetNativeBufferPropertiesOHOS not loaded");
22380 check(unsafe { fp(self.handle(), buffer, p_properties) })
22381 }
22382 ///Wraps [`vkGetMemoryNativeBufferOHOS`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetMemoryNativeBufferOHOS.html).
22383 /**
22384 Provided by **VK_OHOS_external_memory**.*/
22385 ///
22386 ///# Errors
22387 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22388 ///- `VK_ERROR_UNKNOWN`
22389 ///- `VK_ERROR_VALIDATION_FAILED`
22390 ///
22391 ///# Safety
22392 ///- `device` (self) must be valid and not destroyed.
22393 ///
22394 ///# Panics
22395 ///Panics if `vkGetMemoryNativeBufferOHOS` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22396 ///
22397 ///# Usage Notes
22398 ///
22399 ///Exports a Vulkan device memory allocation as an OHOS native
22400 ///buffer handle for sharing with other OpenHarmony services.
22401 ///OHOS only.
22402 ///
22403 ///Requires `VK_OHOS_external_memory`.
22404 pub unsafe fn get_memory_native_buffer_ohos(
22405 &self,
22406 p_info: &MemoryGetNativeBufferInfoOHOS,
22407 p_buffer: *mut *mut core::ffi::c_void,
22408 ) -> VkResult<()> {
22409 let fp = self
22410 .commands()
22411 .get_memory_native_buffer_ohos
22412 .expect("vkGetMemoryNativeBufferOHOS not loaded");
22413 check(unsafe { fp(self.handle(), p_info, p_buffer) })
22414 }
22415 ///Wraps [`vkGetSwapchainGrallocUsageOHOS`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetSwapchainGrallocUsageOHOS.html).
22416 ///
22417 ///# Errors
22418 ///- `VK_ERROR_INITIALIZATION_FAILED`
22419 ///- `VK_ERROR_UNKNOWN`
22420 ///- `VK_ERROR_VALIDATION_FAILED`
22421 ///
22422 ///# Safety
22423 ///- `device` (self) must be valid and not destroyed.
22424 ///
22425 ///# Panics
22426 ///Panics if `vkGetSwapchainGrallocUsageOHOS` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22427 ///
22428 ///# Usage Notes
22429 ///
22430 ///Queries the OHOS gralloc usage flags needed for swapchain images
22431 ///with the given format and Vulkan image usage. Used internally by
22432 ///the OHOS WSI implementation. OHOS only.
22433 ///
22434 ///Requires `VK_OHOS_native_buffer`.
22435 pub unsafe fn get_swapchain_gralloc_usage_ohos(
22436 &self,
22437 format: Format,
22438 image_usage: ImageUsageFlags,
22439 ) -> VkResult<u64> {
22440 let fp = self
22441 .commands()
22442 .get_swapchain_gralloc_usage_ohos
22443 .expect("vkGetSwapchainGrallocUsageOHOS not loaded");
22444 let mut out = unsafe { core::mem::zeroed() };
22445 check(unsafe { fp(self.handle(), format, image_usage, &mut out) })?;
22446 Ok(out)
22447 }
22448 ///Wraps [`vkAcquireImageOHOS`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkAcquireImageOHOS.html).
22449 ///
22450 ///# Errors
22451 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22452 ///- `VK_ERROR_UNKNOWN`
22453 ///- `VK_ERROR_VALIDATION_FAILED`
22454 ///
22455 ///# Safety
22456 ///- `device` (self) must be valid and not destroyed.
22457 ///
22458 ///# Panics
22459 ///Panics if `vkAcquireImageOHOS` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22460 ///
22461 ///# Usage Notes
22462 ///
22463 ///Acquires ownership of a swapchain image on OpenHarmony OS.
22464 ///Takes a native fence file descriptor for synchronisation and
22465 ///can signal a Vulkan semaphore or fence on completion. OHOS only.
22466 ///
22467 ///Requires `VK_OHOS_native_buffer`.
22468 pub unsafe fn acquire_image_ohos(
22469 &self,
22470 image: Image,
22471 native_fence_fd: i32,
22472 semaphore: Semaphore,
22473 fence: Fence,
22474 ) -> VkResult<()> {
22475 let fp = self
22476 .commands()
22477 .acquire_image_ohos
22478 .expect("vkAcquireImageOHOS not loaded");
22479 check(unsafe { fp(self.handle(), image, native_fence_fd, semaphore, fence) })
22480 }
22481 ///Wraps [`vkQueueSignalReleaseImageOHOS`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueSignalReleaseImageOHOS.html).
22482 ///
22483 ///# Errors
22484 ///- `VK_ERROR_INITIALIZATION_FAILED`
22485 ///- `VK_ERROR_UNKNOWN`
22486 ///- `VK_ERROR_VALIDATION_FAILED`
22487 ///
22488 ///# Safety
22489 ///- `queue` (self) must be valid and not destroyed.
22490 ///
22491 ///# Panics
22492 ///Panics if `vkQueueSignalReleaseImageOHOS` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22493 ///
22494 ///# Usage Notes
22495 ///
22496 ///Releases a swapchain image back to the OHOS compositor after
22497 ///rendering. Waits on the given semaphores and returns a native
22498 ///fence FD for external synchronisation. OHOS only.
22499 ///
22500 ///Requires `VK_OHOS_native_buffer`.
22501 pub unsafe fn queue_signal_release_image_ohos(
22502 &self,
22503 queue: Queue,
22504 p_wait_semaphores: &[Semaphore],
22505 image: Image,
22506 ) -> VkResult<i32> {
22507 let fp = self
22508 .commands()
22509 .queue_signal_release_image_ohos
22510 .expect("vkQueueSignalReleaseImageOHOS not loaded");
22511 let mut out = unsafe { core::mem::zeroed() };
22512 check(unsafe {
22513 fp(
22514 queue,
22515 p_wait_semaphores.len() as u32,
22516 p_wait_semaphores.as_ptr(),
22517 image,
22518 &mut out,
22519 )
22520 })?;
22521 Ok(out)
22522 }
22523 ///Wraps [`vkCmdSetComputeOccupancyPriorityNV`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetComputeOccupancyPriorityNV.html).
22524 /**
22525 Provided by **VK_NV_compute_occupancy_priority**.*/
22526 ///
22527 ///# Safety
22528 ///- `commandBuffer` (self) must be valid and not destroyed.
22529 ///
22530 ///# Panics
22531 ///Panics if `vkCmdSetComputeOccupancyPriorityNV` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22532 ///
22533 ///# Usage Notes
22534 ///
22535 ///Sets the compute occupancy priority for subsequent dispatch
22536 ///commands. Higher priority may increase the number of warps
22537 ///resident on an SM, trading off per-warp resources for greater
22538 ///parallelism.
22539 ///
22540 ///Requires `VK_NV_compute_occupancy_priority`.
22541 pub unsafe fn cmd_set_compute_occupancy_priority_nv(
22542 &self,
22543 command_buffer: CommandBuffer,
22544 p_parameters: &ComputeOccupancyPriorityParametersNV,
22545 ) {
22546 let fp = self
22547 .commands()
22548 .cmd_set_compute_occupancy_priority_nv
22549 .expect("vkCmdSetComputeOccupancyPriorityNV not loaded");
22550 unsafe { fp(command_buffer, p_parameters) };
22551 }
22552 ///Wraps [`vkWriteSamplerDescriptorsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkWriteSamplerDescriptorsEXT.html).
22553 /**
22554 Provided by **VK_EXT_descriptor_heap**.*/
22555 ///
22556 ///# Errors
22557 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22558 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22559 ///- `VK_ERROR_UNKNOWN`
22560 ///- `VK_ERROR_VALIDATION_FAILED`
22561 ///
22562 ///# Safety
22563 ///- `device` (self) must be valid and not destroyed.
22564 ///
22565 ///# Panics
22566 ///Panics if `vkWriteSamplerDescriptorsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22567 ///
22568 ///# Usage Notes
22569 ///
22570 ///Writes sampler descriptors to host-visible memory. This is the
22571 ///descriptor heap equivalent for sampler descriptors, instead of
22572 ///using descriptor sets, samplers are written directly to heap
22573 ///memory.
22574 ///
22575 ///Provided by `VK_EXT_descriptor_heap`.
22576 pub unsafe fn write_sampler_descriptors_ext(
22577 &self,
22578 p_samplers: &[SamplerCreateInfo],
22579 p_descriptors: &[HostAddressRangeEXT],
22580 ) -> VkResult<()> {
22581 let fp = self
22582 .commands()
22583 .write_sampler_descriptors_ext
22584 .expect("vkWriteSamplerDescriptorsEXT not loaded");
22585 check(unsafe {
22586 fp(
22587 self.handle(),
22588 p_samplers.len() as u32,
22589 p_samplers.as_ptr(),
22590 p_descriptors.as_ptr(),
22591 )
22592 })
22593 }
22594 ///Wraps [`vkWriteResourceDescriptorsEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkWriteResourceDescriptorsEXT.html).
22595 /**
22596 Provided by **VK_EXT_descriptor_heap**.*/
22597 ///
22598 ///# Errors
22599 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22600 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22601 ///- `VK_ERROR_UNKNOWN`
22602 ///- `VK_ERROR_VALIDATION_FAILED`
22603 ///
22604 ///# Safety
22605 ///- `device` (self) must be valid and not destroyed.
22606 ///
22607 ///# Panics
22608 ///Panics if `vkWriteResourceDescriptorsEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22609 ///
22610 ///# Usage Notes
22611 ///
22612 ///Writes resource descriptors (buffers, images, acceleration
22613 ///structures) to host-visible memory. This is the descriptor heap
22614 ///equivalent of writing descriptors, instead of using descriptor
22615 ///sets, descriptors are written directly to heap memory.
22616 ///
22617 ///Provided by `VK_EXT_descriptor_heap`.
22618 pub unsafe fn write_resource_descriptors_ext(
22619 &self,
22620 p_resources: &[ResourceDescriptorInfoEXT],
22621 p_descriptors: &[HostAddressRangeEXT],
22622 ) -> VkResult<()> {
22623 let fp = self
22624 .commands()
22625 .write_resource_descriptors_ext
22626 .expect("vkWriteResourceDescriptorsEXT not loaded");
22627 check(unsafe {
22628 fp(
22629 self.handle(),
22630 p_resources.len() as u32,
22631 p_resources.as_ptr(),
22632 p_descriptors.as_ptr(),
22633 )
22634 })
22635 }
22636 ///Wraps [`vkCmdBindSamplerHeapEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindSamplerHeapEXT.html).
22637 /**
22638 Provided by **VK_EXT_descriptor_heap**.*/
22639 ///
22640 ///# Safety
22641 ///- `commandBuffer` (self) must be valid and not destroyed.
22642 ///- `commandBuffer` must be externally synchronized.
22643 ///
22644 ///# Panics
22645 ///Panics if `vkCmdBindSamplerHeapEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22646 ///
22647 ///# Usage Notes
22648 ///
22649 ///Binds a sampler descriptor heap for use in subsequent draw and
22650 ///dispatch commands. The `BindHeapInfoEXT` specifies the heap to
22651 ///bind.
22652 ///
22653 ///Sampler heaps hold sampler descriptors. Resource descriptors are
22654 ///bound separately with `cmd_bind_resource_heap_ext`.
22655 ///
22656 ///Provided by `VK_EXT_descriptor_heap`.
22657 pub unsafe fn cmd_bind_sampler_heap_ext(
22658 &self,
22659 command_buffer: CommandBuffer,
22660 p_bind_info: &BindHeapInfoEXT,
22661 ) {
22662 let fp = self
22663 .commands()
22664 .cmd_bind_sampler_heap_ext
22665 .expect("vkCmdBindSamplerHeapEXT not loaded");
22666 unsafe { fp(command_buffer, p_bind_info) };
22667 }
22668 ///Wraps [`vkCmdBindResourceHeapEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindResourceHeapEXT.html).
22669 /**
22670 Provided by **VK_EXT_descriptor_heap**.*/
22671 ///
22672 ///# Safety
22673 ///- `commandBuffer` (self) must be valid and not destroyed.
22674 ///- `commandBuffer` must be externally synchronized.
22675 ///
22676 ///# Panics
22677 ///Panics if `vkCmdBindResourceHeapEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22678 ///
22679 ///# Usage Notes
22680 ///
22681 ///Binds a resource descriptor heap for use in subsequent draw and
22682 ///dispatch commands. The `BindHeapInfoEXT` specifies the heap to
22683 ///bind.
22684 ///
22685 ///Resource heaps hold descriptors for buffers, images, and
22686 ///acceleration structures. Samplers are bound separately with
22687 ///`cmd_bind_sampler_heap_ext`.
22688 ///
22689 ///Provided by `VK_EXT_descriptor_heap`.
22690 pub unsafe fn cmd_bind_resource_heap_ext(
22691 &self,
22692 command_buffer: CommandBuffer,
22693 p_bind_info: &BindHeapInfoEXT,
22694 ) {
22695 let fp = self
22696 .commands()
22697 .cmd_bind_resource_heap_ext
22698 .expect("vkCmdBindResourceHeapEXT not loaded");
22699 unsafe { fp(command_buffer, p_bind_info) };
22700 }
22701 ///Wraps [`vkCmdPushDataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdPushDataEXT.html).
22702 /**
22703 Provided by **VK_EXT_descriptor_heap**.*/
22704 ///
22705 ///# Safety
22706 ///- `commandBuffer` (self) must be valid and not destroyed.
22707 ///- `commandBuffer` must be externally synchronized.
22708 ///
22709 ///# Panics
22710 ///Panics if `vkCmdPushDataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22711 ///
22712 ///# Usage Notes
22713 ///
22714 ///Pushes inline data to the command buffer for use in shaders. The
22715 ///`PushDataInfoEXT` specifies the pipeline layout, stage flags,
22716 ///offset, and data bytes.
22717 ///
22718 ///Similar to push constants but used with the descriptor heap
22719 ///model. Data is accessible in shaders via the push data mechanism.
22720 ///
22721 ///Provided by `VK_EXT_descriptor_heap`.
22722 pub unsafe fn cmd_push_data_ext(
22723 &self,
22724 command_buffer: CommandBuffer,
22725 p_push_data_info: &PushDataInfoEXT,
22726 ) {
22727 let fp = self
22728 .commands()
22729 .cmd_push_data_ext
22730 .expect("vkCmdPushDataEXT not loaded");
22731 unsafe { fp(command_buffer, p_push_data_info) };
22732 }
22733 ///Wraps [`vkRegisterCustomBorderColorEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkRegisterCustomBorderColorEXT.html).
22734 /**
22735 Provided by **VK_EXT_descriptor_heap**.*/
22736 ///
22737 ///# Errors
22738 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22739 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22740 ///- `VK_ERROR_TOO_MANY_OBJECTS`
22741 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS`
22742 ///- `VK_ERROR_UNKNOWN`
22743 ///- `VK_ERROR_VALIDATION_FAILED`
22744 ///
22745 ///# Safety
22746 ///- `device` (self) must be valid and not destroyed.
22747 ///
22748 ///# Panics
22749 ///Panics if `vkRegisterCustomBorderColorEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22750 ///
22751 ///# Usage Notes
22752 ///
22753 ///Registers a custom border color for use with samplers. Returns a
22754 ///handle that can be referenced when creating samplers with
22755 ///`BORDER_COLOR_CUSTOM` modes.
22756 ///
22757 ///The device has a limited number of custom border color slots
22758 ///(query `maxCustomBorderColors`).
22759 ///
22760 ///Unregister with `unregister_custom_border_color_ext` when no
22761 ///longer needed.
22762 ///
22763 ///Provided by `VK_EXT_descriptor_heap`.
22764 pub unsafe fn register_custom_border_color_ext(
22765 &self,
22766 p_border_color: &SamplerCustomBorderColorCreateInfoEXT,
22767 request_index: bool,
22768 ) -> VkResult<u32> {
22769 let fp = self
22770 .commands()
22771 .register_custom_border_color_ext
22772 .expect("vkRegisterCustomBorderColorEXT not loaded");
22773 let mut out = unsafe { core::mem::zeroed() };
22774 check(unsafe {
22775 fp(
22776 self.handle(),
22777 p_border_color,
22778 request_index as u32,
22779 &mut out,
22780 )
22781 })?;
22782 Ok(out)
22783 }
22784 ///Wraps [`vkUnregisterCustomBorderColorEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkUnregisterCustomBorderColorEXT.html).
22785 /**
22786 Provided by **VK_EXT_descriptor_heap**.*/
22787 ///
22788 ///# Safety
22789 ///- `device` (self) must be valid and not destroyed.
22790 ///
22791 ///# Panics
22792 ///Panics if `vkUnregisterCustomBorderColorEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22793 ///
22794 ///# Usage Notes
22795 ///
22796 ///Unregisters a custom border color previously registered with
22797 ///`register_custom_border_color_ext`, freeing the slot for reuse.
22798 ///
22799 ///Ensure no samplers referencing this border color are in use
22800 ///before unregistering.
22801 ///
22802 ///Provided by `VK_EXT_descriptor_heap`.
22803 pub unsafe fn unregister_custom_border_color_ext(&self, index: u32) {
22804 let fp = self
22805 .commands()
22806 .unregister_custom_border_color_ext
22807 .expect("vkUnregisterCustomBorderColorEXT not loaded");
22808 unsafe { fp(self.handle(), index) };
22809 }
22810 ///Wraps [`vkGetImageOpaqueCaptureDataEXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetImageOpaqueCaptureDataEXT.html).
22811 /**
22812 Provided by **VK_EXT_descriptor_heap**.*/
22813 ///
22814 ///# Errors
22815 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22816 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22817 ///- `VK_ERROR_UNKNOWN`
22818 ///- `VK_ERROR_VALIDATION_FAILED`
22819 ///
22820 ///# Safety
22821 ///- `device` (self) must be valid and not destroyed.
22822 ///
22823 ///# Panics
22824 ///Panics if `vkGetImageOpaqueCaptureDataEXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22825 ///
22826 ///# Usage Notes
22827 ///
22828 ///Retrieves opaque capture data for one or more images. The returned
22829 ///`HostAddressRangeEXT` data can be used to reconstruct image
22830 ///resource bindings during capture/replay.
22831 ///
22832 ///Provided by `VK_EXT_descriptor_heap`.
22833 pub unsafe fn get_image_opaque_capture_data_ext(
22834 &self,
22835 p_images: &[Image],
22836 ) -> VkResult<Vec<HostAddressRangeEXT>> {
22837 let fp = self
22838 .commands()
22839 .get_image_opaque_capture_data_ext
22840 .expect("vkGetImageOpaqueCaptureDataEXT not loaded");
22841 let count = p_images.len();
22842 let mut out = vec![unsafe { core::mem::zeroed() }; count];
22843 check(unsafe {
22844 fp(
22845 self.handle(),
22846 p_images.len() as u32,
22847 p_images.as_ptr(),
22848 out.as_mut_ptr(),
22849 )
22850 })?;
22851 Ok(out)
22852 }
22853 ///Wraps [`vkGetTensorOpaqueCaptureDataARM`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetTensorOpaqueCaptureDataARM.html).
22854 /**
22855 Provided by **VK_EXT_descriptor_heap**.*/
22856 ///
22857 ///# Errors
22858 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
22859 ///- `VK_ERROR_OUT_OF_DEVICE_MEMORY`
22860 ///- `VK_ERROR_UNKNOWN`
22861 ///- `VK_ERROR_VALIDATION_FAILED`
22862 ///
22863 ///# Safety
22864 ///- `device` (self) must be valid and not destroyed.
22865 ///
22866 ///# Panics
22867 ///Panics if `vkGetTensorOpaqueCaptureDataARM` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22868 ///
22869 ///# Usage Notes
22870 ///
22871 ///Retrieves opaque capture data for one or more ARM tensors. The
22872 ///returned data can be used to reconstruct tensor resource bindings
22873 ///during capture/replay.
22874 ///
22875 ///Provided by `VK_ARM_tensors`.
22876 pub unsafe fn get_tensor_opaque_capture_data_arm(
22877 &self,
22878 p_tensors: &[TensorARM],
22879 ) -> VkResult<Vec<HostAddressRangeEXT>> {
22880 let fp = self
22881 .commands()
22882 .get_tensor_opaque_capture_data_arm
22883 .expect("vkGetTensorOpaqueCaptureDataARM not loaded");
22884 let count = p_tensors.len();
22885 let mut out = vec![unsafe { core::mem::zeroed() }; count];
22886 check(unsafe {
22887 fp(
22888 self.handle(),
22889 p_tensors.len() as u32,
22890 p_tensors.as_ptr(),
22891 out.as_mut_ptr(),
22892 )
22893 })?;
22894 Ok(out)
22895 }
22896 ///Wraps [`vkCmdCopyMemoryKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMemoryKHR.html).
22897 /**
22898 Provided by **VK_KHR_device_address_commands**.*/
22899 ///
22900 ///# Safety
22901 ///- `commandBuffer` (self) must be valid and not destroyed.
22902 ///- `commandBuffer` must be externally synchronized.
22903 ///
22904 ///# Panics
22905 ///Panics if `vkCmdCopyMemoryKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22906 ///
22907 ///# Usage Notes
22908 ///
22909 ///Copies data between two device address ranges on the GPU. This is
22910 ///the device-address equivalent of `cmd_copy_buffer`, instead of
22911 ///buffer handles, source and destination are specified as device
22912 ///addresses in `CopyDeviceMemoryInfoKHR`.
22913 ///
22914 ///Useful for copying data between arbitrary device memory locations
22915 ///without needing buffer objects.
22916 ///
22917 ///Requires `VK_KHR_device_address_commands`.
22918 pub unsafe fn cmd_copy_memory_khr(
22919 &self,
22920 command_buffer: CommandBuffer,
22921 p_copy_memory_info: Option<&CopyDeviceMemoryInfoKHR>,
22922 ) {
22923 let fp = self
22924 .commands()
22925 .cmd_copy_memory_khr
22926 .expect("vkCmdCopyMemoryKHR not loaded");
22927 let p_copy_memory_info_ptr =
22928 p_copy_memory_info.map_or(core::ptr::null(), core::ptr::from_ref);
22929 unsafe { fp(command_buffer, p_copy_memory_info_ptr) };
22930 }
22931 ///Wraps [`vkCmdCopyMemoryToImageKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyMemoryToImageKHR.html).
22932 /**
22933 Provided by **VK_KHR_device_address_commands**.*/
22934 ///
22935 ///# Safety
22936 ///- `commandBuffer` (self) must be valid and not destroyed.
22937 ///- `commandBuffer` must be externally synchronized.
22938 ///
22939 ///# Panics
22940 ///Panics if `vkCmdCopyMemoryToImageKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22941 ///
22942 ///# Usage Notes
22943 ///
22944 ///Device-address variant of `cmd_copy_buffer_to_image`. Copies data
22945 ///from a device address range into an image, instead of reading from
22946 ///a buffer handle.
22947 ///
22948 ///The `CopyDeviceMemoryImageInfoKHR` struct specifies the source
22949 ///device address, destination image, and region descriptions.
22950 ///
22951 ///This is the device-address counterpart, for the host-side
22952 ///equivalent, see `copy_memory_to_image` (core 1.4).
22953 ///
22954 ///Requires `VK_KHR_device_address_commands`.
22955 pub unsafe fn cmd_copy_memory_to_image_khr(
22956 &self,
22957 command_buffer: CommandBuffer,
22958 p_copy_memory_info: Option<&CopyDeviceMemoryImageInfoKHR>,
22959 ) {
22960 let fp = self
22961 .commands()
22962 .cmd_copy_memory_to_image_khr
22963 .expect("vkCmdCopyMemoryToImageKHR not loaded");
22964 let p_copy_memory_info_ptr =
22965 p_copy_memory_info.map_or(core::ptr::null(), core::ptr::from_ref);
22966 unsafe { fp(command_buffer, p_copy_memory_info_ptr) };
22967 }
22968 ///Wraps [`vkCmdCopyImageToMemoryKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyImageToMemoryKHR.html).
22969 /**
22970 Provided by **VK_KHR_device_address_commands**.*/
22971 ///
22972 ///# Safety
22973 ///- `commandBuffer` (self) must be valid and not destroyed.
22974 ///- `commandBuffer` must be externally synchronized.
22975 ///
22976 ///# Panics
22977 ///Panics if `vkCmdCopyImageToMemoryKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
22978 ///
22979 ///# Usage Notes
22980 ///
22981 ///Device-address variant of `cmd_copy_image_to_buffer`. Copies image
22982 ///texel data to a device address range instead of a buffer handle.
22983 ///
22984 ///The `CopyDeviceMemoryImageInfoKHR` struct specifies the source
22985 ///image, destination device address, and region descriptions.
22986 ///
22987 ///This is the device-address counterpart, for the host-side
22988 ///equivalent, see `copy_image_to_memory` (core 1.4).
22989 ///
22990 ///Requires `VK_KHR_device_address_commands`.
22991 pub unsafe fn cmd_copy_image_to_memory_khr(
22992 &self,
22993 command_buffer: CommandBuffer,
22994 p_copy_memory_info: Option<&CopyDeviceMemoryImageInfoKHR>,
22995 ) {
22996 let fp = self
22997 .commands()
22998 .cmd_copy_image_to_memory_khr
22999 .expect("vkCmdCopyImageToMemoryKHR not loaded");
23000 let p_copy_memory_info_ptr =
23001 p_copy_memory_info.map_or(core::ptr::null(), core::ptr::from_ref);
23002 unsafe { fp(command_buffer, p_copy_memory_info_ptr) };
23003 }
23004 ///Wraps [`vkCmdUpdateMemoryKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdUpdateMemoryKHR.html).
23005 /**
23006 Provided by **VK_KHR_device_address_commands**.*/
23007 ///
23008 ///# Safety
23009 ///- `commandBuffer` (self) must be valid and not destroyed.
23010 ///- `commandBuffer` must be externally synchronized.
23011 ///
23012 ///# Panics
23013 ///Panics if `vkCmdUpdateMemoryKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23014 ///
23015 ///# Usage Notes
23016 ///
23017 ///Device-address variant of `cmd_update_buffer`. Writes a small
23018 ///amount of inline data to a device address range, instead of
23019 ///targeting a buffer handle.
23020 ///
23021 ///`data_size` must be ≤ 65536 bytes and a multiple of 4. For
23022 ///larger transfers, use `cmd_copy_memory_khr`.
23023 ///
23024 ///The `DeviceAddressRangeKHR` specifies the destination address.
23025 ///
23026 ///Requires `VK_KHR_device_address_commands`.
23027 pub unsafe fn cmd_update_memory_khr(
23028 &self,
23029 command_buffer: CommandBuffer,
23030 p_dst_range: &DeviceAddressRangeKHR,
23031 dst_flags: AddressCommandFlagsKHR,
23032 data_size: u64,
23033 p_data: *const core::ffi::c_void,
23034 ) {
23035 let fp = self
23036 .commands()
23037 .cmd_update_memory_khr
23038 .expect("vkCmdUpdateMemoryKHR not loaded");
23039 unsafe { fp(command_buffer, p_dst_range, dst_flags, data_size, p_data) };
23040 }
23041 ///Wraps [`vkCmdFillMemoryKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdFillMemoryKHR.html).
23042 /**
23043 Provided by **VK_KHR_device_address_commands**.*/
23044 ///
23045 ///# Safety
23046 ///- `commandBuffer` (self) must be valid and not destroyed.
23047 ///- `commandBuffer` must be externally synchronized.
23048 ///
23049 ///# Panics
23050 ///Panics if `vkCmdFillMemoryKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23051 ///
23052 ///# Usage Notes
23053 ///
23054 ///Device-address variant of `cmd_fill_buffer`. Fills a device
23055 ///address range with a repeating 32-bit `data` value, instead of
23056 ///targeting a buffer handle.
23057 ///
23058 ///The `DeviceAddressRangeKHR` specifies the destination address
23059 ///and size. The fill size must be a multiple of 4 bytes.
23060 ///
23061 ///Requires `VK_KHR_device_address_commands`.
23062 pub unsafe fn cmd_fill_memory_khr(
23063 &self,
23064 command_buffer: CommandBuffer,
23065 p_dst_range: &DeviceAddressRangeKHR,
23066 dst_flags: AddressCommandFlagsKHR,
23067 data: u32,
23068 ) {
23069 let fp = self
23070 .commands()
23071 .cmd_fill_memory_khr
23072 .expect("vkCmdFillMemoryKHR not loaded");
23073 unsafe { fp(command_buffer, p_dst_range, dst_flags, data) };
23074 }
23075 ///Wraps [`vkCmdCopyQueryPoolResultsToMemoryKHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdCopyQueryPoolResultsToMemoryKHR.html).
23076 /**
23077 Provided by **VK_KHR_device_address_commands**.*/
23078 ///
23079 ///# Safety
23080 ///- `commandBuffer` (self) must be valid and not destroyed.
23081 ///- `commandBuffer` must be externally synchronized.
23082 ///
23083 ///# Panics
23084 ///Panics if `vkCmdCopyQueryPoolResultsToMemoryKHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23085 ///
23086 ///# Usage Notes
23087 ///
23088 ///Device-address variant of `cmd_copy_query_pool_results`. Copies
23089 ///query results directly to a device address range instead of a
23090 ///buffer handle.
23091 ///
23092 ///`first_query` and `query_count` select which queries to copy.
23093 ///`query_result_flags` controls formatting (`_64_BIT`, `WAIT`,
23094 ///`WITH_AVAILABILITY`, `PARTIAL`).
23095 ///
23096 ///The `StridedDeviceAddressRangeKHR` specifies the destination
23097 ///address and stride between results.
23098 ///
23099 ///Requires `VK_KHR_device_address_commands`.
23100 pub unsafe fn cmd_copy_query_pool_results_to_memory_khr(
23101 &self,
23102 command_buffer: CommandBuffer,
23103 query_pool: QueryPool,
23104 first_query: u32,
23105 query_count: u32,
23106 p_dst_range: &StridedDeviceAddressRangeKHR,
23107 dst_flags: AddressCommandFlagsKHR,
23108 query_result_flags: QueryResultFlags,
23109 ) {
23110 let fp = self
23111 .commands()
23112 .cmd_copy_query_pool_results_to_memory_khr
23113 .expect("vkCmdCopyQueryPoolResultsToMemoryKHR not loaded");
23114 unsafe {
23115 fp(
23116 command_buffer,
23117 query_pool,
23118 first_query,
23119 query_count,
23120 p_dst_range,
23121 dst_flags,
23122 query_result_flags,
23123 )
23124 };
23125 }
23126 ///Wraps [`vkCmdBeginConditionalRendering2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginConditionalRendering2EXT.html).
23127 /**
23128 Provided by **VK_KHR_device_address_commands**.*/
23129 ///
23130 ///# Safety
23131 ///- `commandBuffer` (self) must be valid and not destroyed.
23132 ///- `commandBuffer` must be externally synchronized.
23133 ///
23134 ///# Panics
23135 ///Panics if `vkCmdBeginConditionalRendering2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23136 ///
23137 ///# Usage Notes
23138 ///
23139 ///Device-address variant of `cmd_begin_conditional_rendering_ext`.
23140 ///Instead of a buffer handle + offset, the condition is read from a
23141 ///`DeviceAddress` specified in `ConditionalRenderingBeginInfo2EXT`.
23142 ///
23143 ///When the 32-bit value at the address is zero, subsequent rendering
23144 ///and dispatch commands are discarded (or the inverse, if
23145 ///`INVERTED` is set). End the conditional block with
23146 ///`cmd_end_conditional_rendering_ext`.
23147 ///
23148 ///Requires `VK_KHR_device_address_commands` and
23149 ///`VK_EXT_conditional_rendering`.
23150 pub unsafe fn cmd_begin_conditional_rendering2_ext(
23151 &self,
23152 command_buffer: CommandBuffer,
23153 p_conditional_rendering_begin: &ConditionalRenderingBeginInfo2EXT,
23154 ) {
23155 let fp = self
23156 .commands()
23157 .cmd_begin_conditional_rendering2_ext
23158 .expect("vkCmdBeginConditionalRendering2EXT not loaded");
23159 unsafe { fp(command_buffer, p_conditional_rendering_begin) };
23160 }
23161 ///Wraps [`vkCmdBindTransformFeedbackBuffers2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindTransformFeedbackBuffers2EXT.html).
23162 /**
23163 Provided by **VK_KHR_device_address_commands**.*/
23164 ///
23165 ///# Safety
23166 ///- `commandBuffer` (self) must be valid and not destroyed.
23167 ///- `commandBuffer` must be externally synchronized.
23168 ///
23169 ///# Panics
23170 ///Panics if `vkCmdBindTransformFeedbackBuffers2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23171 ///
23172 ///# Usage Notes
23173 ///
23174 ///Device-address variant of `cmd_bind_transform_feedback_buffers_ext`.
23175 ///Binds transform feedback output buffers using device addresses
23176 ///instead of buffer handles.
23177 ///
23178 ///Each `BindTransformFeedbackBuffer2InfoEXT` specifies a device
23179 ///address and size for one binding slot starting at `first_binding`.
23180 ///
23181 ///Requires `VK_KHR_device_address_commands` and
23182 ///`VK_EXT_transform_feedback`.
23183 pub unsafe fn cmd_bind_transform_feedback_buffers2_ext(
23184 &self,
23185 command_buffer: CommandBuffer,
23186 first_binding: u32,
23187 p_binding_infos: &[BindTransformFeedbackBuffer2InfoEXT],
23188 ) {
23189 let fp = self
23190 .commands()
23191 .cmd_bind_transform_feedback_buffers2_ext
23192 .expect("vkCmdBindTransformFeedbackBuffers2EXT not loaded");
23193 unsafe {
23194 fp(
23195 command_buffer,
23196 first_binding,
23197 p_binding_infos.len() as u32,
23198 p_binding_infos.as_ptr(),
23199 )
23200 };
23201 }
23202 ///Wraps [`vkCmdBeginTransformFeedback2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBeginTransformFeedback2EXT.html).
23203 /**
23204 Provided by **VK_KHR_device_address_commands**.*/
23205 ///
23206 ///# Safety
23207 ///- `commandBuffer` (self) must be valid and not destroyed.
23208 ///- `commandBuffer` must be externally synchronized.
23209 ///
23210 ///# Panics
23211 ///Panics if `vkCmdBeginTransformFeedback2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23212 ///
23213 ///# Usage Notes
23214 ///
23215 ///Device-address variant of `cmd_begin_transform_feedback_ext`.
23216 ///Activates transform feedback using counter buffers specified via
23217 ///device addresses in `BindTransformFeedbackBuffer2InfoEXT` rather
23218 ///than buffer handles.
23219 ///
23220 ///`first_counter_range` and the info array identify which transform
23221 ///feedback counter ranges to resume from. Pass empty counter infos
23222 ///to start from offset zero.
23223 ///
23224 ///End the transform feedback pass with
23225 ///`cmd_end_transform_feedback2_ext`.
23226 ///
23227 ///Requires `VK_KHR_device_address_commands` and
23228 ///`VK_EXT_transform_feedback`.
23229 pub unsafe fn cmd_begin_transform_feedback2_ext(
23230 &self,
23231 command_buffer: CommandBuffer,
23232 first_counter_range: u32,
23233 p_counter_infos: &[BindTransformFeedbackBuffer2InfoEXT],
23234 ) {
23235 let fp = self
23236 .commands()
23237 .cmd_begin_transform_feedback2_ext
23238 .expect("vkCmdBeginTransformFeedback2EXT not loaded");
23239 unsafe {
23240 fp(
23241 command_buffer,
23242 first_counter_range,
23243 p_counter_infos.len() as u32,
23244 p_counter_infos.as_ptr(),
23245 )
23246 };
23247 }
23248 ///Wraps [`vkCmdEndTransformFeedback2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdEndTransformFeedback2EXT.html).
23249 /**
23250 Provided by **VK_KHR_device_address_commands**.*/
23251 ///
23252 ///# Safety
23253 ///- `commandBuffer` (self) must be valid and not destroyed.
23254 ///- `commandBuffer` must be externally synchronized.
23255 ///
23256 ///# Panics
23257 ///Panics if `vkCmdEndTransformFeedback2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23258 ///
23259 ///# Usage Notes
23260 ///
23261 ///Device-address variant of `cmd_end_transform_feedback_ext`.
23262 ///Stops transform feedback and writes counter values to device
23263 ///addresses specified in `BindTransformFeedbackBuffer2InfoEXT`.
23264 ///
23265 ///These saved counter values can be passed to
23266 ///`cmd_begin_transform_feedback2_ext` to resume feedback in a
23267 ///later render pass.
23268 ///
23269 ///Requires `VK_KHR_device_address_commands` and
23270 ///`VK_EXT_transform_feedback`.
23271 pub unsafe fn cmd_end_transform_feedback2_ext(
23272 &self,
23273 command_buffer: CommandBuffer,
23274 first_counter_range: u32,
23275 p_counter_infos: &[BindTransformFeedbackBuffer2InfoEXT],
23276 ) {
23277 let fp = self
23278 .commands()
23279 .cmd_end_transform_feedback2_ext
23280 .expect("vkCmdEndTransformFeedback2EXT not loaded");
23281 unsafe {
23282 fp(
23283 command_buffer,
23284 first_counter_range,
23285 p_counter_infos.len() as u32,
23286 p_counter_infos.as_ptr(),
23287 )
23288 };
23289 }
23290 ///Wraps [`vkCmdDrawIndirectByteCount2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndirectByteCount2EXT.html).
23291 /**
23292 Provided by **VK_KHR_device_address_commands**.*/
23293 ///
23294 ///# Safety
23295 ///- `commandBuffer` (self) must be valid and not destroyed.
23296 ///- `commandBuffer` must be externally synchronized.
23297 ///
23298 ///# Panics
23299 ///Panics if `vkCmdDrawIndirectByteCount2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23300 ///
23301 ///# Usage Notes
23302 ///
23303 ///Device-address variant of `cmd_draw_indirect_byte_count_ext`.
23304 ///Draws vertices using a byte count from a transform feedback
23305 ///counter, with the counter buffer specified via device address
23306 ///instead of a buffer handle.
23307 ///
23308 ///`counter_offset` is the byte offset within the counter value
23309 ///to account for any header. `vertex_stride` determines how many
23310 ///bytes each vertex consumes.
23311 ///
23312 ///Requires `VK_KHR_device_address_commands` and
23313 ///`VK_EXT_transform_feedback`.
23314 pub unsafe fn cmd_draw_indirect_byte_count2_ext(
23315 &self,
23316 command_buffer: CommandBuffer,
23317 instance_count: u32,
23318 first_instance: u32,
23319 p_counter_info: &BindTransformFeedbackBuffer2InfoEXT,
23320 counter_offset: u32,
23321 vertex_stride: u32,
23322 ) {
23323 let fp = self
23324 .commands()
23325 .cmd_draw_indirect_byte_count2_ext
23326 .expect("vkCmdDrawIndirectByteCount2EXT not loaded");
23327 unsafe {
23328 fp(
23329 command_buffer,
23330 instance_count,
23331 first_instance,
23332 p_counter_info,
23333 counter_offset,
23334 vertex_stride,
23335 )
23336 };
23337 }
23338 ///Wraps [`vkCmdWriteMarkerToMemoryAMD`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdWriteMarkerToMemoryAMD.html).
23339 /**
23340 Provided by **VK_KHR_device_address_commands**.*/
23341 ///
23342 ///# Safety
23343 ///- `commandBuffer` (self) must be valid and not destroyed.
23344 ///- `commandBuffer` must be externally synchronized.
23345 ///
23346 ///# Panics
23347 ///Panics if `vkCmdWriteMarkerToMemoryAMD` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23348 ///
23349 ///# Usage Notes
23350 ///
23351 ///Device-address variant of the AMD buffer marker extension. Writes
23352 ///a 32-bit marker value to a device address at a specific pipeline
23353 ///stage.
23354 ///
23355 ///The `MemoryMarkerInfoAMD` specifies the pipeline stage, device
23356 ///address, and marker value. Useful for GPU crash debugging,
23357 ///markers that were written indicate how far the GPU progressed
23358 ///before a fault.
23359 ///
23360 ///Requires `VK_KHR_device_address_commands`. This is the
23361 ///device-address counterpart of `cmd_write_buffer_marker_amd`.
23362 pub unsafe fn cmd_write_marker_to_memory_amd(
23363 &self,
23364 command_buffer: CommandBuffer,
23365 p_info: &MemoryMarkerInfoAMD,
23366 ) {
23367 let fp = self
23368 .commands()
23369 .cmd_write_marker_to_memory_amd
23370 .expect("vkCmdWriteMarkerToMemoryAMD not loaded");
23371 unsafe { fp(command_buffer, p_info) };
23372 }
23373 ///Wraps [`vkCmdBindIndexBuffer3KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindIndexBuffer3KHR.html).
23374 /**
23375 Provided by **VK_KHR_device_address_commands**.*/
23376 ///
23377 ///# Safety
23378 ///- `commandBuffer` (self) must be valid and not destroyed.
23379 ///- `commandBuffer` must be externally synchronized.
23380 ///
23381 ///# Panics
23382 ///Panics if `vkCmdBindIndexBuffer3KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23383 ///
23384 ///# Usage Notes
23385 ///
23386 ///Device-address variant of `cmd_bind_index_buffer`. Binds an index
23387 ///buffer for subsequent indexed draw commands using a device address
23388 ///instead of a buffer handle.
23389 ///
23390 ///The `BindIndexBuffer3InfoKHR` struct specifies the device address,
23391 ///size, and index type (`UINT16`, `UINT32`, or `UINT8` if enabled).
23392 ///
23393 ///Supersedes `cmd_bind_index_buffer` and `cmd_bind_index_buffer2`
23394 ///when using `VK_KHR_device_address_commands`.
23395 pub unsafe fn cmd_bind_index_buffer3_khr(
23396 &self,
23397 command_buffer: CommandBuffer,
23398 p_info: &BindIndexBuffer3InfoKHR,
23399 ) {
23400 let fp = self
23401 .commands()
23402 .cmd_bind_index_buffer3_khr
23403 .expect("vkCmdBindIndexBuffer3KHR not loaded");
23404 unsafe { fp(command_buffer, p_info) };
23405 }
23406 ///Wraps [`vkCmdBindVertexBuffers3KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindVertexBuffers3KHR.html).
23407 /**
23408 Provided by **VK_KHR_device_address_commands**.*/
23409 ///
23410 ///# Safety
23411 ///- `commandBuffer` (self) must be valid and not destroyed.
23412 ///- `commandBuffer` must be externally synchronized.
23413 ///
23414 ///# Panics
23415 ///Panics if `vkCmdBindVertexBuffers3KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23416 ///
23417 ///# Usage Notes
23418 ///
23419 ///Device-address variant of `cmd_bind_vertex_buffers`. Binds vertex
23420 ///buffers for subsequent draw commands using device addresses instead
23421 ///of buffer handles.
23422 ///
23423 ///Each `BindVertexBuffer3InfoKHR` specifies a device address, size,
23424 ///and stride for one binding slot starting at `first_binding`.
23425 ///
23426 ///Supersedes `cmd_bind_vertex_buffers`, `cmd_bind_vertex_buffers2`,
23427 ///and the core 1.4 equivalent when using
23428 ///`VK_KHR_device_address_commands`.
23429 pub unsafe fn cmd_bind_vertex_buffers3_khr(
23430 &self,
23431 command_buffer: CommandBuffer,
23432 first_binding: u32,
23433 p_binding_infos: &[BindVertexBuffer3InfoKHR],
23434 ) {
23435 let fp = self
23436 .commands()
23437 .cmd_bind_vertex_buffers3_khr
23438 .expect("vkCmdBindVertexBuffers3KHR not loaded");
23439 unsafe {
23440 fp(
23441 command_buffer,
23442 first_binding,
23443 p_binding_infos.len() as u32,
23444 p_binding_infos.as_ptr(),
23445 )
23446 };
23447 }
23448 ///Wraps [`vkCmdDrawIndirect2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndirect2KHR.html).
23449 /**
23450 Provided by **VK_KHR_device_address_commands**.*/
23451 ///
23452 ///# Safety
23453 ///- `commandBuffer` (self) must be valid and not destroyed.
23454 ///- `commandBuffer` must be externally synchronized.
23455 ///
23456 ///# Panics
23457 ///Panics if `vkCmdDrawIndirect2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23458 ///
23459 ///# Usage Notes
23460 ///
23461 ///Device-address variant of `cmd_draw_indirect`. Reads non-indexed
23462 ///draw parameters from a device address instead of a buffer handle
23463 ///+ offset.
23464 ///
23465 ///The `DrawIndirect2InfoKHR` specifies the device address, draw
23466 ///count, and stride.
23467 ///
23468 ///Requires `VK_KHR_device_address_commands`.
23469 pub unsafe fn cmd_draw_indirect2_khr(
23470 &self,
23471 command_buffer: CommandBuffer,
23472 p_info: &DrawIndirect2InfoKHR,
23473 ) {
23474 let fp = self
23475 .commands()
23476 .cmd_draw_indirect2_khr
23477 .expect("vkCmdDrawIndirect2KHR not loaded");
23478 unsafe { fp(command_buffer, p_info) };
23479 }
23480 ///Wraps [`vkCmdDrawIndexedIndirect2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndexedIndirect2KHR.html).
23481 /**
23482 Provided by **VK_KHR_device_address_commands**.*/
23483 ///
23484 ///# Safety
23485 ///- `commandBuffer` (self) must be valid and not destroyed.
23486 ///- `commandBuffer` must be externally synchronized.
23487 ///
23488 ///# Panics
23489 ///Panics if `vkCmdDrawIndexedIndirect2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23490 ///
23491 ///# Usage Notes
23492 ///
23493 ///Device-address variant of `cmd_draw_indexed_indirect`. Reads
23494 ///indexed draw parameters from a device address instead of a buffer
23495 ///handle + offset.
23496 ///
23497 ///The `DrawIndirect2InfoKHR` specifies the device address, draw
23498 ///count, and stride.
23499 ///
23500 ///Requires `VK_KHR_device_address_commands`.
23501 pub unsafe fn cmd_draw_indexed_indirect2_khr(
23502 &self,
23503 command_buffer: CommandBuffer,
23504 p_info: &DrawIndirect2InfoKHR,
23505 ) {
23506 let fp = self
23507 .commands()
23508 .cmd_draw_indexed_indirect2_khr
23509 .expect("vkCmdDrawIndexedIndirect2KHR not loaded");
23510 unsafe { fp(command_buffer, p_info) };
23511 }
23512 ///Wraps [`vkCmdDrawIndirectCount2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndirectCount2KHR.html).
23513 /**
23514 Provided by **VK_KHR_device_address_commands**.*/
23515 ///
23516 ///# Safety
23517 ///- `commandBuffer` (self) must be valid and not destroyed.
23518 ///- `commandBuffer` must be externally synchronized.
23519 ///
23520 ///# Panics
23521 ///Panics if `vkCmdDrawIndirectCount2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23522 ///
23523 ///# Usage Notes
23524 ///
23525 ///Device-address variant of `cmd_draw_indirect_count`. Reads
23526 ///non-indexed draw parameters and the draw count from device
23527 ///addresses instead of buffer handles.
23528 ///
23529 ///The `DrawIndirectCount2InfoKHR` specifies both the draw parameter
23530 ///address and the count address, along with `max_draw_count` and
23531 ///stride.
23532 ///
23533 ///Requires `VK_KHR_device_address_commands`.
23534 pub unsafe fn cmd_draw_indirect_count2_khr(
23535 &self,
23536 command_buffer: CommandBuffer,
23537 p_info: &DrawIndirectCount2InfoKHR,
23538 ) {
23539 let fp = self
23540 .commands()
23541 .cmd_draw_indirect_count2_khr
23542 .expect("vkCmdDrawIndirectCount2KHR not loaded");
23543 unsafe { fp(command_buffer, p_info) };
23544 }
23545 ///Wraps [`vkCmdDrawIndexedIndirectCount2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawIndexedIndirectCount2KHR.html).
23546 /**
23547 Provided by **VK_KHR_device_address_commands**.*/
23548 ///
23549 ///# Safety
23550 ///- `commandBuffer` (self) must be valid and not destroyed.
23551 ///- `commandBuffer` must be externally synchronized.
23552 ///
23553 ///# Panics
23554 ///Panics if `vkCmdDrawIndexedIndirectCount2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23555 ///
23556 ///# Usage Notes
23557 ///
23558 ///Device-address variant of `cmd_draw_indexed_indirect_count`. Reads
23559 ///indexed draw parameters and the draw count from device addresses
23560 ///instead of buffer handles.
23561 ///
23562 ///The `DrawIndirectCount2InfoKHR` specifies both the draw parameter
23563 ///address and the count address, along with `max_draw_count` and
23564 ///stride.
23565 ///
23566 ///Requires `VK_KHR_device_address_commands`.
23567 pub unsafe fn cmd_draw_indexed_indirect_count2_khr(
23568 &self,
23569 command_buffer: CommandBuffer,
23570 p_info: &DrawIndirectCount2InfoKHR,
23571 ) {
23572 let fp = self
23573 .commands()
23574 .cmd_draw_indexed_indirect_count2_khr
23575 .expect("vkCmdDrawIndexedIndirectCount2KHR not loaded");
23576 unsafe { fp(command_buffer, p_info) };
23577 }
23578 ///Wraps [`vkCmdDrawMeshTasksIndirect2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMeshTasksIndirect2EXT.html).
23579 /**
23580 Provided by **VK_KHR_device_address_commands**.*/
23581 ///
23582 ///# Safety
23583 ///- `commandBuffer` (self) must be valid and not destroyed.
23584 ///- `commandBuffer` must be externally synchronized.
23585 ///
23586 ///# Panics
23587 ///Panics if `vkCmdDrawMeshTasksIndirect2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23588 ///
23589 ///# Usage Notes
23590 ///
23591 ///Device-address variant of `cmd_draw_mesh_tasks_indirect_ext`.
23592 ///Reads mesh shader dispatch parameters from a device address
23593 ///instead of a buffer handle.
23594 ///
23595 ///The `DrawIndirect2InfoKHR` specifies the device address, draw
23596 ///count, and stride.
23597 ///
23598 ///Requires `VK_KHR_device_address_commands` and
23599 ///`VK_EXT_mesh_shader`.
23600 pub unsafe fn cmd_draw_mesh_tasks_indirect2_ext(
23601 &self,
23602 command_buffer: CommandBuffer,
23603 p_info: &DrawIndirect2InfoKHR,
23604 ) {
23605 let fp = self
23606 .commands()
23607 .cmd_draw_mesh_tasks_indirect2_ext
23608 .expect("vkCmdDrawMeshTasksIndirect2EXT not loaded");
23609 unsafe { fp(command_buffer, p_info) };
23610 }
23611 ///Wraps [`vkCmdDrawMeshTasksIndirectCount2EXT`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMeshTasksIndirectCount2EXT.html).
23612 /**
23613 Provided by **VK_KHR_device_address_commands**.*/
23614 ///
23615 ///# Safety
23616 ///- `commandBuffer` (self) must be valid and not destroyed.
23617 ///- `commandBuffer` must be externally synchronized.
23618 ///
23619 ///# Panics
23620 ///Panics if `vkCmdDrawMeshTasksIndirectCount2EXT` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23621 ///
23622 ///# Usage Notes
23623 ///
23624 ///Device-address variant of `cmd_draw_mesh_tasks_indirect_count_ext`.
23625 ///Reads mesh shader dispatch parameters and the draw count from
23626 ///device addresses instead of buffer handles.
23627 ///
23628 ///The `DrawIndirectCount2InfoKHR` specifies both the draw parameter
23629 ///address and the count address, along with `max_draw_count` and
23630 ///stride.
23631 ///
23632 ///Requires `VK_KHR_device_address_commands` and
23633 ///`VK_EXT_mesh_shader`.
23634 pub unsafe fn cmd_draw_mesh_tasks_indirect_count2_ext(
23635 &self,
23636 command_buffer: CommandBuffer,
23637 p_info: &DrawIndirectCount2InfoKHR,
23638 ) {
23639 let fp = self
23640 .commands()
23641 .cmd_draw_mesh_tasks_indirect_count2_ext
23642 .expect("vkCmdDrawMeshTasksIndirectCount2EXT not loaded");
23643 unsafe { fp(command_buffer, p_info) };
23644 }
23645 ///Wraps [`vkCmdDispatchIndirect2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDispatchIndirect2KHR.html).
23646 /**
23647 Provided by **VK_KHR_device_address_commands**.*/
23648 ///
23649 ///# Safety
23650 ///- `commandBuffer` (self) must be valid and not destroyed.
23651 ///- `commandBuffer` must be externally synchronized.
23652 ///
23653 ///# Panics
23654 ///Panics if `vkCmdDispatchIndirect2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23655 ///
23656 ///# Usage Notes
23657 ///
23658 ///Device-address variant of `cmd_dispatch_indirect`. Reads the
23659 ///dispatch parameters (group counts) from a device address instead
23660 ///of a buffer handle + offset.
23661 ///
23662 ///The `DispatchIndirect2InfoKHR` specifies the device address where
23663 ///the `DispatchIndirectCommand` struct resides.
23664 ///
23665 ///Requires `VK_KHR_device_address_commands`.
23666 pub unsafe fn cmd_dispatch_indirect2_khr(
23667 &self,
23668 command_buffer: CommandBuffer,
23669 p_info: &DispatchIndirect2InfoKHR,
23670 ) {
23671 let fp = self
23672 .commands()
23673 .cmd_dispatch_indirect2_khr
23674 .expect("vkCmdDispatchIndirect2KHR not loaded");
23675 unsafe { fp(command_buffer, p_info) };
23676 }
23677 ///Wraps [`vkCreateAccelerationStructure2KHR`](https://registry.khronos.org/vulkan/specs/latest/man/html/vkCreateAccelerationStructure2KHR.html).
23678 /**
23679 Provided by **VK_KHR_device_address_commands**.*/
23680 ///
23681 ///# Errors
23682 ///- `VK_ERROR_OUT_OF_HOST_MEMORY`
23683 ///- `VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR`
23684 ///- `VK_ERROR_VALIDATION_FAILED`
23685 ///- `VK_ERROR_UNKNOWN`
23686 ///
23687 ///# Safety
23688 ///- `device` (self) must be valid and not destroyed.
23689 ///
23690 ///# Panics
23691 ///Panics if `vkCreateAccelerationStructure2KHR` was not loaded. This can happen if the required extension or Vulkan version is not enabled on the instance or device.
23692 ///
23693 ///# Usage Notes
23694 ///
23695 ///Device-address variant of `create_acceleration_structure_khr`.
23696 ///Creates a ray tracing acceleration structure backed by a device
23697 ///address range instead of a buffer handle.
23698 ///
23699 ///The `AccelerationStructureCreateInfo2KHR` specifies the device
23700 ///address, size, type (top-level or bottom-level), and optional
23701 ///capture/replay address.
23702 ///
23703 ///Destroy with `destroy_acceleration_structure_khr`.
23704 ///
23705 ///Requires `VK_KHR_device_address_commands` and
23706 ///`VK_KHR_acceleration_structure`.
23707 pub unsafe fn create_acceleration_structure2_khr(
23708 &self,
23709 p_create_info: &AccelerationStructureCreateInfo2KHR,
23710 allocator: Option<&AllocationCallbacks>,
23711 ) -> VkResult<AccelerationStructureKHR> {
23712 let fp = self
23713 .commands()
23714 .create_acceleration_structure2_khr
23715 .expect("vkCreateAccelerationStructure2KHR not loaded");
23716 let alloc_ptr = allocator.map_or(core::ptr::null(), core::ptr::from_ref);
23717 let mut out = unsafe { core::mem::zeroed() };
23718 check(unsafe { fp(self.handle(), p_create_info, alloc_ptr, &mut out) })?;
23719 Ok(out)
23720 }
23721}