From f135c0d4b77d06814aea7f4810de704163ff3be9 Mon Sep 17 00:00:00 2001 From: DH Date: Thu, 17 Oct 2024 04:38:24 +0300 Subject: [PATCH] gpu: add queue validation --- rpcsx/gpu/lib/vk/src/vk.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rpcsx/gpu/lib/vk/src/vk.cpp b/rpcsx/gpu/lib/vk/src/vk.cpp index 86870f85e..0acbe6066 100644 --- a/rpcsx/gpu/lib/vk/src/vk.cpp +++ b/rpcsx/gpu/lib/vk/src/vk.cpp @@ -538,6 +538,10 @@ void vk::Context::createDevice(VkSurfaceKHR surface, int gpuIndex, queueFamiliesCount++; } + rx::dieIf(queueFamiliesWithPresentSupport.empty(), "not found queue family with present support"); + rx::dieIf(queueFamiliesWithComputeSupport.empty(), "not found queue family with compute support"); + rx::dieIf(queueFamiliesWithGraphicsSupport.empty(), "not found queue family with graphics support"); + this->surface = surface; std::vector requestedQueues; @@ -631,7 +635,9 @@ void vk::Context::createDevice(VkSurfaceKHR surface, int gpuIndex, } } - if (graphicsQueues.empty() && presentQueue != VK_NULL_HANDLE) { + rx::dieIf(presentQueue == VK_NULL_HANDLE, "present queue not found"); + + if (graphicsQueues.empty()) { graphicsQueues.push_back({presentQueue, presentQueueFamily}); } }