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.
This commit is contained in:
Unknown W. Brackets committed 2017-12-03 20:32:17 -08:00
1 parent 9c046d7518
commit 5846016247
1 file changed
+6 -2
+6 -2
View File
@@ -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++) {