Skip to content

Commit

Permalink
Fix validation layer warning on minImageCount of 2. (#1634)
Browse files Browse the repository at this point in the history
  • Loading branch information
asuessenbach authored Aug 7, 2023
1 parent 3d27c17 commit 4bc9d80
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion RAII_Samples/05_InitSwapchain/05_InitSwapchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ int main( int /*argc*/, char ** /*argv*/ )

vk::SwapchainCreateInfoKHR swapChainCreateInfo( vk::SwapchainCreateFlagsKHR(),
*surface,
surfaceCapabilities.minImageCount,
vk::su::clamp( 3u, surfaceCapabilities.minImageCount, surfaceCapabilities.maxImageCount ),
format,
vk::ColorSpaceKHR::eSrgbNonlinear,
swapchainExtent,
Expand Down
2 changes: 1 addition & 1 deletion RAII_Samples/utils/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ namespace vk
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,
Expand Down
4 changes: 2 additions & 2 deletions samples/05_InitSwapchain/05_InitSwapchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ int main( int /*argc*/, char ** /*argv*/ )

vk::SwapchainCreateInfoKHR swapChainCreateInfo( vk::SwapchainCreateFlagsKHR(),
surface,
surfaceCapabilities.minImageCount,
vk::su::clamp( 3u, surfaceCapabilities.minImageCount, surfaceCapabilities.maxImageCount ),
format,
vk::ColorSpaceKHR::eSrgbNonlinear,
swapchainExtent,
Expand Down Expand Up @@ -161,7 +161,7 @@ int main( int /*argc*/, char ** /*argv*/ )
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 );
Expand Down
2 changes: 1 addition & 1 deletion samples/utils/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ namespace vk
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,
Expand Down

0 comments on commit 4bc9d80

Please sign in to comment.