mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-25 16:25:31 +00:00
parent
08691ba2a5
commit
b2897a419f
@ -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" }
|
||||
|
@ -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"
|
||||
|
@ -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())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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())
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user