Skip to main content

LegacyRenderPass.ixx File

Abstraction representing a render pass (framebuffer, attachments, etc.). More...

Included Headers

#include <memory> #include <cassert> #include <helios.util.log.LogManager> #include <helios.util.log.Logger> #include <helios.rendering.shader.UniformValueMap> #include <helios.rendering.Viewport> #include <helios.rendering.RenderQueue>

Namespaces Index

namespacehelios
namespacerendering

Graphics rendering infrastructure. More...

Classes Index

classLegacyRenderPass

Encapsulates a single rendering pass with its associated resources. More...

Macro Definitions Index

#defineHELIOS_LOG_SCOPE   "helios::rendering::LegacyRenderPass"

Description

Abstraction representing a render pass (framebuffer, attachments, etc.).

Macro Definitions

HELIOS_LOG_SCOPE

#define HELIOS_LOG_SCOPE   "helios::rendering::LegacyRenderPass"

Definition at line 20 of file LegacyRenderPass.ixx.

20#define HELIOS_LOG_SCOPE "helios::rendering::LegacyRenderPass"

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file LegacyRenderPass.ixx
3 * @brief Abstraction representing a render pass (framebuffer, attachments, etc.).
4 */
5module;
6
7#include <memory>
8#include <cassert>
9
10export module helios.rendering.LegacyRenderPass;
11
12import helios.rendering.RenderQueue;
13import helios.rendering.shader.UniformValueMap;
14import helios.rendering.Viewport;
15
16
17import helios.util.log.Logger;
18import helios.util.log.LogManager;
19
20#define HELIOS_LOG_SCOPE "helios::rendering::LegacyRenderPass"
21export namespace helios::rendering {
22
23 /**
24 * @brief Encapsulates a single rendering pass with its associated resources.
25 *
26 * A `LegacyRenderPass` holds a `RenderQueue` containing all `MeshRenderCommand` and
27 * `TextRenderCommand` objects to be processed. It also stores frame-level
28 * uniform values (e.g., view and projection matrices) that remain constant
29 * during the pass.
30 *
31 * ## Components
32 *
33 * - **RenderQueue:** Contains geometry and text render commands.
34 * - **Viewport:** Non-owning pointer to the rendering area and clear settings.
35 * - **UniformValueMap:** Frame-level uniforms applied to all commands.
36 *
37 * ## Ownership Model
38 *
39 * - **RenderQueue:** Owned by value (moved into the pass).
40 * - **UniformValueMap:** Owned by value (copied/moved into the pass).
41 * - **Viewport:** Non-owning raw pointer. The caller must ensure the viewport
42 * remains valid for the lifetime of this pass.
43 *
44 * ## Lifecycle
45 *
46 * ```
47 * RenderingDevice::beginRenderPass(pass)
48 * → Clear buffers, configure viewport
49 * RenderingDevice::doRender(pass)
50 * → Process MeshRenderCommands and TextRenderCommands
51 * RenderingDevice::endRenderPass(pass)
52 * → Finalize pass, unbind resources
53 * ```
54 *
55 * @note Future versions should support additional configuration like depth
56 * testing, stencil operations, and draw modes.
57 *
58 * @see RenderQueue
59 * @see RenderingDevice
60 * @see Viewport
61 * @see RenderPassFactory
62 */
64
65 private:
66 /**
67 * @brief The `RenderQueue` for this pass, containing all render commands.
68 */
70
71 /**
72 * @brief Uniform values specific to the current frame.
73 *
74 * This map contains uniforms that change once per frame, such as the view
75 * and the projection matrices.
76 */
78
79 /**
80 * @brief Non-owning pointer to the `Viewport` processed by this pass.
81 *
82 * The caller must ensure the viewport remains valid for the lifetime of this pass.
83 */
84 const helios::rendering::Viewport* viewport_;
85
86 protected:
87 /**
88 * @brief Shared logger instance for all LegacyRenderPass objects.
89 */
92 );
93
94 public:
95 ~LegacyRenderPass() = default;
96
97 /**
98 * @brief Prevent copying.
99 * A LegacyRenderPass is not intended to be copied.
100 */
102
103 /**
104 * @brief Prevent copy assignment.
105 * A LegacyRenderPass is not intended to be copied.
106 */
108
109 /**
110 * @brief Allow move.
111 */
112 LegacyRenderPass(LegacyRenderPass&&) noexcept = default;
113
114 /**
115 * @brief Allow move assignment.
116 */
117 LegacyRenderPass& operator=(LegacyRenderPass&&) noexcept = default;
118
119 /**
120 * @brief Creates a new `LegacyRenderPass` with the specified viewport, render queue, and frame uniforms.
121 *
122 * The render queue is moved into this pass. The viewport pointer must remain
123 * valid for the lifetime of this pass.
124 *
125 * @param viewport Non-owning pointer to the viewport this LegacyRenderPass is processing.
126 * @param renderQueue The `RenderQueue` to be processed with this pass (moved).
127 * @param frameUniformValues Frame-specific uniform values (e.g., view/projection matrices).
128 */
133 ) noexcept
134 :
135 viewport_(viewport),
136 renderQueue_(std::move(renderQueue)),
137 frameUniformValues_(frameUniformValues) {
138
139 assert(viewport_ != nullptr && "Unexpected nullptr for viewport in LegacyRenderPass constructor");
140 }
141
142 /**
143 * @brief Returns a const ref to the `RenderQueue` this `LegacyRenderPass` holds.
144 *
145 * @return A const ref to this `LegacyRenderPass`' `RenderQueue`.
146 */
147 [[nodiscard]] const RenderQueue& renderQueue() const noexcept {
148 return renderQueue_;
149 }
150
151 /**
152 * @brief Returns a const ref to the `Viewport` this `LegacyRenderPass` holds.
153 *
154 * @return A const ref to this `LegacyRenderPass`' `Viewport`.
155 */
156 [[nodiscard]] const Viewport& viewport() const noexcept {
157 return *viewport_;
158 }
159
160 /**
161 * @brief Sets the frame-specific uniform values for this pass.
162 *
163 * @param frameUniformValues The `UniformValueMap` containing frame-specific uniform values.
164 */
166 frameUniformValues_ = frameUniformValues;
167 }
168
169 /**
170 * @brief Returns a const reference to this `LegacyRenderPass`' `UniformValueMap`.
171 *
172 * The map might be empty.
173 *
174 * @return A const reference to this `LegacyRenderPass`' `UniformValueMap` for the current frame.
175 */
176 [[nodiscard]] const helios::rendering::shader::UniformValueMap& frameUniformValues() const noexcept {
177 return frameUniformValues_;
178 }
179 };
180
181
182}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.