Skip to content

Commit c63d568

Browse files
fix a validation error
1 parent 14ba4c0 commit c63d568

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/nbl/video/CVulkanPhysicalDevice.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,10 +1407,11 @@ core::smart_refctd_ptr<ILogicalDevice> CVulkanPhysicalDevice::createLogicalDevic
14071407

14081408

14091409
// extensions
1410-
REQUIRE_EXTENSION_IF(enabledFeatures.swapchainMode.hasFlags(E_SWAPCHAIN_MODE::ESM_SURFACE),VK_KHR_SWAPCHAIN_EXTENSION_NAME,nullptr);
1410+
const bool swapchainEnabled = enabledFeatures.swapchainMode.hasFlags(E_SWAPCHAIN_MODE::ESM_SURFACE);
1411+
REQUIRE_EXTENSION_IF(swapchainEnabled,VK_KHR_SWAPCHAIN_EXTENSION_NAME,nullptr);
14111412
{
14121413
// If we reach here then the instance extension VK_KHR_Surface was definitely enabled otherwise the extension wouldn't be reported by physical device
1413-
REQUIRE_EXTENSION_IF(true,VK_KHR_SWAPCHAIN_MUTABLE_FORMAT_EXTENSION_NAME);
1414+
REQUIRE_EXTENSION_IF(swapchainEnabled,VK_KHR_SWAPCHAIN_MUTABLE_FORMAT_EXTENSION_NAME);
14141415
// TODO: https://github.com/Devsh-Graphics-Programming/Nabla/issues/508
14151416
}
14161417

0 commit comments

Comments
 (0)