Add better log for missing GPU for Vulkan

This commit is contained in:
Wojtek Figat
2021-11-21 19:14:32 +01:00
parent e8b680c78b
commit fd150b3cc1

View File

@@ -1136,6 +1136,12 @@ GPUDevice* GPUDeviceVulkan::Create()
// Enumerate all GPU devices and pick one
uint32 gpuCount = 0;
VALIDATE_VULKAN_RESULT(vkEnumeratePhysicalDevices(Instance, &gpuCount, nullptr));
if (gpuCount <= 0)
{
LOG(Warning, "No valid GPU found for Vulkan.");
Platform::Fatal(TEXT("Vulkan failed to create instance\n\nDo you have a Vulkan-compatible GPU?"));
return nullptr;
}
ASSERT(gpuCount >= 1);
Array<VkPhysicalDevice, InlinedAllocation<4>> gpus;
gpus.Resize(gpuCount);