mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2025-02-16 17:12:29 +00:00
Fixes all examples to use at least two swapchain buffers (#2218)
* Fixes all examples to use at least two swapchain buffers. * Fix build error
This commit is contained in:
parent
d8e504b015
commit
cd9f081e3a
@ -237,7 +237,8 @@ fn main() {
|
||||
device.clone(),
|
||||
surface,
|
||||
SwapchainCreateInfo {
|
||||
min_image_count: surface_capabilities.min_image_count,
|
||||
// Some drivers report `min_image_count=1` but fullscreen mode requires at least 2.
|
||||
min_image_count: surface_capabilities.min_image_count.max(2),
|
||||
image_format,
|
||||
image_extent: window.inner_size().into(),
|
||||
image_usage: ImageUsage::COLOR_ATTACHMENT,
|
||||
|
@ -141,7 +141,8 @@ fn main() {
|
||||
device.clone(),
|
||||
surface,
|
||||
SwapchainCreateInfo {
|
||||
min_image_count: surface_capabilities.min_image_count,
|
||||
// Some drivers report `min_image_count=1` but fullscreen mode requires at least 2.
|
||||
min_image_count: surface_capabilities.min_image_count.max(2),
|
||||
image_format,
|
||||
image_extent: window.inner_size().into(),
|
||||
image_usage: ImageUsage::COLOR_ATTACHMENT,
|
||||
|
@ -119,7 +119,8 @@ fn main() {
|
||||
device.clone(),
|
||||
surface,
|
||||
SwapchainCreateInfo {
|
||||
min_image_count: surface_capabilities.min_image_count,
|
||||
// Some drivers report `min_image_count=1` but fullscreen mode requires at least 2.
|
||||
min_image_count: surface_capabilities.min_image_count.max(2),
|
||||
image_format,
|
||||
image_extent: window.inner_size().into(),
|
||||
image_usage: ImageUsage::COLOR_ATTACHMENT,
|
||||
|
@ -141,7 +141,8 @@ fn main() {
|
||||
device.clone(),
|
||||
surface,
|
||||
SwapchainCreateInfo {
|
||||
min_image_count: surface_capabilities.min_image_count,
|
||||
// Some drivers report `min_image_count=1` but fullscreen mode requires at least 2.
|
||||
min_image_count: surface_capabilities.min_image_count.max(2),
|
||||
image_format,
|
||||
image_extent: window.inner_size().into(),
|
||||
image_usage: ImageUsage::COLOR_ATTACHMENT,
|
||||
|
@ -534,7 +534,8 @@ mod linux {
|
||||
device.clone(),
|
||||
surface,
|
||||
SwapchainCreateInfo {
|
||||
min_image_count: surface_capabilities.min_image_count,
|
||||
// Some drivers report `min_image_count=1` but fullscreen mode requires at least 2.
|
||||
min_image_count: surface_capabilities.min_image_count.max(2),
|
||||
image_format,
|
||||
image_extent: window.inner_size().into(),
|
||||
image_usage: ImageUsage::COLOR_ATTACHMENT,
|
||||
|
@ -145,7 +145,8 @@ fn main() {
|
||||
device.clone(),
|
||||
surface,
|
||||
SwapchainCreateInfo {
|
||||
min_image_count: surface_capabilities.min_image_count,
|
||||
// Some drivers report `min_image_count=1` but fullscreen mode requires at least 2.
|
||||
min_image_count: surface_capabilities.min_image_count.max(2),
|
||||
image_format,
|
||||
image_extent: window.inner_size().into(),
|
||||
image_usage: ImageUsage::COLOR_ATTACHMENT,
|
||||
|
@ -143,7 +143,8 @@ fn main() {
|
||||
device.clone(),
|
||||
surface,
|
||||
SwapchainCreateInfo {
|
||||
min_image_count: surface_capabilities.min_image_count,
|
||||
// Some drivers report `min_image_count=1` but fullscreen mode requires at least 2.
|
||||
min_image_count: surface_capabilities.min_image_count.max(2),
|
||||
image_format,
|
||||
image_extent: window.inner_size().into(),
|
||||
image_usage: ImageUsage::COLOR_ATTACHMENT,
|
||||
|
@ -149,7 +149,8 @@ fn main() {
|
||||
device.clone(),
|
||||
surface,
|
||||
SwapchainCreateInfo {
|
||||
min_image_count: surface_capabilities.min_image_count,
|
||||
// Some drivers report `min_image_count=1` but fullscreen mode requires at least 2.
|
||||
min_image_count: surface_capabilities.min_image_count.max(2),
|
||||
image_format,
|
||||
image_extent: window.inner_size().into(),
|
||||
image_usage: ImageUsage::COLOR_ATTACHMENT,
|
||||
|
@ -158,7 +158,8 @@ fn main() {
|
||||
device.clone(),
|
||||
surface,
|
||||
SwapchainCreateInfo {
|
||||
min_image_count: surface_capabilities.min_image_count,
|
||||
// Some drivers report `min_image_count=1` but fullscreen mode requires at least 2.
|
||||
min_image_count: surface_capabilities.min_image_count.max(2),
|
||||
image_format,
|
||||
image_extent: window.inner_size().into(),
|
||||
image_usage: ImageUsage::COLOR_ATTACHMENT,
|
||||
|
@ -157,7 +157,8 @@ fn main() {
|
||||
device.clone(),
|
||||
surface,
|
||||
SwapchainCreateInfo {
|
||||
min_image_count: surface_capabilities.min_image_count,
|
||||
// Some drivers report `min_image_count=1` but fullscreen mode requires at least 2.
|
||||
min_image_count: surface_capabilities.min_image_count.max(2),
|
||||
image_format,
|
||||
image_extent: window.inner_size().into(),
|
||||
image_usage: ImageUsage::COLOR_ATTACHMENT,
|
||||
|
@ -166,7 +166,8 @@ fn main() {
|
||||
device.clone(),
|
||||
surface.clone(),
|
||||
SwapchainCreateInfo {
|
||||
min_image_count: surface_caps.min_image_count,
|
||||
// Some drivers report `min_image_count=1` but fullscreen mode requires at least 2.
|
||||
min_image_count: surface_caps.min_image_count.max(2),
|
||||
image_format,
|
||||
image_extent: window.inner_size().into(),
|
||||
image_usage: ImageUsage::COLOR_ATTACHMENT,
|
||||
@ -374,7 +375,8 @@ fn main() {
|
||||
device.clone(),
|
||||
surface,
|
||||
SwapchainCreateInfo {
|
||||
min_image_count: surface_caps.min_image_count,
|
||||
// Some drivers report `min_image_count=1` but fullscreen mode requires at least 2.
|
||||
min_image_count: surface_caps.min_image_count.max(2),
|
||||
image_format,
|
||||
image_extent: window.inner_size().into(),
|
||||
image_usage: ImageUsage::COLOR_ATTACHMENT,
|
||||
|
@ -139,7 +139,8 @@ fn main() {
|
||||
device.clone(),
|
||||
surface,
|
||||
SwapchainCreateInfo {
|
||||
min_image_count: surface_capabilities.min_image_count,
|
||||
// Some drivers report `min_image_count=1` but fullscreen mode requires at least 2.
|
||||
min_image_count: surface_capabilities.min_image_count.max(2),
|
||||
image_format,
|
||||
image_extent: window.inner_size().into(),
|
||||
image_usage: ImageUsage::COLOR_ATTACHMENT,
|
||||
|
@ -139,7 +139,8 @@ fn main() {
|
||||
device.clone(),
|
||||
surface,
|
||||
SwapchainCreateInfo {
|
||||
min_image_count: surface_capabilities.min_image_count,
|
||||
// Some drivers report `min_image_count=1` but fullscreen mode requires at least 2.
|
||||
min_image_count: surface_capabilities.min_image_count.max(2),
|
||||
image_format,
|
||||
image_extent: window.inner_size().into(),
|
||||
image_usage: ImageUsage::COLOR_ATTACHMENT,
|
||||
|
@ -146,7 +146,8 @@ fn main() {
|
||||
device.clone(),
|
||||
surface,
|
||||
SwapchainCreateInfo {
|
||||
min_image_count: surface_capabilities.min_image_count,
|
||||
// Some drivers report `min_image_count=1` but fullscreen mode requires at least 2.
|
||||
min_image_count: surface_capabilities.min_image_count.max(2),
|
||||
image_format,
|
||||
image_extent: window.inner_size().into(),
|
||||
image_usage: ImageUsage::COLOR_ATTACHMENT,
|
||||
|
@ -150,7 +150,8 @@ fn main() {
|
||||
device.clone(),
|
||||
surface,
|
||||
SwapchainCreateInfo {
|
||||
min_image_count: surface_capabilities.min_image_count,
|
||||
// Some drivers report `min_image_count=1` but fullscreen mode requires at least 2.
|
||||
min_image_count: surface_capabilities.min_image_count.max(2),
|
||||
image_format,
|
||||
image_extent: window.inner_size().into(),
|
||||
image_usage: ImageUsage::COLOR_ATTACHMENT,
|
||||
|
@ -157,7 +157,8 @@ fn main() {
|
||||
device.clone(),
|
||||
surface,
|
||||
SwapchainCreateInfo {
|
||||
min_image_count: surface_capabilities.min_image_count,
|
||||
// Some drivers report `min_image_count=1` but fullscreen mode requires at least 2.
|
||||
min_image_count: surface_capabilities.min_image_count.max(2),
|
||||
image_format,
|
||||
image_extent: [WINDOW_WIDTH, WINDOW_HEIGHT],
|
||||
image_usage: ImageUsage::COLOR_ATTACHMENT,
|
||||
|
@ -146,7 +146,8 @@ fn main() {
|
||||
device.clone(),
|
||||
surface,
|
||||
SwapchainCreateInfo {
|
||||
min_image_count: surface_capabilities.min_image_count,
|
||||
// Some drivers report `min_image_count=1` but fullscreen mode requires at least 2.
|
||||
min_image_count: surface_capabilities.min_image_count.max(2),
|
||||
image_format,
|
||||
image_extent: window.inner_size().into(),
|
||||
image_usage: ImageUsage::COLOR_ATTACHMENT,
|
||||
|
@ -251,7 +251,8 @@ fn main() {
|
||||
device.clone(),
|
||||
surface,
|
||||
SwapchainCreateInfo {
|
||||
min_image_count: surface_capabilities.min_image_count,
|
||||
// Some drivers report `min_image_count=1` but fullscreen mode requires at least 2.
|
||||
min_image_count: surface_capabilities.min_image_count.max(2),
|
||||
image_format,
|
||||
image_extent: window.inner_size().into(),
|
||||
image_usage: ImageUsage::COLOR_ATTACHMENT,
|
||||
|
@ -145,7 +145,8 @@ fn main() {
|
||||
device.clone(),
|
||||
surface,
|
||||
SwapchainCreateInfo {
|
||||
min_image_count: surface_capabilities.min_image_count,
|
||||
// Some drivers report `min_image_count=1` but fullscreen mode requires at least 2.
|
||||
min_image_count: surface_capabilities.min_image_count.max(2),
|
||||
image_format,
|
||||
image_extent: window.inner_size().into(),
|
||||
image_usage: ImageUsage::COLOR_ATTACHMENT,
|
||||
|
@ -253,7 +253,8 @@ fn main() {
|
||||
device.clone(),
|
||||
surface,
|
||||
SwapchainCreateInfo {
|
||||
min_image_count: surface_capabilities.min_image_count,
|
||||
// Some drivers report `min_image_count=1` but fullscreen mode requires at least 2.
|
||||
min_image_count: surface_capabilities.min_image_count.max(2),
|
||||
|
||||
image_format,
|
||||
|
||||
|
@ -222,7 +222,8 @@ fn main() {
|
||||
device.clone(),
|
||||
surface,
|
||||
SwapchainCreateInfo {
|
||||
min_image_count: surface_capabilities.min_image_count,
|
||||
// Some drivers report `min_image_count=1` but fullscreen mode requires at least 2.
|
||||
min_image_count: surface_capabilities.min_image_count.max(2),
|
||||
|
||||
image_format,
|
||||
|
||||
|
@ -115,7 +115,7 @@ impl VulkanoWindowRenderer {
|
||||
);
|
||||
let (swapchain, images) = Swapchain::new(device, surface, {
|
||||
let mut create_info = SwapchainCreateInfo {
|
||||
min_image_count: surface_capabilities.min_image_count,
|
||||
min_image_count: surface_capabilities.min_image_count.max(2),
|
||||
image_format,
|
||||
image_extent: window.inner_size().into(),
|
||||
image_usage: ImageUsage::COLOR_ATTACHMENT,
|
||||
|
Loading…
Reference in New Issue
Block a user