From 92e8ea8fe81b9cef1534a195304cf92053634a82 Mon Sep 17 00:00:00 2001 From: Greg Wells Date: Wed, 16 Jul 2025 09:13:42 -0400 Subject: [PATCH] resize command buffers list if it is to small --- .../core/src/command/command_buffer/gryphn_command_buffer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/projects/core/src/command/command_buffer/gryphn_command_buffer.c b/projects/core/src/command/command_buffer/gryphn_command_buffer.c index 66eae7f..70c8a9e 100644 --- a/projects/core/src/command/command_buffer/gryphn_command_buffer.c +++ b/projects/core/src/command/command_buffer/gryphn_command_buffer.c @@ -12,6 +12,10 @@ gnReturnCode gnCommandPoolAllocateCommandBuffersFromPointer(gnCommandBufferHandl } gnReturnCode gnCommandPoolAllocateCommandBuffersFromList(gnCommandBufferArrayList buffers, uint32_t count, gnCommandPoolHandle commandPool) { + if (buffers.count < count) { + gnCommandBufferArrayListExpand(&buffers, buffers.count - count); + } + for (int i = 0; i < count; i++) { buffers.data[i] = malloc(sizeof(struct gnCommandBuffer_t)); buffers.data[i]->commandPool = commandPool;