Permalink
Browse files

Vulkan: Allow shutdown with init commands.

On startup, when immediately shutting down, there will be init commands
from creating the backbuffers.  Rather than fight this, just free them.

This fixes hangs when locking/unlocking Android.
  • Loading branch information...
unknownbrackets committed Dec 4, 2017
1 parent 9c046d7 commit 584601624746aada44b0dc0c8d75406ca20e6790
Showing with 6 additions and 2 deletions.
  1. +6 −2 ext/native/thin3d/VulkanRenderManager.cpp
@@ -225,8 +225,12 @@ void VulkanRenderManager::StopThread() {
// when we restart...
for (int i = 0; i < vulkan_->GetInflightFrames(); i++) {
auto &frameData = frameData_[i];
if (frameData.readyForRun || frameData.hasInitCommands || frameData.steps.size() != 0) {
Crash();
_assert_(!frameData.readyForRun);
_assert_(frameData.steps.empty());
if (frameData.hasInitCommands) {
// Clear 'em out. This can happen on restart sometimes.
vkEndCommandBuffer(frameData.initCmd);
frameData.hasInitCommands = false;
}
frameData.readyForRun = false;
for (size_t i = 0; i < frameData.steps.size(); i++) {

0 comments on commit 5846016

Please sign in to comment.