From b23958b20469ef1802e8c8f2517cac2f7897ba2f Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Wed, 1 May 2019 13:42:07 +0300 Subject: [PATCH] - fixed saved game thumbnails generation with Vulkan renderer GZDoom aborts with 'Failed to submit command buffer' error on saving a game when open source Intel Vulkan driver (part of Mesa 3D package) is used on Linux This driver generates VK_DEVICE_LOST error when vkWaitForFences() is called with zero fence count. It must be greater than zero according to Vulkan spec --- src/rendering/vulkan/system/vk_framebuffer.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/rendering/vulkan/system/vk_framebuffer.cpp b/src/rendering/vulkan/system/vk_framebuffer.cpp index 1b7528747..637a4c7da 100644 --- a/src/rendering/vulkan/system/vk_framebuffer.cpp +++ b/src/rendering/vulkan/system/vk_framebuffer.cpp @@ -286,8 +286,12 @@ void VulkanFrameBuffer::WaitForCommands(bool finish) } int numWaitFences = MIN(mNextSubmit, (int)maxConcurrentSubmitCount); - vkWaitForFences(device->device, numWaitFences, mSubmitWaitFences, VK_TRUE, std::numeric_limits::max()); - vkResetFences(device->device, numWaitFences, mSubmitWaitFences); + + if (numWaitFences > 0) + { + vkWaitForFences(device->device, numWaitFences, mSubmitWaitFences, VK_TRUE, std::numeric_limits::max()); + vkResetFences(device->device, numWaitFences, mSubmitWaitFences); + } DeleteFrameObjects(); mNextSubmit = 0;