Remove the mir sufrace extension because it has been deprecated

This commit is contained in:
Maik Klein 2018-10-02 15:23:38 +02:00
parent c62172bdf8
commit 33dc8bff8f
2 changed files with 0 additions and 52 deletions

View file

@ -1,50 +0,0 @@
#![allow(dead_code)]
use prelude::*;
use std::ffi::CStr;
use std::mem;
use version::{EntryV1_0, InstanceV1_0};
use vk;
use RawPtr;
#[derive(Clone)]
pub struct MirSurface {
handle: vk::Instance,
mir_surface_fn: vk::KhrMirSurfaceFn,
}
impl MirSurface {
pub fn new<E: EntryV1_0, I: InstanceV1_0>(
entry: &E,
instance: &I,
) -> Result<MirSurface, Vec<&'static str>> {
let surface_fn = vk::KhrMirSurfaceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr()))
})?;
Ok(MirSurface {
handle: instance.handle(),
mir_surface_fn: surface_fn,
})
}
pub fn name() -> &'static CStr {
CStr::from_bytes_with_nul(b"VK_KHR_mir_surface\0").expect("Wrong extension string")
}
pub unsafe fn create_mir_surface_khr(
&self,
create_info: &vk::MirSurfaceCreateInfoKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::uninitialized();
let err_code = self.mir_surface_fn.create_mir_surface_khr(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut surface,
);
match err_code {
vk::Result::SUCCESS => Ok(surface),
_ => Err(err_code),
}
}
}

View file

@ -5,7 +5,6 @@ pub use self::debug_utils::DebugUtils;
pub use self::display_swapchain::DisplaySwapchain; pub use self::display_swapchain::DisplaySwapchain;
pub use self::ios_surface::IOSSurface; pub use self::ios_surface::IOSSurface;
pub use self::macos_surface::MacOSSurface; pub use self::macos_surface::MacOSSurface;
pub use self::mir_surface::MirSurface;
pub use self::surface::Surface; pub use self::surface::Surface;
pub use self::swapchain::Swapchain; pub use self::swapchain::Swapchain;
pub use self::wayland_surface::WaylandSurface; pub use self::wayland_surface::WaylandSurface;
@ -20,7 +19,6 @@ mod debug_utils;
mod display_swapchain; mod display_swapchain;
mod ios_surface; mod ios_surface;
mod macos_surface; mod macos_surface;
mod mir_surface;
mod surface; mod surface;
mod swapchain; mod swapchain;
mod wayland_surface; mod wayland_surface;