Skip to content

Commit 4c5e910

Browse files
Merge pull request #41 from GermanAizek/refactor
Fixed minor bugs
2 parents 117ff9e + 52b71ca commit 4c5e910

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

src/D3D12MemAlloc.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5228,7 +5228,7 @@ bool BlockMetadata_TLSF::CreateAllocationRequest(
52285228

52295229
// Round up to the next block
52305230
UINT64 sizeForNextList = allocSize;
5231-
UINT64 smallSizeStep = SMALL_BUFFER_SIZE / (IsVirtual() ? 1 << SECOND_LEVEL_INDEX : 4);
5231+
UINT16 smallSizeStep = SMALL_BUFFER_SIZE / (IsVirtual() ? 1 << SECOND_LEVEL_INDEX : 4);
52325232
if (allocSize > SMALL_BUFFER_SIZE)
52335233
{
52345234
sizeForNextList += (1ULL << (BitScanMSB(allocSize) - SECOND_LEVEL_INDEX));
@@ -7769,9 +7769,10 @@ HRESULT AllocatorPimpl::CalcAllocationParams(const ALLOCATION_DESC& allocDesc, U
77697769
msaaAlwaysCommitted = pool->GetBlockVector()->DeniesMsaaTextures();
77707770
outBlockVector = pool->GetBlockVector();
77717771

7772-
outCommittedAllocationParams.m_ProtectedSession = pool->GetDesc().pProtectedSession;
7773-
outCommittedAllocationParams.m_HeapProperties = pool->GetDesc().HeapProperties;
7774-
outCommittedAllocationParams.m_HeapFlags = pool->GetDesc().HeapFlags;
7772+
const auto& desc = pool->GetDesc();
7773+
outCommittedAllocationParams.m_ProtectedSession = desc.pProtectedSession;
7774+
outCommittedAllocationParams.m_HeapProperties = desc.HeapProperties;
7775+
outCommittedAllocationParams.m_HeapFlags = desc.HeapFlags;
77757776
outCommittedAllocationParams.m_List = pool->GetCommittedAllocationList();
77767777
}
77777778
else
@@ -9138,8 +9139,8 @@ bool DefragmentationContextPimpl::IncrementCounters(UINT64 bytes)
91389139
// Early return when max found
91399140
if (++m_PassStats.AllocationsMoved >= m_MaxPassAllocations || m_PassStats.BytesMoved >= m_MaxPassBytes)
91409141
{
9141-
D3D12MA_ASSERT(m_PassStats.AllocationsMoved == m_MaxPassAllocations ||
9142-
m_PassStats.BytesMoved == m_MaxPassBytes && "Exceeded maximal pass threshold!");
9142+
D3D12MA_ASSERT((m_PassStats.AllocationsMoved == m_MaxPassAllocations ||
9143+
m_PassStats.BytesMoved == m_MaxPassBytes) && "Exceeded maximal pass threshold!");
91439144
return true;
91449145
}
91459146
return false;
@@ -9719,6 +9720,7 @@ Allocation::Allocation(AllocatorPimpl* allocator, UINT64 size, UINT64 alignment,
97199720
m_Size{ size },
97209721
m_Alignment{ alignment },
97219722
m_Resource{ NULL },
9723+
m_pPrivateData{ NULL },
97229724
m_Name{ NULL }
97239725
{
97249726
D3D12MA_ASSERT(allocator);

0 commit comments

Comments
 (0)