fix crash bug
This commit is contained in:
+7
-4
@@ -1,4 +1,4 @@
|
||||
#include "FaceApp.h"
|
||||
#include "FaceApp.h"
|
||||
#include "hardcode_data.h"
|
||||
#include "lodepng.h"
|
||||
#include <sstream>
|
||||
@@ -984,9 +984,12 @@ void FaceApp::endSingleTimeCommands(VkCommandBuffer commandBuffer) {
|
||||
submitInfo.commandBufferCount = 1;
|
||||
submitInfo.pCommandBuffers = &commandBuffer;
|
||||
|
||||
vkQueueSubmit(graphicsQueue, 1, &submitInfo, VK_NULL_HANDLE);
|
||||
vkQueueWaitIdle(graphicsQueue);
|
||||
|
||||
// 与 Application::drawFrame 共用 graphicsQueue,必须串行,避免驱动内 SIGSEGV
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mtx);
|
||||
vkQueueSubmit(graphicsQueue, 1, &submitInfo, VK_NULL_HANDLE);
|
||||
vkQueueWaitIdle(graphicsQueue);
|
||||
}
|
||||
vkFreeCommandBuffers(device, commandPool, 1, &commandBuffer);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user