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 (RenderSceneCommand< TMemberHandle > &&renderSceneCommand) noexcept |
|
Queues one scene render context into the batch structure. More... | |
template <typename TRenderBackend, typename TMemberHandle> | |
| bool | submit (RenderSceneMemberCommand< TMemberHandle > &&renderCommand) noexcept |
|
Queues one draw context into the hierarchical batch structure. More... | |
template <typename TRenderBackend, typename TMemberHandle> | |
| bool | submit (RenderInstanceBatchCommand< TMemberHandle > &&renderCommand) noexcept |
|
Queues an instanced draw batch 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 Functions Index
template <typename TRenderBackend, typename TMemberHandle> | |
| auto | ensureViewportBatch (RenderTargetHandle renderTargetHandle, ViewportHandle viewportHandle) -> ViewportBatch< TMemberHandle > & |
|
Ensures that the render-target and viewport batch nodes exist and are active. More... | |
template <typename TContextType> | |
| auto & | meshBatchFor (TContextType &renderContext) noexcept |
|
Resolves the mesh batch for a render context and activates missing hierarchy nodes. More... | |
Private Member Attributes Index
template <typename TRenderBackend, typename TMemberHandle> | |
| std::vector< RenderTargetBatch< TMemberHandle > > | renderTargetBatches_ |
|
Top-level render-target batch storage indexed by handle entity id. More... | |
template <typename TRenderBackend, typename TMemberHandle> | |
| std::vector< EntityId > | activeRenderTargetIndices_ |
|
Active render-target indices used for frame-local flush traversal. More... | |
template <typename TRenderBackend, typename TMemberHandle> | |
| TRenderBackend & | renderBackend_ |
|
Backend instance that receives begin/end hooks and draw submissions. More... | |
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) |
|
Scoped logger used for debug and diagnostics output. More... | |
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 79 of file RenderManager.ixx.
Public Member Typedefs
EngineRoleTag
|
Runtime role tag used for engine manager registration.
Definition at line 304 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 311 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 327 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 454 of file RenderManager.ixx.
submit()
| inline noexcept |
Queues one scene render context into the batch structure.
Ensure that the ViewportBatch is available for the next flush(). In case all scene members were culled, i.e. the shader/material/mesh batches are empty, viewport batches are sent to the graphics backend for making sure no artifacts are left in the viewport from the previous render operation, if any.
- Parameters
-
renderSceneCommand Command containing scene-level render context.
- Returns
true if the command was accepted.
Definition at line 392 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 412 of file RenderManager.ixx.
submit()
| inline noexcept |
Queues an instanced draw batch into the hierarchical batch structure.
Activates missing nodes for render target, viewport, shader, material, and mesh, then appends or moves instance payload into the mesh batch for later rendering in flush(...).
- Parameters
-
renderCommand Command containing instance batch context.
- Returns
true if the command was accepted.
Definition at line 432 of file RenderManager.ixx.
Private Member Functions
ensureViewportBatch()
| inline |
Ensures that the render-target and viewport batch nodes exist and are active.
- Parameters
-
renderTargetHandle Render target used as top-level batch key.
viewportHandle Viewport used as second-level batch key.
- Returns
Active viewport batch for the given handles.
Definition at line 256 of file RenderManager.ixx.
meshBatchFor()
| inline noexcept |
Resolves the mesh batch for a render context and activates missing hierarchy nodes.
Batches are scoped by render target and viewport. A viewport is bound to exactly one scene, so sceneHandle is not required as part of the batch key.
- Template Parameters
-
TContextType Context type exposing render target, viewport, shader, material, and mesh handles.
- Parameters
-
renderContext Render context used as batch key source.
- Returns
Reference to the resolved mesh batch.
Definition at line 289 of file RenderManager.ixx.
Private Member Attributes
activeRenderTargetIndices_
|
Active render-target indices used for frame-local flush traversal.
Definition at line 242 of file RenderManager.ixx.
renderBackend_
|
Backend instance that receives begin/end hooks and draw submissions.
Definition at line 247 of file RenderManager.ixx.
renderTargetBatches_
|
Top-level render-target batch storage indexed by handle entity id.
Definition at line 237 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 110 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 91 of file RenderManager.ixx.
Private Static Attributes
logger_
| static |
Scoped logger used for debug and diagnostics output.
Definition at line 231 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.