From 1f2359dbf6d2d8068cb4d0f9317e0e6727e2d408 Mon Sep 17 00:00:00 2001 From: assiduous Date: Wed, 9 Dec 2020 18:06:45 -0800 Subject: Few updated to BufferSuballocator and DynamicTextureAtlas --- Graphics/GraphicsTools/interface/BufferSuballocator.h | 6 +++++- Graphics/GraphicsTools/interface/DynamicTextureAtlas.h | 4 ++++ Graphics/GraphicsTools/src/BufferSuballocator.cpp | 4 ++-- Graphics/GraphicsTools/src/DynamicTextureAtlas.cpp | 4 ++-- 4 files changed, 13 insertions(+), 5 deletions(-) (limited to 'Graphics/GraphicsTools') diff --git a/Graphics/GraphicsTools/interface/BufferSuballocator.h b/Graphics/GraphicsTools/interface/BufferSuballocator.h index 59251962..f9e15244 100644 --- a/Graphics/GraphicsTools/interface/BufferSuballocator.h +++ b/Graphics/GraphicsTools/interface/BufferSuballocator.h @@ -95,7 +95,7 @@ struct IBufferSuballocator : public IObject /// Returns the total remaining free size. - /// \note Due to fragmentation total free size may be split between + /// \note Due to fragmentation, total free size may be split between /// mutliple free chunks. virtual Uint32 GetFreeSize() = 0; @@ -121,6 +121,10 @@ struct BufferSuballocatorCreateInfo /// Allocation granularity for IBufferSuballocator objects. + + /// Buffer suballocator uses FixedBlockMemoryAllocator to allocate instances + /// of IBufferSuballocation implementation class. This memeber defines + /// the number of objects in one page. Uint32 SuballocationObjAllocationGranularity = 64; }; diff --git a/Graphics/GraphicsTools/interface/DynamicTextureAtlas.h b/Graphics/GraphicsTools/interface/DynamicTextureAtlas.h index 35ed4825..5441c715 100644 --- a/Graphics/GraphicsTools/interface/DynamicTextureAtlas.h +++ b/Graphics/GraphicsTools/interface/DynamicTextureAtlas.h @@ -144,6 +144,10 @@ struct DynamicTextureAtlasCreateInfo /// Allocation granularity for ITextureAtlasSuballocation objects. + + /// Texture atlas uses FixedBlockMemoryAllocator to allocate instances + /// of ITextureAtlasSuballocation implementation class. This memeber defines + /// the number of objects in one page. Uint32 SuballocationObjAllocationGranularity = 64; }; diff --git a/Graphics/GraphicsTools/src/BufferSuballocator.cpp b/Graphics/GraphicsTools/src/BufferSuballocator.cpp index d683978d..dcfbcded 100644 --- a/Graphics/GraphicsTools/src/BufferSuballocator.cpp +++ b/Graphics/GraphicsTools/src/BufferSuballocator.cpp @@ -74,8 +74,8 @@ public: return TBase::Release( [&]() // { - // We must keep parent alive while the object is being destroyed because - // it keeps the object allocator. + // We must keep parent alive while this object is being destroyed because + // the parent keeps the memory allocator for the object. pParent = m_pParentAllocator; }); } diff --git a/Graphics/GraphicsTools/src/DynamicTextureAtlas.cpp b/Graphics/GraphicsTools/src/DynamicTextureAtlas.cpp index a5c6b4e5..c0e824ae 100644 --- a/Graphics/GraphicsTools/src/DynamicTextureAtlas.cpp +++ b/Graphics/GraphicsTools/src/DynamicTextureAtlas.cpp @@ -75,8 +75,8 @@ public: return TBase::Release( [&]() // { - // We must keep the atlas alive while the object is being destroyed because - // the atlas keeps the object allocator. + // We must keep parent alive while this object is being destroyed because + // the parent keeps the memory allocator for the object. pAtlas = m_pParentAtlas; }); } -- cgit v1.2.3