mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-26 15:53:35 +01:00
Windows: Avoid restarting completely on GPU change.
This retains the logger, avoids an annoying window open/close, and most importantly for me: keeps the debugger attached.
This commit is contained in:
1 parent
638a015ced
commit
e8e65881b8
9 files changed
+33
-12
No files matched your search
@@ -112,6 +112,7 @@ unsigned int WINAPI TheThread(void *)
|
||||
args.push_back(string.c_str());
|
||||
}
|
||||
|
||||
bool performingRestart = NativeIsRestarting();
|
||||
NativeInit(static_cast<int>(args.size()), &args[0], "1234", "1234", nullptr);
|
||||
|
||||
Host *nativeHost = host;
|
||||
@@ -123,6 +124,14 @@ unsigned int WINAPI TheThread(void *)
|
||||
|
||||
std::string error_string;
|
||||
if (!host->InitGraphics(&error_string, &graphicsContext)) {
|
||||
// Before anything: are we restarting right now?
|
||||
if (performingRestart) {
|
||||
// Okay, switching graphics didn't work out. Probably a driver bug - fallback to restart.
|
||||
// This happens on NVIDIA when switching OpenGL -> Vulkan.
|
||||
g_Config.Save();
|
||||
W32Util::ExitAndRestart();
|
||||
}
|
||||
|
||||
I18NCategory *err = GetI18NCategory("Error");
|
||||
Reporting::ReportMessage("Graphics init error: %s", error_string.c_str());
|
||||
|
||||
|
||||
Reference in new issue
Block a user