Along with the commands being recorded in each frame, the renderpass is also processed for each frame where the color and the depth information is reset. So, since we only have color attachments in each frame, we have to clear the color information for each frame as well. Go back to the Renderpass.h file and add two new functions, called beginRenderPass and endRenderPass, in the class, as follows:
class Renderpass { public: Renderpass(); ~Renderpass(); VkRenderPass renderPass; void createRenderPass(VkFormat swapChainImageFormat); void beginRenderPass(std::array<VkClearValue, 1>
clearValues, VkCommandBuffer commandBuffer, VkFramebuffer
swapChainFrameBuffer, VkExtent2D swapChainImageExtent); void endRenderPass(VkCommandBuffer commandBuffer); void destroy(); };
In RenderPass.cpp, add...