In Vulkan, the drawing and other operations done on the GPU are performed using command buffers. The command buffers contain the draw commands, which are recorded and then executed. Draw commands are to be recorded and executed in every frame. To create a command buffer, we have to first create a command pool and then allocate command buffers from the command pool, and then the commands are recorded per frame.
Let's create a new class for creating the command buffer pool and then allocate the command buffers. We also create a function to start and stop recording and to destroy the command buffers. Create a new class, called DrawCommandBuffer, and DrawCommandBuffer.h as follows:
#include <vulkan\vulkan.h> #include <vector> class DrawCommandBuffer { public: DrawCommandBuffer(); ~DrawCommandBuffer(); VkCommandPool commandPool...