VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
frameGraph.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2025-2026 Arnis Lektauers
3//
4// Created by Arnis Lektauers on 11.09.2025.
5//
6#pragma once
7
8#include <unordered_map>
9#include <vector>
10
12
13namespace visutwin::canvas
14{
15 /*
16 * A frame graph represents a single rendering frame as a sequence of render passes.
17 */
19 {
20 public:
21 // Reset the frame graph, clearing all render passes
22 void reset();
23
24 // Add a render pass to the frame
25 void addRenderPass(const std::shared_ptr<RenderPass>& renderPass);
26
27 // Compile the frame graph, optimizing render passes
28 void compile();
29
30 // Render all passes in the frame graph
31 void render(GraphicsDevice* device);
32
33 private:
34 std::vector<std::shared_ptr<RenderPass>> _renderPasses;
35
36 // Map used during frame graph compilation. It maps a render target to its previous occurrence
37 std::unordered_map<RenderTarget*, std::shared_ptr<RenderPass>> _renderTargetMap;
38 };
39}
void render(GraphicsDevice *device)
void addRenderPass(const std::shared_ptr< RenderPass > &renderPass)
Abstract GPU interface for resource creation, state management, and draw submission.