O'Reilly logo

Learning Vulkan by Parminder Singh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Clearing the background color

In this section, we use the created Render Pass and framebuffer object and implement the Render Pass instance. This Render Pass instance is very simple and will only clear the background image with a specified color. For each swapchain image, different colors can be specified using the pClearValues field of the VkRenderPassBeginInfo structure; this structure is then passed to the Render Pass instance.

The Render Pass instance is implemented during the preparation stage in which the command buffers are created. For each swapchain image, a corresponding command buffer object is created. This means, for n swapchain images, we need to create n command buffer objects.

The preparation is done using the VulkanDrawable::prepare() ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required