![]() |
Lysa
0.0
Lysa 3D Engine
|
Inheritance diagram for MaterialManager:Public Member Functions | |
| MaterialManager (size_t capacity, size_t parametersCapacity) | |
| StandardMaterial & | create () |
| ShaderMaterial & | create (const std::shared_ptr< ShaderMaterial > &orig) |
| ShaderMaterial & | create (const std::string &fragShaderFileName, const std::string &vertShaderFileName, uint32 parameterCount=0, RenderingPhase stage=RenderingPhase::DEFAULT) |
| ShaderMaterial & | create (const std::string &fragShaderFileName, uint32 parameterCount=0, RenderingPhase stage=RenderingPhase::DEFAULT) |
| void | upload (const Material &material) |
| void | uploadParameters (const ShaderMaterial &material) |
| void | flush () |
| auto | getBuffer () const |
| auto | getParametersBuffer () const |
| bool | destroy (unique_id id) override |
| bool | destroy (const StandardMaterial &m) |
| bool | destroy (const ShaderMaterial &m) |
Public Member Functions inherited from ResourcesManager< Material > | |
| ResourcesManager (ResourcesManager &) = delete | |
| Material & | create (Args &&...args) |
| virtual bool | destroy (const Material &res) |
| void | destroy (const std::vector< unique_id > &ids) |
| void | forEach (Func &&func) |
| void | forEach (Func &&func) const |
| unique_id | getCapacity () const |
| bool | have (const unique_id id) const |
| ResourcesManager & | operator= (ResourcesManager &) = delete |
| Material & | operator[] (const unique_id id) |
| const Material & | operator[] (const unique_id id) const |
| void | use (const unique_id id) |
| virtual | ~ResourcesManager () |
Additional Inherited Members | |
Protected Member Functions inherited from ResourcesManager< Material > | |
| ResourcesManager (const size_t capacity, const std::string &name) | |
| Material & | allocate (std::unique_ptr< Material > instance) |
| bool | isFull () const |
Protected Attributes inherited from ResourcesManager< Material > | |
| std::vector< std::unique_ptr< Material > > | resources |
| std::mutex | resourcesMutex |
Construct a manager bound to the given runtime context.
| capacity | Maximum number of materials |
| parametersCapacity | Total maximum number of float4 parameter slots across all shader materials |
| StandardMaterial& create | ( | ) |
| ShaderMaterial& create | ( | const std::shared_ptr< ShaderMaterial > & | orig | ) |
| ShaderMaterial& create | ( | const std::string & | fragShaderFileName, |
| const std::string & | vertShaderFileName, | ||
| uint32 | parameterCount = 0, |
||
| RenderingPhase | stage = RenderingPhase::DEFAULT |
||
| ) |
| ShaderMaterial& create | ( | const std::string & | fragShaderFileName, |
| uint32 | parameterCount = 0, |
||
| RenderingPhase | stage = RenderingPhase::DEFAULT |
||
| ) |
|
inline |
|
inline |
|
overridevirtual |
Releases a resource by ID, decrementing its reference counter. The slot is returned to the free list only when the counter reaches zero.
| id | Unique identifier of the resource to destroy. |
Reimplemented from lysa::ResourcesManager< Material >::destroy()
| void flush | ( | ) |
|
inline |
|
inline |
Returns the GPU buffer for the shader material parameters SSBO.
| void upload | ( | const Material & | material | ) |
| void uploadParameters | ( | const ShaderMaterial & | material | ) |
Schedules an upload of the parameters SSBO block for the given ShaderMaterial.