|
CeresEngine 0.2.0
A game development framework
|
Represents a graph type that can be used for describring the whole rendering process in the engine. More...
#include <CeresEngine/Renderer/RenderGraph2/RenderGraph.hpp>
Public Member Functions | |
| RenderGraph ()=default | |
Creates a new RenderGraph instance. | |
| ~RenderGraph () noexcept override=default | |
Destroys RenderGraph instance. | |
| const Vector< RenderGraphResourcePtr > & | getResources () const noexcept |
| A list of resources managed by the graph. | |
| RenderGraphImage & | addImage (const RenderGraphImageDescriptor &descriptor, StringView name="") |
| Adds a new image render resource. | |
| RenderGraphBuffer & | addBuffer (const RenderGraphBufferDescriptor &descriptor, StringView name="") |
| Adds a new buffer render resource. | |
| void | removeResource (RenderGraphResource &resource) |
| Removes a resource from the render graph. | |
| SPtr< RenderGraphProgram > | compile (GraphSocket &output) const |
| Compiles the graph into a sequence of commands that is suitable for submitting commands to the GPU. | |
Public Member Functions inherited from CeresEngine::Graph | |
| Graph ()=default | |
| virtual | ~Graph () noexcept=default |
| GraphNode * | getNode (StringView name) const |
| const Vector< GraphNodePtr > & | getNodes () const noexcept |
| void | addNode (GraphNode &node) |
| template<typename T , typename... Args> requires (std::is_base_of_v<GraphNode, T>) | |
| T & | addNode (Args &&... args) |
| void | removeNode (GraphNode &node) |
| GraphConnection * | connect (GraphSocket &outputSocket, GraphSocket &inputSocket) |
| GraphInstancePtr | instantiate () |
Public Member Functions inherited from CeresEngine::RefCounted< Graph > | |
| RefCounted (Args &&... args) | |
Creates a new RefCounted object and constructs a new Deleter by forwarding Args to it. | |
| void | retain () noexcept |
| Retains the object by increment it's reference count by one. | |
| bool | release () noexcept |
| Relases the object by decrementing it's reference count by one. | |
Private Attributes | |
| Vector< RenderGraphResourcePtr > | mResources |
| A list of resources managed by the graph. | |
Additional Inherited Members | |
Public Attributes inherited from CeresEngine::Graph | |
| Event< void()> | onChange |
| Event< void(GraphNode &)> | onNodeAdded |
| Event< void(GraphNode &)> | onNodeRemoved |
Represents a graph type that can be used for describring the whole rendering process in the engine.
Nodes can be added, removed or changed to customize rendering behavior and effects.
When certain rendering features are disabled, the graph can optimize itself and disable any remaining dangling nodes whose output is not required for the current configuration.
|
explicitdefault |
Creates a new RenderGraph instance.
|
overridedefaultnoexcept |
Destroys RenderGraph instance.
| RenderGraphBuffer & CeresEngine::RenderGraph2::RenderGraph::addBuffer | ( | const RenderGraphBufferDescriptor & | descriptor, |
| StringView | name = "" |
||
| ) |
Adds a new buffer render resource.
| descriptor | A structure that describes the buffer to be created. |
| name | An optional string that includes a human readable name for the resource. |
| RenderGraphImage & CeresEngine::RenderGraph2::RenderGraph::addImage | ( | const RenderGraphImageDescriptor & | descriptor, |
| StringView | name = "" |
||
| ) |
Adds a new image render resource.
| descriptor | A structure that describes the image to be created. |
| name | An optional string that includes a human readable name for the resource. |
| SPtr< RenderGraphProgram > CeresEngine::RenderGraph2::RenderGraph::compile | ( | GraphSocket & | output | ) | const |
Compiles the graph into a sequence of commands that is suitable for submitting commands to the GPU.
At this stage, a several actions are performed. The graph is first validated to ensure that it doesn't contain cycles or has all required inputs connected. Next, it orders the execution of each render task such as that all it's inputs are rendered before it and appropriately handles memory barriers for such resources.
After that, a the implementation can perform other optimizations such as merging multiple render passes into one or alising of resource memory.
The baked render graph returned by this method can be used and re-used to perform rendering on the GPU. It can be re-utilized for as long as the originating render graph doesn't change. Any changes to the render graph will require a new compilation of it before executing.
|
inlinenoexcept |
A list of resources managed by the graph.
| void CeresEngine::RenderGraph2::RenderGraph::removeResource | ( | RenderGraphResource & | resource | ) |
Removes a resource from the render graph.
A resource can only be removed if it is no longer referenced by any task.
| resource | The resource to be removed. |
|
private |
A list of resources managed by the graph.