Permalink
Browse files

Vulkan: Better way to make sure we bind the backbuffer at some point.

  • Loading branch information...
hrydgard committed Nov 6, 2017
1 parent ea2fc55 commit 944cc946309a249c2bf14c907ce706dec8a6363d
Showing with 8 additions and 8 deletions.
  1. +8 −8 UI/EmuScreen.cpp
View
@@ -991,10 +991,13 @@ void EmuScreen::postRender() {
void EmuScreen::render() {
using namespace Draw;
DrawContext *thin3d = screenManager()->getDrawContext();
if (invalid_) {
// It's possible this might be set outside PSP_RunLoopFor().
// In this case, we need to double check it here.
checkPowerDown();
thin3d->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::CLEAR });
return;
}
@@ -1024,22 +1027,19 @@ void EmuScreen::render() {
if (coreState == CORE_NEXTFRAME) {
// set back to running for the next frame
coreState = CORE_RUNNING;
} else {
// Didn't actually reach the end of the frame, ran out of the blockTicks cycles.
// In this case we need to bind and wipe the backbuffer, at least.
// It's possible we never ended up outputted anything - make sure we have the backbuffer cleared
thin3d->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::CLEAR });
}
checkPowerDown();
PSP_EndHostFrame();
if (invalid_)
return;
// Here the backbuffer will always be bound.
if (!osm.IsEmpty() || g_Config.bShowDebugStats || g_Config.iShowFPSCounter || g_Config.bShowTouchControls || g_Config.bShowDeveloperMenu || g_Config.bShowAudioDebug || saveStatePreview_->GetVisibility() != UI::V_GONE || g_Config.bShowFrameProfiler) {
DrawContext *thin3d = screenManager()->getDrawContext();
// It's possible we never ended up outputted anything - make sure we have the backbuffer.
thin3d->BindFramebufferAsRenderTarget(nullptr, { RPAction::KEEP, RPAction::KEEP });
// This sets up some important states but not the viewport.
screenManager()->getUIContext()->Begin();

0 comments on commit 944cc94

Please sign in to comment.