RenderManager Class Template
Collects render commands into hierarchical batches and forwards them to the backend. More...
Declaration
Public Member Typedefs Index
template <typename TRenderBackend, typename TMemberHandle> | |
| using | EngineRoleTag = ManagerRole |
|
Runtime role tag used for engine manager registration. More... | |
Public Constructors Index
template <typename TRenderBackend, typename TMemberHandle> | |
| RenderManager (TRenderBackend &renderBackend) | |
|
Constructs the manager for a specific render backend. More... | |
Public Member Functions Index
template <typename TRenderBackend, typename TMemberHandle> | |
| void | flush (UpdateContext &updateContext) |
|
Flushes all active render-target batches to the backend. More... | |
template <typename TRenderBackend, typename TMemberHandle> | |
| bool | submit (RenderCommand< TMemberHandle > renderCommand) noexcept |
|
Queues one draw context into the hierarchical batch structure. More... | |
template <typename TRenderBackend, typename TMemberHandle> | |
| void | init (CommandHandlerRegistry &commandHandlerRegistry) noexcept |
|
Registers this manager as handler for render commands. More... | |
Private Member Attributes Index
template <typename TRenderBackend, typename TMemberHandle> | |
| std::vector< RenderTargetBatch< TMemberHandle > > | renderTargetBatches_ |
template <typename TRenderBackend, typename TMemberHandle> | |
| std::vector< EntityId > | activeRenderTargetIndices_ |
template <typename TRenderBackend, typename TMemberHandle> | |
| TRenderBackend & | renderBackend_ |
Private Static Functions Index
template <typename TBatch, typename TChildHandle> | |
| static void | clearActive (TBatch *batch, std::vector< EntityId > &activeIndices, std::vector< TChildHandle > &batches) |
|
Clears active child batches and resets the parent batch active flag. More... | |
template <typename THandle, typename TChildBatch> | |
| static TChildBatch & | addToBatch (const THandle handle, std::vector< TChildBatch > &batches, std::vector< EntityId > &activeIndices) |
|
Returns the existing child batch for a handle or activates a new one. More... | |
Private Static Attributes Index
template <typename TRenderBackend, typename TMemberHandle> | |
| static auto & | logger_ = LogManager::loggerForScope(HELIOS_LOG_SCOPE) |
Description
Collects render commands into hierarchical batches and forwards them to the backend.
Commands are grouped by render-target, viewport, shader, material, and mesh. flush(...) iterates this hierarchy and calls the corresponding backend batch hooks.
- Template Parameters
-
TRenderBackend Rendering backend type.
TMemberHandle Renderable scene member handle type.
Definition at line 77 of file RenderManager.ixx.
Public Member Typedefs
EngineRoleTag
|
Runtime role tag used for engine manager registration.
Definition at line 235 of file RenderManager.ixx.
Public Constructors
RenderManager()
| inline explicit |
Constructs the manager for a specific render backend.
- Parameters
-
renderBackend Backend used to execute render passes.
Definition at line 242 of file RenderManager.ixx.
Reference DEFAULT_FRAMEBUFFER_POOL_CAPACITY.
Public Member Functions
flush()
| inline |
Flushes all active render-target batches to the backend.
Traverses active render targets and nested viewport/shader/material/mesh batches, executes backend begin/end hooks for each level, renders queued draw contexts, and clears all active batch indices afterwards.
- Parameters
-
updateContext Current frame update context.
Definition at line 258 of file RenderManager.ixx.
init()
| inline noexcept |
Registers this manager as handler for render commands.
- Parameters
-
commandHandlerRegistry Command handler registry used at runtime.
Definition at line 358 of file RenderManager.ixx.
submit()
| inline noexcept |
Queues one draw context into the hierarchical batch structure.
Activates missing nodes for render target, viewport, shader, material, and mesh, then appends the draw context to the mesh batch for later rendering in flush(...).
- Parameters
-
renderCommand Command containing per-member render context.
- Returns
true if the command was accepted.
Definition at line 320 of file RenderManager.ixx.
Private Member Attributes
activeRenderTargetIndices_
|
Definition at line 225 of file RenderManager.ixx.
renderBackend_
|
Definition at line 227 of file RenderManager.ixx.
renderTargetBatches_
|
Definition at line 224 of file RenderManager.ixx.
Private Static Functions
addToBatch()
| inline static |
Returns the existing child batch for a handle or activates a new one.
- Template Parameters
-
THandle Handle type used as index source.
TChildBatch Child batch type.
- Parameters
-
handle Handle selecting the batch slot.
batches Child batch storage.
activeIndices Active child indices list.
- Returns
Reference to the active child batch.
Definition at line 108 of file RenderManager.ixx.
clearActive()
| inline static |
Clears active child batches and resets the parent batch active flag.
- Template Parameters
-
TBatch Parent batch type.
TChildHandle Child batch element type.
- Parameters
-
batch Parent batch to reset.
activeIndices Active child indices to clear.
batches Child batch storage.
Definition at line 89 of file RenderManager.ixx.
Private Static Attributes
logger_
| static |
Definition at line 221 of file RenderManager.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.