Fix crash in GPU devices init when system has no valid GPU driver installed
This commit is contained in:
@@ -145,6 +145,11 @@ GPUDevice* GPUDeviceDX11::Create()
|
||||
}
|
||||
|
||||
// Select the adapter to use
|
||||
if (adapters.Count() == 0)
|
||||
{
|
||||
LOG(Error, "Failed to find valid DirectX adapter!");
|
||||
return nullptr;
|
||||
}
|
||||
GPUAdapterDX selectedAdapter = adapters[0];
|
||||
uint32 vendorId = 0;
|
||||
if (CommandLine::Options.NVIDIA)
|
||||
|
||||
@@ -119,6 +119,11 @@ GPUDevice* GPUDeviceDX12::Create()
|
||||
}
|
||||
|
||||
// Select the adapter to use
|
||||
if (adapters.Count() == 0)
|
||||
{
|
||||
LOG(Error, "Failed to find valid DirectX adapter!");
|
||||
return nullptr;
|
||||
}
|
||||
GPUAdapterDX selectedAdapter = adapters[0];
|
||||
uint32 vendorId = 0;
|
||||
if (CommandLine::Options.NVIDIA)
|
||||
|
||||
@@ -1202,6 +1202,11 @@ GPUDevice* GPUDeviceVulkan::Create()
|
||||
}
|
||||
|
||||
// Select the adapter to use
|
||||
if (adapters.Count() == 0)
|
||||
{
|
||||
LOG(Error, "Failed to find valid Vulkan adapter!");
|
||||
return nullptr;
|
||||
}
|
||||
int32 selectedAdapter = 0;
|
||||
uint32 vendorId = 0;
|
||||
if (CommandLine::Options.NVIDIA)
|
||||
|
||||
Reference in New Issue
Block a user