1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| void xWaitForCommmandFinish(VkCommandBuffer commandbuffer) { VkSubmitInfo submitinfo = {}; submitinfo.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO; submitinfo.commandBufferCount = 1; submitinfo.pCommandBuffers = &commandbuffer; VkFence fence; VkFenceCreateInfo fenceinfo = {}; fenceinfo.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO; vkCreateFence(GetVulkanDevice(), &fenceinfo, nullptr, &fence); vkQueueSubmit(GetGraphicQueue(), 1, &submitinfo, fence); vkWaitForFences(GetVulkanDevice(), 1, &fence, VK_TRUE, 1000000); vkDestroyFence(GetVulkanDevice(), fence, nullptr); }
|