vulkan-renderer
vulkan-renderer copied to clipboard
Refactor command pool and command buffer management
Is your feature request related to a problem?
There is a lot wrong with the command pool and command buffer code I wrote.
Description
First of all, according to NVidia Vulkan tips, we should aim for only one command pool per thread! We have several currently. Even worse, we have one per OnceCommandBuffer. That's not good at all. Furthermore, we should reuse command buffers. We should get rid of the OnceCommandBuffer wrapper and introduce a pool of command buffers from which we can request one.
Affected Code
The entire code base.
Operating System
All operating systems.
We should also remove wrapper::StagingBuffer entirely and implement a method upload_data_to_gpu_buffer into wrapper::Device. This also solves the question of how to manage transfer queues in the device wrapper. We simply keep another command pool which is bound to the queue family index of the transfer queue.
I moved the TODO list to the pull request.