Don't draw a frame from RAM outside the backbuffer pass after toggling Skip Buffer Effects

The GPU only picks up the setting when emulation runs, so after turning
Skip Buffer Effects off in the pause menu, PreRender ran the buffered-mode
display path with a GPU still in non-buffered mode. For a frame displayed
from RAM, that draws straight to output (since b8789af997) with no render
pass bound, crashing in VulkanRenderManager::SetScissor.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-10-19 07:47:48 +02:00
1 parent 0c6aa15f9b
commit 96ff2bd883
1 file changed
+10 -1
+10 -1
View File
@@ -61,6 +61,7 @@ using namespace std::placeholders;
#include "Core/Reporting.h"
#include "Core/Util/PathUtil.h"
#include "Core/System.h"
#include "GPU/Common/FramebufferManagerCommon.h"
#include "GPU/Common/PresentationCommon.h"
#include "GPU/GPUState.h"
#include "GPU/GPUCommon.h"
@@ -1601,6 +1602,14 @@ bool EmuScreen::ShouldRunEmulation(ScreenRenderMode mode) const {
return true;
}
// The GPU only picks up a changed Skip Buffer Effects setting in BeginHostFrame, so while emulation
// isn't running (like in the pause menu) it can still be in non-buffered mode. There, it draws straight
// into the backbuffer pass, which isn't bound yet in PreRender.
static bool GPUIsBuffered() {
FramebufferManagerCommon *framebufferManager = gpu->GetFramebufferManagerCommon();
return !framebufferManager || framebufferManager->UseBufferedRendering();
}
ScreenRenderFlags EmuScreen::PreRender(ScreenRenderMode mode) {
// If a boot is in progress, update it.
ProcessGameBoot(gamePath_);
@@ -1611,7 +1620,7 @@ ScreenRenderFlags EmuScreen::PreRender(ScreenRenderMode mode) {
if (ShouldRunEmulation(mode)) {
// We need to run emulation here, and perform all the normal render passes.
return RunEmulation(false);
} else if (gpu) {
} else if (gpu && GPUIsBuffered()) {
// Need to check for gpu here, we might be in reset.
const DeviceOrientation orientation = GetDeviceOrientation();
const DisplayLayoutConfig &displayLayoutConfig = g_Config.GetDisplayLayoutConfig(orientation);