1 #![allow(clippy::trivially_copy_pass_by_ref)]
6 use std::os::raw::c_void;
9 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkDevice.html>
12 pub(crate) handle: vk::Device,
14 pub(crate) device_fn_1_0: vk::DeviceFnV1_0,
15 pub(crate) device_fn_1_1: vk::DeviceFnV1_1,
16 pub(crate) device_fn_1_2: vk::DeviceFnV1_2,
17 pub(crate) device_fn_1_3: vk::DeviceFnV1_3,
21 pub unsafe fn load(instance_fn: &vk::InstanceFnV1_0, device: vk::Device) -> Self {
22 let load_fn = |name: &std::ffi::CStr| {
23 mem::transmute((instance_fn.get_device_proc_addr)(device, name.as_ptr()))
29 device_fn_1_0: vk::DeviceFnV1_0::load(load_fn),
30 device_fn_1_1: vk::DeviceFnV1_1::load(load_fn),
31 device_fn_1_2: vk::DeviceFnV1_2::load(load_fn),
32 device_fn_1_3: vk::DeviceFnV1_3::load(load_fn),
37 pub fn handle(&self) -> vk::Device {
43 #[allow(non_camel_case_types)]
46 pub fn fp_v1_3(&self) -> &vk::DeviceFnV1_3 {
50 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreatePrivateDataSlot.html>
52 pub unsafe fn create_private_data_slot(
54 create_info: &vk::PrivateDataSlotCreateInfo,
55 allocation_callbacks: Option<&vk::AllocationCallbacks>,
56 ) -> VkResult<vk::PrivateDataSlot> {
57 let mut private_data_slot = mem::zeroed();
58 (self.device_fn_1_3.create_private_data_slot)(
61 allocation_callbacks.as_raw_ptr(),
62 &mut private_data_slot,
64 .result_with_success(private_data_slot)
67 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyPrivateDataSlot.html>
69 pub unsafe fn destroy_private_data_slot(
71 private_data_slot: vk::PrivateDataSlot,
72 allocation_callbacks: Option<&vk::AllocationCallbacks>,
74 (self.device_fn_1_3.destroy_private_data_slot)(
77 allocation_callbacks.as_raw_ptr(),
81 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkSetPrivateData.html>
83 pub unsafe fn set_private_data<T: vk::Handle>(
86 private_data_slot: vk::PrivateDataSlot,
89 (self.device_fn_1_3.set_private_data)(
99 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPrivateData.html>
101 pub unsafe fn get_private_data<T: vk::Handle>(
104 private_data_slot: vk::PrivateDataSlot,
106 let mut data = mem::zeroed();
107 (self.device_fn_1_3.get_private_data)(
117 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdPipelineBarrier2.html>
119 pub unsafe fn cmd_pipeline_barrier2(
121 command_buffer: vk::CommandBuffer,
122 dependency_info: &vk::DependencyInfo,
124 (self.device_fn_1_3.cmd_pipeline_barrier2)(command_buffer, dependency_info)
127 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdResetEvent2.html>
129 pub unsafe fn cmd_reset_event2(
131 command_buffer: vk::CommandBuffer,
133 stage_mask: vk::PipelineStageFlags2,
135 (self.device_fn_1_3.cmd_reset_event2)(command_buffer, event, stage_mask)
138 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetEvent2.html>
140 pub unsafe fn cmd_set_event2(
142 command_buffer: vk::CommandBuffer,
144 dependency_info: &vk::DependencyInfo,
146 (self.device_fn_1_3.cmd_set_event2)(command_buffer, event, dependency_info)
149 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdWaitEvents2.html>
151 pub unsafe fn cmd_wait_events2(
153 command_buffer: vk::CommandBuffer,
154 events: &[vk::Event],
155 dependency_infos: &[vk::DependencyInfo],
157 assert_eq!(events.len(), dependency_infos.len());
158 (self.device_fn_1_3.cmd_wait_events2)(
162 dependency_infos.as_ptr(),
166 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdWriteTimestamp2.html>
168 pub unsafe fn cmd_write_timestamp2(
170 command_buffer: vk::CommandBuffer,
171 stage: vk::PipelineStageFlags2,
172 query_pool: vk::QueryPool,
175 (self.device_fn_1_3.cmd_write_timestamp2)(command_buffer, stage, query_pool, query)
178 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkQueueSubmit2.html>
180 pub unsafe fn queue_submit2(
183 submits: &[vk::SubmitInfo2],
186 (self.device_fn_1_3.queue_submit2)(queue, submits.len() as u32, submits.as_ptr(), fence)
190 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyBuffer2.html>
192 pub unsafe fn cmd_copy_buffer2(
194 command_buffer: vk::CommandBuffer,
195 copy_buffer_info: &vk::CopyBufferInfo2,
197 (self.device_fn_1_3.cmd_copy_buffer2)(command_buffer, copy_buffer_info)
199 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyImage2.html>
201 pub unsafe fn cmd_copy_image2(
203 command_buffer: vk::CommandBuffer,
204 copy_image_info: &vk::CopyImageInfo2,
206 (self.device_fn_1_3.cmd_copy_image2)(command_buffer, copy_image_info)
208 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyBufferToImage2.html>
210 pub unsafe fn cmd_copy_buffer_to_image2(
212 command_buffer: vk::CommandBuffer,
213 copy_buffer_to_image_info: &vk::CopyBufferToImageInfo2,
215 (self.device_fn_1_3.cmd_copy_buffer_to_image2)(command_buffer, copy_buffer_to_image_info)
217 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyImageToBuffer2.html>
219 pub unsafe fn cmd_copy_image_to_buffer2(
221 command_buffer: vk::CommandBuffer,
222 copy_image_to_buffer_info: &vk::CopyImageToBufferInfo2,
224 (self.device_fn_1_3.cmd_copy_image_to_buffer2)(command_buffer, copy_image_to_buffer_info)
226 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBlitImage2.html>
228 pub unsafe fn cmd_blit_image2(
230 command_buffer: vk::CommandBuffer,
231 blit_image_info: &vk::BlitImageInfo2,
233 (self.device_fn_1_3.cmd_blit_image2)(command_buffer, blit_image_info)
235 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdResolveImage2.html>
237 pub unsafe fn cmd_resolve_image2(
239 command_buffer: vk::CommandBuffer,
240 resolve_image_info: &vk::ResolveImageInfo2,
242 (self.device_fn_1_3.cmd_resolve_image2)(command_buffer, resolve_image_info)
245 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBeginRendering.html>
247 pub unsafe fn cmd_begin_rendering(
249 command_buffer: vk::CommandBuffer,
250 rendering_info: &vk::RenderingInfo,
252 (self.device_fn_1_3.cmd_begin_rendering)(command_buffer, rendering_info)
255 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdEndRendering.html>
257 pub unsafe fn cmd_end_rendering(&self, command_buffer: vk::CommandBuffer) {
258 (self.device_fn_1_3.cmd_end_rendering)(command_buffer)
261 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetCullMode.html>
263 pub unsafe fn cmd_set_cull_mode(
265 command_buffer: vk::CommandBuffer,
266 cull_mode: vk::CullModeFlags,
268 (self.device_fn_1_3.cmd_set_cull_mode)(command_buffer, cull_mode)
271 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetFrontFace.html>
273 pub unsafe fn cmd_set_front_face(
275 command_buffer: vk::CommandBuffer,
276 front_face: vk::FrontFace,
278 (self.device_fn_1_3.cmd_set_front_face)(command_buffer, front_face)
281 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetPrimitiveTopology.html>
283 pub unsafe fn cmd_set_primitive_topology(
285 command_buffer: vk::CommandBuffer,
286 primitive_topology: vk::PrimitiveTopology,
288 (self.device_fn_1_3.cmd_set_primitive_topology)(command_buffer, primitive_topology)
291 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetViewportWithCount.html>
293 pub unsafe fn cmd_set_viewport_with_count(
295 command_buffer: vk::CommandBuffer,
296 viewports: &[vk::Viewport],
298 (self.device_fn_1_3.cmd_set_viewport_with_count)(
300 viewports.len() as u32,
305 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetScissorWithCount.html>
307 pub unsafe fn cmd_set_scissor_with_count(
309 command_buffer: vk::CommandBuffer,
310 scissors: &[vk::Rect2D],
312 (self.device_fn_1_3.cmd_set_scissor_with_count)(
314 scissors.len() as u32,
319 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBindVertexBuffers2.html>
321 pub unsafe fn cmd_bind_vertex_buffers2(
323 command_buffer: vk::CommandBuffer,
325 buffers: &[vk::Buffer],
326 offsets: &[vk::DeviceSize],
327 sizes: Option<&[vk::DeviceSize]>,
328 strides: Option<&[vk::DeviceSize]>,
330 assert_eq!(offsets.len(), buffers.len());
331 let p_sizes = if let Some(sizes) = sizes {
332 assert_eq!(sizes.len(), buffers.len());
337 let p_strides = if let Some(strides) = strides {
338 assert_eq!(strides.len(), buffers.len());
343 (self.device_fn_1_3.cmd_bind_vertex_buffers2)(
346 buffers.len() as u32,
354 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthTestEnable.html>
356 pub unsafe fn cmd_set_depth_test_enable(
358 command_buffer: vk::CommandBuffer,
359 depth_test_enable: bool,
361 (self.device_fn_1_3.cmd_set_depth_test_enable)(command_buffer, depth_test_enable.into())
364 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthWriteEnable.html>
366 pub unsafe fn cmd_set_depth_write_enable(
368 command_buffer: vk::CommandBuffer,
369 depth_write_enable: bool,
371 (self.device_fn_1_3.cmd_set_depth_write_enable)(command_buffer, depth_write_enable.into())
374 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthCompareOp.html>
376 pub unsafe fn cmd_set_depth_compare_op(
378 command_buffer: vk::CommandBuffer,
379 depth_compare_op: vk::CompareOp,
381 (self.device_fn_1_3.cmd_set_depth_compare_op)(command_buffer, depth_compare_op)
384 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthBoundsTestEnable.html>
386 pub unsafe fn cmd_set_depth_bounds_test_enable(
388 command_buffer: vk::CommandBuffer,
389 depth_bounds_test_enable: bool,
391 (self.device_fn_1_3.cmd_set_depth_bounds_test_enable)(
393 depth_bounds_test_enable.into(),
397 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetStencilTestEnable.html>
399 pub unsafe fn cmd_set_stencil_test_enable(
401 command_buffer: vk::CommandBuffer,
402 stencil_test_enable: bool,
404 (self.device_fn_1_3.cmd_set_stencil_test_enable)(command_buffer, stencil_test_enable.into())
407 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetStencilOp.html>
409 pub unsafe fn cmd_set_stencil_op(
411 command_buffer: vk::CommandBuffer,
412 face_mask: vk::StencilFaceFlags,
413 fail_op: vk::StencilOp,
414 pass_op: vk::StencilOp,
415 depth_fail_op: vk::StencilOp,
416 compare_op: vk::CompareOp,
418 (self.device_fn_1_3.cmd_set_stencil_op)(
428 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetRasterizerDiscardEnable.html>
430 pub unsafe fn cmd_set_rasterizer_discard_enable(
432 command_buffer: vk::CommandBuffer,
433 rasterizer_discard_enable: bool,
435 (self.device_fn_1_3.cmd_set_rasterizer_discard_enable)(
437 rasterizer_discard_enable.into(),
441 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthBiasEnable.html>
443 pub unsafe fn cmd_set_depth_bias_enable(
445 command_buffer: vk::CommandBuffer,
446 depth_bias_enable: bool,
448 (self.device_fn_1_3.cmd_set_depth_bias_enable)(command_buffer, depth_bias_enable.into())
451 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetPrimitiveRestartEnable.html>
453 pub unsafe fn cmd_set_primitive_restart_enable(
455 command_buffer: vk::CommandBuffer,
456 primitive_restart_enable: bool,
458 (self.device_fn_1_3.cmd_set_primitive_restart_enable)(
460 primitive_restart_enable.into(),
464 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceBufferMemoryRequirements.html>
466 pub unsafe fn get_device_buffer_memory_requirements(
468 memory_requirements: &vk::DeviceBufferMemoryRequirements,
469 out: &mut vk::MemoryRequirements2,
471 (self.device_fn_1_3.get_device_buffer_memory_requirements)(
478 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceImageMemoryRequirements.html>
480 pub unsafe fn get_device_image_memory_requirements(
482 memory_requirements: &vk::DeviceImageMemoryRequirements,
483 out: &mut vk::MemoryRequirements2,
485 (self.device_fn_1_3.get_device_image_memory_requirements)(
492 /// Retrieve the number of elements to pass to [`get_device_image_sparse_memory_requirements()`][Self::get_device_image_sparse_memory_requirements()]
494 pub unsafe fn get_device_image_sparse_memory_requirements_len(
496 memory_requirements: &vk::DeviceImageMemoryRequirements,
501 .get_device_image_sparse_memory_requirements)(
505 std::ptr::null_mut(),
510 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceImageSparseMemoryRequirements.html>
512 /// Call [`get_device_image_sparse_memory_requirements_len()`][Self::get_device_image_sparse_memory_requirements_len()] to query the number of elements to pass to `out`.
513 /// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
515 pub unsafe fn get_device_image_sparse_memory_requirements(
517 memory_requirements: &vk::DeviceImageMemoryRequirements,
518 out: &mut [vk::SparseImageMemoryRequirements2],
520 let mut count = out.len() as u32;
523 .get_device_image_sparse_memory_requirements)(
529 assert_eq!(count as usize, out.len());
534 #[allow(non_camel_case_types)]
537 pub fn fp_v1_2(&self) -> &vk::DeviceFnV1_2 {
541 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDrawIndirectCount.html>
543 pub unsafe fn cmd_draw_indirect_count(
545 command_buffer: vk::CommandBuffer,
547 offset: vk::DeviceSize,
548 count_buffer: vk::Buffer,
549 count_buffer_offset: vk::DeviceSize,
553 (self.device_fn_1_2.cmd_draw_indirect_count)(
564 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDrawIndexedIndirectCount.html>
566 pub unsafe fn cmd_draw_indexed_indirect_count(
568 command_buffer: vk::CommandBuffer,
570 offset: vk::DeviceSize,
571 count_buffer: vk::Buffer,
572 count_buffer_offset: vk::DeviceSize,
576 (self.device_fn_1_2.cmd_draw_indexed_indirect_count)(
587 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateRenderPass2.html>
589 pub unsafe fn create_render_pass2(
591 create_info: &vk::RenderPassCreateInfo2,
592 allocation_callbacks: Option<&vk::AllocationCallbacks>,
593 ) -> VkResult<vk::RenderPass> {
594 let mut renderpass = mem::zeroed();
595 (self.device_fn_1_2.create_render_pass2)(
598 allocation_callbacks.as_raw_ptr(),
601 .result_with_success(renderpass)
604 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBeginRenderPass2.html>
606 pub unsafe fn cmd_begin_render_pass2(
608 command_buffer: vk::CommandBuffer,
609 render_pass_begin_info: &vk::RenderPassBeginInfo,
610 subpass_begin_info: &vk::SubpassBeginInfo,
612 (self.device_fn_1_2.cmd_begin_render_pass2)(
614 render_pass_begin_info,
619 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdNextSubpass2.html>
621 pub unsafe fn cmd_next_subpass2(
623 command_buffer: vk::CommandBuffer,
624 subpass_begin_info: &vk::SubpassBeginInfo,
625 subpass_end_info: &vk::SubpassEndInfo,
627 (self.device_fn_1_2.cmd_next_subpass2)(
634 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdEndRenderPass2.html>
636 pub unsafe fn cmd_end_render_pass2(
638 command_buffer: vk::CommandBuffer,
639 subpass_end_info: &vk::SubpassEndInfo,
641 (self.device_fn_1_2.cmd_end_render_pass2)(command_buffer, subpass_end_info);
644 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkResetQueryPool.html>
646 pub unsafe fn reset_query_pool(
648 query_pool: vk::QueryPool,
652 (self.device_fn_1_2.reset_query_pool)(self.handle(), query_pool, first_query, query_count);
655 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetSemaphoreCounterValue.html>
657 pub unsafe fn get_semaphore_counter_value(&self, semaphore: vk::Semaphore) -> VkResult<u64> {
659 (self.device_fn_1_2.get_semaphore_counter_value)(self.handle(), semaphore, &mut value)
660 .result_with_success(value)
663 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkWaitSemaphores.html>
665 pub unsafe fn wait_semaphores(
667 wait_info: &vk::SemaphoreWaitInfo,
670 (self.device_fn_1_2.wait_semaphores)(self.handle(), wait_info, timeout).result()
673 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkSignalSemaphore.html>
675 pub unsafe fn signal_semaphore(&self, signal_info: &vk::SemaphoreSignalInfo) -> VkResult<()> {
676 (self.device_fn_1_2.signal_semaphore)(self.handle(), signal_info).result()
679 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetBufferDeviceAddress.html>
681 pub unsafe fn get_buffer_device_address(
683 info: &vk::BufferDeviceAddressInfo,
684 ) -> vk::DeviceAddress {
685 (self.device_fn_1_2.get_buffer_device_address)(self.handle(), info)
688 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetBufferOpaqueCaptureAddress.html>
690 pub unsafe fn get_buffer_opaque_capture_address(
692 info: &vk::BufferDeviceAddressInfo,
694 (self.device_fn_1_2.get_buffer_opaque_capture_address)(self.handle(), info)
697 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceMemoryOpaqueCaptureAddress.html>
699 pub unsafe fn get_device_memory_opaque_capture_address(
701 info: &vk::DeviceMemoryOpaqueCaptureAddressInfo,
703 (self.device_fn_1_2.get_device_memory_opaque_capture_address)(self.handle(), info)
708 #[allow(non_camel_case_types)]
711 pub fn fp_v1_1(&self) -> &vk::DeviceFnV1_1 {
715 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkBindBufferMemory2.html>
717 pub unsafe fn bind_buffer_memory2(
719 bind_infos: &[vk::BindBufferMemoryInfo],
721 (self.device_fn_1_1.bind_buffer_memory2)(
723 bind_infos.len() as _,
729 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkBindImageMemory2.html>
731 pub unsafe fn bind_image_memory2(
733 bind_infos: &[vk::BindImageMemoryInfo],
735 (self.device_fn_1_1.bind_image_memory2)(
737 bind_infos.len() as _,
743 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceGroupPeerMemoryFeatures.html>
745 pub unsafe fn get_device_group_peer_memory_features(
748 local_device_index: u32,
749 remote_device_index: u32,
750 ) -> vk::PeerMemoryFeatureFlags {
751 let mut peer_memory_features = mem::zeroed();
752 (self.device_fn_1_1.get_device_group_peer_memory_features)(
757 &mut peer_memory_features,
762 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDeviceMask.html>
764 pub unsafe fn cmd_set_device_mask(&self, command_buffer: vk::CommandBuffer, device_mask: u32) {
765 (self.device_fn_1_1.cmd_set_device_mask)(command_buffer, device_mask);
768 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDispatchBase.html>
770 pub unsafe fn cmd_dispatch_base(
772 command_buffer: vk::CommandBuffer,
780 (self.device_fn_1_1.cmd_dispatch_base)(
791 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetImageMemoryRequirements2.html>
793 pub unsafe fn get_image_memory_requirements2(
795 info: &vk::ImageMemoryRequirementsInfo2,
796 out: &mut vk::MemoryRequirements2,
798 (self.device_fn_1_1.get_image_memory_requirements2)(self.handle(), info, out);
801 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetBufferMemoryRequirements2.html>
803 pub unsafe fn get_buffer_memory_requirements2(
805 info: &vk::BufferMemoryRequirementsInfo2,
806 out: &mut vk::MemoryRequirements2,
808 (self.device_fn_1_1.get_buffer_memory_requirements2)(self.handle(), info, out);
811 /// Retrieve the number of elements to pass to [`get_image_sparse_memory_requirements2()`][Self::get_image_sparse_memory_requirements2()]
813 pub unsafe fn get_image_sparse_memory_requirements2_len(
815 info: &vk::ImageSparseMemoryRequirementsInfo2,
818 (self.device_fn_1_1.get_image_sparse_memory_requirements2)(
827 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetImageSparseMemoryRequirements2.html>
829 /// Call [`get_image_sparse_memory_requirements2_len()`][Self::get_image_sparse_memory_requirements2_len()] to query the number of elements to pass to `out`.
830 /// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
832 pub unsafe fn get_image_sparse_memory_requirements2(
834 info: &vk::ImageSparseMemoryRequirementsInfo2,
835 out: &mut [vk::SparseImageMemoryRequirements2],
837 let mut count = out.len() as u32;
838 (self.device_fn_1_1.get_image_sparse_memory_requirements2)(
844 assert_eq!(count as usize, out.len());
847 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkTrimCommandPool.html>
849 pub unsafe fn trim_command_pool(
851 command_pool: vk::CommandPool,
852 flags: vk::CommandPoolTrimFlags,
854 (self.device_fn_1_1.trim_command_pool)(self.handle(), command_pool, flags);
857 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceQueue2.html>
859 pub unsafe fn get_device_queue2(&self, queue_info: &vk::DeviceQueueInfo2) -> vk::Queue {
860 let mut queue = mem::zeroed();
861 (self.device_fn_1_1.get_device_queue2)(self.handle(), queue_info, &mut queue);
865 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateSamplerYcbcrConversion.html>
867 pub unsafe fn create_sampler_ycbcr_conversion(
869 create_info: &vk::SamplerYcbcrConversionCreateInfo,
870 allocation_callbacks: Option<&vk::AllocationCallbacks>,
871 ) -> VkResult<vk::SamplerYcbcrConversion> {
872 let mut ycbcr_conversion = mem::zeroed();
873 (self.device_fn_1_1.create_sampler_ycbcr_conversion)(
876 allocation_callbacks.as_raw_ptr(),
877 &mut ycbcr_conversion,
879 .result_with_success(ycbcr_conversion)
882 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroySamplerYcbcrConversion.html>
884 pub unsafe fn destroy_sampler_ycbcr_conversion(
886 ycbcr_conversion: vk::SamplerYcbcrConversion,
887 allocation_callbacks: Option<&vk::AllocationCallbacks>,
889 (self.device_fn_1_1.destroy_sampler_ycbcr_conversion)(
892 allocation_callbacks.as_raw_ptr(),
896 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateDescriptorUpdateTemplate.html>
898 pub unsafe fn create_descriptor_update_template(
900 create_info: &vk::DescriptorUpdateTemplateCreateInfo,
901 allocation_callbacks: Option<&vk::AllocationCallbacks>,
902 ) -> VkResult<vk::DescriptorUpdateTemplate> {
903 let mut descriptor_update_template = mem::zeroed();
904 (self.device_fn_1_1.create_descriptor_update_template)(
907 allocation_callbacks.as_raw_ptr(),
908 &mut descriptor_update_template,
910 .result_with_success(descriptor_update_template)
913 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyDescriptorUpdateTemplate.html>
915 pub unsafe fn destroy_descriptor_update_template(
917 descriptor_update_template: vk::DescriptorUpdateTemplate,
918 allocation_callbacks: Option<&vk::AllocationCallbacks>,
920 (self.device_fn_1_1.destroy_descriptor_update_template)(
922 descriptor_update_template,
923 allocation_callbacks.as_raw_ptr(),
927 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkUpdateDescriptorSetWithTemplate.html>
929 pub unsafe fn update_descriptor_set_with_template(
931 descriptor_set: vk::DescriptorSet,
932 descriptor_update_template: vk::DescriptorUpdateTemplate,
935 (self.device_fn_1_1.update_descriptor_set_with_template)(
938 descriptor_update_template,
943 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDescriptorSetLayoutSupport.html>
945 pub unsafe fn get_descriptor_set_layout_support(
947 create_info: &vk::DescriptorSetLayoutCreateInfo,
948 out: &mut vk::DescriptorSetLayoutSupport,
950 (self.device_fn_1_1.get_descriptor_set_layout_support)(self.handle(), create_info, out);
955 #[allow(non_camel_case_types)]
958 pub fn fp_v1_0(&self) -> &vk::DeviceFnV1_0 {
962 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyDevice.html>
964 pub unsafe fn destroy_device(&self, allocation_callbacks: Option<&vk::AllocationCallbacks>) {
965 (self.device_fn_1_0.destroy_device)(self.handle(), allocation_callbacks.as_raw_ptr());
968 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroySampler.html>
970 pub unsafe fn destroy_sampler(
972 sampler: vk::Sampler,
973 allocation_callbacks: Option<&vk::AllocationCallbacks>,
975 (self.device_fn_1_0.destroy_sampler)(
978 allocation_callbacks.as_raw_ptr(),
982 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkFreeMemory.html>
984 pub unsafe fn free_memory(
986 memory: vk::DeviceMemory,
987 allocation_callbacks: Option<&vk::AllocationCallbacks>,
989 (self.device_fn_1_0.free_memory)(self.handle(), memory, allocation_callbacks.as_raw_ptr());
992 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkFreeCommandBuffers.html>
994 pub unsafe fn free_command_buffers(
996 command_pool: vk::CommandPool,
997 command_buffers: &[vk::CommandBuffer],
999 (self.device_fn_1_0.free_command_buffers)(
1002 command_buffers.len() as u32,
1003 command_buffers.as_ptr(),
1007 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateEvent.html>
1009 pub unsafe fn create_event(
1011 create_info: &vk::EventCreateInfo,
1012 allocation_callbacks: Option<&vk::AllocationCallbacks>,
1013 ) -> VkResult<vk::Event> {
1014 let mut event = mem::zeroed();
1015 (self.device_fn_1_0.create_event)(
1018 allocation_callbacks.as_raw_ptr(),
1021 .result_with_success(event)
1024 /// Returns [`true`] if the event was set, and [`false`] if the event was reset, otherwise it will
1025 /// return the error code.
1026 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetEventStatus.html>
1028 pub unsafe fn get_event_status(&self, event: vk::Event) -> VkResult<bool> {
1029 let err_code = (self.device_fn_1_0.get_event_status)(self.handle(), event);
1031 vk::Result::EVENT_SET => Ok(true),
1032 vk::Result::EVENT_RESET => Ok(false),
1037 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkSetEvent.html>
1039 pub unsafe fn set_event(&self, event: vk::Event) -> VkResult<()> {
1040 (self.device_fn_1_0.set_event)(self.handle(), event).result()
1043 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkResetEvent.html>
1045 pub unsafe fn reset_event(&self, event: vk::Event) -> VkResult<()> {
1046 (self.device_fn_1_0.reset_event)(self.handle(), event).result()
1048 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetEvent.html>
1050 pub unsafe fn cmd_set_event(
1052 command_buffer: vk::CommandBuffer,
1054 stage_mask: vk::PipelineStageFlags,
1056 (self.device_fn_1_0.cmd_set_event)(command_buffer, event, stage_mask);
1058 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdResetEvent.html>
1060 pub unsafe fn cmd_reset_event(
1062 command_buffer: vk::CommandBuffer,
1064 stage_mask: vk::PipelineStageFlags,
1066 (self.device_fn_1_0.cmd_reset_event)(command_buffer, event, stage_mask);
1069 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdWaitEvents.html>
1071 pub unsafe fn cmd_wait_events(
1073 command_buffer: vk::CommandBuffer,
1074 events: &[vk::Event],
1075 src_stage_mask: vk::PipelineStageFlags,
1076 dst_stage_mask: vk::PipelineStageFlags,
1077 memory_barriers: &[vk::MemoryBarrier],
1078 buffer_memory_barriers: &[vk::BufferMemoryBarrier],
1079 image_memory_barriers: &[vk::ImageMemoryBarrier],
1081 (self.device_fn_1_0.cmd_wait_events)(
1087 memory_barriers.len() as _,
1088 memory_barriers.as_ptr(),
1089 buffer_memory_barriers.len() as _,
1090 buffer_memory_barriers.as_ptr(),
1091 image_memory_barriers.len() as _,
1092 image_memory_barriers.as_ptr(),
1096 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyFence.html>
1098 pub unsafe fn destroy_fence(
1101 allocation_callbacks: Option<&vk::AllocationCallbacks>,
1103 (self.device_fn_1_0.destroy_fence)(self.handle(), fence, allocation_callbacks.as_raw_ptr());
1106 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyEvent.html>
1108 pub unsafe fn destroy_event(
1111 allocation_callbacks: Option<&vk::AllocationCallbacks>,
1113 (self.device_fn_1_0.destroy_event)(self.handle(), event, allocation_callbacks.as_raw_ptr());
1116 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyImage.html>
1118 pub unsafe fn destroy_image(
1121 allocation_callbacks: Option<&vk::AllocationCallbacks>,
1123 (self.device_fn_1_0.destroy_image)(self.handle(), image, allocation_callbacks.as_raw_ptr());
1126 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyCommandPool.html>
1128 pub unsafe fn destroy_command_pool(
1130 pool: vk::CommandPool,
1131 allocation_callbacks: Option<&vk::AllocationCallbacks>,
1133 (self.device_fn_1_0.destroy_command_pool)(
1136 allocation_callbacks.as_raw_ptr(),
1140 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyImageView.html>
1142 pub unsafe fn destroy_image_view(
1144 image_view: vk::ImageView,
1145 allocation_callbacks: Option<&vk::AllocationCallbacks>,
1147 (self.device_fn_1_0.destroy_image_view)(
1150 allocation_callbacks.as_raw_ptr(),
1154 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyRenderPass.html>
1156 pub unsafe fn destroy_render_pass(
1158 renderpass: vk::RenderPass,
1159 allocation_callbacks: Option<&vk::AllocationCallbacks>,
1161 (self.device_fn_1_0.destroy_render_pass)(
1164 allocation_callbacks.as_raw_ptr(),
1168 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyFramebuffer.html>
1170 pub unsafe fn destroy_framebuffer(
1172 framebuffer: vk::Framebuffer,
1173 allocation_callbacks: Option<&vk::AllocationCallbacks>,
1175 (self.device_fn_1_0.destroy_framebuffer)(
1178 allocation_callbacks.as_raw_ptr(),
1182 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyPipelineLayout.html>
1184 pub unsafe fn destroy_pipeline_layout(
1186 pipeline_layout: vk::PipelineLayout,
1187 allocation_callbacks: Option<&vk::AllocationCallbacks>,
1189 (self.device_fn_1_0.destroy_pipeline_layout)(
1192 allocation_callbacks.as_raw_ptr(),
1196 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyPipelineCache.html>
1198 pub unsafe fn destroy_pipeline_cache(
1200 pipeline_cache: vk::PipelineCache,
1201 allocation_callbacks: Option<&vk::AllocationCallbacks>,
1203 (self.device_fn_1_0.destroy_pipeline_cache)(
1206 allocation_callbacks.as_raw_ptr(),
1210 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyBuffer.html>
1212 pub unsafe fn destroy_buffer(
1215 allocation_callbacks: Option<&vk::AllocationCallbacks>,
1217 (self.device_fn_1_0.destroy_buffer)(
1220 allocation_callbacks.as_raw_ptr(),
1224 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyShaderModule.html>
1226 pub unsafe fn destroy_shader_module(
1228 shader: vk::ShaderModule,
1229 allocation_callbacks: Option<&vk::AllocationCallbacks>,
1231 (self.device_fn_1_0.destroy_shader_module)(
1234 allocation_callbacks.as_raw_ptr(),
1238 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyPipeline.html>
1240 pub unsafe fn destroy_pipeline(
1242 pipeline: vk::Pipeline,
1243 allocation_callbacks: Option<&vk::AllocationCallbacks>,
1245 (self.device_fn_1_0.destroy_pipeline)(
1248 allocation_callbacks.as_raw_ptr(),
1252 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroySemaphore.html>
1254 pub unsafe fn destroy_semaphore(
1256 semaphore: vk::Semaphore,
1257 allocation_callbacks: Option<&vk::AllocationCallbacks>,
1259 (self.device_fn_1_0.destroy_semaphore)(
1262 allocation_callbacks.as_raw_ptr(),
1266 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyDescriptorPool.html>
1268 pub unsafe fn destroy_descriptor_pool(
1270 pool: vk::DescriptorPool,
1271 allocation_callbacks: Option<&vk::AllocationCallbacks>,
1273 (self.device_fn_1_0.destroy_descriptor_pool)(
1276 allocation_callbacks.as_raw_ptr(),
1280 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyQueryPool.html>
1282 pub unsafe fn destroy_query_pool(
1284 pool: vk::QueryPool,
1285 allocation_callbacks: Option<&vk::AllocationCallbacks>,
1287 (self.device_fn_1_0.destroy_query_pool)(
1290 allocation_callbacks.as_raw_ptr(),
1294 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyDescriptorSetLayout.html>
1296 pub unsafe fn destroy_descriptor_set_layout(
1298 layout: vk::DescriptorSetLayout,
1299 allocation_callbacks: Option<&vk::AllocationCallbacks>,
1301 (self.device_fn_1_0.destroy_descriptor_set_layout)(
1304 allocation_callbacks.as_raw_ptr(),
1308 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkFreeDescriptorSets.html>
1310 pub unsafe fn free_descriptor_sets(
1312 pool: vk::DescriptorPool,
1313 descriptor_sets: &[vk::DescriptorSet],
1315 (self.device_fn_1_0.free_descriptor_sets)(
1318 descriptor_sets.len() as u32,
1319 descriptor_sets.as_ptr(),
1324 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkUpdateDescriptorSets.html>
1326 pub unsafe fn update_descriptor_sets(
1328 descriptor_writes: &[vk::WriteDescriptorSet],
1329 descriptor_copies: &[vk::CopyDescriptorSet],
1331 (self.device_fn_1_0.update_descriptor_sets)(
1333 descriptor_writes.len() as u32,
1334 descriptor_writes.as_ptr(),
1335 descriptor_copies.len() as u32,
1336 descriptor_copies.as_ptr(),
1340 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateSampler.html>
1342 pub unsafe fn create_sampler(
1344 create_info: &vk::SamplerCreateInfo,
1345 allocation_callbacks: Option<&vk::AllocationCallbacks>,
1346 ) -> VkResult<vk::Sampler> {
1347 let mut sampler = mem::zeroed();
1348 (self.device_fn_1_0.create_sampler)(
1351 allocation_callbacks.as_raw_ptr(),
1354 .result_with_success(sampler)
1357 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBlitImage.html>
1359 pub unsafe fn cmd_blit_image(
1361 command_buffer: vk::CommandBuffer,
1362 src_image: vk::Image,
1363 src_image_layout: vk::ImageLayout,
1364 dst_image: vk::Image,
1365 dst_image_layout: vk::ImageLayout,
1366 regions: &[vk::ImageBlit],
1369 (self.device_fn_1_0.cmd_blit_image)(
1381 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdResolveImage.html>
1383 pub unsafe fn cmd_resolve_image(
1385 command_buffer: vk::CommandBuffer,
1386 src_image: vk::Image,
1387 src_image_layout: vk::ImageLayout,
1388 dst_image: vk::Image,
1389 dst_image_layout: vk::ImageLayout,
1390 regions: &[vk::ImageResolve],
1392 (self.device_fn_1_0.cmd_resolve_image)(
1398 regions.len() as u32,
1403 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdFillBuffer.html>
1405 pub unsafe fn cmd_fill_buffer(
1407 command_buffer: vk::CommandBuffer,
1409 offset: vk::DeviceSize,
1410 size: vk::DeviceSize,
1413 (self.device_fn_1_0.cmd_fill_buffer)(command_buffer, buffer, offset, size, data);
1416 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdUpdateBuffer.html>
1418 pub unsafe fn cmd_update_buffer(
1420 command_buffer: vk::CommandBuffer,
1422 offset: vk::DeviceSize,
1425 (self.device_fn_1_0.cmd_update_buffer)(
1434 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyBuffer.html>
1436 pub unsafe fn cmd_copy_buffer(
1438 command_buffer: vk::CommandBuffer,
1439 src_buffer: vk::Buffer,
1440 dst_buffer: vk::Buffer,
1441 regions: &[vk::BufferCopy],
1443 (self.device_fn_1_0.cmd_copy_buffer)(
1447 regions.len() as u32,
1452 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyImageToBuffer.html>
1454 pub unsafe fn cmd_copy_image_to_buffer(
1456 command_buffer: vk::CommandBuffer,
1457 src_image: vk::Image,
1458 src_image_layout: vk::ImageLayout,
1459 dst_buffer: vk::Buffer,
1460 regions: &[vk::BufferImageCopy],
1462 (self.device_fn_1_0.cmd_copy_image_to_buffer)(
1467 regions.len() as u32,
1472 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyBufferToImage.html>
1474 pub unsafe fn cmd_copy_buffer_to_image(
1476 command_buffer: vk::CommandBuffer,
1477 src_buffer: vk::Buffer,
1478 dst_image: vk::Image,
1479 dst_image_layout: vk::ImageLayout,
1480 regions: &[vk::BufferImageCopy],
1482 (self.device_fn_1_0.cmd_copy_buffer_to_image)(
1487 regions.len() as u32,
1492 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyImage.html>
1494 pub unsafe fn cmd_copy_image(
1496 command_buffer: vk::CommandBuffer,
1497 src_image: vk::Image,
1498 src_image_layout: vk::ImageLayout,
1499 dst_image: vk::Image,
1500 dst_image_layout: vk::ImageLayout,
1501 regions: &[vk::ImageCopy],
1503 (self.device_fn_1_0.cmd_copy_image)(
1509 regions.len() as u32,
1514 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkAllocateDescriptorSets.html>
1516 pub unsafe fn allocate_descriptor_sets(
1518 allocate_info: &vk::DescriptorSetAllocateInfo,
1519 ) -> VkResult<Vec<vk::DescriptorSet>> {
1520 let mut desc_set = Vec::with_capacity(allocate_info.descriptor_set_count as usize);
1521 (self.device_fn_1_0.allocate_descriptor_sets)(
1524 desc_set.as_mut_ptr(),
1528 desc_set.set_len(allocate_info.descriptor_set_count as usize);
1532 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateDescriptorSetLayout.html>
1534 pub unsafe fn create_descriptor_set_layout(
1536 create_info: &vk::DescriptorSetLayoutCreateInfo,
1537 allocation_callbacks: Option<&vk::AllocationCallbacks>,
1538 ) -> VkResult<vk::DescriptorSetLayout> {
1539 let mut layout = mem::zeroed();
1540 (self.device_fn_1_0.create_descriptor_set_layout)(
1543 allocation_callbacks.as_raw_ptr(),
1546 .result_with_success(layout)
1549 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDeviceWaitIdle.html>
1551 pub unsafe fn device_wait_idle(&self) -> VkResult<()> {
1552 (self.device_fn_1_0.device_wait_idle)(self.handle()).result()
1555 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateDescriptorPool.html>
1557 pub unsafe fn create_descriptor_pool(
1559 create_info: &vk::DescriptorPoolCreateInfo,
1560 allocation_callbacks: Option<&vk::AllocationCallbacks>,
1561 ) -> VkResult<vk::DescriptorPool> {
1562 let mut pool = mem::zeroed();
1563 (self.device_fn_1_0.create_descriptor_pool)(
1566 allocation_callbacks.as_raw_ptr(),
1569 .result_with_success(pool)
1572 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkResetDescriptorPool.html>
1574 pub unsafe fn reset_descriptor_pool(
1576 pool: vk::DescriptorPool,
1577 flags: vk::DescriptorPoolResetFlags,
1579 (self.device_fn_1_0.reset_descriptor_pool)(self.handle(), pool, flags).result()
1582 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkResetCommandPool.html>
1584 pub unsafe fn reset_command_pool(
1586 command_pool: vk::CommandPool,
1587 flags: vk::CommandPoolResetFlags,
1589 (self.device_fn_1_0.reset_command_pool)(self.handle(), command_pool, flags).result()
1592 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkResetCommandBuffer.html>
1594 pub unsafe fn reset_command_buffer(
1596 command_buffer: vk::CommandBuffer,
1597 flags: vk::CommandBufferResetFlags,
1599 (self.device_fn_1_0.reset_command_buffer)(command_buffer, flags).result()
1602 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkResetFences.html>
1604 pub unsafe fn reset_fences(&self, fences: &[vk::Fence]) -> VkResult<()> {
1605 (self.device_fn_1_0.reset_fences)(self.handle(), fences.len() as u32, fences.as_ptr())
1609 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBindIndexBuffer.html>
1611 pub unsafe fn cmd_bind_index_buffer(
1613 command_buffer: vk::CommandBuffer,
1615 offset: vk::DeviceSize,
1616 index_type: vk::IndexType,
1618 (self.device_fn_1_0.cmd_bind_index_buffer)(command_buffer, buffer, offset, index_type);
1621 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdClearColorImage.html>
1623 pub unsafe fn cmd_clear_color_image(
1625 command_buffer: vk::CommandBuffer,
1627 image_layout: vk::ImageLayout,
1628 clear_color_value: &vk::ClearColorValue,
1629 ranges: &[vk::ImageSubresourceRange],
1631 (self.device_fn_1_0.cmd_clear_color_image)(
1636 ranges.len() as u32,
1641 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdClearDepthStencilImage.html>
1643 pub unsafe fn cmd_clear_depth_stencil_image(
1645 command_buffer: vk::CommandBuffer,
1647 image_layout: vk::ImageLayout,
1648 clear_depth_stencil_value: &vk::ClearDepthStencilValue,
1649 ranges: &[vk::ImageSubresourceRange],
1651 (self.device_fn_1_0.cmd_clear_depth_stencil_image)(
1655 clear_depth_stencil_value,
1656 ranges.len() as u32,
1661 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdClearAttachments.html>
1663 pub unsafe fn cmd_clear_attachments(
1665 command_buffer: vk::CommandBuffer,
1666 attachments: &[vk::ClearAttachment],
1667 rects: &[vk::ClearRect],
1669 (self.device_fn_1_0.cmd_clear_attachments)(
1671 attachments.len() as u32,
1672 attachments.as_ptr(),
1678 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDrawIndexed.html>
1680 pub unsafe fn cmd_draw_indexed(
1682 command_buffer: vk::CommandBuffer,
1684 instance_count: u32,
1687 first_instance: u32,
1689 (self.device_fn_1_0.cmd_draw_indexed)(
1699 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDrawIndexedIndirect.html>
1701 pub unsafe fn cmd_draw_indexed_indirect(
1703 command_buffer: vk::CommandBuffer,
1705 offset: vk::DeviceSize,
1709 (self.device_fn_1_0.cmd_draw_indexed_indirect)(
1718 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdExecuteCommands.html>
1720 pub unsafe fn cmd_execute_commands(
1722 primary_command_buffer: vk::CommandBuffer,
1723 secondary_command_buffers: &[vk::CommandBuffer],
1725 (self.device_fn_1_0.cmd_execute_commands)(
1726 primary_command_buffer,
1727 secondary_command_buffers.len() as u32,
1728 secondary_command_buffers.as_ptr(),
1732 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBindDescriptorSets.html>
1734 pub unsafe fn cmd_bind_descriptor_sets(
1736 command_buffer: vk::CommandBuffer,
1737 pipeline_bind_point: vk::PipelineBindPoint,
1738 layout: vk::PipelineLayout,
1740 descriptor_sets: &[vk::DescriptorSet],
1741 dynamic_offsets: &[u32],
1743 (self.device_fn_1_0.cmd_bind_descriptor_sets)(
1745 pipeline_bind_point,
1748 descriptor_sets.len() as u32,
1749 descriptor_sets.as_ptr(),
1750 dynamic_offsets.len() as u32,
1751 dynamic_offsets.as_ptr(),
1755 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyQueryPoolResults.html>
1757 pub unsafe fn cmd_copy_query_pool_results(
1759 command_buffer: vk::CommandBuffer,
1760 query_pool: vk::QueryPool,
1763 dst_buffer: vk::Buffer,
1764 dst_offset: vk::DeviceSize,
1765 stride: vk::DeviceSize,
1766 flags: vk::QueryResultFlags,
1768 (self.device_fn_1_0.cmd_copy_query_pool_results)(
1780 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdPushConstants.html>
1782 pub unsafe fn cmd_push_constants(
1784 command_buffer: vk::CommandBuffer,
1785 layout: vk::PipelineLayout,
1786 stage_flags: vk::ShaderStageFlags,
1790 (self.device_fn_1_0.cmd_push_constants)(
1795 constants.len() as _,
1796 constants.as_ptr() as _,
1800 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBeginRenderPass.html>
1802 pub unsafe fn cmd_begin_render_pass(
1804 command_buffer: vk::CommandBuffer,
1805 render_pass_begin: &vk::RenderPassBeginInfo,
1806 contents: vk::SubpassContents,
1808 (self.device_fn_1_0.cmd_begin_render_pass)(command_buffer, render_pass_begin, contents);
1811 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdNextSubpass.html>
1813 pub unsafe fn cmd_next_subpass(
1815 command_buffer: vk::CommandBuffer,
1816 contents: vk::SubpassContents,
1818 (self.device_fn_1_0.cmd_next_subpass)(command_buffer, contents);
1821 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBindPipeline.html>
1823 pub unsafe fn cmd_bind_pipeline(
1825 command_buffer: vk::CommandBuffer,
1826 pipeline_bind_point: vk::PipelineBindPoint,
1827 pipeline: vk::Pipeline,
1829 (self.device_fn_1_0.cmd_bind_pipeline)(command_buffer, pipeline_bind_point, pipeline);
1832 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetScissor.html>
1834 pub unsafe fn cmd_set_scissor(
1836 command_buffer: vk::CommandBuffer,
1838 scissors: &[vk::Rect2D],
1840 (self.device_fn_1_0.cmd_set_scissor)(
1843 scissors.len() as u32,
1848 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetLineWidth.html>
1850 pub unsafe fn cmd_set_line_width(&self, command_buffer: vk::CommandBuffer, line_width: f32) {
1851 (self.device_fn_1_0.cmd_set_line_width)(command_buffer, line_width);
1854 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBindVertexBuffers.html>
1856 pub unsafe fn cmd_bind_vertex_buffers(
1858 command_buffer: vk::CommandBuffer,
1860 buffers: &[vk::Buffer],
1861 offsets: &[vk::DeviceSize],
1863 debug_assert_eq!(buffers.len(), offsets.len());
1864 (self.device_fn_1_0.cmd_bind_vertex_buffers)(
1867 buffers.len() as u32,
1873 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdEndRenderPass.html>
1875 pub unsafe fn cmd_end_render_pass(&self, command_buffer: vk::CommandBuffer) {
1876 (self.device_fn_1_0.cmd_end_render_pass)(command_buffer);
1879 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDraw.html>
1881 pub unsafe fn cmd_draw(
1883 command_buffer: vk::CommandBuffer,
1885 instance_count: u32,
1887 first_instance: u32,
1889 (self.device_fn_1_0.cmd_draw)(
1898 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDrawIndirect.html>
1900 pub unsafe fn cmd_draw_indirect(
1902 command_buffer: vk::CommandBuffer,
1904 offset: vk::DeviceSize,
1908 (self.device_fn_1_0.cmd_draw_indirect)(command_buffer, buffer, offset, draw_count, stride);
1911 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDispatch.html>
1913 pub unsafe fn cmd_dispatch(
1915 command_buffer: vk::CommandBuffer,
1920 (self.device_fn_1_0.cmd_dispatch)(
1928 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDispatchIndirect.html>
1930 pub unsafe fn cmd_dispatch_indirect(
1932 command_buffer: vk::CommandBuffer,
1934 offset: vk::DeviceSize,
1936 (self.device_fn_1_0.cmd_dispatch_indirect)(command_buffer, buffer, offset);
1939 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetViewport.html>
1941 pub unsafe fn cmd_set_viewport(
1943 command_buffer: vk::CommandBuffer,
1944 first_viewport: u32,
1945 viewports: &[vk::Viewport],
1947 (self.device_fn_1_0.cmd_set_viewport)(
1950 viewports.len() as u32,
1955 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthBias.html>
1957 pub unsafe fn cmd_set_depth_bias(
1959 command_buffer: vk::CommandBuffer,
1960 constant_factor: f32,
1964 (self.device_fn_1_0.cmd_set_depth_bias)(
1972 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetBlendConstants.html>
1974 pub unsafe fn cmd_set_blend_constants(
1976 command_buffer: vk::CommandBuffer,
1977 blend_constants: &[f32; 4],
1979 (self.device_fn_1_0.cmd_set_blend_constants)(command_buffer, blend_constants);
1982 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthBounds.html>
1984 pub unsafe fn cmd_set_depth_bounds(
1986 command_buffer: vk::CommandBuffer,
1987 min_depth_bounds: f32,
1988 max_depth_bounds: f32,
1990 (self.device_fn_1_0.cmd_set_depth_bounds)(
1997 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetStencilCompareMask.html>
1999 pub unsafe fn cmd_set_stencil_compare_mask(
2001 command_buffer: vk::CommandBuffer,
2002 face_mask: vk::StencilFaceFlags,
2005 (self.device_fn_1_0.cmd_set_stencil_compare_mask)(command_buffer, face_mask, compare_mask);
2008 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetStencilWriteMask.html>
2010 pub unsafe fn cmd_set_stencil_write_mask(
2012 command_buffer: vk::CommandBuffer,
2013 face_mask: vk::StencilFaceFlags,
2016 (self.device_fn_1_0.cmd_set_stencil_write_mask)(command_buffer, face_mask, write_mask);
2019 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetStencilReference.html>
2021 pub unsafe fn cmd_set_stencil_reference(
2023 command_buffer: vk::CommandBuffer,
2024 face_mask: vk::StencilFaceFlags,
2027 (self.device_fn_1_0.cmd_set_stencil_reference)(command_buffer, face_mask, reference);
2030 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetQueryPoolResults.html>
2032 pub unsafe fn get_query_pool_results<T>(
2034 query_pool: vk::QueryPool,
2038 flags: vk::QueryResultFlags,
2040 let data_length = query_count as usize;
2042 data_length <= data.len(),
2043 "query_count was higher than the length of the slice"
2045 let data_size = mem::size_of::<T>() * data_length;
2046 (self.device_fn_1_0.get_query_pool_results)(
2052 data.as_mut_ptr().cast(),
2053 mem::size_of::<T>() as _,
2059 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBeginQuery.html>
2061 pub unsafe fn cmd_begin_query(
2063 command_buffer: vk::CommandBuffer,
2064 query_pool: vk::QueryPool,
2066 flags: vk::QueryControlFlags,
2068 (self.device_fn_1_0.cmd_begin_query)(command_buffer, query_pool, query, flags);
2071 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdEndQuery.html>
2073 pub unsafe fn cmd_end_query(
2075 command_buffer: vk::CommandBuffer,
2076 query_pool: vk::QueryPool,
2079 (self.device_fn_1_0.cmd_end_query)(command_buffer, query_pool, query);
2082 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdResetQueryPool.html>
2084 pub unsafe fn cmd_reset_query_pool(
2086 command_buffer: vk::CommandBuffer,
2087 pool: vk::QueryPool,
2091 (self.device_fn_1_0.cmd_reset_query_pool)(command_buffer, pool, first_query, query_count);
2094 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdWriteTimestamp.html>
2096 pub unsafe fn cmd_write_timestamp(
2098 command_buffer: vk::CommandBuffer,
2099 pipeline_stage: vk::PipelineStageFlags,
2100 query_pool: vk::QueryPool,
2103 (self.device_fn_1_0.cmd_write_timestamp)(command_buffer, pipeline_stage, query_pool, query);
2106 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateSemaphore.html>
2108 pub unsafe fn create_semaphore(
2110 create_info: &vk::SemaphoreCreateInfo,
2111 allocation_callbacks: Option<&vk::AllocationCallbacks>,
2112 ) -> VkResult<vk::Semaphore> {
2113 let mut semaphore = mem::zeroed();
2114 (self.device_fn_1_0.create_semaphore)(
2117 allocation_callbacks.as_raw_ptr(),
2120 .result_with_success(semaphore)
2123 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateGraphicsPipelines.html>
2125 pub unsafe fn create_graphics_pipelines(
2127 pipeline_cache: vk::PipelineCache,
2128 create_infos: &[vk::GraphicsPipelineCreateInfo],
2129 allocation_callbacks: Option<&vk::AllocationCallbacks>,
2130 ) -> Result<Vec<vk::Pipeline>, (Vec<vk::Pipeline>, vk::Result)> {
2131 let mut pipelines = Vec::with_capacity(create_infos.len());
2132 let err_code = (self.device_fn_1_0.create_graphics_pipelines)(
2135 create_infos.len() as u32,
2136 create_infos.as_ptr(),
2137 allocation_callbacks.as_raw_ptr(),
2138 pipelines.as_mut_ptr(),
2140 pipelines.set_len(create_infos.len());
2142 vk::Result::SUCCESS => Ok(pipelines),
2143 _ => Err((pipelines, err_code)),
2147 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateComputePipelines.html>
2149 pub unsafe fn create_compute_pipelines(
2151 pipeline_cache: vk::PipelineCache,
2152 create_infos: &[vk::ComputePipelineCreateInfo],
2153 allocation_callbacks: Option<&vk::AllocationCallbacks>,
2154 ) -> Result<Vec<vk::Pipeline>, (Vec<vk::Pipeline>, vk::Result)> {
2155 let mut pipelines = Vec::with_capacity(create_infos.len());
2156 let err_code = (self.device_fn_1_0.create_compute_pipelines)(
2159 create_infos.len() as u32,
2160 create_infos.as_ptr(),
2161 allocation_callbacks.as_raw_ptr(),
2162 pipelines.as_mut_ptr(),
2164 pipelines.set_len(create_infos.len());
2166 vk::Result::SUCCESS => Ok(pipelines),
2167 _ => Err((pipelines, err_code)),
2171 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateBuffer.html>
2173 pub unsafe fn create_buffer(
2175 create_info: &vk::BufferCreateInfo,
2176 allocation_callbacks: Option<&vk::AllocationCallbacks>,
2177 ) -> VkResult<vk::Buffer> {
2178 let mut buffer = mem::zeroed();
2179 (self.device_fn_1_0.create_buffer)(
2182 allocation_callbacks.as_raw_ptr(),
2185 .result_with_success(buffer)
2188 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreatePipelineLayout.html>
2190 pub unsafe fn create_pipeline_layout(
2192 create_info: &vk::PipelineLayoutCreateInfo,
2193 allocation_callbacks: Option<&vk::AllocationCallbacks>,
2194 ) -> VkResult<vk::PipelineLayout> {
2195 let mut pipeline_layout = mem::zeroed();
2196 (self.device_fn_1_0.create_pipeline_layout)(
2199 allocation_callbacks.as_raw_ptr(),
2200 &mut pipeline_layout,
2202 .result_with_success(pipeline_layout)
2205 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreatePipelineCache.html>
2207 pub unsafe fn create_pipeline_cache(
2209 create_info: &vk::PipelineCacheCreateInfo,
2210 allocation_callbacks: Option<&vk::AllocationCallbacks>,
2211 ) -> VkResult<vk::PipelineCache> {
2212 let mut pipeline_cache = mem::zeroed();
2213 (self.device_fn_1_0.create_pipeline_cache)(
2216 allocation_callbacks.as_raw_ptr(),
2217 &mut pipeline_cache,
2219 .result_with_success(pipeline_cache)
2222 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPipelineCacheData.html>
2224 pub unsafe fn get_pipeline_cache_data(
2226 pipeline_cache: vk::PipelineCache,
2227 ) -> VkResult<Vec<u8>> {
2228 read_into_uninitialized_vector(|count, data| {
2229 (self.device_fn_1_0.get_pipeline_cache_data)(
2238 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkMergePipelineCaches.html>
2240 pub unsafe fn merge_pipeline_caches(
2242 dst_cache: vk::PipelineCache,
2243 src_caches: &[vk::PipelineCache],
2245 (self.device_fn_1_0.merge_pipeline_caches)(
2248 src_caches.len() as u32,
2249 src_caches.as_ptr(),
2254 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkMapMemory.html>
2256 pub unsafe fn map_memory(
2258 memory: vk::DeviceMemory,
2259 offset: vk::DeviceSize,
2260 size: vk::DeviceSize,
2261 flags: vk::MemoryMapFlags,
2262 ) -> VkResult<*mut c_void> {
2263 let mut data: *mut c_void = ptr::null_mut();
2264 (self.device_fn_1_0.map_memory)(self.handle(), memory, offset, size, flags, &mut data)
2265 .result_with_success(data)
2268 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkUnmapMemory.html>
2270 pub unsafe fn unmap_memory(&self, memory: vk::DeviceMemory) {
2271 (self.device_fn_1_0.unmap_memory)(self.handle(), memory);
2274 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkInvalidateMappedMemoryRanges.html>
2276 pub unsafe fn invalidate_mapped_memory_ranges(
2278 ranges: &[vk::MappedMemoryRange],
2280 (self.device_fn_1_0.invalidate_mapped_memory_ranges)(
2282 ranges.len() as u32,
2288 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkFlushMappedMemoryRanges.html>
2290 pub unsafe fn flush_mapped_memory_ranges(
2292 ranges: &[vk::MappedMemoryRange],
2294 (self.device_fn_1_0.flush_mapped_memory_ranges)(
2296 ranges.len() as u32,
2302 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateFramebuffer.html>
2304 pub unsafe fn create_framebuffer(
2306 create_info: &vk::FramebufferCreateInfo,
2307 allocation_callbacks: Option<&vk::AllocationCallbacks>,
2308 ) -> VkResult<vk::Framebuffer> {
2309 let mut framebuffer = mem::zeroed();
2310 (self.device_fn_1_0.create_framebuffer)(
2313 allocation_callbacks.as_raw_ptr(),
2316 .result_with_success(framebuffer)
2319 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceQueue.html>
2321 pub unsafe fn get_device_queue(&self, queue_family_index: u32, queue_index: u32) -> vk::Queue {
2322 let mut queue = mem::zeroed();
2323 (self.device_fn_1_0.get_device_queue)(
2332 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdPipelineBarrier.html>
2334 pub unsafe fn cmd_pipeline_barrier(
2336 command_buffer: vk::CommandBuffer,
2337 src_stage_mask: vk::PipelineStageFlags,
2338 dst_stage_mask: vk::PipelineStageFlags,
2339 dependency_flags: vk::DependencyFlags,
2340 memory_barriers: &[vk::MemoryBarrier],
2341 buffer_memory_barriers: &[vk::BufferMemoryBarrier],
2342 image_memory_barriers: &[vk::ImageMemoryBarrier],
2344 (self.device_fn_1_0.cmd_pipeline_barrier)(
2349 memory_barriers.len() as u32,
2350 memory_barriers.as_ptr(),
2351 buffer_memory_barriers.len() as u32,
2352 buffer_memory_barriers.as_ptr(),
2353 image_memory_barriers.len() as u32,
2354 image_memory_barriers.as_ptr(),
2358 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateRenderPass.html>
2360 pub unsafe fn create_render_pass(
2362 create_info: &vk::RenderPassCreateInfo,
2363 allocation_callbacks: Option<&vk::AllocationCallbacks>,
2364 ) -> VkResult<vk::RenderPass> {
2365 let mut renderpass = mem::zeroed();
2366 (self.device_fn_1_0.create_render_pass)(
2369 allocation_callbacks.as_raw_ptr(),
2372 .result_with_success(renderpass)
2375 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkBeginCommandBuffer.html>
2377 pub unsafe fn begin_command_buffer(
2379 command_buffer: vk::CommandBuffer,
2380 begin_info: &vk::CommandBufferBeginInfo,
2382 (self.device_fn_1_0.begin_command_buffer)(command_buffer, begin_info).result()
2385 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkEndCommandBuffer.html>
2387 pub unsafe fn end_command_buffer(&self, command_buffer: vk::CommandBuffer) -> VkResult<()> {
2388 (self.device_fn_1_0.end_command_buffer)(command_buffer).result()
2391 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkWaitForFences.html>
2393 pub unsafe fn wait_for_fences(
2395 fences: &[vk::Fence],
2399 (self.device_fn_1_0.wait_for_fences)(
2401 fences.len() as u32,
2409 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetFenceStatus.html>
2411 pub unsafe fn get_fence_status(&self, fence: vk::Fence) -> VkResult<bool> {
2412 let err_code = (self.device_fn_1_0.get_fence_status)(self.handle(), fence);
2414 vk::Result::SUCCESS => Ok(true),
2415 vk::Result::NOT_READY => Ok(false),
2420 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkQueueWaitIdle.html>
2422 pub unsafe fn queue_wait_idle(&self, queue: vk::Queue) -> VkResult<()> {
2423 (self.device_fn_1_0.queue_wait_idle)(queue).result()
2426 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkQueueSubmit.html>
2428 pub unsafe fn queue_submit(
2431 submits: &[vk::SubmitInfo],
2434 (self.device_fn_1_0.queue_submit)(queue, submits.len() as u32, submits.as_ptr(), fence)
2438 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkQueueBindSparse.html>
2440 pub unsafe fn queue_bind_sparse(
2443 bind_info: &[vk::BindSparseInfo],
2446 (self.device_fn_1_0.queue_bind_sparse)(
2448 bind_info.len() as u32,
2455 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateBufferView.html>
2457 pub unsafe fn create_buffer_view(
2459 create_info: &vk::BufferViewCreateInfo,
2460 allocation_callbacks: Option<&vk::AllocationCallbacks>,
2461 ) -> VkResult<vk::BufferView> {
2462 let mut buffer_view = mem::zeroed();
2463 (self.device_fn_1_0.create_buffer_view)(
2466 allocation_callbacks.as_raw_ptr(),
2469 .result_with_success(buffer_view)
2472 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyBufferView.html>
2474 pub unsafe fn destroy_buffer_view(
2476 buffer_view: vk::BufferView,
2477 allocation_callbacks: Option<&vk::AllocationCallbacks>,
2479 (self.device_fn_1_0.destroy_buffer_view)(
2482 allocation_callbacks.as_raw_ptr(),
2486 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateImageView.html>
2488 pub unsafe fn create_image_view(
2490 create_info: &vk::ImageViewCreateInfo,
2491 allocation_callbacks: Option<&vk::AllocationCallbacks>,
2492 ) -> VkResult<vk::ImageView> {
2493 let mut image_view = mem::zeroed();
2494 (self.device_fn_1_0.create_image_view)(
2497 allocation_callbacks.as_raw_ptr(),
2500 .result_with_success(image_view)
2503 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkAllocateCommandBuffers.html>
2505 pub unsafe fn allocate_command_buffers(
2507 allocate_info: &vk::CommandBufferAllocateInfo,
2508 ) -> VkResult<Vec<vk::CommandBuffer>> {
2509 let mut buffers = Vec::with_capacity(allocate_info.command_buffer_count as usize);
2510 (self.device_fn_1_0.allocate_command_buffers)(
2513 buffers.as_mut_ptr(),
2516 buffers.set_len(allocate_info.command_buffer_count as usize);
2520 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateCommandPool.html>
2522 pub unsafe fn create_command_pool(
2524 create_info: &vk::CommandPoolCreateInfo,
2525 allocation_callbacks: Option<&vk::AllocationCallbacks>,
2526 ) -> VkResult<vk::CommandPool> {
2527 let mut pool = mem::zeroed();
2528 (self.device_fn_1_0.create_command_pool)(
2531 allocation_callbacks.as_raw_ptr(),
2534 .result_with_success(pool)
2537 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateQueryPool.html>
2539 pub unsafe fn create_query_pool(
2541 create_info: &vk::QueryPoolCreateInfo,
2542 allocation_callbacks: Option<&vk::AllocationCallbacks>,
2543 ) -> VkResult<vk::QueryPool> {
2544 let mut pool = mem::zeroed();
2545 (self.device_fn_1_0.create_query_pool)(
2548 allocation_callbacks.as_raw_ptr(),
2551 .result_with_success(pool)
2554 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateImage.html>
2556 pub unsafe fn create_image(
2558 create_info: &vk::ImageCreateInfo,
2559 allocation_callbacks: Option<&vk::AllocationCallbacks>,
2560 ) -> VkResult<vk::Image> {
2561 let mut image = mem::zeroed();
2562 (self.device_fn_1_0.create_image)(
2565 allocation_callbacks.as_raw_ptr(),
2568 .result_with_success(image)
2571 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetImageSubresourceLayout.html>
2573 pub unsafe fn get_image_subresource_layout(
2576 subresource: vk::ImageSubresource,
2577 ) -> vk::SubresourceLayout {
2578 let mut layout = mem::zeroed();
2579 (self.device_fn_1_0.get_image_subresource_layout)(
2588 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetImageMemoryRequirements.html>
2590 pub unsafe fn get_image_memory_requirements(&self, image: vk::Image) -> vk::MemoryRequirements {
2591 let mut mem_req = mem::zeroed();
2592 (self.device_fn_1_0.get_image_memory_requirements)(self.handle(), image, &mut mem_req);
2596 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetBufferMemoryRequirements.html>
2598 pub unsafe fn get_buffer_memory_requirements(
2601 ) -> vk::MemoryRequirements {
2602 let mut mem_req = mem::zeroed();
2603 (self.device_fn_1_0.get_buffer_memory_requirements)(self.handle(), buffer, &mut mem_req);
2607 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkAllocateMemory.html>
2609 pub unsafe fn allocate_memory(
2611 allocate_info: &vk::MemoryAllocateInfo,
2612 allocation_callbacks: Option<&vk::AllocationCallbacks>,
2613 ) -> VkResult<vk::DeviceMemory> {
2614 let mut memory = mem::zeroed();
2615 (self.device_fn_1_0.allocate_memory)(
2618 allocation_callbacks.as_raw_ptr(),
2621 .result_with_success(memory)
2624 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateShaderModule.html>
2626 pub unsafe fn create_shader_module(
2628 create_info: &vk::ShaderModuleCreateInfo,
2629 allocation_callbacks: Option<&vk::AllocationCallbacks>,
2630 ) -> VkResult<vk::ShaderModule> {
2631 let mut shader = mem::zeroed();
2632 (self.device_fn_1_0.create_shader_module)(
2635 allocation_callbacks.as_raw_ptr(),
2638 .result_with_success(shader)
2641 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateFence.html>
2643 pub unsafe fn create_fence(
2645 create_info: &vk::FenceCreateInfo,
2646 allocation_callbacks: Option<&vk::AllocationCallbacks>,
2647 ) -> VkResult<vk::Fence> {
2648 let mut fence = mem::zeroed();
2649 (self.device_fn_1_0.create_fence)(
2652 allocation_callbacks.as_raw_ptr(),
2655 .result_with_success(fence)
2658 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkBindBufferMemory.html>
2660 pub unsafe fn bind_buffer_memory(
2663 device_memory: vk::DeviceMemory,
2664 offset: vk::DeviceSize,
2666 (self.device_fn_1_0.bind_buffer_memory)(self.handle(), buffer, device_memory, offset)
2670 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkBindImageMemory.html>
2672 pub unsafe fn bind_image_memory(
2675 device_memory: vk::DeviceMemory,
2676 offset: vk::DeviceSize,
2678 (self.device_fn_1_0.bind_image_memory)(self.handle(), image, device_memory, offset).result()
2681 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetRenderAreaGranularity.html>
2683 pub unsafe fn get_render_area_granularity(&self, render_pass: vk::RenderPass) -> vk::Extent2D {
2684 let mut granularity = mem::zeroed();
2685 (self.device_fn_1_0.get_render_area_granularity)(
2693 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceMemoryCommitment.html>
2695 pub unsafe fn get_device_memory_commitment(&self, memory: vk::DeviceMemory) -> vk::DeviceSize {
2696 let mut committed_memory_in_bytes = 0;
2697 (self.device_fn_1_0.get_device_memory_commitment)(
2700 &mut committed_memory_in_bytes,
2702 committed_memory_in_bytes
2705 /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetImageSparseMemoryRequirements.html>
2707 pub unsafe fn get_image_sparse_memory_requirements(
2710 ) -> Vec<vk::SparseImageMemoryRequirements> {
2711 read_into_uninitialized_vector(|count, data| {
2712 (self.device_fn_1_0.get_image_sparse_memory_requirements)(
2720 // The closure always returns SUCCESS