Skip to content

Commit a2a1992

Browse files
author
François Bérard
committed
add a flags field to SwapchainPreferences that is used to initialize VkSwapchainCreateInfoKHR.
1 parent 57d771a commit a2a1992

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

include/vsg/vk/Swapchain.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ namespace vsg
3838
VkSurfaceFormatKHR surfaceFormat = {VK_FORMAT_B8G8R8A8_SRGB, VK_COLOR_SPACE_SRGB_NONLINEAR_KHR};
3939
VkPresentModeKHR presentMode = VK_PRESENT_MODE_FIFO_KHR;
4040
VkImageUsageFlags imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
41+
VkSwapchainCreateFlagsKHR flags = 0; // e.g. VK_SWAPCHAIN_CREATE_PRESENT_ID_2_BIT_KHR / VK_SWAPCHAIN_CREATE_PRESENT_WAIT_2_BIT_KHR
4142
};
4243

4344
/// Swapchain encapsulates vkSwapchainKHR

src/vsg/vk/Swapchain.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ Swapchain::Swapchain(PhysicalDevice* physicalDevice, Device* device, Surface* su
183183
VkSwapchainCreateInfoKHR createInfo = {};
184184
createInfo.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR;
185185
createInfo.surface = *surface;
186+
createInfo.flags = preferences.flags;
186187

187188
createInfo.minImageCount = imageCount;
188189
createInfo.imageFormat = surfaceFormat.format;

0 commit comments

Comments
 (0)