From bc393d8fd195f2d4400b6aeb42fa40b92d6b4b68 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Thu, 21 Jun 2018 21:33:43 -0700 Subject: Improved memory allocation for shader variables and resource cache in Vk backend --- Common/interface/FixedBlockMemoryAllocator.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Common/interface') diff --git a/Common/interface/FixedBlockMemoryAllocator.h b/Common/interface/FixedBlockMemoryAllocator.h index c092c203..2b9a5f3e 100644 --- a/Common/interface/FixedBlockMemoryAllocator.h +++ b/Common/interface/FixedBlockMemoryAllocator.h @@ -52,7 +52,7 @@ namespace Diligent class FixedBlockMemoryAllocator : public IMemoryAllocator { public: - FixedBlockMemoryAllocator(IMemoryAllocator &RawMemoryAllocator, size_t BlockSize, Uint32 NumBlocksInPage); + FixedBlockMemoryAllocator(IMemoryAllocator& RawMemoryAllocator, size_t BlockSize, Uint32 NumBlocksInPage); ~FixedBlockMemoryAllocator(); /// Allocates block of memory @@ -62,10 +62,10 @@ public: virtual void Free(void *Ptr)override final; private: - FixedBlockMemoryAllocator(const FixedBlockMemoryAllocator&) = delete; - FixedBlockMemoryAllocator(FixedBlockMemoryAllocator&&) = delete; + FixedBlockMemoryAllocator (const FixedBlockMemoryAllocator&) = delete; + FixedBlockMemoryAllocator (FixedBlockMemoryAllocator&&) = delete; FixedBlockMemoryAllocator& operator = (const FixedBlockMemoryAllocator&) = delete; - FixedBlockMemoryAllocator& operator = (FixedBlockMemoryAllocator&&) = delete; + FixedBlockMemoryAllocator& operator = (FixedBlockMemoryAllocator&&) = delete; void CreateNewPage(); @@ -74,15 +74,15 @@ private: class MemoryPage { public: - static constexpr Uint8 NewPageMemPattern = 0xAA; - static constexpr Uint8 AllocatedBlockMemPattern = 0xAB; + static constexpr Uint8 NewPageMemPattern = 0xAA; + static constexpr Uint8 AllocatedBlockMemPattern = 0xAB; static constexpr Uint8 DeallocatedBlockMemPattern = 0xDE; static constexpr Uint8 InitializedBlockMemPattern = 0xCF; - MemoryPage(FixedBlockMemoryAllocator &OwnerAllocator): - m_NumFreeBlocks(OwnerAllocator.m_NumBlocksInPage), + MemoryPage(FixedBlockMemoryAllocator& OwnerAllocator): + m_NumFreeBlocks (OwnerAllocator.m_NumBlocksInPage), m_NumInitializedBlocks(0), - m_pOwnerAllocator(&OwnerAllocator) + m_pOwnerAllocator (&OwnerAllocator) { auto PageSize = OwnerAllocator.m_BlockSize * OwnerAllocator.m_NumBlocksInPage; m_pPageStart = reinterpret_cast( -- cgit v1.2.3