vk::SwapchainCreateInfoKHR swapChainCreateInfo( vk::SwapchainCreateFlagsKHR(),
*surface,
- surfaceCapabilities.minImageCount,
+ vk::su::clamp( 3u, surfaceCapabilities.minImageCount, surfaceCapabilities.maxImageCount ),
format,
vk::ColorSpaceKHR::eSrgbNonlinear,
swapchainExtent,
vk::PresentModeKHR presentMode = vk::su::pickPresentMode( physicalDevice.getSurfacePresentModesKHR( *surface ) );
vk::SwapchainCreateInfoKHR swapChainCreateInfo( {},
*surface,
- surfaceCapabilities.minImageCount,
+ vk::su::clamp( 3u, surfaceCapabilities.minImageCount, surfaceCapabilities.maxImageCount ),
colorFormat,
surfaceFormat.colorSpace,
swapchainExtent,
vk::SwapchainCreateInfoKHR swapChainCreateInfo( vk::SwapchainCreateFlagsKHR(),
surface,
- surfaceCapabilities.minImageCount,
+ vk::su::clamp( 3u, surfaceCapabilities.minImageCount, surfaceCapabilities.maxImageCount ),
format,
vk::ColorSpaceKHR::eSrgbNonlinear,
swapchainExtent,
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 )
{
device.destroyImageView( imageView );
vk::PresentModeKHR presentMode = vk::su::pickPresentMode( physicalDevice.getSurfacePresentModesKHR( surface ) );
vk::SwapchainCreateInfoKHR swapChainCreateInfo( {},
surface,
- surfaceCapabilities.minImageCount,
+ vk::su::clamp( 3u, surfaceCapabilities.minImageCount, surfaceCapabilities.maxImageCount ),
colorFormat,
surfaceFormat.colorSpace,
swapchainExtent,