diff --git a/GPU/Common/PresentationCommon.cpp b/GPU/Common/PresentationCommon.cpp index 8d71a9e92c..69e440a64c 100644 --- a/GPU/Common/PresentationCommon.cpp +++ b/GPU/Common/PresentationCommon.cpp @@ -801,6 +801,7 @@ void PresentationCommon::CopyToOutput(OutputFlags flags, int uvRotation, float u if (usePostShader) { // When we render to temp framebuffers during post, we switch position, not UV. // The flipping here is only because D3D has a clip coordinate system that doesn't match their screen coordinate system. + // The flipping here is only because D3D has a clip coordinate system that doesn't match their screen coordinate system. bool flipped = flags & OutputFlags::POSITION_FLIPPED; float y0 = flipped ? 1.0f : -1.0f; float y1 = flipped ? -1.0f : 1.0f; diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index ac3beecd3b..c2c420c15b 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -1326,7 +1326,7 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) { // We only bind it in FramebufferManager::CopyDisplayToOutput (unless non-buffered)... // We do, however, start the frame in other ways. - if ((g_Config.bSkipBufferEffects && !g_Config.bSoftwareRendering) || Core_IsStepping()) { + if ((skipBufferEffects && !g_Config.bSoftwareRendering) || Core_IsStepping()) { // We need to clear here already so that drawing during the frame is done on a clean slate. if (Core_IsStepping() && gpuStats.numFlips != 0) { draw->BindFramebufferAsRenderTarget(nullptr, { RPAction::KEEP, RPAction::CLEAR, RPAction::CLEAR }, "EmuScreen_BackBuffer"); @@ -1348,12 +1348,12 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) { System_Notify(SystemNotification::KEEP_SCREEN_AWAKE); } else if (!Core_ShouldRunBehind() && strcmp(screenManager()->topScreen()->tag(), "DevMenu") != 0) { // Just to make sure. - if (PSP_IsInited() && !g_Config.bSkipBufferEffects) { + if (PSP_IsInited() && !skipBufferEffects) { PSP_BeginHostFrame(); gpu->CopyDisplayToOutput(true); PSP_EndHostFrame(); } - if (!gpu->PresentedThisFrame()) { + if (!framebufferBound && !gpu->PresentedThisFrame()) { draw->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::CLEAR, RPAction::CLEAR, }, "EmuScreen_Behind"); } // Need to make sure the UI texture is available, for "darken". diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 38e1e60b7d..89ce32f92f 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -1061,23 +1061,6 @@ void NativeFrame(GraphicsContext *graphicsContext) { ProcessWheelRelease(NKCODE_EXT_MOUSEWHEEL_UP, startTime, false); ProcessWheelRelease(NKCODE_EXT_MOUSEWHEEL_DOWN, startTime, false); - std::vector toProcess; - { - std::lock_guard lock(pendingMutex); - toProcess = std::move(pendingMessages); - pendingMessages.clear(); - } - - for (const auto &item : toProcess) { - if (HandleGlobalMessage(item.message, item.value)) { - // TODO: Add a to-string thingy. - INFO_LOG(SYSTEM, "Handled global message: %d / %s", (int)item.message, item.value.c_str()); - } - g_screenManager->sendMessage(item.message, item.value.c_str()); - } - - g_requestManager.ProcessRequests(); - // it's ok to call this redundantly with DoFrame from EmuScreen Achievements::Idle(); @@ -1104,6 +1087,24 @@ void NativeFrame(GraphicsContext *graphicsContext) { g_screenManager->update(); + // Do this after g_screenManager.update() so we can receive setting changes before rendering. + std::vector toProcess; + { + std::lock_guard lock(pendingMutex); + toProcess = std::move(pendingMessages); + pendingMessages.clear(); + } + + for (const auto &item : toProcess) { + if (HandleGlobalMessage(item.message, item.value)) { + // TODO: Add a to-string thingy. + INFO_LOG(SYSTEM, "Handled global message: %d / %s", (int)item.message, item.value.c_str()); + } + g_screenManager->sendMessage(item.message, item.value.c_str()); + } + + g_requestManager.ProcessRequests(); + // Apply the UIContext bounds as a 2D transformation matrix. // TODO: This should be moved into the draw context... Matrix4x4 ortho = ComputeOrthoMatrix(g_display.dp_xres, g_display.dp_yres);