Vulkan: Fix race crash in trace viewer

This commit is contained in:
DrChat 2017-08-07 23:35:17 -05:00
parent cce5182725
commit 0720bbe19f
1 changed files with 6 additions and 1 deletions

View File

@ -85,7 +85,7 @@ std::unique_ptr<RawImage> VulkanGraphicsSystem::Capture() {
1,
};
VkCommandBuffer cmd;
VkCommandBuffer cmd = nullptr;
status = vkAllocateCommandBuffers(*device_, &alloc_info, &cmd);
CheckResult(status, "vkAllocateCommandBuffers");
@ -247,6 +247,11 @@ void VulkanGraphicsSystem::Swap(xe::ui::UIEvent* e) {
}
auto event = reinterpret_cast<VkEvent>(swap_state.backend_data);
if (event == nullptr) {
// The command processor is currently uninitialized.
return;
}
VkResult status = vkGetEventStatus(*device_, event);
if (status != VK_EVENT_SET) {
// The device has not finished processing the image.