From e09410b89ef0832d11c287d067569ddf6bbfb096 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 17 Oct 2024 21:43:03 +0200 Subject: [PATCH] Cleanup, fix the shader viewer UI --- Common/Render/DrawBuffer.cpp | 1 + UI/EmuScreen.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Common/Render/DrawBuffer.cpp b/Common/Render/DrawBuffer.cpp index 5310dd612b..40941b09f5 100644 --- a/Common/Render/DrawBuffer.cpp +++ b/Common/Render/DrawBuffer.cpp @@ -534,6 +534,7 @@ void DrawBuffer::MeasureTextRect(FontID font_id, std::string_view text, const Bo std::string toMeasure = std::string(text); AtlasWordWrapper wrapper(*font, fontscalex, toMeasure, bounds.w, wrap); toMeasure = wrapper.Wrapped(); + MeasureText(font_id, toMeasure, w, h); } else { MeasureText(font_id, text, w, h); } diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 202dc5052a..02385ff210 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -1369,6 +1369,9 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) { framebufferBound = true; } draw->SetTargetSize(g_display.pixel_xres, g_display.pixel_yres); + } else { + // Some other screen bound the backbuffer first. + framebufferBound = true; } g_OSD.NudgeSidebar(); @@ -1376,6 +1379,7 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) { if (mode & ScreenRenderMode::TOP) { System_Notify(SystemNotification::KEEP_SCREEN_AWAKE); } else if (!Core_ShouldRunBehind() && strcmp(screenManager()->topScreen()->tag(), "DevMenu") != 0) { + // NOTE: The strcmp is != 0 - so all popped-over screens EXCEPT DevMenu // Just to make sure. if (PSP_IsInited() && !skipBufferEffects) { _dbg_assert_(gpu); @@ -1383,7 +1387,7 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) { gpu->CopyDisplayToOutput(true); PSP_EndHostFrame(); } - if (!framebufferBound && (!gpu || !gpu->PresentedThisFrame())) { + if (!framebufferBound) { draw->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::CLEAR, RPAction::CLEAR, }, "EmuScreen_Behind"); } // Need to make sure the UI texture is available, for "darken".