mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
synced 2024-11-05 04:10:06 +00:00
Fix for build on Linux
This commit is contained in:
parent
ae0b011e7a
commit
4dfa169ffc
@ -8,6 +8,7 @@ platforms { "x64", "Linux-x64" }
|
||||
location "../build"
|
||||
filename ("VulkanSample_" .. _SUFFIX)
|
||||
startproject "VulkanSample"
|
||||
cppdialect "C++14"
|
||||
|
||||
filter "platforms:x64"
|
||||
system "Windows"
|
||||
@ -50,7 +51,6 @@ defines { "WIN32", "_CONSOLE", "PROFILE", "_WINDOWS", "_WIN32_WINNT=0x0601" }
|
||||
links { "vulkan-1" }
|
||||
|
||||
filter { "platforms:Linux-x64" }
|
||||
buildoptions { "-std=c++0x" }
|
||||
links { "vulkan" }
|
||||
|
||||
filter { "configurations:Debug", "platforms:x64" }
|
||||
@ -89,7 +89,6 @@ defines { "WIN32", "_CONSOLE", "PROFILE", "_WINDOWS", "_WIN32_WINNT=0x0601" }
|
||||
links { "vulkan-1" }
|
||||
|
||||
filter { "platforms:Linux-x64" }
|
||||
buildoptions { "-std=c++0x" }
|
||||
links { "vulkan" }
|
||||
|
||||
filter { "configurations:Debug", "platforms:x64" }
|
||||
|
@ -17194,16 +17194,17 @@ void VmaAllocator_T::CreateLostAllocation(VmaAllocation* pAllocation)
|
||||
}
|
||||
|
||||
// An object that increments given atomic but decrements it back in the destructor unless Commit() is called.
|
||||
template<typename AtomicT>
|
||||
template<typename T>
|
||||
struct AtomicTransactionalIncrement
|
||||
{
|
||||
public:
|
||||
typedef std::atomic<T> AtomicT;
|
||||
~AtomicTransactionalIncrement()
|
||||
{
|
||||
if(m_Atomic)
|
||||
--(*m_Atomic);
|
||||
}
|
||||
typename AtomicT::value_type Increment(AtomicT* atomic)
|
||||
T Increment(AtomicT* atomic)
|
||||
{
|
||||
m_Atomic = atomic;
|
||||
return m_Atomic->fetch_add(1);
|
||||
@ -17219,7 +17220,7 @@ private:
|
||||
|
||||
VkResult VmaAllocator_T::AllocateVulkanMemory(const VkMemoryAllocateInfo* pAllocateInfo, VkDeviceMemory* pMemory)
|
||||
{
|
||||
AtomicTransactionalIncrement<VMA_ATOMIC_UINT32> deviceMemoryCountIncrement;
|
||||
AtomicTransactionalIncrement<uint32_t> deviceMemoryCountIncrement;
|
||||
const uint64_t prevDeviceMemoryCount = deviceMemoryCountIncrement.Increment(&m_DeviceMemoryCount);
|
||||
#if VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT
|
||||
if(prevDeviceMemoryCount >= m_PhysicalDeviceProperties.limits.maxMemoryAllocationCount)
|
||||
|
Loading…
Reference in New Issue
Block a user