resize command buffers list if it is to small

This commit is contained in:
Greg Wells
2025-07-16 09:13:42 -04:00
parent 002b0960d9
commit 92e8ea8fe8

View File

@@ -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;