Permalink
Browse files

Fix annoying little flicker when starting a game.

  • Loading branch information...
hrydgard committed Nov 13, 2017
1 parent 4788221 commit 8bfdf7b1b2f5bbc3093890b64ee1d67fe136d6c9
Showing with 8 additions and 3 deletions.
  1. +3 −1 UI/EmuScreen.cpp
  2. +1 −0 UI/EmuScreen.h
  3. +4 −2 ext/native/thin3d/VulkanRenderManager.cpp
View
@@ -320,11 +320,13 @@ void EmuScreen::sendMessage(const char *message, const char *value) {
// We will push MainScreen in update().
PSP_Shutdown();
bootPending_ = false;
stopRender_ = true;
invalid_ = true;
host->UpdateDisassembly();
} else if (!strcmp(message, "reset")) {
PSP_Shutdown();
bootPending_ = true;
stopRender_ = true;

This comment has been minimized.

Show comment
Hide comment
@unknownbrackets

unknownbrackets Nov 13, 2017

Collaborator

Doesn't this need to get set back to false at some point on reset?

-[Unknown]

@unknownbrackets

unknownbrackets Nov 13, 2017

Collaborator

Doesn't this need to get set back to false at some point on reset?

-[Unknown]

This comment has been minimized.

Show comment
Hide comment
@hrydgard

hrydgard Nov 13, 2017

Owner

Hm, oops. Yeah. Not even sure we actually still need this thing...

@hrydgard

hrydgard Nov 13, 2017

Owner

Hm, oops. Yeah. Not even sure we actually still need this thing...

invalid_ = true;
host->UpdateDisassembly();
@@ -987,7 +989,7 @@ void EmuScreen::postRender() {
Draw::DrawContext *draw = screenManager()->getDrawContext();
if (!draw)
return;
if (invalid_)
if (stopRender_)
draw->WipeQueue();
draw->EndFrame();
}
View
@@ -77,6 +77,7 @@ class EmuScreen : public UIScreen {
// Something invalid was loaded, don't try to emulate
bool invalid_;
bool quit_;
bool stopRender_ = false;
std::string errorMessage_;
// If set, pauses at the end of the frame.
@@ -227,6 +227,9 @@ void VulkanRenderManager::StopThread() {
Crash();
}
frameData.readyForRun = false;
for (size_t i = 0; i < frameData.steps.size(); i++) {
delete frameData.steps[i];
}
frameData.steps.clear();
std::unique_lock<std::mutex> lock(frameData.push_mutex);
@@ -803,8 +806,7 @@ void VulkanRenderManager::EndSubmitFrame(int frame) {
present.waitSemaphoreCount = 1;
VkResult res = vkQueuePresentKHR(vulkan_->GetGraphicsQueue(), &present);
// TODO: Deal with the VK_SUBOPTIMAL_WSI and VK_ERROR_OUT_OF_DATE_WSI
// return codes
// TODO: Deal with VK_SUBOPTIMAL_WSI ?
if (res == VK_ERROR_OUT_OF_DATE_KHR) {
// ignore, it'll be fine. this happens sometimes during resizes, and we do make sure to recreate the swap chain.
} else {

0 comments on commit 8bfdf7b

Please sign in to comment.