vpr::Renderpass class

RAII wrapper around a Vulkan object, with a few utility methods to avoid redundancy and clutter in command-recording methods for various scenes.

Contents

Requires updating per-frame with the framebuffer being rendered to, and make sure to set both the render area and the clear values array after creating the object.

Public functions

void SetupBeginInfo(const VkClearValue* clear_values, const size_t num_values, const VkExtent2D& render_area)
Must be setup before trying to use the VkRenderPassBeginInfo object attached to this class.
void UpdateBeginInfo(const VkFramebuffer& current_framebuffer)
Call each frame or when changing a framebuffer to ensure the correct framebuffer is rendered to.
void Destroy()
Effectively resets this object back to a base state.
void Recreate()
Recreates object after a call to destroy, using pre-existing VkRenderPassCreateInfo that we have stored.
auto BeginInfo() const -> const VkRenderPassBeginInfo& noexcept
This is the object you will need to retrieve inside renderpasses, when calling vkCmdBeginRenderpass.

Function documentation

void vpr::Renderpass::SetupBeginInfo(const VkClearValue* clear_values, const size_t num_values, const VkExtent2D& render_area)

Must be setup before trying to use the VkRenderPassBeginInfo object attached to this class.

Will cause validation layer and rendering errors otherwise.