Support for intel linux driver

fixes #204
This commit is contained in:
Nicolas Koch 2016-07-31 12:33:08 +02:00
parent 08691ba2a5
commit b2897a419f
4 changed files with 14 additions and 7 deletions

View File

@ -9,7 +9,7 @@ vulkano = { path = "../vulkano" }
vulkano-win = { path = "../vulkano-win" }
cgmath = "0.7.0"
image = "0.6.1"
winit = "0.5.1"
winit = "0.5.2"
[build-dependencies]
vk-sys = { path = "../vk-sys" }

View File

@ -8,4 +8,4 @@ license = "MIT/Apache-2.0"
[dependencies]
vulkano = { version = "0.2.0", path = "../vulkano" }
winit = "0.5.1"
winit = "0.5.2"

View File

@ -126,10 +126,17 @@ unsafe fn winit_to_surface(instance: &Arc<Instance>,
match (win.get_wayland_display(), win.get_wayland_surface()) {
(Some(display), Some(surface)) => Surface::from_wayland(instance, display, surface),
_ => {
// No wayland display found, assume xlib will work.
Surface::from_xlib(instance,
win.get_xlib_display().unwrap(),
win.get_xlib_window().unwrap())
// No wayland display found, check if we can use xlib.
// If not, we use xcb.
if instance.loaded_extensions().khr_xlib_surface {
Surface::from_xlib(instance,
win.get_xlib_display().unwrap(),
win.get_xlib_window().unwrap())
} else {
Surface::from_xcb(instance,
win.get_xcb_connection().unwrap(),
win.get_xlib_window().unwrap())
}
}
}
}

View File

@ -395,7 +395,7 @@ impl Surface {
modes.as_mut_ptr())
));
modes.set_len(num as usize);
debug_assert!(modes.iter().find(|&&m| m == vk::PRESENT_MODE_FIFO_KHR).is_some());
debug_assert!(modes.iter().count() > 0);
SupportedPresentModes::from_list(modes.into_iter())
};