Added explicit error check for when no supported GPUs are available to use #256

Merged
Pycorax merged 1 commits from Fix-NoGPUClarity into main 2022-11-23 13:48:37 +08:00
1 changed files with 6 additions and 1 deletions
Showing only changes of commit 1a26b0ac70 - Show all commits

View File

@ -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