EmuScreen: Turn the pass asserts into dbg_asserts and add safe workarounds

This commit is contained in:
Henrik Rydgård 2024-10-31 23:09:47 +01:00
parent f14551ef33
commit 2adbc231f0

View File

@ -1398,7 +1398,11 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) {
Draw::BackendState state = draw->GetCurrentBackendState();
if (state.valid) {
_assert_msg_(state.passes >= 1, "skipB: %d sw: %d mode: %d back: %d tag: %s", (int)skipBufferEffects, (int)g_Config.bSoftwareRendering, (int)mode, (int)g_Config.iGPUBackend, screenManager()->topScreen()->tag());
_dbg_assert_msg_(state.passes >= 1, "skipB: %d sw: %d mode: %d back: %d tag: %s", (int)skipBufferEffects, (int)g_Config.bSoftwareRendering, (int)mode, (int)g_Config.iGPUBackend, screenManager()->topScreen()->tag());
// Workaround any remaining bugs like this.
if (state.passes == 0) {
draw->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::CLEAR, RPAction::CLEAR, }, "EmuScreen_SafeFallback");
}
}
// Need to make sure the UI texture is available, for "darken".
@ -1527,7 +1531,11 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) {
// State.valid just states whether the passes parameter has a meaningful value.
if (state.valid) {
_assert_msg_(state.passes >= 1, "skipB: %d sw: %d mode: %d back: %d bound: %d", (int)skipBufferEffects, (int)g_Config.bSoftwareRendering, (int)mode, (int)g_Config.iGPUBackend, (int)framebufferBound);
_dbg_assert_msg_(state.passes >= 1, "skipB: %d sw: %d mode: %d back: %d bound: %d", (int)skipBufferEffects, (int)g_Config.bSoftwareRendering, (int)mode, (int)g_Config.iGPUBackend, (int)framebufferBound);
if (state.passes == 0) {
// Workaround any remaining bugs like this.
draw->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::CLEAR, RPAction::CLEAR, }, "EmuScreen_SafeFallback");
}
}
screenManager()->getUIContext()->BeginFrame();