Class RenderGraph

Class Documentation

class RenderGraph

Public Functions

inline RenderGraph(wrapper::Device &device, const wrapper::Swapchain &swapchain)
template<typename T, typename ...Args>
inline T *add(Args&&... args)

Adds either a render resource or render stage to the render graph.

Returns

A mutable reference to the just-added resource or stage

void compile(const RenderResource *target)

Compiles the render graph resources/stages into physical vulkan objects.

Parameters

target – The target resource of the render graph (usually the back buffer)

void render(std::uint32_t image_index, const wrapper::CommandBuffer &cmd_buf)

Submits the command frame’s command buffers for drawing.

Parameters
  • image_index – The current image index, retrieved from Swapchain::acquire_next_image

  • cmd_buf – The command buffer

Private Functions

void build_buffer(const BufferResource&, PhysicalBuffer&) const
void build_image(const TextureResource&, PhysicalImage&, VmaAllocationCreateInfo*) const
void build_image_view(const TextureResource&, PhysicalImage&) const
void build_pipeline_layout(const RenderStage*, PhysicalStage&) const
void record_command_buffer(const RenderStage*, const wrapper::CommandBuffer &cmd_buf, std::uint32_t image_index) const
void build_render_pass(const GraphicsStage*, PhysicalGraphicsStage&) const
void build_graphics_pipeline(const GraphicsStage*, PhysicalGraphicsStage&) const

Private Members

wrapper::Device &m_device
const wrapper::Swapchain &m_swapchain
std::shared_ptr<spdlog::logger> m_log = {spdlog::default_logger()->clone("render-graph")}
std::vector<std::unique_ptr<BufferResource>> m_buffer_resources
std::vector<std::unique_ptr<TextureResource>> m_texture_resources
std::vector<std::unique_ptr<RenderStage>> m_stages
std::vector<RenderStage*> m_stage_stack