diff --git a/ash/src/device.rs b/ash/src/device.rs index 4c4330d..0d0312a 100644 --- a/ash/src/device.rs +++ b/ash/src/device.rs @@ -265,6 +265,15 @@ pub trait DeviceV1_0 { .destroy_fence(self.handle(), fence, allocation_callbacks.as_raw_ptr()); } + unsafe fn destroy_event( + &self, + event: vk::Event, + allocation_callbacks: Option<&vk::AllocationCallbacks>, + ) { + self.fp_v1_0() + .destroy_event(self.handle(), event, allocation_callbacks.as_raw_ptr()); + } + unsafe fn destroy_image( &self, image: vk::Image, @@ -1276,6 +1285,34 @@ pub trait DeviceV1_0 { } } + unsafe fn get_pipeline_cache_data( + &self, + pipeline_cache: vk::PipelineCache, + ) -> VkResult> { + let mut data_size: usize = 0; + let err_code = self.fp_v1_0().get_pipeline_cache_data( + self.handle(), + pipeline_cache, + &mut data_size, + ptr::null_mut(), + ); + if err_code != vk::Result::SUCCESS { + return Err(err_code); + }; + let mut data: Vec = Vec::with_capacity(data_size); + let err_code = self.fp_v1_0().get_pipeline_cache_data( + self.handle(), + pipeline_cache, + &mut data_size, + data.as_mut_ptr() as _, + ); + data.set_len(data_size); + match err_code { + vk::Result::SUCCESS => Ok(data), + _ => Err(err_code), + } + } + unsafe fn map_memory( &self, memory: vk::DeviceMemory, @@ -1394,11 +1431,11 @@ pub trait DeviceV1_0 { unsafe fn begin_command_buffer( &self, command_buffer: vk::CommandBuffer, - create_info: &vk::CommandBufferBeginInfo, + begin_info: &vk::CommandBufferBeginInfo, ) -> VkResult<()> { let err_code = self .fp_v1_0() - .begin_command_buffer(command_buffer, create_info); + .begin_command_buffer(command_buffer, begin_info); match err_code { vk::Result::SUCCESS => Ok(()), _ => Err(err_code), diff --git a/ash/src/extensions/debug_marker.rs b/ash/src/extensions/ext/debug_marker.rs similarity index 87% rename from ash/src/extensions/debug_marker.rs rename to ash/src/extensions/ext/debug_marker.rs index 5483985..fe954e9 100644 --- a/ash/src/extensions/debug_marker.rs +++ b/ash/src/extensions/ext/debug_marker.rs @@ -24,7 +24,7 @@ impl DebugMarker { CStr::from_bytes_with_nul(b"VK_EXT_debug_marker\0").expect("Wrong extension string") } - pub unsafe fn debug_marker_set_object_name_ext( + pub unsafe fn debug_marker_set_object_name( &self, device: vk::Device, name_info: &vk::DebugMarkerObjectNameInfoEXT, @@ -38,7 +38,7 @@ impl DebugMarker { } } - pub unsafe fn cmd_debug_marker_begin_ext( + pub unsafe fn cmd_debug_marker_begin( &self, command_buffer: vk::CommandBuffer, marker_info: &vk::DebugMarkerMarkerInfoEXT, @@ -47,12 +47,12 @@ impl DebugMarker { .cmd_debug_marker_begin_ext(command_buffer, marker_info); } - pub unsafe fn cmd_debug_marker_end_ext(&self, command_buffer: vk::CommandBuffer) { + pub unsafe fn cmd_debug_marker_end(&self, command_buffer: vk::CommandBuffer) { self.debug_marker_fn .cmd_debug_marker_end_ext(command_buffer); } - pub unsafe fn cmd_debug_marker_insert_ext( + pub unsafe fn cmd_debug_marker_insert( &self, command_buffer: vk::CommandBuffer, marker_info: &vk::DebugMarkerMarkerInfoEXT, diff --git a/ash/src/extensions/debug_report.rs b/ash/src/extensions/ext/debug_report.rs similarity index 94% rename from ash/src/extensions/debug_report.rs rename to ash/src/extensions/ext/debug_report.rs index 421b3a9..ec8e147 100644 --- a/ash/src/extensions/debug_report.rs +++ b/ash/src/extensions/ext/debug_report.rs @@ -27,7 +27,7 @@ impl DebugReport { CStr::from_bytes_with_nul(b"VK_EXT_debug_report\0").expect("Wrong extension string") } - pub unsafe fn destroy_debug_report_callback_ext( + pub unsafe fn destroy_debug_report_callback( &self, debug: vk::DebugReportCallbackEXT, allocation_callbacks: Option<&vk::AllocationCallbacks>, @@ -39,7 +39,7 @@ impl DebugReport { ); } - pub unsafe fn create_debug_report_callback_ext( + pub unsafe fn create_debug_report_callback( &self, create_info: &vk::DebugReportCallbackCreateInfoEXT, allocation_callbacks: Option<&vk::AllocationCallbacks>, diff --git a/ash/src/extensions/debug_utils.rs b/ash/src/extensions/ext/debug_utils.rs similarity index 85% rename from ash/src/extensions/debug_utils.rs rename to ash/src/extensions/ext/debug_utils.rs index 67485a0..443e688 100644 --- a/ash/src/extensions/debug_utils.rs +++ b/ash/src/extensions/ext/debug_utils.rs @@ -26,7 +26,7 @@ impl DebugUtils { CStr::from_bytes_with_nul(b"VK_EXT_debug_utils\0").expect("Wrong extension string") } - pub unsafe fn debug_utils_set_object_name_ext( + pub unsafe fn debug_utils_set_object_name( &self, device: vk::Device, name_info: &vk::DebugUtilsObjectNameInfoEXT, @@ -40,7 +40,7 @@ impl DebugUtils { } } - pub unsafe fn debug_utils_set_object_tag_ext( + pub unsafe fn debug_utils_set_object_tag( &self, device: vk::Device, tag_info: &vk::DebugUtilsObjectTagInfoEXT, @@ -54,7 +54,7 @@ impl DebugUtils { } } - pub unsafe fn cmd_begin_debug_utils_label_ext( + pub unsafe fn cmd_begin_debug_utils_label( &self, command_buffer: vk::CommandBuffer, label: &vk::DebugUtilsLabelEXT, @@ -63,12 +63,12 @@ impl DebugUtils { .cmd_begin_debug_utils_label_ext(command_buffer, label); } - pub unsafe fn cmd_end_debug_utils_label_ext(&self, command_buffer: vk::CommandBuffer) { + pub unsafe fn cmd_end_debug_utils_label(&self, command_buffer: vk::CommandBuffer) { self.debug_utils_fn .cmd_end_debug_utils_label_ext(command_buffer); } - pub unsafe fn cmd_insert_debug_utils_label_ext( + pub unsafe fn cmd_insert_debug_utils_label( &self, command_buffer: vk::CommandBuffer, label: &vk::DebugUtilsLabelEXT, @@ -77,7 +77,7 @@ impl DebugUtils { .cmd_insert_debug_utils_label_ext(command_buffer, label); } - pub unsafe fn queue_begin_debug_utils_label_ext( + pub unsafe fn queue_begin_debug_utils_label( &self, queue: vk::Queue, label: &vk::DebugUtilsLabelEXT, @@ -86,11 +86,11 @@ impl DebugUtils { .queue_begin_debug_utils_label_ext(queue, label); } - pub unsafe fn queue_end_debug_utils_label_ext(&self, queue: vk::Queue) { + pub unsafe fn queue_end_debug_utils_label(&self, queue: vk::Queue) { self.debug_utils_fn.queue_end_debug_utils_label_ext(queue); } - pub unsafe fn queue_insert_debug_utils_label_ext( + pub unsafe fn queue_insert_debug_utils_label( &self, queue: vk::Queue, label: &vk::DebugUtilsLabelEXT, @@ -99,7 +99,7 @@ impl DebugUtils { .queue_insert_debug_utils_label_ext(queue, label); } - pub unsafe fn create_debug_utils_messenger_ext( + pub unsafe fn create_debug_utils_messenger( &self, create_info: &vk::DebugUtilsMessengerCreateInfoEXT, allocator: Option<&vk::AllocationCallbacks>, @@ -117,7 +117,7 @@ impl DebugUtils { } } - pub unsafe fn destroy_debug_utils_messenger_ext( + pub unsafe fn destroy_debug_utils_messenger( &self, messenger: vk::DebugUtilsMessengerEXT, allocator: Option<&vk::AllocationCallbacks>, @@ -129,7 +129,7 @@ impl DebugUtils { ); } - pub unsafe fn submit_debug_utils_message_ext( + pub unsafe fn submit_debug_utils_message( &self, instance: vk::Instance, message_severity: vk::DebugUtilsMessageSeverityFlagsEXT, diff --git a/ash/src/extensions/ext/mod.rs b/ash/src/extensions/ext/mod.rs new file mode 100644 index 0000000..eba690f --- /dev/null +++ b/ash/src/extensions/ext/mod.rs @@ -0,0 +1,7 @@ +pub use self::debug_marker::DebugMarker; +pub use self::debug_report::DebugReport; +pub use self::debug_utils::DebugUtils; + +mod debug_marker; +mod debug_report; +mod debug_utils; diff --git a/ash/src/extensions/android_surface.rs b/ash/src/extensions/khr/android_surface.rs similarity index 96% rename from ash/src/extensions/android_surface.rs rename to ash/src/extensions/khr/android_surface.rs index 9643d6b..0ceade6 100644 --- a/ash/src/extensions/android_surface.rs +++ b/ash/src/extensions/khr/android_surface.rs @@ -27,7 +27,7 @@ impl AndroidSurface { CStr::from_bytes_with_nul(b"VK_KHR_android_surface\0").expect("Wrong extension string") } - pub unsafe fn create_android_surface_khr( + pub unsafe fn create_android_surface( &self, create_info: &vk::AndroidSurfaceCreateInfoKHR, allocation_callbacks: Option<&vk::AllocationCallbacks>, diff --git a/ash/src/extensions/display_swapchain.rs b/ash/src/extensions/khr/display_swapchain.rs similarity index 96% rename from ash/src/extensions/display_swapchain.rs rename to ash/src/extensions/khr/display_swapchain.rs index 5cd0184..dfe1820 100644 --- a/ash/src/extensions/display_swapchain.rs +++ b/ash/src/extensions/khr/display_swapchain.rs @@ -27,7 +27,7 @@ impl DisplaySwapchain { CStr::from_bytes_with_nul(b"VK_KHR_display_swapchain\0").expect("Wrong extension string") } - pub unsafe fn create_shared_swapchains_khr( + pub unsafe fn create_shared_swapchains( &self, create_infos: &[vk::SwapchainCreateInfoKHR], allocation_callbacks: Option<&vk::AllocationCallbacks>, diff --git a/ash/src/extensions/khr/mod.rs b/ash/src/extensions/khr/mod.rs new file mode 100644 index 0000000..8812674 --- /dev/null +++ b/ash/src/extensions/khr/mod.rs @@ -0,0 +1,17 @@ +pub use self::android_surface::AndroidSurface; +pub use self::display_swapchain::DisplaySwapchain; +pub use self::surface::Surface; +pub use self::swapchain::Swapchain; +pub use self::wayland_surface::WaylandSurface; +pub use self::win32_surface::Win32Surface; +pub use self::xcb_surface::XcbSurface; +pub use self::xlib_surface::XlibSurface; + +mod android_surface; +mod display_swapchain; +mod surface; +mod swapchain; +mod wayland_surface; +mod win32_surface; +mod xcb_surface; +mod xlib_surface; diff --git a/ash/src/extensions/surface.rs b/ash/src/extensions/khr/surface.rs similarity index 92% rename from ash/src/extensions/surface.rs rename to ash/src/extensions/khr/surface.rs index 3f37bb7..bfcaca4 100644 --- a/ash/src/extensions/surface.rs +++ b/ash/src/extensions/khr/surface.rs @@ -28,7 +28,7 @@ impl Surface { CStr::from_bytes_with_nul(b"VK_KHR_surface\0").expect("Wrong extension string") } - pub unsafe fn get_physical_device_surface_support_khr( + pub unsafe fn get_physical_device_surface_support( &self, physical_device: vk::PhysicalDevice, queue_index: u32, @@ -44,7 +44,7 @@ impl Surface { b > 0 } - pub unsafe fn get_physical_device_surface_present_modes_khr( + pub unsafe fn get_physical_device_surface_present_modes( &self, physical_device: vk::PhysicalDevice, surface: vk::SurfaceKHR, @@ -73,7 +73,7 @@ impl Surface { } } - pub unsafe fn get_physical_device_surface_capabilities_khr( + pub unsafe fn get_physical_device_surface_capabilities( &self, physical_device: vk::PhysicalDevice, surface: vk::SurfaceKHR, @@ -92,7 +92,7 @@ impl Surface { } } - pub unsafe fn get_physical_device_surface_formats_khr( + pub unsafe fn get_physical_device_surface_formats( &self, physical_device: vk::PhysicalDevice, surface: vk::SurfaceKHR, @@ -118,7 +118,7 @@ impl Surface { } } - pub unsafe fn destroy_surface_khr( + pub unsafe fn destroy_surface( &self, surface: vk::SurfaceKHR, allocation_callbacks: Option<&vk::AllocationCallbacks>, diff --git a/ash/src/extensions/swapchain.rs b/ash/src/extensions/khr/swapchain.rs similarity index 94% rename from ash/src/extensions/swapchain.rs rename to ash/src/extensions/khr/swapchain.rs index 5841602..fb24d59 100644 --- a/ash/src/extensions/swapchain.rs +++ b/ash/src/extensions/khr/swapchain.rs @@ -28,7 +28,7 @@ impl Swapchain { CStr::from_bytes_with_nul(b"VK_KHR_swapchain\0").expect("Wrong extension string") } - pub unsafe fn destroy_swapchain_khr( + pub unsafe fn destroy_swapchain( &self, swapchain: vk::SwapchainKHR, allocation_callbacks: Option<&vk::AllocationCallbacks>, @@ -41,7 +41,7 @@ impl Swapchain { } /// On success, returns the next image's index and whether the swapchain is suboptimal for the surface. - pub unsafe fn acquire_next_image_khr( + pub unsafe fn acquire_next_image( &self, swapchain: vk::SwapchainKHR, timeout: u64, @@ -64,7 +64,7 @@ impl Swapchain { } } - pub unsafe fn create_swapchain_khr( + pub unsafe fn create_swapchain( &self, create_info: &vk::SwapchainCreateInfoKHR, allocation_callbacks: Option<&vk::AllocationCallbacks>, @@ -83,7 +83,7 @@ impl Swapchain { } /// On success, returns whether the swapchain is suboptimal for the surface. - pub unsafe fn queue_present_khr( + pub unsafe fn queue_present( &self, queue: vk::Queue, create_info: &vk::PresentInfoKHR, @@ -96,7 +96,7 @@ impl Swapchain { } } - pub unsafe fn get_swapchain_images_khr( + pub unsafe fn get_swapchain_images( &self, swapchain: vk::SwapchainKHR, ) -> VkResult> { diff --git a/ash/src/extensions/wayland_surface.rs b/ash/src/extensions/khr/wayland_surface.rs similarity index 96% rename from ash/src/extensions/wayland_surface.rs rename to ash/src/extensions/khr/wayland_surface.rs index 04cdd2f..7a1608c 100644 --- a/ash/src/extensions/wayland_surface.rs +++ b/ash/src/extensions/khr/wayland_surface.rs @@ -27,7 +27,7 @@ impl WaylandSurface { CStr::from_bytes_with_nul(b"VK_KHR_wayland_surface\0").expect("Wrong extension string") } - pub unsafe fn create_wayland_surface_khr( + pub unsafe fn create_wayland_surface( &self, create_info: &vk::WaylandSurfaceCreateInfoKHR, allocation_callbacks: Option<&vk::AllocationCallbacks>, diff --git a/ash/src/extensions/win32_surface.rs b/ash/src/extensions/khr/win32_surface.rs similarity index 96% rename from ash/src/extensions/win32_surface.rs rename to ash/src/extensions/khr/win32_surface.rs index 15339bd..86daec6 100644 --- a/ash/src/extensions/win32_surface.rs +++ b/ash/src/extensions/khr/win32_surface.rs @@ -27,7 +27,7 @@ impl Win32Surface { CStr::from_bytes_with_nul(b"VK_KHR_win32_surface\0").expect("Wrong extension string") } - pub unsafe fn create_win32_surface_khr( + pub unsafe fn create_win32_surface( &self, create_info: &vk::Win32SurfaceCreateInfoKHR, allocation_callbacks: Option<&vk::AllocationCallbacks>, diff --git a/ash/src/extensions/xcb_surface.rs b/ash/src/extensions/khr/xcb_surface.rs similarity index 96% rename from ash/src/extensions/xcb_surface.rs rename to ash/src/extensions/khr/xcb_surface.rs index 5575533..e3a662d 100644 --- a/ash/src/extensions/xcb_surface.rs +++ b/ash/src/extensions/khr/xcb_surface.rs @@ -27,7 +27,7 @@ impl XcbSurface { CStr::from_bytes_with_nul(b"VK_KHR_xcb_surface\0").expect("Wrong extension string") } - pub unsafe fn create_xcb_surface_khr( + pub unsafe fn create_xcb_surface( &self, create_info: &vk::XcbSurfaceCreateInfoKHR, allocation_callbacks: Option<&vk::AllocationCallbacks>, diff --git a/ash/src/extensions/xlib_surface.rs b/ash/src/extensions/khr/xlib_surface.rs similarity index 96% rename from ash/src/extensions/xlib_surface.rs rename to ash/src/extensions/khr/xlib_surface.rs index 79c3990..ffd9ab1 100644 --- a/ash/src/extensions/xlib_surface.rs +++ b/ash/src/extensions/khr/xlib_surface.rs @@ -27,7 +27,7 @@ impl XlibSurface { CStr::from_bytes_with_nul(b"VK_KHR_xlib_surface\0").expect("Wrong extension string") } - pub unsafe fn create_xlib_surface_khr( + pub unsafe fn create_xlib_surface( &self, create_info: &vk::XlibSurfaceCreateInfoKHR, allocation_callbacks: Option<&vk::AllocationCallbacks>, diff --git a/ash/src/extensions/mod.rs b/ash/src/extensions/mod.rs index 8d28374..fe7443f 100644 --- a/ash/src/extensions/mod.rs +++ b/ash/src/extensions/mod.rs @@ -1,29 +1,4 @@ -pub use self::android_surface::AndroidSurface; -pub use self::debug_marker::DebugMarker; -pub use self::debug_report::DebugReport; -pub use self::debug_utils::DebugUtils; -pub use self::display_swapchain::DisplaySwapchain; -pub use self::ios_surface::IOSSurface; -pub use self::macos_surface::MacOSSurface; -pub use self::mesh_shader::MeshShader; -pub use self::surface::Surface; -pub use self::swapchain::Swapchain; -pub use self::wayland_surface::WaylandSurface; -pub use self::win32_surface::Win32Surface; -pub use self::xcb_surface::XcbSurface; -pub use self::xlib_surface::XlibSurface; - -mod android_surface; -mod debug_marker; -mod debug_report; -mod debug_utils; -mod display_swapchain; -mod ios_surface; -mod macos_surface; -mod mesh_shader; -mod surface; -mod swapchain; -mod wayland_surface; -mod win32_surface; -mod xcb_surface; -mod xlib_surface; +pub mod ext; +pub mod khr; +pub mod mvk; +pub mod nv; diff --git a/ash/src/extensions/ios_surface.rs b/ash/src/extensions/mvk/ios_surface.rs similarity index 100% rename from ash/src/extensions/ios_surface.rs rename to ash/src/extensions/mvk/ios_surface.rs diff --git a/ash/src/extensions/macos_surface.rs b/ash/src/extensions/mvk/macos_surface.rs similarity index 100% rename from ash/src/extensions/macos_surface.rs rename to ash/src/extensions/mvk/macos_surface.rs diff --git a/ash/src/extensions/mvk/mod.rs b/ash/src/extensions/mvk/mod.rs new file mode 100644 index 0000000..e475d53 --- /dev/null +++ b/ash/src/extensions/mvk/mod.rs @@ -0,0 +1,5 @@ +pub use self::ios_surface::IOSSurface; +pub use self::macos_surface::MacOSSurface; + +mod ios_surface; +mod macos_surface; diff --git a/ash/src/extensions/mesh_shader.rs b/ash/src/extensions/nv/mesh_shader.rs similarity index 92% rename from ash/src/extensions/mesh_shader.rs rename to ash/src/extensions/nv/mesh_shader.rs index 988b34b..db08f83 100644 --- a/ash/src/extensions/mesh_shader.rs +++ b/ash/src/extensions/nv/mesh_shader.rs @@ -16,7 +16,7 @@ impl MeshShader { }); MeshShader { mesh_shader_fn } } - pub unsafe fn cmd_draw_mesh_tasks_nv( + pub unsafe fn cmd_draw_mesh_tasks( &self, command_buffer: vk::CommandBuffer, task_count: u32, @@ -25,7 +25,7 @@ impl MeshShader { self.mesh_shader_fn .cmd_draw_mesh_tasks_nv(command_buffer, task_count, first_task); } - pub unsafe fn cmd_draw_mesh_tasks_indirect_nv( + pub unsafe fn cmd_draw_mesh_tasks_indirect( &self, command_buffer: vk::CommandBuffer, buffer: vk::Buffer, @@ -41,7 +41,7 @@ impl MeshShader { stride, ); } - pub unsafe fn cmd_draw_mesh_tasks_indirect_count_nv( + pub unsafe fn cmd_draw_mesh_tasks_indirect_count( &self, command_buffer: vk::CommandBuffer, buffer: vk::Buffer, diff --git a/ash/src/extensions/nv/mod.rs b/ash/src/extensions/nv/mod.rs new file mode 100644 index 0000000..4a8d1e5 --- /dev/null +++ b/ash/src/extensions/nv/mod.rs @@ -0,0 +1,3 @@ +pub use self::mesh_shader::MeshShader; + +mod mesh_shader; diff --git a/examples/src/bin/texture.rs b/examples/src/bin/texture.rs index 1362dcd..f8bc221 100644 --- a/examples/src/bin/texture.rs +++ b/examples/src/bin/texture.rs @@ -715,7 +715,7 @@ fn main() { base.render_loop(|| { let (present_index, _) = base .swapchain_loader - .acquire_next_image_khr( + .acquire_next_image( base.swapchain, std::u64::MAX, base.present_complete_semaphore, @@ -806,7 +806,7 @@ fn main() { .build(); base.swapchain_loader - .queue_present_khr(base.present_queue, &present_info) + .queue_present(base.present_queue, &present_info) .unwrap(); }); base.device.device_wait_idle().unwrap(); diff --git a/examples/src/bin/triangle.rs b/examples/src/bin/triangle.rs index 5e80c3b..612f664 100644 --- a/examples/src/bin/triangle.rs +++ b/examples/src/bin/triangle.rs @@ -354,7 +354,7 @@ fn main() { base.render_loop(|| { let (present_index, _) = base .swapchain_loader - .acquire_next_image_khr( + .acquire_next_image( base.swapchain, std::u64::MAX, base.present_complete_semaphore, @@ -438,7 +438,7 @@ fn main() { .image_indices(&[present_index]) .build(); base.swapchain_loader - .queue_present_khr(base.present_queue, &present_info) + .queue_present(base.present_queue, &present_info) .unwrap(); }); diff --git a/examples/src/lib.rs b/examples/src/lib.rs index 6825b2f..4c494cd 100644 --- a/examples/src/lib.rs +++ b/examples/src/lib.rs @@ -22,18 +22,19 @@ use objc::runtime::YES; #[cfg(target_os = "macos")] use std::mem; -#[cfg(target_os = "macos")] -use ash::extensions::MacOSSurface; -#[cfg(target_os = "windows")] -use ash::extensions::Win32Surface; #[cfg(all(unix, not(target_os = "android"), not(target_os = "macos")))] -use ash::extensions::XlibSurface; -use ash::extensions::{DebugReport, Surface, Swapchain}; +use ash::extensions::khr::XlibSurface; +use ash::extensions::{ + ext::DebugReport, + khr::{Surface, Swapchain}, +}; + +#[cfg(target_os = "windows")] +use ash::extensions::khr::Win32Surface; +#[cfg(target_os = "macos")] +use ash::extensions::mvk::MacOSSurface; pub use ash::version::{DeviceV1_0, EntryV1_0, InstanceV1_0}; -use ash::vk; -use ash::Device; -use ash::Entry; -use ash::Instance; +use ash::{vk, Device, Entry, Instance}; use std::cell::RefCell; use std::default::Default; use std::ffi::{CStr, CString}; @@ -144,7 +145,7 @@ unsafe fn create_surface( .dpy(x11_display as *mut vk::Display) .build(); let xlib_surface_loader = XlibSurface::new(entry, instance); - xlib_surface_loader.create_xlib_surface_khr(&x11_create_info, None) + xlib_surface_loader.create_xlib_surface(&x11_create_info, None) } #[cfg(target_os = "macos")] @@ -200,7 +201,7 @@ unsafe fn create_surface( hwnd: hwnd as *const c_void, }; let win32_surface_loader = Win32Surface::new(entry, instance); - win32_surface_loader.create_win32_surface_khr(&win32_create_info, None) + win32_surface_loader.create_win32_surface(&win32_create_info, None) } #[cfg(all(unix, not(target_os = "android"), not(target_os = "macos")))] @@ -388,7 +389,7 @@ impl ExampleBase { let debug_report_loader = DebugReport::new(&entry, &instance); let debug_call_back = debug_report_loader - .create_debug_report_callback_ext(&debug_info, None) + .create_debug_report_callback(&debug_info, None) .unwrap(); let surface = create_surface(&entry, &instance, &window).unwrap(); let pdevices = instance @@ -405,7 +406,7 @@ impl ExampleBase { .filter_map(|(index, ref info)| { let supports_graphic_and_surface = info.queue_flags.contains(vk::QueueFlags::GRAPHICS) - && surface_loader.get_physical_device_surface_support_khr( + && surface_loader.get_physical_device_surface_support( *pdevice, index as u32, surface, @@ -443,7 +444,7 @@ impl ExampleBase { let present_queue = device.get_device_queue(queue_family_index as u32, 0); let surface_formats = surface_loader - .get_physical_device_surface_formats_khr(pdevice, surface) + .get_physical_device_surface_formats(pdevice, surface) .unwrap(); let surface_format = surface_formats .iter() @@ -456,7 +457,7 @@ impl ExampleBase { }).nth(0) .expect("Unable to find suitable surface format."); let surface_capabilities = surface_loader - .get_physical_device_surface_capabilities_khr(pdevice, surface) + .get_physical_device_surface_capabilities(pdevice, surface) .unwrap(); let mut desired_image_count = surface_capabilities.min_image_count + 1; if surface_capabilities.max_image_count > 0 @@ -480,7 +481,7 @@ impl ExampleBase { surface_capabilities.current_transform }; let present_modes = surface_loader - .get_physical_device_surface_present_modes_khr(pdevice, surface) + .get_physical_device_surface_present_modes(pdevice, surface) .unwrap(); let present_mode = present_modes .iter() @@ -503,7 +504,7 @@ impl ExampleBase { .image_array_layers(1) .build(); let swapchain = swapchain_loader - .create_swapchain_khr(&swapchain_create_info, None) + .create_swapchain(&swapchain_create_info, None) .unwrap(); let pool_create_info = vk::CommandPoolCreateInfo::builder() @@ -525,9 +526,7 @@ impl ExampleBase { let setup_command_buffer = command_buffers[0]; let draw_command_buffer = command_buffers[1]; - let present_images = swapchain_loader - .get_swapchain_images_khr(swapchain) - .unwrap(); + let present_images = swapchain_loader.get_swapchain_images(swapchain).unwrap(); let present_image_views: Vec = present_images .iter() .map(|&image| { @@ -689,11 +688,11 @@ impl Drop for ExampleBase { } self.device.destroy_command_pool(self.pool, None); self.swapchain_loader - .destroy_swapchain_khr(self.swapchain, None); + .destroy_swapchain(self.swapchain, None); self.device.destroy_device(None); - self.surface_loader.destroy_surface_khr(self.surface, None); + self.surface_loader.destroy_surface(self.surface, None); self.debug_report_loader - .destroy_debug_report_callback_ext(self.debug_call_back, None); + .destroy_debug_report_callback(self.debug_call_back, None); self.instance.destroy_instance(None); } }