From c620aefd29d03bc0330a44fd2e2df8a5160e9d7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Miguel=20S=C3=A1nchez=20Garc=C3=ADa?= Date: Fri, 31 Jan 2020 23:37:06 +0100 Subject: [PATCH] Add 's' to dimension in Swapchain::recreate_with_dimension (#1315) --- CHANGELOG_VULKANO.md | 1 + examples/src/bin/deferred/main.rs | 2 +- examples/src/bin/image/main.rs | 2 +- examples/src/bin/indirect.rs | 2 +- examples/src/bin/instancing.rs | 2 +- examples/src/bin/multi-window.rs | 2 +- examples/src/bin/runtime-shader/main.rs | 2 +- examples/src/bin/teapot/main.rs | 2 +- examples/src/bin/tessellation.rs | 2 +- examples/src/bin/triangle.rs | 2 +- vulkano/src/swapchain/mod.rs | 2 +- vulkano/src/swapchain/swapchain.rs | 2 +- 12 files changed, 12 insertions(+), 11 deletions(-) diff --git a/CHANGELOG_VULKANO.md b/CHANGELOG_VULKANO.md index 78cfc5a4..820b8536 100644 --- a/CHANGELOG_VULKANO.md +++ b/CHANGELOG_VULKANO.md @@ -1,5 +1,6 @@ # Version 0.17.0 (TBA) +- **Breaking** Swapchain::recreate_with_dimension() is now Swapchain::recreate_with_dimensions() - **Breaking** Sync::SharingMode::Exclusive(queue_family: u32) is now Sync::SharingMode::Exclusive. - **Breaking** Added Swapchain::with_old_swapchain() - same as previous Swapchain::new(), if an oldswapchain needs to be used - **Breaking** Swapchain::new() now doesnt need to have the old_swapchain parameter anymore but requires the ColorSpace diff --git a/examples/src/bin/deferred/main.rs b/examples/src/bin/deferred/main.rs index 5236a7fe..f8af522c 100644 --- a/examples/src/bin/deferred/main.rs +++ b/examples/src/bin/deferred/main.rs @@ -101,7 +101,7 @@ fn main() { if recreate_swapchain { let dimensions: [u32; 2] = surface.window().inner_size().into(); - let (new_swapchain, new_images) = match swapchain.recreate_with_dimension(dimensions) { + let (new_swapchain, new_images) = match swapchain.recreate_with_dimensions(dimensions) { Ok(r) => r, Err(SwapchainCreationError::UnsupportedDimensions) => return, Err(e) => panic!("Failed to recreate swapchain: {:?}", e) diff --git a/examples/src/bin/image/main.rs b/examples/src/bin/image/main.rs index 59792b6e..00a5cbc5 100644 --- a/examples/src/bin/image/main.rs +++ b/examples/src/bin/image/main.rs @@ -162,7 +162,7 @@ fn main() { if recreate_swapchain { let dimensions: [u32; 2] = surface.window().inner_size().into(); - let (new_swapchain, new_images) = match swapchain.recreate_with_dimension(dimensions) { + let (new_swapchain, new_images) = match swapchain.recreate_with_dimensions(dimensions) { Ok(r) => r, Err(SwapchainCreationError::UnsupportedDimensions) => return, Err(e) => panic!("Failed to recreate swapchain: {:?}", e) diff --git a/examples/src/bin/indirect.rs b/examples/src/bin/indirect.rs index 82069338..6fae78c5 100644 --- a/examples/src/bin/indirect.rs +++ b/examples/src/bin/indirect.rs @@ -219,7 +219,7 @@ fn main() { if recreate_swapchain { let dimensions: [u32; 2] = surface.window().inner_size().into(); - let (new_swapchain, new_images) = match swapchain.recreate_with_dimension(dimensions) { + let (new_swapchain, new_images) = match swapchain.recreate_with_dimensions(dimensions) { Ok(r) => r, Err(SwapchainCreationError::UnsupportedDimensions) => return, Err(e) => panic!("Failed to recreate swapchain: {:?}", e) diff --git a/examples/src/bin/instancing.rs b/examples/src/bin/instancing.rs index a20b44ca..8d9ba7e8 100644 --- a/examples/src/bin/instancing.rs +++ b/examples/src/bin/instancing.rs @@ -208,7 +208,7 @@ fn main() { if recreate_swapchain { let dimensions: [u32; 2] = surface.window().inner_size().into(); - let (new_swapchain, new_images) = match swapchain.recreate_with_dimension(dimensions) { + let (new_swapchain, new_images) = match swapchain.recreate_with_dimensions(dimensions) { Ok(r) => r, Err(SwapchainCreationError::UnsupportedDimensions) => return, Err(e) => panic!("Failed to recreate swapchain: {:?}", e) diff --git a/examples/src/bin/multi-window.rs b/examples/src/bin/multi-window.rs index 8683b090..1a14e20a 100644 --- a/examples/src/bin/multi-window.rs +++ b/examples/src/bin/multi-window.rs @@ -216,7 +216,7 @@ fn main() { if *recreate_swapchain { let dimensions: [u32; 2] = surface.window().inner_size().into(); - let (new_swapchain, new_images) = match swapchain.recreate_with_dimension(dimensions) { + let (new_swapchain, new_images) = match swapchain.recreate_with_dimensions(dimensions) { Ok(r) => r, Err(SwapchainCreationError::UnsupportedDimensions) => return, Err(e) => panic!("Failed to recreate swapchain: {:?}", e) diff --git a/examples/src/bin/runtime-shader/main.rs b/examples/src/bin/runtime-shader/main.rs index 3d702701..dbcf3f0e 100644 --- a/examples/src/bin/runtime-shader/main.rs +++ b/examples/src/bin/runtime-shader/main.rs @@ -396,7 +396,7 @@ fn main() { if recreate_swapchain { let dimensions: [u32; 2] = surface.window().inner_size().into(); - let (new_swapchain, new_images) = match swapchain.recreate_with_dimension(dimensions) { + let (new_swapchain, new_images) = match swapchain.recreate_with_dimensions(dimensions) { Ok(r) => r, Err(SwapchainCreationError::UnsupportedDimensions) => return, Err(e) => panic!("Failed to recreate swapchain: {:?}", e) diff --git a/examples/src/bin/teapot/main.rs b/examples/src/bin/teapot/main.rs index c6285fed..64620c10 100644 --- a/examples/src/bin/teapot/main.rs +++ b/examples/src/bin/teapot/main.rs @@ -130,7 +130,7 @@ fn main() { if recreate_swapchain { let dimensions: [u32; 2] = surface.window().inner_size().into(); - let (new_swapchain, new_images) = match swapchain.recreate_with_dimension(dimensions) { + let (new_swapchain, new_images) = match swapchain.recreate_with_dimensions(dimensions) { Ok(r) => r, Err(SwapchainCreationError::UnsupportedDimensions) => return, Err(e) => panic!("Failed to recreate swapchain: {:?}", e) diff --git a/examples/src/bin/tessellation.rs b/examples/src/bin/tessellation.rs index 54f3fc1a..44a686b5 100644 --- a/examples/src/bin/tessellation.rs +++ b/examples/src/bin/tessellation.rs @@ -238,7 +238,7 @@ fn main() { if recreate_swapchain { let dimensions: [u32; 2] = surface.window().inner_size().into(); - let (new_swapchain, new_images) = match swapchain.recreate_with_dimension(dimensions) { + let (new_swapchain, new_images) = match swapchain.recreate_with_dimensions(dimensions) { Ok(r) => r, Err(SwapchainCreationError::UnsupportedDimensions) => return, Err(e) => panic!("Failed to recreate swapchain: {:?}", e) diff --git a/examples/src/bin/triangle.rs b/examples/src/bin/triangle.rs index abf5a26e..3b12974e 100644 --- a/examples/src/bin/triangle.rs +++ b/examples/src/bin/triangle.rs @@ -324,7 +324,7 @@ fn main() { if recreate_swapchain { // Get the new dimensions of the window. let dimensions: [u32; 2] = surface.window().inner_size().into(); - let (new_swapchain, new_images) = match swapchain.recreate_with_dimension(dimensions) { + let (new_swapchain, new_images) = match swapchain.recreate_with_dimensions(dimensions) { Ok(r) => r, // This error tends to happen when the user is manually resizing the window. // Simply restarting the loop is the easiest way to fix this issue. diff --git a/vulkano/src/swapchain/mod.rs b/vulkano/src/swapchain/mod.rs index b9ee7fdd..11f78bb6 100644 --- a/vulkano/src/swapchain/mod.rs +++ b/vulkano/src/swapchain/mod.rs @@ -276,7 +276,7 @@ //! //! loop { //! if recreate_swapchain { -//! swapchain = swapchain.0.recreate_with_dimension([1024, 768]).unwrap(); +//! swapchain = swapchain.0.recreate_with_dimensions([1024, 768]).unwrap(); //! recreate_swapchain = false; //! } //! diff --git a/vulkano/src/swapchain/swapchain.rs b/vulkano/src/swapchain/swapchain.rs index 80c5b7af..2e058515 100644 --- a/vulkano/src/swapchain/swapchain.rs +++ b/vulkano/src/swapchain/swapchain.rs @@ -295,7 +295,7 @@ impl Swapchain { } /// Recreates the swapchain with new dimensions. - pub fn recreate_with_dimension( + pub fn recreate_with_dimensions( &self, dimensions: [u32; 2]) -> Result<(Arc>, Vec>>), SwapchainCreationError> { Swapchain::new_inner(self.device.clone(),