FCT
载入中...
搜索中...
未找到
FCT::RenderGraph类 参考

#include <RenderGraph.h>

类 FCT::RenderGraph 继承关系图:
Inheritance graph
FCT::RenderGraph 的协作图:
Collaboration graph

struct  BarrierInfo
struct  ImageState

Public 成员函数

 RenderGraph (Device *device, FlowControl *flowControl, CommandBufferGraph *commandBufferGraph, ResourceManager *resourceManager)
template<typename Func>
SubscribeId subscribe (std::string passName, Func &&func)
void unsubscribe (SubscribeId subscribeId)
template<typename... Args>
void addPass (std::string name, Args &&... args)
void compile ()
void executeAllPassGroups (RHI::CommandBuffer *cmdBuffer)
RHI::PassgetPass (const std::string &name) const
ImagegetImage (const std::string &name) const
std::vector< TextureEdge * > getTextureEdges (const std::string &passName) const

Private 成员函数

void initForSubmit ()
void allocateCommandBuffer ()
RenderGraphImageNodegetOrCreateImageNode (const std::string &name, const Texture &texture)
RenderGraphImageNodegetOrCreateImageNode (const std::string &name, const Target &target)
RenderGraphImageNodegetOrCreateImageNode (const std::string &name, const DepthStencil &depthStencil)
void createTextureEdge (const std::string &passName, const std::string &textureName, const Texture &texture)
void createTargetEdge (const std::string &passName, const std::string &targetName, const Target &target)
void createDepthStencilEdge (const std::string &passName, const std::string &depthStencilName, const DepthStencil &depthStencil)
void simulatePassGroupExecution (const std::string &groupLeader, const std::vector< std::string > &groupMembers, std::unordered_map< Image *, ImageState > &imageStates)
void simulateExecutionAndAnalyzeBarriers ()
std::vector< BarrierInfocheckBarriersBeforePassGroup (const std::string &groupLeader, const std::vector< std::string > &groupMembers, const std::unordered_map< Image *, ImageState > &imageStates)
void executeBarriers (RHI::CommandBuffer *cmdBuffer, const std::vector< BarrierInfo > &barriers)
void addPass (const PassDesc &desc)
void cleanUpCompile ()
void cleanUp ()
void resolveTextureSizes ()
void groupPasses ()
void allocateResources ()
void createRHIPasses ()
void analyzePassGroupDependencies (const std::string &groupLeader, const std::vector< std::string > &groupMembers, std::map< std::string, std::set< std::string > > &dependencies) const
std::vector< std::string > topologicalSort (const std::map< std::string, std::set< std::string > > &dependencies) const
void analyzePassGroupBarriers ()
void computePassGroupExecutionOrder ()
void createPassGroups ()
PipelineStage convertShaderStageToPipelineStage (ShaderStage stage) const
void submitPassGroup (RHI::CommandBuffer *cmdBuffer, const std::string &groupLeader)
void trigger (const Event &event)
void enqueue (Event &&event)
void update ()
void updateAll ()
SubscribeId subscribe (Func &&func)
void unsubscribeAll ()

静态 Private 成员函数

static constexpr auto getEventTypeId ()

Private 属性

uint32_t m_commandBufferIndex = 0
CommandBufferToken m_commandBufferToken
Devicem_resourceDevice
FlowControlm_flowControl
CommandBufferGraphm_commandBufferGraph
ResourceManagerm_resourceManager
std::unordered_map< std::string, std::vector< BarrierInfo > > m_passGroupBarriers
std::map< std::string, std::set< std::string > > m_passGroupDependencies
std::unordered_map< std::string, std::unique_ptr< RenderGraphImageNode > > m_imageNodes
std::unordered_map< std::string, RenderGraphPassNodem_passNodes
UnionFind< std::string, char > m_passesUnions
std::vector< std::unique_ptr< Edge > > m_edges
std::unordered_map< std::string, Image * > m_allocatedImages
std::unordered_map< std::string, RHI::Pass * > m_allocatedPasses
std::unordered_map< std::string, RHI::PassGroup * > m_allocatedPassGroups
std::unordered_map< std::string, std::vector< std::string > > m_passGroupOrders
std::vector< std::string > m_passGroupExecutionOrder
std::conditional_t< EventSystemConfig::TriggerOnly::EventAsData, std::unordered_map< entt::id_type, std::unordered_map< SubscribeId, std::unique_ptr< IEventHandler > > >, std::unordered_map< entt::id_type, std::unordered_map< SubscribeId, std::unique_ptr< IEventIdentifierHandler > > > > m_handlers
std::conditional_t< EventSystemConfig::TriggerOnly::EnableQueue, std::unordered_map< entt::id_type, std::vector< std::function< void()> > >, std::monostate > m_eventQueue
SubscribeId m_nextSubscribeId

