Fix validation layer warning on minImageCount of 2. (#1634)

This commit is contained in:
Andreas Süßenbach 2023-08-07 12:00:11 +02:00 committed by GitHub
parent 3d27c1736a
commit 4bc9d80d82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View File

@ -120,7 +120,7 @@ int main( int /*argc*/, char ** /*argv*/ )
vk::SwapchainCreateInfoKHR swapChainCreateInfo( vk::SwapchainCreateFlagsKHR(), vk::SwapchainCreateInfoKHR swapChainCreateInfo( vk::SwapchainCreateFlagsKHR(),
*surface, *surface,
surfaceCapabilities.minImageCount, vk::su::clamp( 3u, surfaceCapabilities.minImageCount, surfaceCapabilities.maxImageCount ),
format, format,
vk::ColorSpaceKHR::eSrgbNonlinear, vk::ColorSpaceKHR::eSrgbNonlinear,
swapchainExtent, swapchainExtent,

View File

@ -367,7 +367,7 @@ namespace vk
vk::PresentModeKHR presentMode = vk::su::pickPresentMode( physicalDevice.getSurfacePresentModesKHR( *surface ) ); vk::PresentModeKHR presentMode = vk::su::pickPresentMode( physicalDevice.getSurfacePresentModesKHR( *surface ) );
vk::SwapchainCreateInfoKHR swapChainCreateInfo( {}, vk::SwapchainCreateInfoKHR swapChainCreateInfo( {},
*surface, *surface,
surfaceCapabilities.minImageCount, vk::su::clamp( 3u, surfaceCapabilities.minImageCount, surfaceCapabilities.maxImageCount ),
colorFormat, colorFormat,
surfaceFormat.colorSpace, surfaceFormat.colorSpace,
swapchainExtent, swapchainExtent,

View File

@ -123,7 +123,7 @@ int main( int /*argc*/, char ** /*argv*/ )
vk::SwapchainCreateInfoKHR swapChainCreateInfo( vk::SwapchainCreateFlagsKHR(), vk::SwapchainCreateInfoKHR swapChainCreateInfo( vk::SwapchainCreateFlagsKHR(),
surface, surface,
surfaceCapabilities.minImageCount, vk::su::clamp( 3u, surfaceCapabilities.minImageCount, surfaceCapabilities.maxImageCount ),
format, format,
vk::ColorSpaceKHR::eSrgbNonlinear, vk::ColorSpaceKHR::eSrgbNonlinear,
swapchainExtent, swapchainExtent,
@ -161,7 +161,7 @@ int main( int /*argc*/, char ** /*argv*/ )
imageViews.push_back( device.createImageView( imageViewCreateInfo ) ); imageViews.push_back( device.createImageView( imageViewCreateInfo ) );
} }
// destroy the imageViews, the swapChain,and the surface // destroy the imageViews, the swapChain, and the surface
for ( auto & imageView : imageViews ) for ( auto & imageView : imageViews )
{ {
device.destroyImageView( imageView ); device.destroyImageView( imageView );

View File

@ -833,7 +833,7 @@ namespace vk
vk::PresentModeKHR presentMode = vk::su::pickPresentMode( physicalDevice.getSurfacePresentModesKHR( surface ) ); vk::PresentModeKHR presentMode = vk::su::pickPresentMode( physicalDevice.getSurfacePresentModesKHR( surface ) );
vk::SwapchainCreateInfoKHR swapChainCreateInfo( {}, vk::SwapchainCreateInfoKHR swapChainCreateInfo( {},
surface, surface,
surfaceCapabilities.minImageCount, vk::su::clamp( 3u, surfaceCapabilities.minImageCount, surfaceCapabilities.maxImageCount ),
colorFormat, colorFormat,
surfaceFormat.colorSpace, surfaceFormat.colorSpace,
swapchainExtent, swapchainExtent,