mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
synced 2024-11-05 04:10:06 +00:00
Merge pull request #310 from orlowd/vma_atomic-def-fix
Fix atomic type used in AtomicTransactionalIncrement
This commit is contained in:
commit
8b87b6cbf7
@ -4002,11 +4002,11 @@ private:
|
|||||||
|
|
||||||
#ifndef _VMA_ATOMIC_TRANSACTIONAL_INCREMENT
|
#ifndef _VMA_ATOMIC_TRANSACTIONAL_INCREMENT
|
||||||
// An object that increments given atomic but decrements it back in the destructor unless Commit() is called.
|
// An object that increments given atomic but decrements it back in the destructor unless Commit() is called.
|
||||||
template<typename T>
|
template<typename AtomicT>
|
||||||
struct AtomicTransactionalIncrement
|
struct AtomicTransactionalIncrement
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef std::atomic<T> AtomicT;
|
using T = decltype(AtomicT().load());
|
||||||
|
|
||||||
~AtomicTransactionalIncrement()
|
~AtomicTransactionalIncrement()
|
||||||
{
|
{
|
||||||
@ -15374,7 +15374,7 @@ VkResult VmaAllocator_T::CheckCorruption(uint32_t memoryTypeBits)
|
|||||||
|
|
||||||
VkResult VmaAllocator_T::AllocateVulkanMemory(const VkMemoryAllocateInfo* pAllocateInfo, VkDeviceMemory* pMemory)
|
VkResult VmaAllocator_T::AllocateVulkanMemory(const VkMemoryAllocateInfo* pAllocateInfo, VkDeviceMemory* pMemory)
|
||||||
{
|
{
|
||||||
AtomicTransactionalIncrement<uint32_t> deviceMemoryCountIncrement;
|
AtomicTransactionalIncrement<VMA_ATOMIC_UINT32> deviceMemoryCountIncrement;
|
||||||
const uint64_t prevDeviceMemoryCount = deviceMemoryCountIncrement.Increment(&m_DeviceMemoryCount);
|
const uint64_t prevDeviceMemoryCount = deviceMemoryCountIncrement.Increment(&m_DeviceMemoryCount);
|
||||||
#if VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT
|
#if VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT
|
||||||
if(prevDeviceMemoryCount >= m_PhysicalDeviceProperties.limits.maxMemoryAllocationCount)
|
if(prevDeviceMemoryCount >= m_PhysicalDeviceProperties.limits.maxMemoryAllocationCount)
|
||||||
|
Loading…
Reference in New Issue
Block a user