Cleanup, fix the shader viewer UI

This commit is contained in:
Henrik Rydgård 2024-10-17 21:43:03 +02:00
parent 680bb2bf22
commit 97c5094ff2
2 changed files with 6 additions and 1 deletions

View File

@ -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);
}

View File

@ -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".