From b6c4d84e6168b7f281adf71822eb9668ce335f06 Mon Sep 17 00:00:00 2001 From: Lucas Kent Date: Wed, 3 Oct 2018 07:44:48 +1000 Subject: [PATCH] Removed mir support (#1060) --- CHANGELOG.md | 1 + vk-sys/src/lib.rs | 15 --------- vulkano-win/src/lib.rs | 1 - vulkano/src/instance/extensions.rs | 1 - vulkano/src/swapchain/mod.rs | 3 +- vulkano/src/swapchain/surface.rs | 53 ------------------------------ 6 files changed, 2 insertions(+), 72 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54914ae2..8b11c4e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Unreleased (Breaking) +- Removed mir support, as it is being removed from the vulkan spec. - Remove vulkano_shaders::build_glsl_shaders - Split `PersistentDescriptorSetError::MissingUsage` into `MissingImageUsage` and `MissingBufferUsage` each with a matching enum indicating the usage that was missing. diff --git a/vk-sys/src/lib.rs b/vk-sys/src/lib.rs index 2bdcb03f..2a71bc06 100644 --- a/vk-sys/src/lib.rs +++ b/vk-sys/src/lib.rs @@ -161,7 +161,6 @@ pub const STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR: u32 = 1000003000; pub const STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR: u32 = 1000004000; pub const STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR: u32 = 1000005000; pub const STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR: u32 = 1000006000; -pub const STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR: u32 = 1000007000; pub const STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR: u32 = 1000008000; pub const STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR: u32 = 1000009000; #[deprecated(note = "Use STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT instead")] @@ -2394,18 +2393,6 @@ pub struct WaylandSurfaceCreateInfoKHR { pub surface: *mut c_void, } - -pub type MirSurfaceCreateFlagsKHR = Flags; - -#[repr(C)] -pub struct MirSurfaceCreateInfoKHR { - pub sType: StructureType, - pub pNext: *const c_void, - pub flags: MirSurfaceCreateFlagsKHR, - pub connection: *mut c_void, - pub mirSurface: *mut c_void, -} - pub type AndroidSurfaceCreateFlagsKHR = Flags; #[repr(C)] @@ -2757,8 +2744,6 @@ ptrs!(InstancePointers, { GetPhysicalDeviceXcbPresentationSupportKHR => (physicalDevice: PhysicalDevice, queueFamilyIndex: u32, connection: *mut c_void, visual_id: u32 /* FIXME: xcb_visualid */) -> Bool32, CreateWaylandSurfaceKHR => (instance: Instance, pCreateInfo: *const WaylandSurfaceCreateInfoKHR, pAllocator: *const AllocationCallbacks, pSurface: *mut SurfaceKHR) -> Result, GetPhysicalDeviceWaylandPresentationSupportKHR => (physicalDevice: PhysicalDevice, queueFamilyIndex: u32, display: *mut c_void) -> Bool32, - CreateMirSurfaceKHR => (instance: Instance, pCreateInfo: *const MirSurfaceCreateInfoKHR, pAllocator: *const AllocationCallbacks, pSurface: *mut SurfaceKHR) -> Result, - GetPhysicalDeviceMirPresentationSupportKHR => (physicalDevice: PhysicalDevice, queueFamilyIndex: u32, connection: *mut c_void) -> Bool32, CreateAndroidSurfaceKHR => (instance: Instance, pCreateInfo: *const AndroidSurfaceCreateInfoKHR, pAllocator: *const AllocationCallbacks, pSurface: *mut SurfaceKHR) -> Result, CreateWin32SurfaceKHR => (instance: Instance, pCreateInfo: *const Win32SurfaceCreateInfoKHR, pAllocator: *const AllocationCallbacks, pSurface: *mut SurfaceKHR) -> Result, GetPhysicalDeviceWin32PresentationSupportKHR => (physicalDevice: PhysicalDevice, queueFamilyIndex: u32) -> Bool32, diff --git a/vulkano-win/src/lib.rs b/vulkano-win/src/lib.rs index b969db38..276fc9ae 100644 --- a/vulkano-win/src/lib.rs +++ b/vulkano-win/src/lib.rs @@ -41,7 +41,6 @@ pub fn required_extensions() -> InstanceExtensions { khr_xlib_surface: true, khr_xcb_surface: true, khr_wayland_surface: true, - khr_mir_surface: true, khr_android_surface: true, khr_win32_surface: true, mvk_ios_surface: true, diff --git a/vulkano/src/instance/extensions.rs b/vulkano/src/instance/extensions.rs index 1a412418..af28b83e 100644 --- a/vulkano/src/instance/extensions.rs +++ b/vulkano/src/instance/extensions.rs @@ -377,7 +377,6 @@ instance_extensions! { khr_xlib_surface => b"VK_KHR_xlib_surface", khr_xcb_surface => b"VK_KHR_xcb_surface", khr_wayland_surface => b"VK_KHR_wayland_surface", - khr_mir_surface => b"VK_KHR_mir_surface", khr_android_surface => b"VK_KHR_android_surface", khr_win32_surface => b"VK_KHR_win32_surface", ext_debug_report => b"VK_EXT_debug_report", diff --git a/vulkano/src/swapchain/mod.rs b/vulkano/src/swapchain/mod.rs index a8279118..a7beb0fb 100644 --- a/vulkano/src/swapchain/mod.rs +++ b/vulkano/src/swapchain/mod.rs @@ -31,12 +31,11 @@ //! //! ## Creating a surface from a window //! -//! There are 6 extensions that each allow you to create a surface from a type of window: +//! There are 5 extensions that each allow you to create a surface from a type of window: //! //! - `VK_KHR_xlib_surface` //! - `VK_KHR_xcb_surface` //! - `VK_KHR_wayland_surface` -//! - `VK_KHR_mir_surface` //! - `VK_KHR_android_surface` //! - `VK_KHR_win32_surface` //! diff --git a/vulkano/src/swapchain/surface.rs b/vulkano/src/swapchain/surface.rs index 11bd0907..bfb676c4 100644 --- a/vulkano/src/swapchain/surface.rs +++ b/vulkano/src/swapchain/surface.rs @@ -291,50 +291,6 @@ impl Surface { })) } - /// Creates a `Surface` from a MIR window. - /// - /// If the swapchain's dimensions does not match the window's dimensions, the image will - /// automatically be scaled during presentation. - /// - /// # Safety - /// - /// The caller must ensure that the `connection` and the `surface` are both correct and stay - /// alive for the entire lifetime of the surface. The `win` parameter can be used to ensure this. - pub unsafe fn from_mir(instance: Arc, connection: *const C, - surface: *const S, - win: W) - -> Result>, SurfaceCreationError> { - let vk = instance.pointers(); - - if !instance.loaded_extensions().khr_mir_surface { - return Err(SurfaceCreationError::MissingExtension { name: "VK_KHR_mir_surface" }); - } - - let surface = { - let infos = vk::MirSurfaceCreateInfoKHR { - sType: vk::STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR, - pNext: ptr::null(), - flags: 0, // reserved - connection: connection as *mut _, - mirSurface: surface as *mut _, - }; - - let mut output = mem::uninitialized(); - check_errors(vk.CreateMirSurfaceKHR(instance.internal_object(), - &infos, - ptr::null(), - &mut output))?; - output - }; - - Ok(Arc::new(Surface { - window: win, - instance: instance.clone(), - surface: surface, - has_swapchain: AtomicBool::new(false), - })) - } - /// Creates a `Surface` from an Android window. /// /// # Safety @@ -803,15 +759,6 @@ mod tests { } } - #[test] - fn khr_mir_surface_ext_missing() { - let instance = instance!(); - match unsafe { Surface::from_mir(instance, ptr::null::(), ptr::null::(), ()) } { - Err(SurfaceCreationError::MissingExtension { .. }) => (), - _ => panic!(), - } - } - #[test] fn khr_android_surface_ext_missing() { let instance = instance!();