protected CommandBuffer AllocateCommandBuffer(CommandBufferLevel level) { CommandBufferAllocateInfo info = new CommandBufferAllocateInfo(commandPool: this.CommandPool, level: level, commandBufferCount: 1); CommandBuffer buffer; var res = VkApi.AllocateCommandBuffers(Device, &info, &buffer); if (res != Result.Success) { throw new Exception("Unable to allocate command buffers"); } return(buffer); }
protected CommandBuffer[] AllocateCommandBuffers(int count, CommandBufferLevel level) { CommandBufferAllocateInfo info = new CommandBufferAllocateInfo(commandPool: this.CommandPool, level: level, commandBufferCount: (uint)count); CommandBuffer[] buffers = new CommandBuffer[count]; fixed(CommandBuffer *pbuffers = buffers) { var res = VkApi.AllocateCommandBuffers(Device, &info, pbuffers); if (res != Result.Success) { throw new Exception("Unable to allocate command buffers"); } } return(buffers); }