详细描述

在文件 RenderGraph.h202 行定义.

构造及析构函数说明

◆ RenderGraph()

FCT::RenderGraph::RenderGraph ( Device * device,
FlowControl * flowControl,
CommandBufferGraph * commandBufferGraph,
ResourceManager * resourceManager )

在文件 RenderGraph.cpp83 行定义.

函数调用图:

成员函数说明

◆ addPass() [1/2]

void FCT::RenderGraph::addPass ( const PassDesc & desc)
private

在文件 RenderGraph.cpp210 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ addPass() [2/2]

template<typename... Args>
void FCT::RenderGraph::addPass ( std::string name,
Args &&... args )
inline

在文件 RenderGraph.h340 行定义.

函数调用图:

◆ allocateCommandBuffer()

void FCT::RenderGraph::allocateCommandBuffer ( )
private

todo: 添加移除机制来支持重新编译

在文件 RenderGraph.cpp37 行定义.

这是这个函数的调用关系图:

◆ allocateResources()

void FCT::RenderGraph::allocateResources ( )
private

在文件 RenderGraph.cpp374 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ analyzePassGroupBarriers()

void FCT::RenderGraph::analyzePassGroupBarriers ( )
private

◆ analyzePassGroupDependencies()

void FCT::RenderGraph::analyzePassGroupDependencies ( const std::string & groupLeader,
const std::vector< std::string > & groupMembers,
std::map< std::string, std::set< std::string > > & dependencies ) const
private

在文件 RenderGraph.cpp502 行定义.

这是这个函数的调用关系图:

◆ checkBarriersBeforePassGroup()

std::vector< RenderGraph::BarrierInfo > FCT::RenderGraph::checkBarriersBeforePassGroup ( const std::string & groupLeader,
const std::vector< std::string > & groupMembers,
const std::unordered_map< Image *, ImageState > & imageStates )
private

在文件 RenderGraph.cpp777 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ cleanUp()

void FCT::RenderGraph::cleanUp ( )
private

◆ cleanUpCompile()

void FCT::RenderGraph::cleanUpCompile ( )
private

在文件 RenderGraph.cpp247 行定义.

◆ compile()

void FCT::RenderGraph::compile ( )
inline

在文件 RenderGraph.h346 行定义.

函数调用图:

◆ computePassGroupExecutionOrder()

void FCT::RenderGraph::computePassGroupExecutionOrder ( )
private

在文件 RenderGraph.cpp599 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ convertShaderStageToPipelineStage()

PipelineStage FCT::RenderGraph::convertShaderStageToPipelineStage ( ShaderStage stage) const
private

在文件 RenderGraph.cpp901 行定义.

这是这个函数的调用关系图:

◆ createDepthStencilEdge()

void FCT::RenderGraph::createDepthStencilEdge ( const std::string & passName,
const std::string & depthStencilName,
const DepthStencil & depthStencil )
private

在文件 RenderGraph.cpp190 行定义.

这是这个函数的调用关系图:

◆ createPassGroups()

void FCT::RenderGraph::createPassGroups ( )
private
注解
创建PassGroup并设置Pass之间的依赖关系 根据m_passesUnions的分组结果创建PassGroup 通过TextureEdge分析Pass之间的依赖关系 设置正确的PipelineStage和AccessFlags 注意点: 1.PassGroup内部在create的时候会把找不到的Pass*设置为external 2.

在文件 RenderGraph.cpp613 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ createRHIPasses()

void FCT::RenderGraph::createRHIPasses ( )
private
注解
创建所有RHI Pass并绑定对应的图片资源 遍历所有pass节点,为每个pass创建RHI::Pass 通过ImageNode的getImage()获取对应的Image并绑定到Pass Target按order绑定,DepthStencil直接绑定,Texture不绑定

在文件 RenderGraph.cpp467 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ createTargetEdge()

void FCT::RenderGraph::createTargetEdge ( const std::string & passName,
const std::string & targetName,
const Target & target )
private

在文件 RenderGraph.cpp171 行定义.

这是这个函数的调用关系图:

◆ createTextureEdge()

void FCT::RenderGraph::createTextureEdge ( const std::string & passName,
const std::string & textureName,
const Texture & texture )
private

在文件 RenderGraph.cpp149 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ enqueue()

void FCT::IEventSystem< EventSystemConfig::TriggerOnly >::enqueue ( Event && event)
inlineinherited

在文件 IEventSystem.h138 行定义.

◆ executeAllPassGroups()

void FCT::RenderGraph::executeAllPassGroups ( RHI::CommandBuffer * cmdBuffer)

在文件 RenderGraph.cpp927 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ executeBarriers()

void FCT::RenderGraph::executeBarriers ( RHI::CommandBuffer * cmdBuffer,
const std::vector< BarrierInfo > & barriers )
private

