Merge pull request #43 from PixelCatalyst/fix_atomic_initialization

Use list initialization for atomics
This commit is contained in:
Adam Sawicki 2022-07-18 12:13:15 +02:00 committed by GitHub
commit f0458801c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -145,7 +145,7 @@ public:
protected:
virtual void ReleaseThis() { delete this; }
private:
D3D12MA_ATOMIC_UINT32 m_RefCount = 1;
D3D12MA_ATOMIC_UINT32 m_RefCount = {1};
};
} // namespace D3D12MA

View File

@ -6120,7 +6120,7 @@ private:
D3D12MA_ATOMIC_UINT64 m_BlockBytes[DXGI_MEMORY_SEGMENT_GROUP_COUNT] = {};
D3D12MA_ATOMIC_UINT64 m_AllocationBytes[DXGI_MEMORY_SEGMENT_GROUP_COUNT] = {};
D3D12MA_ATOMIC_UINT32 m_OperationsSinceBudgetFetch = 0;
D3D12MA_ATOMIC_UINT32 m_OperationsSinceBudgetFetch = {0};
D3D12MA_RW_MUTEX m_BudgetMutex;
UINT64 m_D3D12Usage[DXGI_MEMORY_SEGMENT_GROUP_COUNT] = {};
UINT64 m_D3D12Budget[DXGI_MEMORY_SEGMENT_GROUP_COUNT] = {};
@ -6355,7 +6355,7 @@ class AllocatorPimpl
friend class Allocator;
friend class Pool;
public:
std::atomic_uint32_t m_RefCount = 1;
std::atomic_uint32_t m_RefCount = {1};
CurrentBudgetData m_Budget;
AllocatorPimpl(const ALLOCATION_CALLBACKS& allocationCallbacks, const ALLOCATOR_DESC& desc);