Merge pull request #11143 from K0bin/cmd_buffer_cleanup-fix

VideoBackends:Vulkan: Fix command buffer cleanup
This commit is contained in:
Admiral H. Curtiss 2022-10-08 22:07:58 +02:00 committed by GitHub
commit 1dd30b58f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -270,8 +270,8 @@ void CommandBufferManager::WaitForCommandBufferCompletion(u32 index)
// Clean up any resources for command buffers between the last known completed buffer and this
// now-completed command buffer. If we use >2 buffers, this may be more than one buffer.
const u64 now_completed_counter = resources.fence_counter;
u32 cleanup_index = (index + 1) % NUM_COMMAND_BUFFERS;
while (cleanup_index != index)
u32 cleanup_index = (m_current_cmd_buffer + 1) % NUM_COMMAND_BUFFERS;
while (cleanup_index != m_current_cmd_buffer)
{
CmdBufferResources& cleanup_resources = m_command_buffers[cleanup_index];
if (cleanup_resources.fence_counter > now_completed_counter)