- do not signal mRenderFinishedSemaphore if the submitted commands aren't about to be presented

This commit is contained in:
Magnus Norddahl 2019-03-22 13:54:13 +01:00
parent 4d768e5a49
commit d03839dfef

View file

@ -249,7 +249,7 @@ void VulkanFrameBuffer::SubmitCommands(bool finish)
submitInfo.pWaitDstStageMask = waitStages; submitInfo.pWaitDstStageMask = waitStages;
submitInfo.commandBufferCount = 1; submitInfo.commandBufferCount = 1;
submitInfo.pCommandBuffers = &mDrawCommands->buffer; submitInfo.pCommandBuffers = &mDrawCommands->buffer;
submitInfo.signalSemaphoreCount = 1; submitInfo.signalSemaphoreCount = finish ? 1 : 0;
submitInfo.pSignalSemaphores = &mRenderFinishedSemaphore->semaphore; submitInfo.pSignalSemaphores = &mRenderFinishedSemaphore->semaphore;
result = vkQueueSubmit(device->graphicsQueue, 1, &submitInfo, mRenderFinishedFence->fence); result = vkQueueSubmit(device->graphicsQueue, 1, &submitInfo, mRenderFinishedFence->fence);
if (result < VK_SUCCESS) if (result < VK_SUCCESS)
@ -267,7 +267,7 @@ void VulkanFrameBuffer::SubmitCommands(bool finish)
submitInfo.pWaitDstStageMask = waitStages; submitInfo.pWaitDstStageMask = waitStages;
submitInfo.commandBufferCount = 1; submitInfo.commandBufferCount = 1;
submitInfo.pCommandBuffers = &mDrawCommands->buffer; submitInfo.pCommandBuffers = &mDrawCommands->buffer;
submitInfo.signalSemaphoreCount = 1; submitInfo.signalSemaphoreCount = finish ? 1 : 0;
submitInfo.pSignalSemaphores = &mRenderFinishedSemaphore->semaphore; submitInfo.pSignalSemaphores = &mRenderFinishedSemaphore->semaphore;
VkResult result = vkQueueSubmit(device->graphicsQueue, 1, &submitInfo, mRenderFinishedFence->fence); VkResult result = vkQueueSubmit(device->graphicsQueue, 1, &submitInfo, mRenderFinishedFence->fence);
if (result < VK_SUCCESS) if (result < VK_SUCCESS)