在文件 RenderGraph.cpp913 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ getEventTypeId()

constexpr auto FCT::IEventSystem< EventSystemConfig::TriggerOnly >::getEventTypeId ( )
inlinestaticconstexprprivateinherited

在文件 IEventSystem.h49 行定义.

◆ getImage()

Image * FCT::RenderGraph::getImage ( const std::string & name) const

在文件 RenderGraph.cpp943 行定义.

这是这个函数的调用关系图:

◆ getOrCreateImageNode() [1/3]

RenderGraphImageNode * FCT::RenderGraph::getOrCreateImageNode ( const std::string & name,
const DepthStencil & depthStencil )
private

在文件 RenderGraph.cpp128 行定义.

◆ getOrCreateImageNode() [2/3]

RenderGraphImageNode * FCT::RenderGraph::getOrCreateImageNode ( const std::string & name,
const Target & target )
private

在文件 RenderGraph.cpp107 行定义.

◆ getOrCreateImageNode() [3/3]

RenderGraphImageNode * FCT::RenderGraph::getOrCreateImageNode ( const std::string & name,
const Texture & texture )
private

在文件 RenderGraph.cpp93 行定义.

这是这个函数的调用关系图:

◆ getPass()

RHI::Pass * FCT::RenderGraph::getPass ( const std::string & name) const

在文件 RenderGraph.cpp938 行定义.

这是这个函数的调用关系图:

◆ getTextureEdges()

std::vector< TextureEdge * > FCT::RenderGraph::getTextureEdges ( const std::string & passName) const

在文件 RenderGraph.cpp952 行定义.

这是这个函数的调用关系图:

◆ groupPasses()

void FCT::RenderGraph::groupPasses ( )
private
注解
在compile时调用,用于将Pass分组到PassGroup中
  1. 遍历所有pass,首先pass先unite自己
  2. 遍历texture边对应的image和(任一target或depthStencil)是否相同大小
  3. 如果相同大小,找到把texture当target的pass,unite起来
  4. 遍历所有image,遍历他们的target边和depthstencil边,fromPass全部unite起来

在文件 RenderGraph.cpp299 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ initForSubmit()

void FCT::RenderGraph::initForSubmit ( )
private

在文件 RenderGraph.cpp18 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ resolveTextureSizes()

void FCT::RenderGraph::resolveTextureSizes ( )
private
注解
在compile调用时执行,遍历每个pass, 然后遍历pass的texture边, 如果TextureSize.type=Undefined, 并且调用对应texture的SizeNode的isSizeDetermined为false, 那么就调用SizeNode的 bool unite(SizeNode* other, const Scale2D& scale = Scale2D()) 把texture和任意一个target或depthStencilunite起来, 如果TextureSize.type=Relative, 不管texture的size决定没有, 把texture和(target或depth stencil 其中的一个)unite起来, 并把传 Scale2D(TextureSize.relativeWidth,TextureSize.relativeHeight) 进去

在文件 RenderGraph.cpp252 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ simulateExecutionAndAnalyzeBarriers()

void FCT::RenderGraph::simulateExecutionAndAnalyzeBarriers ( )
private

在文件 RenderGraph.cpp750 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ simulatePassGroupExecution()

void FCT::RenderGraph::simulatePassGroupExecution ( const std::string & groupLeader,
const std::vector< std::string > & groupMembers,
std::unordered_map< Image *, ImageState > & imageStates )
private

在文件 RenderGraph.cpp846 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ submitPassGroup()

void FCT::RenderGraph::submitPassGroup ( RHI::CommandBuffer * cmdBuffer,
const std::string & groupLeader )
private

在文件 RenderGraph.cpp723 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ subscribe() [1/2]

SubscribeId FCT::IEventSystem< EventSystemConfig::TriggerOnly >::subscribe ( Func && func)
inlineinherited

在文件 IEventSystem.h192 行定义.

◆ subscribe() [2/2]

template<typename Func>
SubscribeId FCT::RenderGraph::subscribe ( std::string passName,
Func && func )
inline

在文件 RenderGraph.h324 行定义.

函数调用图:

◆ topologicalSort()

std::vector< std::string > FCT::RenderGraph::topologicalSort ( const std::map< std::string, std::set< std::string > > & dependencies) const
private

在文件 RenderGraph.cpp552 行定义.

这是这个函数的调用关系图:

◆ trigger()

void FCT::IEventSystem< EventSystemConfig::TriggerOnly >::trigger ( const Event & event)
inlineinherited

在文件 IEventSystem.h110 行定义.

这是这个函数的调用关系图:

◆ unsubscribe()

void FCT::RenderGraph::unsubscribe ( SubscribeId subscribeId)
inline

