mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 21:39:52 +00:00
Vulkan: Better way to make sure we bind the backbuffer at some point.
This commit is contained in:
parent
ea2fc55217
commit
944cc94630
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user