diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 83442497b0..dc19ce2977 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -1165,11 +1165,6 @@ void EmuScreen::preRender() { using namespace Draw; DrawContext *draw = screenManager()->getDrawContext(); draw->BeginFrame(); - // Let's be consistent for the entire frame. We skip the UI texture if we don't need it. - hasVisibleUI_ = hasVisibleUI(); - if (hasVisibleUI_) { - screenManager()->getUIContext()->BeginFrame(); - } // Here we do NOT bind the backbuffer or clear the screen, unless non-buffered. // The emuscreen is different than the others - we really want to allow the game to render to framebuffers // before we ever bind the backbuffer for rendering. On mobile GPUs, switching back and forth between render @@ -1268,7 +1263,8 @@ void EmuScreen::render() { if (invalid_) return; - if (hasVisibleUI_) { + if (hasVisibleUI()) { + screenManager()->getUIContext()->BeginFrame(); renderUI(); } diff --git a/UI/EmuScreen.h b/UI/EmuScreen.h index 0dd44e614a..0ac62e76e7 100644 --- a/UI/EmuScreen.h +++ b/UI/EmuScreen.h @@ -80,7 +80,6 @@ private: bool invalid_; bool quit_; bool stopRender_ = false; - bool hasVisibleUI_ = true; std::string errorMessage_; // If set, pauses at the end of the frame. diff --git a/ext/native/ui/ui_context.cpp b/ext/native/ui/ui_context.cpp index 492191442a..914c849931 100644 --- a/ext/native/ui/ui_context.cpp +++ b/ext/native/ui/ui_context.cpp @@ -38,12 +38,12 @@ void UIContext::BeginFrame() { FLOG("Failed to load ui_atlas.zim"); } } + ActivateTopScissor(); } void UIContext::Begin() { draw_->BindSamplerStates(0, 1, &sampler_); draw_->BindTexture(0, uitexture_->GetTexture()); - ActivateTopScissor(); UIBegin(ui_pipeline_); } diff --git a/ext/native/ui/ui_screen.cpp b/ext/native/ui/ui_screen.cpp index eb87763ed6..a49877327d 100644 --- a/ext/native/ui/ui_screen.cpp +++ b/ext/native/ui/ui_screen.cpp @@ -78,9 +78,9 @@ void UIScreen::preRender() { return; } draw->BeginFrame(); - screenManager()->getUIContext()->BeginFrame(); // Bind and clear the back buffer draw->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::CLEAR, RPAction::CLEAR, 0xFF000000 }); + screenManager()->getUIContext()->BeginFrame(); Draw::Viewport viewport; viewport.TopLeftX = 0;