From 2b396d236ab33dfe9c0defbe401d354ed3fb34f9 Mon Sep 17 00:00:00 2001 From: azhirnov Date: Thu, 8 Oct 2020 21:45:01 +0300 Subject: removed strong references to shaders in PSO --- Common/src/DefaultRawMemoryAllocator.cpp | 1 + Common/src/FixedBlockMemoryAllocator.cpp | 2 ++ 2 files changed, 3 insertions(+) (limited to 'Common/src') diff --git a/Common/src/DefaultRawMemoryAllocator.cpp b/Common/src/DefaultRawMemoryAllocator.cpp index 38840360..f1ecabe8 100644 --- a/Common/src/DefaultRawMemoryAllocator.cpp +++ b/Common/src/DefaultRawMemoryAllocator.cpp @@ -37,6 +37,7 @@ DefaultRawMemoryAllocator::DefaultRawMemoryAllocator() void* DefaultRawMemoryAllocator::Allocate(size_t Size, const Char* dbgDescription, const char* dbgFileName, const Int32 dbgLineNumber) { + VERIFY_EXPR(Size > 0); return new Uint8[Size]; } diff --git a/Common/src/FixedBlockMemoryAllocator.cpp b/Common/src/FixedBlockMemoryAllocator.cpp index 2d2c993b..e4dc53d3 100644 --- a/Common/src/FixedBlockMemoryAllocator.cpp +++ b/Common/src/FixedBlockMemoryAllocator.cpp @@ -74,6 +74,8 @@ void FixedBlockMemoryAllocator::CreateNewPage() void* FixedBlockMemoryAllocator::Allocate(size_t Size, const Char* dbgDescription, const char* dbgFileName, const Int32 dbgLineNumber) { + VERIFY_EXPR(Size > 0); + Size = AdjustBlockSize(Size); VERIFY(m_BlockSize == Size, "Requested size (", Size, ") does not match the block size (", m_BlockSize, ")"); -- cgit v1.2.3 From 91aac63f651da1079be93d2fe722cd10e4e15570 Mon Sep 17 00:00:00 2001 From: assiduous Date: Sat, 10 Oct 2020 19:28:54 -0700 Subject: A number of corrections for PSO refactoring --- Common/src/FixedBlockMemoryAllocator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Common/src') diff --git a/Common/src/FixedBlockMemoryAllocator.cpp b/Common/src/FixedBlockMemoryAllocator.cpp index e4dc53d3..eb8ca3d1 100644 --- a/Common/src/FixedBlockMemoryAllocator.cpp +++ b/Common/src/FixedBlockMemoryAllocator.cpp @@ -50,6 +50,8 @@ FixedBlockMemoryAllocator::FixedBlockMemoryAllocator(IMemoryAllocator& RawMemory m_NumBlocksInPage {NumBlocksInPage } // clang-format on { + VERIFY_EXPR(BlockSize > 0); + // Allocate one page CreateNewPage(); } @@ -74,8 +76,6 @@ void FixedBlockMemoryAllocator::CreateNewPage() void* FixedBlockMemoryAllocator::Allocate(size_t Size, const Char* dbgDescription, const char* dbgFileName, const Int32 dbgLineNumber) { - VERIFY_EXPR(Size > 0); - Size = AdjustBlockSize(Size); VERIFY(m_BlockSize == Size, "Requested size (", Size, ") does not match the block size (", m_BlockSize, ")"); -- cgit v1.2.3 From 259a9d5897937dcaaca1b4b294bb8d5250371e76 Mon Sep 17 00:00:00 2001 From: azhirnov Date: Thu, 15 Oct 2020 20:55:38 +0300 Subject: Added GraphicsPipelineCreateInfo and ComputePipelineCreateInfo instead of single PipelineCreateInfo. Some optimizations for dynamic memory allocations in PipelineState. --- Common/src/FixedBlockMemoryAllocator.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Common/src') diff --git a/Common/src/FixedBlockMemoryAllocator.cpp b/Common/src/FixedBlockMemoryAllocator.cpp index eb8ca3d1..bf4c8290 100644 --- a/Common/src/FixedBlockMemoryAllocator.cpp +++ b/Common/src/FixedBlockMemoryAllocator.cpp @@ -76,6 +76,8 @@ void FixedBlockMemoryAllocator::CreateNewPage() void* FixedBlockMemoryAllocator::Allocate(size_t Size, const Char* dbgDescription, const char* dbgFileName, const Int32 dbgLineNumber) { + VERIFY_EXPR(Size > 0); + Size = AdjustBlockSize(Size); VERIFY(m_BlockSize == Size, "Requested size (", Size, ") does not match the block size (", m_BlockSize, ")"); -- cgit v1.2.3