fix exponential growth when submitting multiple command buffers

main 1.5.2
cosmonaut 2022-06-27 10:21:40 -07:00
parent 99e9dc5b8c
commit e5da75d33a
1 changed files with 5 additions and 8 deletions

View File

@ -9470,9 +9470,9 @@ static void VULKAN_Submit(
/* Mark command buffers as submitted */
if (renderer->submittedCommandBufferCount + commandBufferCount >= renderer->submittedCommandBufferCapacity)
if (renderer->submittedCommandBufferCount + 1 >= renderer->submittedCommandBufferCapacity)
{
renderer->submittedCommandBufferCapacity = renderer->submittedCommandBufferCount + commandBufferCount;
renderer->submittedCommandBufferCapacity = renderer->submittedCommandBufferCount + 1;
renderer->submittedCommandBuffers = SDL_realloc(
renderer->submittedCommandBuffers,
@ -9480,12 +9480,9 @@ static void VULKAN_Submit(
);
}
for (i = 0; i < commandBufferCount; i += 1)
{
((VulkanCommandBuffer*)pCommandBuffers[i])->submitted = 1;
renderer->submittedCommandBuffers[renderer->submittedCommandBufferCount] = (VulkanCommandBuffer*) pCommandBuffers[i];
renderer->submittedCommandBufferCount += 1;
}
((VulkanCommandBuffer*)pCommandBuffers[i])->submitted = 1;
renderer->submittedCommandBuffers[renderer->submittedCommandBufferCount] = (VulkanCommandBuffer*) pCommandBuffers[i];
renderer->submittedCommandBufferCount += 1;
/* Present, if applicable */