![]() |
Castor3D 0.17.0
Multiplatform 3D engine
|
Material collection, with additional functions. More...
#include <MaterialCache.hpp>


Public Types | |
| using | ElementT = castor3d::Material |
| using | ElementKeyT = String |
| using | ElementCacheTraitsT = castor3d::MaterialCacheTraits |
| using | ElementCacheT = ResourceCacheBaseT< ElementT, ElementKeyT, ElementCacheTraitsT > |
| using | ElementPtrT = typename ElementCacheT::ElementPtrT |
| using | ElementContT = typename ElementCacheT::ElementContT |
| using | ElementInitialiserT = typename ElementCacheT::ElementInitialiserT |
| using | ElementCleanerT = typename ElementCacheT::ElementCleanerT |
| using | ElementMergerT = typename ElementCacheT::ElementMergerT |
Public Types inherited from castor::ResourceCacheBaseT< castor3d::Material, String, castor3d::MaterialCacheTraits > | |
| using | ElementT |
| using | ElementKeyT |
| using | ElementCacheTraitsT |
| using | ElementCacheBaseT |
| using | ElementCacheT |
| using | ElementPtrT |
| using | ElementObsT |
| using | ElementContT |
| using | ElementInitialiserT |
| using | ElementCleanerT |
| using | ElementMergerT |
Public Member Functions | |
| C3D_API | ResourceCacheT (castor3d::Engine &engine) |
| Constructor. | |
| C3D_API void | initialise (castor3d::RenderDevice const &device) |
| Intialises the default material. | |
| C3D_API void | cleanup () |
| Sets all the elements to be cleaned up. | |
| C3D_API void | clear () noexcept |
| Deletes the default material, flush the collection. | |
| C3D_API void | update (castor3d::CpuUpdater &updater) |
| Updates the render pass, CPU wise. | |
| C3D_API void | update (castor3d::GpuUpdater &updater) |
| Updates the render pass, GPU wise. | |
| C3D_API void | upload (castor3d::UploadData &uploader) const |
| Uploads all GPU buffers to VRAM. | |
| C3D_API void | registerSpecificsBuffer (castor::String const &name, castor3d::SpecificsBuffer buffer) |
| Registers a specific data shader buffer. | |
| C3D_API void | unregisterSpecificsBuffer (castor::String const &name) noexcept |
| Unregisters a pass' specific data buffer. | |
| C3D_API void | addSpecificsBuffersBindings (ashes::VkDescriptorSetLayoutBindingArray &bindings, VkShaderStageFlags shaderStages, uint32_t &index) const |
| Addw the pass' specific data buffer into the given descriptor layout bindings array. | |
| C3D_API void | addSpecificsBuffersDescriptors (ashes::WriteDescriptorSetArray &descriptorWrites, uint32_t &index) const |
| Writes the pass' specific data buffer into the given descriptor writes array. | |
| C3D_API void | createSpecificsBuffersPassBindings (crg::FramePass &pass, uint32_t &index) const |
| Writes the pass' specific data buffer bindings into given frame pass. | |
| C3D_API void | declareSpecificsShaderBuffers (sdw::ShaderWriter &writer, castor::StringMap< castor3d::shader::BufferBaseUPtr > &buffers, uint32_t &binding, uint32_t set) const |
| Declares pass' specific data shader buffers. | |
| C3D_API void | getNames (StringArray &names) |
| Puts all the materials names in the given array. | |
| C3D_API uint32_t | getMaxPassTypeCount () const |
| C3D_API std::tuple< castor3d::PassComponentCombineID, castor3d::TextureCombineID > | getPassTypeDetails (uint32_t passTypeIndex) const |
| C3D_API uint32_t | getPassTypeIndex (castor3d::PassComponentCombineID passType, castor3d::TextureCombineID textureFlags) const |
| C3D_API bool | registerPass (castor3d::Pass &pass) |
| C3D_API void | unregisterPass (castor3d::Pass &pass) noexcept |
| C3D_API bool | registerUnit (castor3d::TextureUnit &unit) |
| C3D_API void | unregisterUnit (castor3d::TextureUnit &unit) noexcept |
| C3D_API bool | registerTexture (castor3d::AnimatedTexture const &texture) |
| C3D_API void | unregisterTexture (castor3d::AnimatedTexture const &texture) noexcept |
| C3D_API uint32_t | getCurrentPassTypeCount () const |
| castor3d::MaterialObs | getDefaultMaterial () const |
| castor3d::PassBuffer const & | getPassBuffer () const |
| castor3d::SssProfileBuffer const & | getSssProfileBuffer () const |
| castor3d::TextureConfigurationBuffer const & | getTexConfigBuffer () const |
| castor3d::TextureAnimationBuffer const & | getTexAnimBuffer () const |
Public Member Functions inherited from castor::ResourceCacheBaseT< castor3d::Material, String, castor3d::MaterialCacheTraits > | |
| ResourceCacheBaseT (ResourceCacheBaseT const &)=delete | |
| ResourceCacheBaseT (ResourceCacheBaseT &&) noexcept=delete | |
| ResourceCacheBaseT & | operator= (ResourceCacheBaseT const &)=delete |
| ResourceCacheBaseT & | operator= (ResourceCacheBaseT &&) noexcept=delete |
| void | cleanup () noexcept |
| Sets all the elements to be cleaned up. | |
| void | clear () noexcept |
| Flushes the collection. | |
| ElementPtrT | create (ElementKeyT const &name, ParametersT &&... parameters) const |
| Creates an element. | |
| ElementObsT | tryAdd (ElementKeyT const &name, ElementPtrT &element, bool initialise=false) |
| Adds an element. | |
| ElementObsT | tryAddNoLock (ElementKeyT const &name, ElementPtrT &element, bool initialise=false) |
| Adds an element. | |
| ElementObsT | add (ElementKeyT const &name, ElementPtrT &element, bool initialise=true) |
| Logging version of tryAdd. | |
| ElementObsT | addNoLock (ElementKeyT const &name, ElementPtrT &element, bool initialise=true) |
| Logging version of tryAdd. | |
| ElementObsT | tryAddNew (ElementKeyT const &name, bool initialise, ElementObsT &created, ParametersT &&... parameters) |
| Add an element, constructed in-place. | |
| ElementObsT | tryAddNewNoLock (ElementKeyT const &name, bool initialise, ElementObsT &created, ParametersT &&... parameters) |
| Add an element, constructed in-place. | |
| ElementObsT | addNew (ElementKeyT const &name, ParametersT &&... parameters) |
| Logging version of tryAdd. | |
| ElementObsT | addNewNoLock (ElementKeyT const &name, ParametersT &&... parameters) |
| Logging version of tryAdd. | |
| ElementPtrT | tryRemove (ElementKeyT const &name, bool cleanup=false) noexcept |
| Removes an element, given a name. | |
| ElementPtrT | tryRemoveNoLock (ElementKeyT const &name, bool cleanup=false) noexcept |
| Removes an element, given a name. | |
| ElementPtrT | remove (ElementKeyT const &name, bool cleanup=false) noexcept |
| Logging version of tryRemove. | |
| ElementPtrT | removeNoLock (ElementKeyT const &name, bool cleanup=false) noexcept |
| Logging version of tryRemove. | |
| void | rename (ElementKeyT const &oldName, ElementKeyT const &newName) |
| Renames a resource. | |
| ElementObsT | tryFind (ElementKeyT const &name) const noexcept |
| Looks for an element with given name. | |
| ElementObsT | tryFindNoLock (ElementKeyT const &name) const noexcept |
| Looks for an element with given name. | |
| ElementObsT | find (ElementKeyT const &name) const |
| Logging version of tryRemove. | |
| ElementObsT | findNoLock (ElementKeyT const &name) const |
| Logging version of tryRemove. | |
| void | mergeInto (ElementCacheBaseT &destination) |
| Merges this cache's elements to the one given. | |
| void | forEach (FuncType func) const |
| void | forEach (FuncType func) |
| uint32_t | getObjectCount () const noexcept |
| uint32_t | getObjectCountNoLock () const noexcept |
| String const & | getObjectTypeName () const noexcept |
| bool | has (ElementKeyT const &name) const noexcept |
| bool | hasNoLock (ElementKeyT const &name) const noexcept |
| bool | isEmpty () const noexcept |
| bool | isEmptyNoLock () const noexcept |
| void | lock () const |
| void | unlock () const noexcept |
| auto | begin () noexcept |
| auto | begin () const noexcept |
| auto | end () noexcept |
| auto | end () const noexcept |
| void | reportCreation (String const &name) const |
| void | reportAdded (String const &name) const |
| void | reportDuplicate (String const &name) const |
| void | reportNull () const |
| void | reportUnknown (String const &name) const |
Material collection, with additional functions.
| using castor::ResourceCacheT< castor3d::Material, String, castor3d::MaterialCacheTraits >::ElementCacheT = ResourceCacheBaseT< ElementT, ElementKeyT, ElementCacheTraitsT > |
| using castor::ResourceCacheT< castor3d::Material, String, castor3d::MaterialCacheTraits >::ElementCacheTraitsT = castor3d::MaterialCacheTraits |
| using castor::ResourceCacheT< castor3d::Material, String, castor3d::MaterialCacheTraits >::ElementCleanerT = typename ElementCacheT::ElementCleanerT |
| using castor::ResourceCacheT< castor3d::Material, String, castor3d::MaterialCacheTraits >::ElementContT = typename ElementCacheT::ElementContT |
| using castor::ResourceCacheT< castor3d::Material, String, castor3d::MaterialCacheTraits >::ElementInitialiserT = typename ElementCacheT::ElementInitialiserT |
| using castor::ResourceCacheT< castor3d::Material, String, castor3d::MaterialCacheTraits >::ElementKeyT = String |
| using castor::ResourceCacheT< castor3d::Material, String, castor3d::MaterialCacheTraits >::ElementMergerT = typename ElementCacheT::ElementMergerT |
| using castor::ResourceCacheT< castor3d::Material, String, castor3d::MaterialCacheTraits >::ElementPtrT = typename ElementCacheT::ElementPtrT |
| using castor::ResourceCacheT< castor3d::Material, String, castor3d::MaterialCacheTraits >::ElementT = castor3d::Material |
|
explicit |
Constructor.
| [in] | engine | The engine. |
| C3D_API void castor::ResourceCacheT< castor3d::Material, String, castor3d::MaterialCacheTraits >::addSpecificsBuffersBindings | ( | ashes::VkDescriptorSetLayoutBindingArray & | bindings, |
| VkShaderStageFlags | shaderStages, | ||
| uint32_t & | index ) const |
Addw the pass' specific data buffer into the given descriptor layout bindings array.
| [in,out] | bindings | Receives the buffers descriptor layout bindings. |
| [in] | shaderStages | The shader stage flags. |
| [in,out] | index | The binding index. |
| C3D_API void castor::ResourceCacheT< castor3d::Material, String, castor3d::MaterialCacheTraits >::addSpecificsBuffersDescriptors | ( | ashes::WriteDescriptorSetArray & | descriptorWrites, |
| uint32_t & | index ) const |
Writes the pass' specific data buffer into the given descriptor writes array.
| [in,out] | descriptorWrites | Receives the buffers descriptor writes. |
| [in,out] | index | The binding index. |
| C3D_API void castor::ResourceCacheT< castor3d::Material, String, castor3d::MaterialCacheTraits >::cleanup | ( | ) |
Sets all the elements to be cleaned up.
|
noexcept |
Deletes the default material, flush the collection.
| C3D_API void castor::ResourceCacheT< castor3d::Material, String, castor3d::MaterialCacheTraits >::createSpecificsBuffersPassBindings | ( | crg::FramePass & | pass, |
| uint32_t & | index ) const |
Writes the pass' specific data buffer bindings into given frame pass.
| [in,out] | pass | The target frame pass. |
| [in,out] | index | The binding index. |
| C3D_API void castor::ResourceCacheT< castor3d::Material, String, castor3d::MaterialCacheTraits >::declareSpecificsShaderBuffers | ( | sdw::ShaderWriter & | writer, |
| castor::StringMap< castor3d::shader::BufferBaseUPtr > & | buffers, | ||
| uint32_t & | binding, | ||
| uint32_t | set ) const |
Declares pass' specific data shader buffers.
| [in,out] | writer | The shader writer. |
| [out] | buffers | Receives the registered shader buffers. |
| [in,out] | binding | The descriptor binding index. |
| [in] | set | The descriptor set index. |
| C3D_API uint32_t castor::ResourceCacheT< castor3d::Material, String, castor3d::MaterialCacheTraits >::getCurrentPassTypeCount | ( | ) | const |
|
inline |
| C3D_API uint32_t castor::ResourceCacheT< castor3d::Material, String, castor3d::MaterialCacheTraits >::getMaxPassTypeCount | ( | ) | const |
| C3D_API void castor::ResourceCacheT< castor3d::Material, String, castor3d::MaterialCacheTraits >::getNames | ( | StringArray & | names | ) |
Puts all the materials names in the given array.
| [out] | names | The array of names to be filled |
|
inline |
References CU_Require.
| C3D_API std::tuple< castor3d::PassComponentCombineID, castor3d::TextureCombineID > castor::ResourceCacheT< castor3d::Material, String, castor3d::MaterialCacheTraits >::getPassTypeDetails | ( | uint32_t | passTypeIndex | ) | const |
| C3D_API uint32_t castor::ResourceCacheT< castor3d::Material, String, castor3d::MaterialCacheTraits >::getPassTypeIndex | ( | castor3d::PassComponentCombineID | passType, |
| castor3d::TextureCombineID | textureFlags ) const |
|
inline |
References CU_Require.
|
inline |
References CU_Require.
|
inline |
References CU_Require.
| C3D_API void castor::ResourceCacheT< castor3d::Material, String, castor3d::MaterialCacheTraits >::initialise | ( | castor3d::RenderDevice const & | device | ) |
Intialises the default material.
| [in] | device | The GPU device. |
| C3D_API bool castor::ResourceCacheT< castor3d::Material, String, castor3d::MaterialCacheTraits >::registerPass | ( | castor3d::Pass & | pass | ) |
| C3D_API void castor::ResourceCacheT< castor3d::Material, String, castor3d::MaterialCacheTraits >::registerSpecificsBuffer | ( | castor::String const & | name, |
| castor3d::SpecificsBuffer | buffer ) |
Registers a specific data shader buffer.
| [in,out] | name | The shader buffer name. |
| [out] | buffer | The shader buffer. |
| C3D_API bool castor::ResourceCacheT< castor3d::Material, String, castor3d::MaterialCacheTraits >::registerTexture | ( | castor3d::AnimatedTexture const & | texture | ) |
| C3D_API bool castor::ResourceCacheT< castor3d::Material, String, castor3d::MaterialCacheTraits >::registerUnit | ( | castor3d::TextureUnit & | unit | ) |
|
noexcept |
|
noexcept |
Unregisters a pass' specific data buffer.
| [in,out] | name | The shader buffer name. |
|
noexcept |
|
noexcept |
| C3D_API void castor::ResourceCacheT< castor3d::Material, String, castor3d::MaterialCacheTraits >::update | ( | castor3d::CpuUpdater & | updater | ) |
Updates the render pass, CPU wise.
| [in,out] | updater | The update data. |
| C3D_API void castor::ResourceCacheT< castor3d::Material, String, castor3d::MaterialCacheTraits >::update | ( | castor3d::GpuUpdater & | updater | ) |
Updates the render pass, GPU wise.
| [in,out] | updater | The update data. |
| C3D_API void castor::ResourceCacheT< castor3d::Material, String, castor3d::MaterialCacheTraits >::upload | ( | castor3d::UploadData & | uploader | ) | const |
Uploads all GPU buffers to VRAM.
| [in] | uploader | Receives the upload requests. |