Beginning a render pass
When we have created a render pass and a framebuffer and we are ready to start recording commands needed to render a geometry, we must record an operation that begins the render pass. This also automatically starts its first subpass.
How to do it...
- Take the handle of a command buffer stored in a variable of type
VkCommandBuffer
namedcommand_buffer
. Make sure the command buffer is in the recording state. - Use the handle of the render pass to initialize a variable of type
VkRenderPass
namedrender_pass
.
- Take the framebuffer that is compatible with the
render_pass
. Store its handle in a variable of typeVkFramebuffer
namedframebuffer
. - Specify the dimensions of the render area into which rendering will be confined during the render pass. This area cannot be larger than the size specified for the framebuffer. Store the dimensions in a variable of type
VkRect2D
namedrender_area
. - Create a variable of type
std::vector<VkClearValue>
namedclear_values
with the number of...