在文件 RenderGraph.h335 行定义.

函数调用图:

◆ unsubscribeAll()

void FCT::IEventSystem< EventSystemConfig::TriggerOnly >::unsubscribeAll ( )
inlineinherited

在文件 IEventSystem.h239 行定义.

◆ update()

void FCT::IEventSystem< EventSystemConfig::TriggerOnly >::update ( )
inlineinherited

在文件 IEventSystem.h165 行定义.

◆ updateAll()

void FCT::IEventSystem< EventSystemConfig::TriggerOnly >::updateAll ( )
inlineinherited

在文件 IEventSystem.h180 行定义.

类成员变量说明

◆ m_allocatedImages

std::unordered_map<std::string, Image*> FCT::RenderGraph::m_allocatedImages
private

在文件 RenderGraph.h245 行定义.

◆ m_allocatedPasses

std::unordered_map<std::string, RHI::Pass*> FCT::RenderGraph::m_allocatedPasses
private

在文件 RenderGraph.h246 行定义.

◆ m_allocatedPassGroups

std::unordered_map<std::string, RHI::PassGroup*> FCT::RenderGraph::m_allocatedPassGroups
private

在文件 RenderGraph.h309 行定义.

◆ m_commandBufferGraph

CommandBufferGraph* FCT::RenderGraph::m_commandBufferGraph
private

在文件 RenderGraph.h217 行定义.

◆ m_commandBufferIndex

uint32_t FCT::RenderGraph::m_commandBufferIndex = 0
private

在文件 RenderGraph.h204 行定义.

◆ m_commandBufferToken

CommandBufferToken FCT::RenderGraph::m_commandBufferToken
private

todo:修改以做多CommandBufferGraph支持

在文件 RenderGraph.h210 行定义.

◆ m_edges

std::vector<std::unique_ptr<Edge> > FCT::RenderGraph::m_edges
private

在文件 RenderGraph.h244 行定义.

◆ m_eventQueue

std::conditional_t<EventSystemConfig::TriggerOnly::EnableQueue, std::unordered_map<entt::id_type, std::vector<std::function<void()> > >, std::monostate> FCT::IEventSystem< EventSystemConfig::TriggerOnly >::m_eventQueue
privateinherited

在文件 IEventSystem.h104 行定义.

◆ m_flowControl

FlowControl* FCT::RenderGraph::m_flowControl
private

在文件 RenderGraph.h216 行定义.

◆ m_handlers

std::conditional_t<EventSystemConfig::TriggerOnly::EventAsData, std::unordered_map<entt::id_type, std::unordered_map<SubscribeId, std::unique_ptr<IEventHandler> > >, std::unordered_map<entt::id_type, std::unordered_map<SubscribeId, std::unique_ptr<IEventIdentifierHandler> > > > FCT::IEventSystem< EventSystemConfig::TriggerOnly >::m_handlers
privateinherited

在文件 IEventSystem.h100 行定义.

◆ m_imageNodes

std::unordered_map<std::string, std::unique_ptr<RenderGraphImageNode> > FCT::RenderGraph::m_imageNodes
private

在文件 RenderGraph.h241 行定义.

◆ m_nextSubscribeId

SubscribeId FCT::IEventSystem< EventSystemConfig::TriggerOnly >::m_nextSubscribeId
privateinherited

在文件 IEventSystem.h106 行定义.

◆ m_passesUnions

UnionFind<std::string,char> FCT::RenderGraph::m_passesUnions
private

在文件 RenderGraph.h243 行定义.

◆ m_passGroupBarriers

std::unordered_map<std::string, std::vector<BarrierInfo> > FCT::RenderGraph::m_passGroupBarriers
private

在文件 RenderGraph.h239 行定义.

◆ m_passGroupDependencies

std::map<std::string, std::set<std::string> > FCT::RenderGraph::m_passGroupDependencies
private

在文件 RenderGraph.h240 行定义.

◆ m_passGroupExecutionOrder

std::vector<std::string> FCT::RenderGraph::m_passGroupExecutionOrder
private

在文件 RenderGraph.h363 行定义.

◆ m_passGroupOrders

std::unordered_map<std::string, std::vector<std::string> > FCT::RenderGraph::m_passGroupOrders
private

在文件 RenderGraph.h362 行定义.

◆ m_passNodes

std::unordered_map<std::string,RenderGraphPassNode> FCT::RenderGraph::m_passNodes
private

在文件 RenderGraph.h242 行定义.

◆ m_resourceDevice

Device* FCT::RenderGraph::m_resourceDevice
private

在文件 RenderGraph.h215 行定义.

◆ m_resourceManager

ResourceManager* FCT::RenderGraph::m_resourceManager
private

在文件 RenderGraph.h218 行定义.


该类的文档由以下文件生成: