|
Sparkle 0.0.1
|
Encapsulates a shader resource (UBO, SSBO, or sampler) bound by a pipeline. More...
#include <spk_pipeline.hpp>

Public Types | |
| enum class | Kind { None , UBO , SSBO , Sampler } |
| Enumerates the supported constant types. | |
Public Member Functions | |
| Constant ()=default | |
| Default constructor for an empty constant. | |
| Constant (Constant &&)=default | |
| Move-constructs a constant, transferring ownership of the underlying resource. | |
| Constant & | operator= (Constant &&)=default |
| Move-assigns from another constant instance. | |
| Constant (const Constant &)=delete | |
| Constant & | operator= (const Constant &)=delete |
| Kind | kind () const noexcept |
| Reports the currently configured resource type. | |
| GLuint | bindingPoint () const noexcept |
| Binding slot used when the constant represents a buffer or sampler. | |
| std::size_t | size () const noexcept |
| Size of the buffer-backed constant in bytes. | |
| void | setUBO (GLuint p_bindingPoint, std::size_t p_size, spk::OpenGL::BufferObject::Usage p_usage) |
| Initializes the constant as a uniform buffer. | |
| void | setSSBO (GLuint p_bindingPoint, std::size_t p_size, spk::OpenGL::BufferObject::Usage p_usage) |
| Initializes the constant as a shader storage buffer. | |
| void | setSampler (GLint p_uniformLocation, GLuint p_textureUnitIndex) |
| Initializes the constant as a sampler bound to a texture unit. | |
| void | activate () |
| Activates the underlying resource on the GPU. | |
| void | deactivate () |
| Deactivates the underlying resource on the GPU. | |
| spk::OpenGL::UBO & | ubo () |
| Accesses the constant as a uniform buffer object. | |
| const spk::OpenGL::UBO & | ubo () const |
| Accesses the constant as a uniform buffer object. | |
| spk::OpenGL::SSBO & | ssbo () |
| Accesses the constant as a shader storage buffer object. | |
| const spk::OpenGL::SSBO & | ssbo () const |
| Accesses the constant as a shader storage buffer object. | |
| spk::OpenGL::SamplerObject & | sampler () |
| Accesses the constant as a sampler object. | |
| const spk::OpenGL::SamplerObject & | sampler () const |
| Accesses the constant as a sampler object. | |
| operator spk::OpenGL::UBO & () | |
| Implicitly converts the constant to its UBO representation. | |
| operator const spk::OpenGL::UBO & () const | |
| Implicitly converts the constant to its UBO representation. | |
| operator spk::OpenGL::SSBO & () | |
| Implicitly converts the constant to its SSBO representation. | |
| operator const spk::OpenGL::SSBO & () const | |
| Implicitly converts the constant to its SSBO representation. | |
| operator spk::OpenGL::SamplerObject & () | |
| Implicitly converts the constant to its sampler object. | |
| operator const spk::OpenGL::SamplerObject & () const | |
| Implicitly converts the constant to its sampler object. | |
Encapsulates a shader resource (UBO, SSBO, or sampler) bound by a pipeline.
|
inlinenoexcept |
Binding slot used when the constant represents a buffer or sampler.
|
inlinenoexcept |
Reports the currently configured resource type.

|
inline |
Implicitly converts the constant to its sampler object.
|
inline |
Implicitly converts the constant to its SSBO representation.
|
inline |
Implicitly converts the constant to its UBO representation.
|
inline |
Implicitly converts the constant to its sampler object.
|
inline |
Implicitly converts the constant to its SSBO representation.
|
inline |
Implicitly converts the constant to its UBO representation.
Move-assigns from another constant instance.

|
inline |
Accesses the constant as a sampler object.
|
inline |
Accesses the constant as a sampler object.
|
inline |
Initializes the constant as a sampler bound to a texture unit.
| p_uniformLocation | Uniform location used in the shader, or -1 when using layout(binding). |
| p_textureUnitIndex | Index of the texture unit to bind. |
|
inline |
Initializes the constant as a shader storage buffer.
| p_bindingPoint | Binding point to use when activating the buffer. |
| p_size | Size in bytes to allocate inside the SSBO. |
| p_usage | OpenGL usage hint for the buffer data. |
|
inline |
Initializes the constant as a uniform buffer.
| p_bindingPoint | Binding point to use when activating the buffer. |
| p_size | Size in bytes to allocate inside the UBO. |
| p_usage | OpenGL usage hint for the buffer data. |
|
inlinenoexcept |
Size of the buffer-backed constant in bytes.

|
inline |
Accesses the constant as a shader storage buffer object.
|
inline |
Accesses the constant as a shader storage buffer object.
|
inline |
Accesses the constant as a uniform buffer object.
|
inline |
Accesses the constant as a uniform buffer object.