vulkan-renderer icon indicating copy to clipboard operation
vulkan-renderer copied to clipboard

Refactor command pool and command buffer management

Open IAmNotHanni opened this issue 3 years ago • 2 comments

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.

IAmNotHanni avatar Apr 24 '22 20:04 IAmNotHanni

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.

IAmNotHanni avatar Apr 28 '22 10:04 IAmNotHanni

I moved the TODO list to the pull request.

IAmNotHanni avatar May 12 '22 20:05 IAmNotHanni