Topaz 5.0
Topaz Game Engine
Loading...
Searching...
No Matches
graph.hpp
1#ifndef TOPAZ_GPU_GRAPH_HPP
2#define TOPAZ_GPU_GRAPH_HPP
3#include "tz/gpu/pass.hpp"
4#include <vector>
5
6namespace tz::gpu
7{
19 {
20 };
21
22 constexpr graph_flag operator|(graph_flag lhs, graph_flag rhs)
23 {
24 return static_cast<graph_flag>(static_cast<int>(lhs) | static_cast<int>(rhs));
25 }
26
27 constexpr bool operator&(graph_flag lhs, graph_flag& rhs)
28 {
29 return static_cast<int>(lhs) & static_cast<int>(rhs);
30 }
31
32 using graph_handle = tz::handle<pass_handle>;
33
38 graph_handle create_graph(const char* name = "<untitled graph>");
39 void graph_add_pass(graph_handle graph, pass_handle pass, std::span<const pass_handle> dependencies = {});
40 void graph_add_subgraph(graph_handle graph, graph_handle subgraph);
41 void graph_set_execute_callback(graph_handle graph, void(*on_execute)(graph_handle));
47}
48
49#endif // TOPAZ_GPU_GRAPH_HPP
Represents a generic opaque handle.
Definition handle.hpp:32
graph_flag
Specifies optional, extra functionality for a graph.
Definition graph.hpp:19
graph_handle create_graph(const char *name="<untitled graph>")
Create a new graph, which can be used for rendering a frame.
void execute(graph_handle)
Execute the graph - invoking all passes contained a single time.