GLTF resource manager. More...
#include <GLTFResourceManager.hpp>
Classes | |
| struct | CreateInfo |
| Resource manager create info. More... | |
| struct | DefaultVertexPoolDesc |
| struct | TransitionResourceStatesInfo |
| Parameters of the TransitionResourceStates() method. More... | |
| struct | VertexLayoutKey |
| Vertex layout key used to select the vertex pool. More... | |
Static Public Member Functions | |
| static RefCntAutoPtr< ResourceManager > | Create (IRenderDevice *pDevice, const CreateInfo &CI) |
| Creates a new resource manager instance. | |
GLTF resource manager.
| RefCntAutoPtr< IBufferSuballocation > Diligent::GLTF::ResourceManager::AllocateIndices | ( | Uint32 | Size, |
| Uint32 | Alignment = 4 ) |
Allocates indices in the index buffer.
The function is thread-safe and can be called from multiple threads simultaneously and in parallel with other thread-safe class methods.
| RefCntAutoPtr< ITextureAtlasSuballocation > Diligent::GLTF::ResourceManager::AllocateTextureSpace | ( | TEXTURE_FORMAT | Fmt, |
| Uint32 | Width, | ||
| Uint32 | Height, | ||
| const char * | CacheId = nullptr, | ||
| IObject * | pUserData = nullptr ) |
Allocates texture space in the texture atlas that matches the specified format.
| [in] | Fmt | - Texture format. |
| [in] | Width | - Texture width. |
| [in] | Height | - Texture height. |
| [in] | CacheId | - Optional cache ID. |
| [in] | pUserData | - Optional user data to set in the texture atlas suballocation. |
If the texture atlas for the given format does not exist and if the default atlas description allows creating new atlases (Desc.Type != Diligent::RESOURCE_DIM_UNDEFINED), new atlas will be added. Otherwise, the function will return null.
The function is thread-safe and can be called from multiple threads simultaneously and in parallel with other thread-safe class methods.
| RefCntAutoPtr< IVertexPoolAllocation > Diligent::GLTF::ResourceManager::AllocateVertices | ( | const VertexLayoutKey & | LayoutKey, |
| Uint32 | VertexCount ) |
Allocates vertices in the vertex pool that matches the specified layout.
| [in] | LayoutKey | - Vertex layout key, see VertexLayoutKey. |
| [in] | VertexCount | - The number of vertices to allocate. |
If the vertex pool for the given key does not exist and if the default pool description allows creating new pools (VertexCount != 0), new pool will be added.
If existing pools run out of space, a new vertex pool will be created and vertices will be allocated from this pool.
If no pull exists for the given key and the default pool description does not allow creating new pools (VertexCount == 0), the function returns null.
The function is thread-safe and can be called from multiple threads simultaneously and in parallel with other thread-safe class methods.
| RefCntAutoPtr< ITextureAtlasSuballocation > Diligent::GLTF::ResourceManager::FindTextureAllocation | ( | const char * | CacheId | ) |
Finds texture allocation in the texture atlas that matches the specified cache ID.
The function is thread-safe and can be called from multiple threads simultaneously and in parallel with other thread-safe class methods.
| std::vector< TEXTURE_FORMAT > Diligent::GLTF::ResourceManager::GetAllocatedAtlasFormats | ( | ) | const |
Returns the formats of the allocated texture atlases.
The function is thread-safe and can be called from multiple threads simultaneously and in parallel with other thread-safe class methods.
| Uint32 Diligent::GLTF::ResourceManager::GetAllocationAlignment | ( | TEXTURE_FORMAT | Fmt, |
| Uint32 | Width, | ||
| Uint32 | Height ) |
Returns the texture atlas allocation alignment for the given format.
The function is thread-safe and can be called from multiple threads simultaneously and in parallel with other thread-safe class methods.
| TextureDesc Diligent::GLTF::ResourceManager::GetAtlasDesc | ( | TEXTURE_FORMAT | Fmt | ) |
Returns the texture atlas description for the given format.
The function is thread-safe and can be called from multiple threads simultaneously and in parallel with other thread-safe class methods.
| DynamicTextureAtlasUsageStats Diligent::GLTF::ResourceManager::GetAtlasUsageStats | ( | TEXTURE_FORMAT | Fmt = TEX_FORMAT_UNKNOWN | ) |
Returns the texture atlas usage stats.
If fmt is not Diligent::TEX_FORMAT_UNKNOWN, returns the stats for the atlas matching the specified format. Otherwise, returns the net usage stats for all atlases.
The function is thread-safe and can be called from multiple threads simultaneously and in parallel with other thread-safe class methods.
| Uint32 Diligent::GLTF::ResourceManager::GetIndexAllocatorIndex | ( | IBufferSuballocator * | pAllocator | ) | const |
Returns the index allocator index.
The function is thread-safe and can be called from multiple threads simultaneously and in parallel with other thread-safe class methods.
Returns a pointer to the index buffer.
The function is thread-safe and can be called from multiple threads simultaneously and in parallel with other thread-safe class methods.
| size_t Diligent::GLTF::ResourceManager::GetIndexBufferCount | ( | ) | const |
Returns the number of index buffers.
The function is thread-safe and can be called from multiple threads simultaneously and in parallel with other thread-safe class methods.
| BufferSuballocatorUsageStats Diligent::GLTF::ResourceManager::GetIndexBufferUsageStats | ( | ) |
Returns the index buffer usage stats.
The function is thread-safe and can be called from multiple threads simultaneously and in parallel with other thread-safe class methods.
| Uint32 Diligent::GLTF::ResourceManager::GetIndexBufferVersion | ( | ) | const |
Returns the index buffer version.
The function is thread-safe and can be called from multiple threads simultaneously and in parallel with other thread-safe class methods.
| ITexture * Diligent::GLTF::ResourceManager::GetTexture | ( | TEXTURE_FORMAT | Fmt | ) | const |
Returns the atlas texture for the given format. If the atlas does not exist, null is returned.
The function is thread-safe and can be called from multiple threads simultaneously and in parallel with other thread-safe class methods.
| Uint32 Diligent::GLTF::ResourceManager::GetTextureVersion | ( | ) | const |
Returns the combined texture atlas version, i.e. the sum of the texture versions of all atlases.
The function is thread-safe and can be called from multiple threads simultaneously and in parallel with other thread-safe class methods.
| IVertexPool * Diligent::GLTF::ResourceManager::GetVertexPool | ( | const VertexLayoutKey & | Key, |
| Uint32 | Index = 0 ) |
Returns a pointer to the vertex pool for the given key and index. If the pool does not exist, null is returned.
If multiple vertex pools with the same key may exist, an application can use the GetVertexPools() method to get all pools for the given key.
The function is thread-safe and can be called from multiple threads simultaneously and in parallel with other thread-safe class methods.
| size_t Diligent::GLTF::ResourceManager::GetVertexPoolCount | ( | const VertexLayoutKey & | Key | ) | const |
Returns the number of vertex pools for the given key.
The function is thread-safe and can be called from multiple threads simultaneously and in parallel with other thread-safe class methods.
| Uint32 Diligent::GLTF::ResourceManager::GetVertexPoolIndex | ( | const VertexLayoutKey & | Key, |
| IVertexPool * | pPool ) const |
Returns index of the vertex pool with the give key. If the pool does not exist, InvalidIndex (0xFFFFFFFF) is returned.
The function is thread-safe and can be called from multiple threads simultaneously and in parallel with other thread-safe class methods.
| std::vector< IVertexPool * > Diligent::GLTF::ResourceManager::GetVertexPools | ( | const VertexLayoutKey & | Key | ) | const |
Returns all vertex pools for the given key.
The function is thread-safe and can be called from multiple threads simultaneously and in parallel with other thread-safe class methods.
| Uint32 Diligent::GLTF::ResourceManager::GetVertexPoolsVersion | ( | ) | const |
Returns the combined vertex pool version, i.e. the sum all vertex pool versions.
The function is thread-safe and can be called from multiple threads simultaneously and in parallel with other thread-safe class methods.
| VertexPoolUsageStats Diligent::GLTF::ResourceManager::GetVertexPoolUsageStats | ( | const VertexLayoutKey & | Key = VertexLayoutKey{} | ) |
Returns the vertex pool usage stats.
If the key is not equal the default key, returns the stats for the vertex pool matching the key. Otherwise, returns the net usage stats for all pools.
The function is thread-safe and can be called from multiple threads simultaneously and in parallel with other thread-safe class methods.
| void Diligent::GLTF::ResourceManager::TransitionResourceStates | ( | IRenderDevice * | pDevice, |
| IDeviceContext * | pContext, | ||
| const TransitionResourceStatesInfo & | Info ) |
Transitions resource states of all vertex buffers, index buffer and texture atlases.
| [in] | pDevice | - Pointer to the render device. |
| [in] | pContext | - Pointer to the device context. |
| [in] | Info | - Resource state transition info, see Diligent::ResourceManager::TransitionResourceStatesInfo. |
This function is not thread-safe, but can be called in parallel with other thread-safe class methods.
| void Diligent::GLTF::ResourceManager::UpdateAllResources | ( | IRenderDevice * | pDevice, |
| IDeviceContext * | pContext ) |
Updates all vertex buffers, index buffer and atlas textures.
This method is equivalent to calling UpdateIndexBuffer(), UpdateVertexBuffers() and UpdateTextures().
The function is not thread-safe, but can be called in parallel with other thread-safe class methods.
| IBuffer * Diligent::GLTF::ResourceManager::UpdateIndexBuffer | ( | IRenderDevice * | pDevice, |
| IDeviceContext * | pContext, | ||
| Uint32 | Index = 0 ) |
Updates the index buffer, if necessary.
The function is not thread-safe, but can be called in parallel with other thread-safe class methods.
| void Diligent::GLTF::ResourceManager::UpdateIndexBuffers | ( | IRenderDevice * | pDevice, |
| IDeviceContext * | pContext ) |
Updates all index buffers.
The function is not thread-safe, but can be called in parallel with other thread-safe class methods.
| ITexture * Diligent::GLTF::ResourceManager::UpdateTexture | ( | TEXTURE_FORMAT | Fmt, |
| IRenderDevice * | pDevice, | ||
| IDeviceContext * | pContext ) |
Updates the atlas texture for the given format. If the atlas does not exist, null is returned.
The function is not thread-safe, but can be called in parallel with other thread-safe class methods.
| void Diligent::GLTF::ResourceManager::UpdateTextures | ( | IRenderDevice * | pDevice, |
| IDeviceContext * | pContext ) |
Updates all atlas textures.
The function is not thread-safe, but can be called in parallel with other thread-safe class methods.
| void Diligent::GLTF::ResourceManager::UpdateVertexBuffers | ( | IRenderDevice * | pDevice, |
| IDeviceContext * | pContext ) |
Updates the vertex buffers, if necessary.
The function is not thread-safe, but can be called in parallel with other thread-safe class methods.