mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-30 08:50:33 +00:00
Merge pull request #17879 from hrydgard/move-present-out-of-screenmanager
Call draw->Begin/EndFrame from outside the screen manager.
This commit is contained in:
commit
a246df40c3
@ -191,10 +191,7 @@ void UIScreen::deviceRestored() {
|
||||
void UIScreen::preRender() {
|
||||
using namespace Draw;
|
||||
Draw::DrawContext *draw = screenManager()->getDrawContext();
|
||||
if (!draw) {
|
||||
return;
|
||||
}
|
||||
draw->BeginFrame();
|
||||
_dbg_assert_(draw != nullptr);
|
||||
// Bind and clear the back buffer
|
||||
draw->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::CLEAR, RPAction::CLEAR, 0xFF000000 }, "UI");
|
||||
screenManager()->getUIContext()->BeginFrame();
|
||||
@ -211,12 +208,7 @@ void UIScreen::preRender() {
|
||||
}
|
||||
|
||||
void UIScreen::postRender() {
|
||||
Draw::DrawContext *draw = screenManager()->getDrawContext();
|
||||
if (!draw) {
|
||||
return;
|
||||
}
|
||||
screenManager()->getUIContext()->Flush();
|
||||
draw->EndFrame();
|
||||
}
|
||||
|
||||
void UIScreen::render() {
|
||||
|
@ -1355,7 +1355,6 @@ static void DrawFPS(UIContext *ctx, const Bounds &bounds) {
|
||||
void EmuScreen::preRender() {
|
||||
using namespace Draw;
|
||||
DrawContext *draw = screenManager()->getDrawContext();
|
||||
draw->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
|
||||
@ -1389,7 +1388,6 @@ void EmuScreen::postRender() {
|
||||
return;
|
||||
if (stopRender_)
|
||||
draw->WipeQueue();
|
||||
draw->EndFrame();
|
||||
}
|
||||
|
||||
void EmuScreen::render() {
|
||||
|
@ -1135,12 +1135,17 @@ void NativeFrame(GraphicsContext *graphicsContext) {
|
||||
debugFlags |= Draw::DebugFlags::PROFILE_SCOPES;
|
||||
g_screenManager->getDrawContext()->SetDebugFlags(debugFlags);
|
||||
|
||||
g_draw->BeginFrame();
|
||||
|
||||
// All actual rendering happen in here.
|
||||
g_screenManager->render();
|
||||
if (g_screenManager->getUIContext()->Text()) {
|
||||
g_screenManager->getUIContext()->Text()->OncePerFrame();
|
||||
}
|
||||
|
||||
// This triggers present.
|
||||
g_draw->EndFrame();
|
||||
|
||||
if (resized) {
|
||||
INFO_LOG(G3D, "Resized flag set - recalculating bounds");
|
||||
resized = false;
|
||||
|
Loading…
Reference in New Issue
Block a user