OpenGLShaderCompileManager Class Template
Manager that consumes shader compile commands and performs OpenGL compilation/linking. More...
Declaration
Public Member Typedefs Index
template < ... > | |
| using | EngineRoleTag = ManagerRole |
|
Engine role marker used by runtime registries. More... | |
Public Constructors Index
template < ... > | |
| OpenGLShaderCompileManager (RenderResourceWorld &renderResourceWorld, TUniformCacheStrategy &&uniformCacheStrategy) | |
|
Constructs the manager with access to render-resource world storage. More... | |
Public Member Functions Index
template < ... > | |
| void | flush (UpdateContext &updateContext) noexcept |
|
Compiles all queued shaders and clears processed command data. More... | |
template < ... > | |
| bool | submit (ShaderBatchCompileCommand< THandle > &&command) noexcept |
|
Enqueues a batch of shader handles for compilation. More... | |
template < ... > | |
| bool | submit (ShaderCompileCommand< THandle > &&command) noexcept |
|
Enqueues a single shader handle for compilation. More... | |
template < ... > | |
| void | init (helios::engine::runtime::messaging::command::CommandHandlerRegistry &commandHandlerRegistry) noexcept |
|
Registers compile command handlers in the command registry. More... | |
Private Member Functions Index
template < ... > | |
| bool | load (const std::string &vertexShaderPath, const std::string &fragmentShaderPath, std::string &vertexShaderSource, std::string &fragmentShaderSource) noexcept |
|
Loads the specified vertex and fragment shader. More... | |
template < ... > | |
| bool | compile (ShaderEntity shader) noexcept |
|
Compiles the vertex and fragment shader represented by this instance. More... | |
Private Member Attributes Index
template < ... > | |
| BasicStringFileReader | stringFileReader_ |
|
File reader used to load shader source text from disk. More... | |
template < ... > | |
| RenderResourceWorld & | renderResourceWorld_ |
|
Render-resource world used to resolve shader entities by handle. More... | |
template < ... > | |
| std::vector< ShaderHandle > | shaderHandles_ |
|
Pending shader handles queued for compilation during flush(...). More... | |
template < ... > | |
| std::string | vertexShaderSource_ |
|
Reused storage for loaded vertex shader source. More... | |
template < ... > | |
| std::string | fragmentShaderSource_ |
|
Reused storage for loaded fragment shader source. More... | |
template < ... > | |
| TUniformCacheStrategy | uniformCacheStrategy_ |
|
Uniform caching strategy executed after successful shader compilation. More... | |
Private Static Attributes Index
template < ... > | |
| static const Logger & | logger_ = LogManager::loggerForScope(HELIOS_LOG_SCOPE) |
|
Scoped logger for shader compile and link diagnostics. More... | |
Description
Manager that consumes shader compile commands and performs OpenGL compilation/linking.
- Template Parameters
-
THandle Shader handle type.
TUniformCacheStrategy Uniform cache strategy used after successful program linking.
Definition at line 67 of file OpenGLShaderCompileManager.ixx.
Public Member Typedefs
EngineRoleTag
|
Engine role marker used by runtime registries.
Definition at line 242 of file OpenGLShaderCompileManager.ixx.
Public Constructors
OpenGLShaderCompileManager()
| inline explicit |
Constructs the manager with access to render-resource world storage.
- Parameters
-
renderResourceWorld Render-resource world used to resolve shader entities.
uniformCacheStrategy Strategy object used to cache pass/draw uniforms.
Definition at line 230 of file OpenGLShaderCompileManager.ixx.
Public Member Functions
flush()
| inline noexcept |
Compiles all queued shaders and clears processed command data.
Handles are queued through consuming submit(...) overloads and processed in FIFO order for the current frame.
- Parameters
-
updateContext Frame-local update context.
Definition at line 253 of file OpenGLShaderCompileManager.ixx.
init()
| inline noexcept |
Registers compile command handlers in the command registry.
- Parameters
-
commandHandlerRegistry Registry used for command-handler registration.
Definition at line 313 of file OpenGLShaderCompileManager.ixx.
submit()
| inline noexcept |
Enqueues a batch of shader handles for compilation.
- Parameters
-
command Compile command that is consumed by move.
- Returns
true if the command was accepted.
Definition at line 288 of file OpenGLShaderCompileManager.ixx.
submit()
| inline noexcept |
Enqueues a single shader handle for compilation.
- Parameters
-
command Compile command that is consumed by move.
- Returns
true if the command was accepted.
Definition at line 303 of file OpenGLShaderCompileManager.ixx.
Private Member Functions
compile()
| inline noexcept |
Compiles the vertex and fragment shader represented by this instance.
- Parameters
-
shader Shader entity providing source and receiving OpenGL shader state.
- Returns
true if compilation succeeded, otherwise false.
On compile/link errors, diagnostics are asserted/logged and false is returned.
Definition at line 140 of file OpenGLShaderCompileManager.ixx.
load()
| inline noexcept |
Loads the specified vertex and fragment shader.
- Parameters
-
vertexShaderPath Path to the vertex shader source file.
fragmentShaderPath Path to the fragment shader source file.
vertexShaderSource Output buffer receiving vertex shader source text.
fragmentShaderSource Output buffer receiving fragment shader source text.
- Returns
true if loading succeeded, otherwise false.
On failure, diagnostics are asserted/logged and false is returned.
Definition at line 116 of file OpenGLShaderCompileManager.ixx.
Private Member Attributes
fragmentShaderSource_
|
Reused storage for loaded fragment shader source.
Definition at line 92 of file OpenGLShaderCompileManager.ixx.
renderResourceWorld_
|
Render-resource world used to resolve shader entities by handle.
Definition at line 77 of file OpenGLShaderCompileManager.ixx.
shaderHandles_
|
Pending shader handles queued for compilation during flush(...).
Definition at line 82 of file OpenGLShaderCompileManager.ixx.
stringFileReader_
|
File reader used to load shader source text from disk.
Definition at line 72 of file OpenGLShaderCompileManager.ixx.
uniformCacheStrategy_
|
Uniform caching strategy executed after successful shader compilation.
Definition at line 103 of file OpenGLShaderCompileManager.ixx.
vertexShaderSource_
|
Reused storage for loaded vertex shader source.
Definition at line 87 of file OpenGLShaderCompileManager.ixx.
Private Static Attributes
logger_
| static |
Scoped logger for shader compile and link diagnostics.
Definition at line 98 of file OpenGLShaderCompileManager.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.