From 728edb69cedfbf15b233be2be8d4126c66f6f130 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Wed, 18 Oct 2023 07:40:21 -0700 Subject: [PATCH] rendervulkan: Fix compute only present test --- src/rendervulkan.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/rendervulkan.cpp b/src/rendervulkan.cpp index c327641..baf6f6b 100644 --- a/src/rendervulkan.cpp +++ b/src/rendervulkan.cpp @@ -321,11 +321,14 @@ bool CVulkanDevice::selectPhysDev(VkSurfaceKHR surface) vk_log.infof( "physical device %04x:%04x queue doesn't support presenting on our surface, testing next one..", deviceProperties.vendorID, deviceProperties.deviceID ); continue; } - vk.GetPhysicalDeviceSurfaceSupportKHR( cphysDev, computeOnlyIndex, surface, &canPresent ); - if ( !canPresent ) + if (computeOnlyIndex != ~0u) { - vk_log.debugf( "physical device %04x:%04x compute queue doesn't support presenting on our surface, using graphics queue", deviceProperties.vendorID, deviceProperties.deviceID ); - computeOnlyIndex = 0; + vk.GetPhysicalDeviceSurfaceSupportKHR( cphysDev, computeOnlyIndex, surface, &canPresent ); + if ( !canPresent ) + { + vk_log.debugf( "physical device %04x:%04x compute queue doesn't support presenting on our surface, using graphics queue", deviceProperties.vendorID, deviceProperties.deviceID ); + computeOnlyIndex = ~0u; + } } }