From 1a26b0ac70a616a85f5a0e5fec69c50c4cabb037 Mon Sep 17 00:00:00 2001 From: Kah Wei Date: Wed, 23 Nov 2022 09:57:55 +0800 Subject: [PATCH] When no GPU is detected, a proper exception describing it is now thrown instead of failing silently --- .../src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp index 03ca0b3d..bd1d60cd 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp +++ b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp @@ -61,8 +61,13 @@ namespace SHADE SHVkInstance::Init(true, false, true); #endif - // Get Physical Device and Construct Logical Device + // Get Physical Device physicalDevice = SHVkInstance::CreatePhysicalDevice(SH_PHYSICAL_DEVICE_TYPE::BEST); + if (!physicalDevice->GetVkPhysicalDevice()) + { + throw std::runtime_error("[Graphics System] No supported Vulkan 1.3 compatible GPU was detected!"); + } + // Construct Logical Device device = SHVkInstance::CreateLogicalDevice({ SHQueueParams(SH_Q_FAM::GRAPHICS, SH_QUEUE_SELECT::DEDICATED), SHQueueParams(SH_Q_FAM::TRANSFER, SH_QUEUE_SELECT::DEDICATED) }, physicalDevice); // Construct surface -- 2.40.1