Fix some more presentation issues

This commit is contained in:
Henrik Rydgård 2024-10-22 11:59:41 +02:00
parent a859b2223a
commit 3a4b27b086
6 changed files with 18 additions and 3 deletions

View File

@ -370,6 +370,8 @@ void VulkanRenderManager::StartThreads() {
// Called from main thread.
void VulkanRenderManager::StopThreads() {
// Make sure we don't have an open render pass.
EndCurRenderStep();
// Not sure this is a sensible check - should be ok even if not.
// _dbg_assert_(steps_.empty());

View File

@ -657,6 +657,11 @@ void SoftGPU::CopyDisplayToOutput(bool reallyDirty) {
MarkDirty(displayFramebuf_, displayStride_, 272, displayFormat_, SoftGPUVRAMDirty::CLEAR);
}
void SoftGPU::BeginHostFrame() {
GPUCommon::BeginHostFrame();
presentation_->BeginFrame();
}
bool SoftGPU::PresentedThisFrame() const {
return presentation_->PresentedThisFrame();
}

View File

@ -209,6 +209,7 @@ public:
typedef void (SoftGPU::*CmdFunc)(u32 op, u32 diff);
void BeginHostFrame() override;
bool PresentedThisFrame() const override;
protected:

View File

@ -343,7 +343,7 @@ UI::EventReturn ControlMappingScreen::OnAutoConfigure(UI::EventParams &params) {
}
void ControlMappingScreen::dialogFinished(const Screen *dialog, DialogResult result) {
if (result == DR_OK && std::string(dialog->tag()) == "listpopup") {
if (result == DR_OK && !strcmp(dialog->tag(), "listpopup")) {
UI::ListPopupScreen *popup = (UI::ListPopupScreen *)dialog;
KeyMap::AutoConfForPad(popup->GetChoiceString());
}

View File

@ -384,6 +384,8 @@ LogLevelScreen::LogLevelScreen(std::string_view title) : ListPopupScreen(title)
list.push_back(logLevelList[i]);
}
adaptor_ = UI::StringVectorListAdaptor(list, -1);
// CreateViews takes care of, well, that.
}
void LogLevelScreen::OnCompleted(DialogResult result) {

View File

@ -1281,14 +1281,16 @@ bool EmuScreen::checkPowerDown() {
}
if (coreState == CORE_POWERDOWN && !PSP_IsIniting() && !PSP_IsRebooting()) {
bool shutdown = false;
if (PSP_IsInited()) {
PSP_Shutdown();
shutdown = true;
}
INFO_LOG(Log::System, "SELF-POWERDOWN!");
screenManager()->switchScreen(new MainScreen());
bootPending_ = false;
invalid_ = true;
return true;
return shutdown;
}
return false;
}
@ -1513,6 +1515,7 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) {
draw->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::CLEAR, RPAction::CLEAR, clearColor }, "EmuScreen_NoFrame");
draw->SetViewport(viewport);
draw->SetScissorRect(0, 0, g_display.pixel_xres, g_display.pixel_yres);
framebufferBound = true;
}
Draw::BackendState state = draw->GetCurrentBackendState();
@ -1533,7 +1536,9 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) {
}
// NOTE: We don't check for powerdown if we're not the top screen.
checkPowerDown();
if (checkPowerDown()) {
draw->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::CLEAR, RPAction::CLEAR, clearColor }, "EmuScreen_PowerDown");
}
if (hasVisibleUI()) {
draw->SetViewport(viewport);