Host: Report error on GPU device creation fail

This commit is contained in:
Stenzek 2023-09-20 19:12:49 +10:00
parent 18ae01bedb
commit 3c47f9b1b1
1 changed files with 6 additions and 1 deletions

View File

@ -242,10 +242,15 @@ bool Host::CreateGPUDevice(RenderAPI api)
SHADER_CACHE_VERSION, g_settings.gpu_use_debug_device, vsync,
g_settings.gpu_threaded_presentation))
{
Log_ErrorPrintf("Failed to initialize GPU device.");
Log_ErrorPrintf("Failed to create GPU device.");
if (g_gpu_device)
g_gpu_device->Destroy();
g_gpu_device.reset();
Host::ReportErrorAsync("Error",
fmt::format("Failed to create render device. This may be due to your GPU not supporting the "
"chosen renderer ({}), or because your graphics drivers need to be updated.",
GPUDevice::RenderAPIToString(api)));
return false;
}