summaryrefslogtreecommitdiffstats
path: root/AssetLoader/interface/GLTFResourceManager.hpp
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-12-01 04:36:47 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-12-01 04:36:47 +0000
commit2e37306dce0f0c151ba9401d6a5d5e80c36e28cc (patch)
tree5b8ca89010fe3a638ebbfebfef9a3953b194d9f5 /AssetLoader/interface/GLTFResourceManager.hpp
parentGLTF Loader: updated GPU resource initialization (diff)
downloadDiligentTools-2e37306dce0f0c151ba9401d6a5d5e80c36e28cc.tar.gz
DiligentTools-2e37306dce0f0c151ba9401d6a5d5e80c36e28cc.zip
GLTF Loader: implemented buffer suballocation in cache
Diffstat (limited to 'AssetLoader/interface/GLTFResourceManager.hpp')
-rw-r--r--AssetLoader/interface/GLTFResourceManager.hpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/AssetLoader/interface/GLTFResourceManager.hpp b/AssetLoader/interface/GLTFResourceManager.hpp
index 520a149..9a8fbbe 100644
--- a/AssetLoader/interface/GLTFResourceManager.hpp
+++ b/AssetLoader/interface/GLTFResourceManager.hpp
@@ -49,7 +49,8 @@ public:
struct BufferAllocation
{
- Uint32 BufferIndex = 0;
+ Int32 BufferIndex = -1;
+
VariableSizeAllocationsManager::Allocation Region;
bool IsValid() const
@@ -59,7 +60,7 @@ public:
};
struct TextureAllocation
{
- Uint32 TextureIndex = 0;
+ Int32 TextureIndex = -1;
DynamicAtlasManager::Region Region;
bool IsValid() const
@@ -91,18 +92,18 @@ public:
void FreeBufferSpace(BufferAllocation&& Allocation);
- IBuffer* GetBuffer(Uint32 Idx)
+ IBuffer* GetBuffer(const BufferAllocation& Allocation)
{
- return m_Buffers[Idx].pBuffer;
+ return m_Buffers[Allocation.BufferIndex].pBuffer;
}
TextureAllocation AllocateTextureSpace(Uint32 TextureIndex, Uint32 Width, Uint32 Height);
void FreeTextureSpace(TextureAllocation&& Allocation);
- ITexture* GetTexture(Uint32 Idx)
+ ITexture* GetTexture(const TextureAllocation& Allocation)
{
- return m_Textures[Idx].pTexture;
+ return m_Textures[Allocation.TextureIndex].pTexture;
}
private: