diff --git a/src/rendering/vulkan/system/vk_framebuffer.cpp b/src/rendering/vulkan/system/vk_framebuffer.cpp index 54789bbdb..da43430ab 100644 --- a/src/rendering/vulkan/system/vk_framebuffer.cpp +++ b/src/rendering/vulkan/system/vk_framebuffer.cpp @@ -193,7 +193,7 @@ void VulkanFrameBuffer::DeleteFrameObjects() FrameDeleteList.CommandBuffers.clear(); } -void VulkanFrameBuffer::FlushCommands(VulkanCommandBuffer **commands, size_t count, bool finish) +void VulkanFrameBuffer::FlushCommands(VulkanCommandBuffer **commands, size_t count, bool finish, bool lastsubmit) { int currentIndex = mNextSubmit % maxConcurrentSubmitCount; @@ -217,14 +217,14 @@ void VulkanFrameBuffer::FlushCommands(VulkanCommandBuffer **commands, size_t cou submit.addSignal(mRenderFinishedSemaphore.get()); } - if (!finish) + if (!lastsubmit) submit.addSignal(mSubmitSemaphore[currentIndex].get()); submit.execute(device, device->graphicsQueue, mSubmitFence[currentIndex].get()); mNextSubmit++; } -void VulkanFrameBuffer::FlushCommands(bool finish) +void VulkanFrameBuffer::FlushCommands(bool finish, bool lastsubmit) { if (mDrawCommands || mTransferCommands) { @@ -245,7 +245,7 @@ void VulkanFrameBuffer::FlushCommands(bool finish) FrameDeleteList.CommandBuffers.push_back(std::move(mDrawCommands)); } - FlushCommands(commands, count, finish); + FlushCommands(commands, count, finish, lastsubmit); current_rendered_commandbuffers += (int)count; } @@ -263,7 +263,7 @@ void VulkanFrameBuffer::WaitForCommands(bool finish) mPostprocess->DrawPresentTexture(mOutputLetterbox, true, true); } - FlushCommands(finish); + FlushCommands(finish, true); if (finish) { diff --git a/src/rendering/vulkan/system/vk_framebuffer.h b/src/rendering/vulkan/system/vk_framebuffer.h index 5bdbc820d..0051abbaa 100644 --- a/src/rendering/vulkan/system/vk_framebuffer.h +++ b/src/rendering/vulkan/system/vk_framebuffer.h @@ -34,7 +34,7 @@ public: VkPostprocess *GetPostprocess() { return mPostprocess.get(); } VkRenderBuffers *GetBuffers() { return mActiveRenderBuffers; } - void FlushCommands(bool finish); + void FlushCommands(bool finish, bool lastsubmit = false); unsigned int GetLightBufferBlockSize() const; @@ -111,7 +111,7 @@ private: void CopyScreenToBuffer(int w, int h, void *data); void UpdateShadowMap(); void DeleteFrameObjects(); - void FlushCommands(VulkanCommandBuffer **commands, size_t count, bool finish); + void FlushCommands(VulkanCommandBuffer **commands, size_t count, bool finish, bool lastsubmit); std::unique_ptr mShaderManager; std::unique_ptr mSamplerManager;