From 836290aa74461bf1148737c1d0d504aa4a086a62 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 22 Jun 2023 19:06:12 +0900 Subject: [PATCH] [vulkan] Update the active command buffer indices When creating a new command buffer and appending it to a queue, the active buffer count needs to be incremented too otherwise the new command buffer will be accidentally reused prematurely. Not noticed earlier because only one buffer was being created. --- libs/video/renderer/vulkan/command.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/video/renderer/vulkan/command.c b/libs/video/renderer/vulkan/command.c index 9708ead0e..39b02e211 100644 --- a/libs/video/renderer/vulkan/command.c +++ b/libs/video/renderer/vulkan/command.c @@ -109,8 +109,10 @@ QFV_CmdPoolManager_CmdBuffer (qfv_cmdpoolmgr_t *manager, bool secondary) dfunc->vkAllocateCommandBuffers (device->dev, &cinfo, &cmd); if (secondary) { DARRAY_APPEND (&manager->secondary, cmd); + manager->active_secondary++; } else { DARRAY_APPEND (&manager->primary, cmd); + manager->active_primary++; } return cmd; }