From 9936fcfee353e7738ab07d2ff0dbb2e3826fc92f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 10 Feb 2026 08:25:52 +0100 Subject: [PATCH] Libretro: Freeze fix Broke in #21221, forgot to apply the refactoring with libretro --- libretro/libretro.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/libretro/libretro.cpp b/libretro/libretro.cpp index 1c506b5380..5a2f9104f1 100644 --- a/libretro/libretro.cpp +++ b/libretro/libretro.cpp @@ -1360,9 +1360,9 @@ namespace Libretro ctx->GetDrawContext()->BeginFrame(Draw::DebugFlags::NONE); } + const DisplayLayoutConfig &displayLayoutConfig = g_Config.GetDisplayLayoutConfig(g_display.GetDeviceOrientation()); if (gpu) { - const DisplayLayoutConfig &config = g_Config.GetDisplayLayoutConfig(g_display.GetDeviceOrientation()); - gpu->BeginHostFrame(config); + gpu->BeginHostFrame(displayLayoutConfig); } PSP_RunLoopWhileState(); @@ -1377,9 +1377,20 @@ namespace Libretro break; } - if (gpu) + if (gpu) { gpu->EndHostFrame(); + gpu->PrepareCopyDisplayToOutput(displayLayoutConfig); + } + + // gotta do the backbuffer bind somewhere. + using namespace Draw; + ctx->GetDrawContext()->BindFramebufferAsRenderTarget(nullptr, {RPAction::CLEAR, RPAction::CLEAR, RPAction::CLEAR}, "BackBuffer"); + + if (gpu) { + gpu->CopyDisplayToOutput(displayLayoutConfig); + } + if (ctx->GetDrawContext()) { ctx->GetDrawContext()->EndFrame(); ctx->GetDrawContext()->Present(Draw::PresentMode::FIFO);