Engine²
Open-source game engine written in C++.
Loading...
Searching...
No Matches
Graphic::Resource::RenderGraph Class Reference

#include <RenderGraph.hpp>

Classes

struct  IDHash

Public Member Functions

 RenderGraph (void)=default
 ~RenderGraph ()=default
 RenderGraph (const RenderGraph &)=delete
RenderGraphoperator= (const RenderGraph &)=delete
 RenderGraph (RenderGraph &&)=default
RenderGraphoperator= (RenderGraph &&)=default
template<CRenderPass TRenderPass>
void Add (std::string_view name, TRenderPass &&renderPass)
void Remove (std::string_view name)
void Execute (Engine::Core &core)
bool Contains (std::string_view name) const
void SetDependency (std::string_view nameBefore, std::string_view nameAfter)

Private Types

using ID = entt::hashed_string

Private Member Functions

void Update (void)
void TopologicalSort (void)
void ProcessDependencies (ID current, std::queue< ID > &queue, std::unordered_map< ID, size_t, IDHash > &inDegree) const

Static Private Member Functions

static ID GetID (std::string_view name)

Private Attributes

bool _dirty = false
std::unordered_map< ID, std::shared_ptr< ARenderPass >, IDHash_renderPasses
std::unordered_map< ID, std::unordered_set< ID, IDHash >, IDHash_dependencies
std::list< ID_orderedIDs

Member Typedef Documentation

◆ ID

using Graphic::Resource::RenderGraph::ID = entt::hashed_string
private

Constructor & Destructor Documentation

◆ RenderGraph() [1/3]

Graphic::Resource::RenderGraph::RenderGraph ( void )
default

◆ ~RenderGraph()

Graphic::Resource::RenderGraph::~RenderGraph ( )
default

◆ RenderGraph() [2/3]

Graphic::Resource::RenderGraph::RenderGraph ( const RenderGraph & )
delete

◆ RenderGraph() [3/3]

Graphic::Resource::RenderGraph::RenderGraph ( RenderGraph && )
default

Member Function Documentation

◆ Add()

template<CRenderPass TRenderPass>
void Graphic::Resource::RenderGraph::Add ( std::string_view name,
TRenderPass && renderPass )
inline

◆ Contains()

bool Graphic::Resource::RenderGraph::Contains ( std::string_view name) const

◆ Execute()

void Graphic::Resource::RenderGraph::Execute ( Engine::Core & core)

◆ GetID()

ID Graphic::Resource::RenderGraph::GetID ( std::string_view name)
inlinestaticprivate

◆ operator=() [1/2]

RenderGraph & Graphic::Resource::RenderGraph::operator= ( const RenderGraph & )
delete

◆ operator=() [2/2]

RenderGraph & Graphic::Resource::RenderGraph::operator= ( RenderGraph && )
default

◆ ProcessDependencies()

void Graphic::Resource::RenderGraph::ProcessDependencies ( ID current,
std::queue< ID > & queue,
std::unordered_map< ID, size_t, IDHash > & inDegree ) const
private

◆ Remove()

void Graphic::Resource::RenderGraph::Remove ( std::string_view name)

◆ SetDependency()

void Graphic::Resource::RenderGraph::SetDependency ( std::string_view nameBefore,
std::string_view nameAfter )

◆ TopologicalSort()

void Graphic::Resource::RenderGraph::TopologicalSort ( void )
private

◆ Update()

void Graphic::Resource::RenderGraph::Update ( void )
private

Member Data Documentation

◆ _dependencies

std::unordered_map<ID, std::unordered_set<ID, IDHash>, IDHash> Graphic::Resource::RenderGraph::_dependencies
private

◆ _dirty

bool Graphic::Resource::RenderGraph::_dirty = false
private

◆ _orderedIDs

std::list<ID> Graphic::Resource::RenderGraph::_orderedIDs
private

◆ _renderPasses

std::unordered_map<ID, std::shared_ptr<ARenderPass>, IDHash> Graphic::Resource::RenderGraph::_renderPasses
private

The documentation for this class was generated from the following files: