diff --git a/examples/src/bin/image.rs b/examples/src/bin/image.rs index 024e137a..dc422f37 100644 --- a/examples/src/bin/image.rs +++ b/examples/src/bin/image.rs @@ -36,7 +36,7 @@ fn main() { let events_loop = winit::EventsLoop::new(); let window = winit::WindowBuilder::new().build_vk_surface(&events_loop, &instance).unwrap(); - let queue = physical.queue_families().find(|q| q.supports_graphics() && + let queue = physical.queue_families().find(|&q| q.supports_graphics() && window.surface().is_supported(q).unwrap_or(false)) .expect("couldn't find a graphical queue family"); @@ -50,7 +50,7 @@ fn main() { let queue = queues.next().unwrap(); let (swapchain, images) = { - let caps = window.surface().get_capabilities(&physical).expect("failed to get surface capabilities"); + let caps = window.surface().capabilities(physical).expect("failed to get surface capabilities"); let dimensions = caps.current_extent.unwrap_or([1280, 1024]); let present = caps.present_modes.iter().next().unwrap(); diff --git a/examples/src/bin/teapot.rs b/examples/src/bin/teapot.rs index 923c4f0a..c886444f 100644 --- a/examples/src/bin/teapot.rs +++ b/examples/src/bin/teapot.rs @@ -40,7 +40,7 @@ fn main() { let events_loop = winit::EventsLoop::new(); let window = winit::WindowBuilder::new().build_vk_surface(&events_loop, &instance).unwrap(); - let queue = physical.queue_families().find(|q| q.supports_graphics() && + let queue = physical.queue_families().find(|&q| q.supports_graphics() && window.surface().is_supported(q).unwrap_or(false)) .expect("couldn't find a graphical queue family"); @@ -55,7 +55,7 @@ fn main() { let queue = queues.next().unwrap(); let (swapchain, images) = { - let caps = window.surface().get_capabilities(&physical).expect("failed to get surface capabilities"); + let caps = window.surface().capabilities(physical).expect("failed to get surface capabilities"); let dimensions = caps.current_extent.unwrap_or([1280, 1024]); let present = caps.present_modes.iter().next().unwrap(); diff --git a/examples/src/bin/triangle.rs b/examples/src/bin/triangle.rs index f673eb31..be6603ee 100644 --- a/examples/src/bin/triangle.rs +++ b/examples/src/bin/triangle.rs @@ -118,7 +118,7 @@ fn main() { // queue to handle data transfers in parallel. In this example we only use one queue. // // We have to choose which queues to use early on, because we will need this info very soon. - let queue = physical.queue_families().find(|q| { + let queue = physical.queue_families().find(|&q| { // We take the first queue that supports drawing to our window. q.supports_graphics() && window.surface().is_supported(q).unwrap_or(false) }).expect("couldn't find a graphical queue family"); @@ -163,7 +163,7 @@ fn main() { let (swapchain, images) = { // Querying the capabilities of the surface. When we create the swapchain we can only // pass values that are allowed by the capabilities. - let caps = window.surface().get_capabilities(&physical) + let caps = window.surface().capabilities(physical) .expect("failed to get surface capabilities"); // We choose the dimensions of the swapchain to match the current dimensions of the window. diff --git a/vulkano/src/swapchain/surface.rs b/vulkano/src/swapchain/surface.rs index 4f7a435c..89391cc7 100644 --- a/vulkano/src/swapchain/surface.rs +++ b/vulkano/src/swapchain/surface.rs @@ -366,7 +366,7 @@ impl Surface { } /// Returns true if the given queue family can draw on this surface. - pub fn is_supported(&self, queue: &QueueFamily) -> Result { + pub fn is_supported(&self, queue: QueueFamily) -> Result { unsafe { let vk = self.instance.pointers();