diff --git a/src/engine/client/backend/backend_base.h b/src/engine/client/backend/backend_base.h index d38f4fb1e..5d389ac76 100644 --- a/src/engine/client/backend/backend_base.h +++ b/src/engine/client/backend/backend_base.h @@ -50,6 +50,7 @@ enum EGFXWarningType { GFX_WARNING_TYPE_NONE = 0, GFX_WARNING_TYPE_INIT_FAILED, + GFX_WARNING_TYPE_INIT_FAILED_MISSING_INTEGRATED_GPU_DRIVER, GFX_WARNING_LOW_ON_MEMORY, GFX_WARNING_MISSING_EXTENSION, GFX_WARNING_TYPE_UNKNOWN, diff --git a/src/engine/client/backend/vulkan/backend_vulkan.cpp b/src/engine/client/backend/vulkan/backend_vulkan.cpp index b8e571cf5..9acfb44d6 100644 --- a/src/engine/client/backend/vulkan/backend_vulkan.cpp +++ b/src/engine/client/backend/vulkan/backend_vulkan.cpp @@ -1210,7 +1210,7 @@ protected: m_RecreateSwapChain = true; break; default: - m_ErrorHelper = "unknown error"; + m_ErrorHelper = "unknown error: "; m_ErrorHelper.append(std::to_string(CallResult)); pCriticalError = m_ErrorHelper.c_str(); break; @@ -3720,11 +3720,20 @@ public: std::vector vDeviceList(DevicesCount); Res = vkEnumeratePhysicalDevices(m_VKInstance, &DevicesCount, vDeviceList.data()); - if(Res != VK_SUCCESS) + if(Res != VK_SUCCESS && Res != VK_INCOMPLETE) { SetError(EGFXErrorType::GFX_ERROR_TYPE_INIT, CheckVulkanCriticalError(Res)); return false; } + if(DevicesCount == 0) + { + SetWarning(EGFXWarningType::GFX_WARNING_TYPE_INIT_FAILED_MISSING_INTEGRATED_GPU_DRIVER, "No vulkan compatible devices found."); + return false; + } + // make sure to use the correct amount of devices available + // the amount of physical devices can be smaller than the amount of devices reported + // see vkEnumeratePhysicalDevices for details + vDeviceList.resize(DevicesCount); size_t Index = 0; std::vector vDevicePropList(vDeviceList.size()); diff --git a/src/engine/client/backend_sdl.cpp b/src/engine/client/backend_sdl.cpp index 152cc8f69..2f6bc4d3a 100644 --- a/src/engine/client/backend_sdl.cpp +++ b/src/engine/client/backend_sdl.cpp @@ -311,6 +311,9 @@ void CCommandProcessor_SDL_GL::HandleWarning() case GFX_WARNING_TYPE_INIT_FAILED: Warn.m_vWarnings.emplace_back(Localizable("Could not initialize the given graphics backend, reverting to the default backend now.", "Graphics error")); break; + case GFX_WARNING_TYPE_INIT_FAILED_MISSING_INTEGRATED_GPU_DRIVER: + Warn.m_vWarnings.emplace_back(Localizable("Could not initialize the given graphics backend, this is probably caused because you didn't install the driver of the integrated graphics card.", "Graphics error")); + break; case GFX_WARNING_MISSING_EXTENSION: // ignore this warning for now return;