- the semaphore should never be added when its the last submit before waiting

This commit is contained in:
Magnus Norddahl 2019-04-20 16:42:52 +02:00
commit a3587009e7
2 changed files with 7 additions and 7 deletions

View file

@ -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)
{