Permalink
Browse files

Merge pull request #11362 from unknownbrackets/gpu-failed

Core: Don't consider graphics failed on shutdown
  • Loading branch information...
hrydgard committed Sep 6, 2018
2 parents 8ac50b2 + fb8f408 commit d7bf2841d13087c839817addec9faf65a9cd48a8
Showing with 11 additions and 4 deletions.
  1. +11 −4 UI/NativeApp.cpp
View
@@ -346,6 +346,14 @@ void CreateDirectoriesAndroid() {
}
static void CheckFailedGPUBackends() {
// We only want to do this once per process run and backend, to detect process crashes.
// If NativeShutdown is called before we finish, we might call this multiple times.
static int lastBackend = -1;
if (lastBackend == g_Config.iGPUBackend) {
return;
}
lastBackend = g_Config.iGPUBackend;
std::string cache = GetSysDirectory(DIRECTORY_APP_CACHE) + "/FailedGraphicsBackends.txt";
if (System_GetPropertyBool(SYSPROP_SUPPORTS_PERMISSIONS)) {
@@ -361,10 +369,9 @@ static void CheckFailedGPUBackends() {
ERROR_LOG(LOADER, "Failed graphics backends: %s", g_Config.sFailedGPUBackends.c_str());
// Okay, let's not try a backend in the failed list.
int newBackend = g_Config.NextValidBackend();
if (newBackend != g_Config.iGPUBackend)
WARN_LOG(LOADER, "Failed graphics backend switched from %d to %d", g_Config.iGPUBackend, newBackend);
g_Config.iGPUBackend = newBackend;
g_Config.iGPUBackend = g_Config.NextValidBackend();
if (lastBackend != g_Config.iGPUBackend)
WARN_LOG(LOADER, "Failed graphics backend switched from %d to %d", lastBackend, g_Config.iGPUBackend);
// And then let's - for now - add the current to the failed list.
if (g_Config.sFailedGPUBackends.empty()) {
g_Config.sFailedGPUBackends = StringFromFormat("%d", g_Config.iGPUBackend);

0 comments on commit d7bf284

Please sign in to comment.