|
| ShaderRegistry () |
|
| ShaderRegistry (const ShaderRegistry &)=delete |
|
| ShaderRegistry (ShaderRegistry &&) noexcept=delete |
|
ShaderRegistry & | operator= (const ShaderRegistry &)=delete |
|
ShaderRegistry & | operator= (ShaderRegistry &&) noexcept=delete |
|
virtual | ~ShaderRegistry ()=default |
|
virtual bool | isShader (const std::string &shaderName) const noexcept |
| Checks if a shader exists in the registry for the given name. More...
|
|
virtual const std::shared_ptr< gfx::Shader > | getShader (const std::string &shaderName) const noexcept |
| Get a shader from the registry by name. More...
|
|
virtual bool | replaceShader (std::shared_ptr< Shader > &&shader) noexcept |
| Replace a matching shader in the registry with the provided instance. Shader type-names must match. More...
|
|
virtual bool | replaceShader (std::shared_ptr< Shader > &&shader, const std::string &shaderName) noexcept |
| Replace a matching shader in the registry with the provided instance. Shader type-names must match. This variant replaces by explicit name. More...
|
|
virtual bool | registerShader (std::shared_ptr< Shader > &&shader) noexcept |
| Register a new shader with the registry. If a shader is present in the registry with a conflicting name, registration will fail. More...
|
|
virtual bool | registerShader (std::shared_ptr< Shader > &&shader, const std::string &shaderName) noexcept |
| Register a new shader with the registry. If a shader is present in the registry with a conflicting name, registration will fail. This variant registers using an explicit name. More...
|
|
template<typename T , typename std::enable_if_t< is_shader_v< T >, bool > * = nullptr> |
std::shared_ptr< T > | get (const std::string &shaderName) noexcept |
| Shorthand helper to quickly get a derived type from the registry. More...
|
|
template<typename T , typename std::enable_if_t< is_shader_v< T >, bool > * = nullptr> |
std::shared_ptr< T > | get () noexcept |
| Shorthand helper to quickly get a derived type from the registry. This variant looks up shaders only by type name. More...
|
|
template<typename T , typename std::enable_if_t< is_shader_v< T >, bool > * = nullptr> |
bool | populate (std::shared_ptr< T > &to, const std::string &shaderName) noexcept |
| Ensure the destination 'to' is populated with the requested shader. If already non-null, does nothing. More...
|
|
template<typename T , typename std::enable_if_t< is_shader_v< T >, bool > * = nullptr> |
bool | populate (std::shared_ptr< T > &to) noexcept |
| Ensure the destination 'to' is populated with the requested shader. If already non-null, does nothing. This variant looks up shaders only by type name. More...
|
|
A ShaderRegistry contains a collection of gfx::Shader instances. Using the registry, shaders may be dynamically registered or replaced at runtime.
Definition at line 16 of file shader_registry.hpp.
template<typename T , typename std::enable_if_t< is_shader_v< T >, bool > * = nullptr>
bool mbgl::gfx::ShaderRegistry::populate |
( |
std::shared_ptr< T > & |
to | ) |
|
|
inlinenoexcept |
Ensure the destination 'to' is populated with the requested shader. If already non-null, does nothing. This variant looks up shaders only by type name.
- Template Parameters
-
- Parameters
-
to | Location to store the shader |
- Returns
- True if 'to' has a valid program object, false otherwise.
Definition at line 133 of file shader_registry.hpp.
template<typename T , typename std::enable_if_t< is_shader_v< T >, bool > * = nullptr>
bool mbgl::gfx::ShaderRegistry::populate |
( |
std::shared_ptr< T > & |
to, |
|
|
const std::string & |
shaderName |
|
) |
| |
|
inlinenoexcept |
Ensure the destination 'to' is populated with the requested shader. If already non-null, does nothing.
- Template Parameters
-
- Parameters
-
to | Location to store the shader |
shaderName | The registry name to look up |
- Returns
- True if 'to' has a valid program object, false otherwise.
Definition at line 112 of file shader_registry.hpp.