Loads shader artifacts and orchestrates draw calls with strongly typed constants and attributes.
More...
#include <spk_pipeline.hpp>
|
| class | Constant |
| | Encapsulates a shader resource (UBO, SSBO, or sampler) bound by a pipeline. More...
|
| class | Object |
| | Represents a drawable entity configured with pipeline attributes. More...
|
|
| static Pipeline | fromFile (const std::filesystem::path &p_filePath) |
| | Loads a pipeline definition from disk.
|
| static Constant & | insertConstant (const std::string &p_jsonBlock) |
| | Inserts a global constant from a JSON description block.
|
| static Constant & | insertConstant (const std::wstring &p_jsonBlock) |
| | Wide-string overload for insertConstant.
|
| static bool | containConstant (const std::wstring &p_name) |
| | Check if the constant defined by name exist in the global registry.
|
| static Constant & | constant (const std::wstring &p_name) |
| | Retrieves a mutable constant defined by name in the global registry.
|
| static Constant & | getOrCreateConstant (const std::string &p_jsonBlock) |
| | Retrieves or creates a constant from a JSON description block.
|
| static Constant & | getOrCreateConstant (const std::wstring &p_jsonBlock) |
| | Wide-string overload for getOrCreateConstant.
|
Loads shader artifacts and orchestrates draw calls with strongly typed constants and attributes.
object.
attribute(L
"model").
as<spk::OpenGL::UBO>().setData(models[0]);
object.render();
TResourceType & as()
Returns the attribute as the requested resource type.
Definition spk_pipeline.hpp:579
Attribute & attribute(const std::wstring &p_name)
Retrieves a named attribute configured on the pipeline.
Definition spk_pipeline.hpp:665
Loads shader artifacts and orchestrates draw calls with strongly typed constants and attributes.
Definition spk_pipeline.hpp:38
static Pipeline fromFile(const std::filesystem::path &p_filePath)
Loads a pipeline definition from disk.
Definition spk_pipeline.cpp:729
Object createObject()
Instantiates a drawable object using the pipeline layout.
Definition spk_pipeline.cpp:749
◆ Pipeline() [1/2]
| spk::Lumina::Pipeline::Pipeline |
( |
const std::string & | p_input | ) |
|
|
explicit |
Builds a pipeline from a JSON artifact string.
- Parameters
-
| p_input | JSON description following the Lumina pipeline schema. |
◆ Pipeline() [2/2]
| spk::Lumina::Pipeline::Pipeline |
( |
Pipeline && | p_other | ) |
|
|
defaultnoexcept |
Moves pipeline ownership to a new instance.
- Parameters
-
◆ constant()
Retrieves a mutable constant defined by name in the global registry.
- Parameters
-
| p_name | Constant name declared in Lumina artifacts or pre-registered. |
- Returns
- Reference to the managed constant resource.
- Exceptions
-
| std::runtime_error | When the constant cannot be found. |
◆ containConstant()
| bool spk::Lumina::Pipeline::containConstant |
( |
const std::wstring & | p_name | ) |
|
|
static |
Check if the constant defined by name exist in the global registry.
- Parameters
-
| p_name | Constant name declared in Lumina artifacts or pre-registered. |
- Returns
- The existance status.
◆ createBufferSet()
Creates a buffer set matching the pipeline's vertex layout.
- Returns
- Shared pointer to a newly allocated buffer set.
◆ createObject()
Instantiates a drawable object using the pipeline layout.
- Returns
- Object pre-populated with attribute constants and buffer set.
◆ frameBuffer() [1/2]
Accesses a framebuffer configured on the pipeline.
- Parameters
-
| p_name | Name of the framebuffer attachment set in the artifact. |
- Returns
- Reference to the framebuffer object.
- Exceptions
-
| std::runtime_error | When the framebuffer is missing. |
◆ frameBuffer() [2/2]
Accesses a framebuffer configured on the pipeline.
- Parameters
-
| p_name | Name of the framebuffer attachment set in the artifact. |
- Returns
- Constant reference to the framebuffer object.
- Exceptions
-
| std::runtime_error | When the framebuffer is missing. |
◆ fromFile()
| Pipeline spk::Lumina::Pipeline::fromFile |
( |
const std::filesystem::path & | p_filePath | ) |
|
|
static |
Loads a pipeline definition from disk.
- Parameters
-
| p_filePath | Path to the JSON artifact describing the pipeline. |
- Returns
- Fully constructed pipeline ready to spawn drawable objects.
◆ getOrCreateConstant() [1/2]
| Pipeline::Constant & spk::Lumina::Pipeline::getOrCreateConstant |
( |
const std::string & | p_jsonBlock | ) |
|
|
static |
Retrieves or creates a constant from a JSON description block.
- Parameters
-
| p_jsonBlock | JSON string describing the data block. |
- Returns
- Reference to the created or existing constant.
◆ getOrCreateConstant() [2/2]
| Pipeline::Constant & spk::Lumina::Pipeline::getOrCreateConstant |
( |
const std::wstring & | p_jsonBlock | ) |
|
|
static |
Wide-string overload for getOrCreateConstant.
- Parameters
-
| p_jsonBlock | JSON string describing the data block. |
- Returns
- Reference to the created or existing constant.
◆ insertConstant() [1/2]
| Pipeline::Constant & spk::Lumina::Pipeline::insertConstant |
( |
const std::string & | p_jsonBlock | ) |
|
|
static |
Inserts a global constant from a JSON description block.
The JSON must match a single entry of the "constants" array in a compiled Lumina artifact, e.g.:
{ "name": "ViewRegionConstant", "type": "UBO", "size": 64, "members": [ ... ], "dynamicArrayLayout": { ... } // optional }
If a constant with the same name already exists, this verifies that its kind and size are compatible and returns it; otherwise a new constant is created, with a binding point allocated from the internal counter.
- Parameters
-
| p_jsonBlock | JSON string describing the data block. |
- Returns
- Reference to the created or existing constant.
◆ insertConstant() [2/2]
| Pipeline::Constant & spk::Lumina::Pipeline::insertConstant |
( |
const std::wstring & | p_jsonBlock | ) |
|
|
static |
Wide-string overload for insertConstant.
The string must contain UTF-8 JSON encoded in a std::wstring; it will be converted to UTF-8 internally before parsing.
- Parameters
-
| p_jsonBlock | JSON string describing the data block. |
- Returns
- Reference to the created or existing constant.
◆ operator=()
Move-assigns pipeline ownership.
- Parameters
-
- Returns
- Reference to this pipeline.
The documentation for this class was generated from the following files:
- includes/structure/lumina/spk_pipeline.hpp
- srcs/structure/lumina/spk_pipeline.cpp