Don't use partial-restart unless debugger is present.
Works around #9666 for most practical purposes.
This commit is contained in:
parent
6e66f443e6
commit
a1e3be445a
6 changed files with 47 additions and 17 deletions
|
@ -495,6 +495,9 @@ static ConfigSetting graphicsSettings[] = {
|
|||
ReportedConfigSetting("AutoFrameSkip", &g_Config.bAutoFrameSkip, false, true, true),
|
||||
ConfigSetting("FrameRate", &g_Config.iFpsLimit, 0, true, true),
|
||||
ConfigSetting("FrameSkipUnthrottle", &g_Config.bFrameSkipUnthrottle, &DefaultFrameskipUnthrottle, true, false),
|
||||
#if defined(USING_WIN_UI)
|
||||
ConfigSetting("RestartRequired", &g_Config.bRestartRequired, false, false),
|
||||
#endif
|
||||
ReportedConfigSetting("ForceMaxEmulatedFPS", &g_Config.iForceMaxEmulatedFPS, 60, true, true),
|
||||
|
||||
// TODO: Hm, on fast mobile GPUs we should definitely default to at least 4 (setting = 2)...
|
||||
|
|
|
@ -113,6 +113,7 @@ public:
|
|||
bool bTopMost;
|
||||
std::string sFont;
|
||||
bool bIgnoreWindowsKey;
|
||||
bool bRestartRequired;
|
||||
#endif
|
||||
|
||||
bool bPauseWhenMinimized;
|
||||
|
|
|
@ -360,6 +360,12 @@ void SystemInfoScreen::CreateViews() {
|
|||
deviceSpecs->Add(new InfoItem("Name", System_GetProperty(SYSPROP_NAME)));
|
||||
deviceSpecs->Add(new InfoItem("Lang/Region", System_GetProperty(SYSPROP_LANGREGION)));
|
||||
deviceSpecs->Add(new InfoItem("ABI", GetCompilerABI()));
|
||||
#ifdef _WIN32
|
||||
if (IsDebuggerPresent()) {
|
||||
deviceSpecs->Add(new InfoItem("Debugger Present", "Yes"));
|
||||
}
|
||||
#endif
|
||||
|
||||
deviceSpecs->Add(new ItemHeader("CPU Information"));
|
||||
deviceSpecs->Add(new InfoItem("Name", cpu_info.brand_string));
|
||||
#if defined(ARM) || defined(ARM64) || defined(MIPS)
|
||||
|
|
|
@ -566,6 +566,15 @@ namespace MainWindow {
|
|||
NativeMessageReceived("gpu_resized", "");
|
||||
}
|
||||
|
||||
static void RestartApp() {
|
||||
if (IsDebuggerPresent()) {
|
||||
PostMessage(MainWindow::GetHWND(), WM_USER_RESTART_EMUTHREAD, 0, 0);
|
||||
} else {
|
||||
g_Config.bRestartRequired = true;
|
||||
PostMessage(MainWindow::GetHWND(), WM_CLOSE, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindowMenu_Process(HWND hWnd, WPARAM wParam) {
|
||||
std::string fn;
|
||||
|
||||
|
@ -752,11 +761,11 @@ namespace MainWindow {
|
|||
break;
|
||||
|
||||
case ID_TEXTURESCALING_AUTO: setTexScalingMultiplier(TEXSCALING_AUTO); break;
|
||||
case ID_TEXTURESCALING_OFF: setTexScalingMultiplier(TEXSCALING_OFF); break;
|
||||
case ID_TEXTURESCALING_2X: setTexScalingMultiplier(TEXSCALING_2X); break;
|
||||
case ID_TEXTURESCALING_3X: setTexScalingMultiplier(TEXSCALING_3X); break;
|
||||
case ID_TEXTURESCALING_4X: setTexScalingMultiplier(TEXSCALING_4X); break;
|
||||
case ID_TEXTURESCALING_5X: setTexScalingMultiplier(TEXSCALING_MAX); break;
|
||||
case ID_TEXTURESCALING_OFF: setTexScalingMultiplier(TEXSCALING_OFF); break;
|
||||
case ID_TEXTURESCALING_2X: setTexScalingMultiplier(TEXSCALING_2X); break;
|
||||
case ID_TEXTURESCALING_3X: setTexScalingMultiplier(TEXSCALING_3X); break;
|
||||
case ID_TEXTURESCALING_4X: setTexScalingMultiplier(TEXSCALING_4X); break;
|
||||
case ID_TEXTURESCALING_5X: setTexScalingMultiplier(TEXSCALING_MAX); break;
|
||||
|
||||
case ID_TEXTURESCALING_XBRZ: setTexScalingType(TextureScalerCommon::XBRZ); break;
|
||||
case ID_TEXTURESCALING_HYBRID: setTexScalingType(TextureScalerCommon::HYBRID); break;
|
||||
|
@ -770,22 +779,22 @@ namespace MainWindow {
|
|||
|
||||
case ID_OPTIONS_DIRECT3D9:
|
||||
g_Config.iGPUBackend = GPU_BACKEND_DIRECT3D9;
|
||||
PostMessage(MainWindow::GetHWND(), WM_USER_RESTART_EMUTHREAD, 0, 0);
|
||||
RestartApp();
|
||||
break;
|
||||
|
||||
case ID_OPTIONS_DIRECT3D11:
|
||||
g_Config.iGPUBackend = GPU_BACKEND_DIRECT3D11;
|
||||
PostMessage(MainWindow::GetHWND(), WM_USER_RESTART_EMUTHREAD, 0, 0);
|
||||
RestartApp();
|
||||
break;
|
||||
|
||||
case ID_OPTIONS_OPENGL:
|
||||
g_Config.iGPUBackend = GPU_BACKEND_OPENGL;
|
||||
PostMessage(MainWindow::GetHWND(), WM_USER_RESTART_EMUTHREAD, 0, 0);
|
||||
RestartApp();
|
||||
break;
|
||||
|
||||
case ID_OPTIONS_VULKAN:
|
||||
g_Config.iGPUBackend = GPU_BACKEND_VULKAN;
|
||||
PostMessage(MainWindow::GetHWND(), WM_USER_RESTART_EMUTHREAD, 0, 0);
|
||||
RestartApp();
|
||||
break;
|
||||
|
||||
case ID_OPTIONS_NONBUFFEREDRENDERING: setRenderingMode(FB_NON_BUFFERED_MODE); break;
|
||||
|
|
|
@ -242,7 +242,12 @@ void System_SendMessage(const char *command, const char *parameter) {
|
|||
PostMessage(MainWindow::GetHWND(), WM_CLOSE, 0, 0);
|
||||
}
|
||||
} else if (!strcmp(command, "graphics_restart")) {
|
||||
PostMessage(MainWindow::GetHWND(), MainWindow::WM_USER_RESTART_EMUTHREAD, 0, 0);
|
||||
if (IsDebuggerPresent()) {
|
||||
PostMessage(MainWindow::GetHWND(), MainWindow::WM_USER_RESTART_EMUTHREAD, 0, 0);
|
||||
} else {
|
||||
g_Config.bRestartRequired = true;
|
||||
PostMessage(MainWindow::GetHWND(), WM_CLOSE, 0, 0);
|
||||
}
|
||||
} else if (!strcmp(command, "setclipboardtext")) {
|
||||
if (OpenClipboard(MainWindow::GetDisplayHWND())) {
|
||||
std::wstring data = ConvertUTF8ToWString(parameter);
|
||||
|
@ -575,6 +580,10 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
|
|||
|
||||
LogManager::Shutdown();
|
||||
|
||||
if (g_Config.bRestartRequired) {
|
||||
W32Util::ExitAndRestart();
|
||||
}
|
||||
|
||||
net::Shutdown();
|
||||
CoUninitialize();
|
||||
|
||||
|
|
|
@ -922,13 +922,15 @@ void VKContext::SetScissorRect(int left, int top, int width, int height) {
|
|||
}
|
||||
|
||||
void VKContext::SetViewports(int count, Viewport *viewports) {
|
||||
viewport_.x = viewports[0].TopLeftX;
|
||||
viewport_.y = viewports[0].TopLeftY;
|
||||
viewport_.width = viewports[0].Width;
|
||||
viewport_.height = viewports[0].Height;
|
||||
viewport_.minDepth = viewports[0].MinDepth;
|
||||
viewport_.maxDepth = viewports[0].MaxDepth;
|
||||
viewportDirty_ = true;
|
||||
if (count > 0) {
|
||||
viewport_.x = viewports[0].TopLeftX;
|
||||
viewport_.y = viewports[0].TopLeftY;
|
||||
viewport_.width = viewports[0].Width;
|
||||
viewport_.height = viewports[0].Height;
|
||||
viewport_.minDepth = viewports[0].MinDepth;
|
||||
viewport_.maxDepth = viewports[0].MaxDepth;
|
||||
viewportDirty_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
void VKContext::SetBlendFactor(float color[4]) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue