Skip to content

Commit ba2bdea

Browse files
Remove redundant variable VmaBlockVector::m_IsCustomPool
1 parent bc266d6 commit ba2bdea

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

src/vk_mem_alloc.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6032,7 +6032,6 @@ struct VmaBlockVector
60326032
size_t maxBlockCount,
60336033
VkDeviceSize bufferImageGranularity,
60346034
uint32_t frameInUseCount,
6035-
bool isCustomPool,
60366035
bool explicitBlockSize,
60376036
uint32_t algorithm);
60386037
~VmaBlockVector();
@@ -6041,6 +6040,7 @@ struct VmaBlockVector
60416040

60426041
VmaAllocator GetAllocator() const { return m_hAllocator; }
60436042
VmaPool GetParentPool() const { return m_hParentPool; }
6043+
bool IsCustomPool() const { return m_hParentPool != VMA_NULL; }
60446044
uint32_t GetMemoryTypeIndex() const { return m_MemoryTypeIndex; }
60456045
VkDeviceSize GetPreferredBlockSize() const { return m_PreferredBlockSize; }
60466046
VkDeviceSize GetBufferImageGranularity() const { return m_BufferImageGranularity; }
@@ -6106,7 +6106,6 @@ struct VmaBlockVector
61066106
const size_t m_MaxBlockCount;
61076107
const VkDeviceSize m_BufferImageGranularity;
61086108
const uint32_t m_FrameInUseCount;
6109-
const bool m_IsCustomPool;
61106109
const bool m_ExplicitBlockSize;
61116110
const uint32_t m_Algorithm;
61126111
/* There can be at most one allocation that is completely empty - a
@@ -11448,7 +11447,6 @@ VmaPool_T::VmaPool_T(
1144811447
createInfo.maxBlockCount,
1144911448
(createInfo.flags & VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT) != 0 ? 1 : hAllocator->GetBufferImageGranularity(),
1145011449
createInfo.frameInUseCount,
11451-
true, // isCustomPool
1145211450
createInfo.blockSize != 0, // explicitBlockSize
1145311451
createInfo.flags & VMA_POOL_CREATE_ALGORITHM_MASK), // algorithm
1145411452
m_Id(0),
@@ -11488,7 +11486,6 @@ VmaBlockVector::VmaBlockVector(
1148811486
size_t maxBlockCount,
1148911487
VkDeviceSize bufferImageGranularity,
1149011488
uint32_t frameInUseCount,
11491-
bool isCustomPool,
1149211489
bool explicitBlockSize,
1149311490
uint32_t algorithm) :
1149411491
m_hAllocator(hAllocator),
@@ -11499,7 +11496,6 @@ VmaBlockVector::VmaBlockVector(
1149911496
m_MaxBlockCount(maxBlockCount),
1150011497
m_BufferImageGranularity(bufferImageGranularity),
1150111498
m_FrameInUseCount(frameInUseCount),
11502-
m_IsCustomPool(isCustomPool),
1150311499
m_ExplicitBlockSize(explicitBlockSize),
1150411500
m_Algorithm(algorithm),
1150511501
m_HasEmptyBlock(false),
@@ -12426,7 +12422,7 @@ void VmaBlockVector::PrintDetailedMap(class VmaJsonWriter& json)
1242612422

1242712423
json.BeginObject();
1242812424

12429-
if(m_IsCustomPool)
12425+
if(IsCustomPool())
1243012426
{
1243112427
const char* poolName = m_hParentPool->GetName();
1243212428
if(poolName != VMA_NULL && poolName[0] != '\0')
@@ -14331,7 +14327,6 @@ VmaAllocator_T::VmaAllocator_T(const VmaAllocatorCreateInfo* pCreateInfo) :
1433114327
SIZE_MAX,
1433214328
GetBufferImageGranularity(),
1433314329
pCreateInfo->frameInUseCount,
14334-
false, // isCustomPool
1433514330
false, // explicitBlockSize
1433614331
false); // linearAlgorithm
1433714332
// No need to call m_pBlockVectors[memTypeIndex][blockVectorTypeIndex]->CreateMinBlocks here,

0 commit comments

Comments
 (0)