diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 1188e2fed2..54947cdb11 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -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; 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(); } diff --git a/UI/EmuScreen.h b/UI/EmuScreen.h index 3f103513b7..8fefb5226c 100644 --- a/UI/EmuScreen.h +++ b/UI/EmuScreen.h @@ -77,6 +77,7 @@ private: // 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. diff --git a/ext/native/thin3d/VulkanRenderManager.cpp b/ext/native/thin3d/VulkanRenderManager.cpp index d578ac7335..36ca452f21 100644 --- a/ext/native/thin3d/VulkanRenderManager.cpp +++ b/ext/native/thin3d/VulkanRenderManager.cpp @@ -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 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 {