mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
synced 2025-05-14 16:58:34 +00:00
Renamed macro VMA_DEBUG_ALIGNMENT to VMA_MIN_ALIGNMENT as there are valid use cases for it other than debugging purposes.
This commit is contained in:
parent
49d9f99467
commit
8d4a9e9174
3 changed files with 16 additions and 12 deletions
|
@ -4346,12 +4346,16 @@ If providing your own implementation, you need to implement a subset of std::ato
|
|||
#define VMA_DEBUG_ALWAYS_DEDICATED_MEMORY (0)
|
||||
#endif
|
||||
|
||||
#ifndef VMA_DEBUG_ALIGNMENT
|
||||
#ifndef VMA_MIN_ALIGNMENT
|
||||
/**
|
||||
Minimum alignment of all allocations, in bytes.
|
||||
Set to more than 1 for debugging purposes only. Must be power of two.
|
||||
Set to more than 1 for debugging purposes. Must be power of two.
|
||||
*/
|
||||
#define VMA_DEBUG_ALIGNMENT (1)
|
||||
#ifdef VMA_DEBUG_ALIGNMENT // Old name
|
||||
#define VMA_MIN_ALIGNMENT VMA_DEBUG_ALIGNMENT
|
||||
#else
|
||||
#define VMA_MIN_ALIGNMENT (1)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef VMA_DEBUG_MARGIN
|
||||
|
@ -8229,8 +8233,8 @@ public:
|
|||
VkDeviceSize GetMemoryTypeMinAlignment(uint32_t memTypeIndex) const
|
||||
{
|
||||
return IsMemoryTypeNonCoherent(memTypeIndex) ?
|
||||
VMA_MAX((VkDeviceSize)VMA_DEBUG_ALIGNMENT, m_PhysicalDeviceProperties.limits.nonCoherentAtomSize) :
|
||||
(VkDeviceSize)VMA_DEBUG_ALIGNMENT;
|
||||
VMA_MAX((VkDeviceSize)VMA_MIN_ALIGNMENT, m_PhysicalDeviceProperties.limits.nonCoherentAtomSize) :
|
||||
(VkDeviceSize)VMA_MIN_ALIGNMENT;
|
||||
}
|
||||
|
||||
bool IsIntegratedGpu() const
|
||||
|
@ -15907,7 +15911,7 @@ void VmaRecorder::WriteConfiguration(
|
|||
fprintf(m_File, "Extension,VK_AMD_device_coherent_memory,%u\n", deviceCoherentMemoryExtensionEnabled ? 1 : 0);
|
||||
|
||||
fprintf(m_File, "Macro,VMA_DEBUG_ALWAYS_DEDICATED_MEMORY,%u\n", VMA_DEBUG_ALWAYS_DEDICATED_MEMORY ? 1 : 0);
|
||||
fprintf(m_File, "Macro,VMA_DEBUG_ALIGNMENT,%llu\n", (VkDeviceSize)VMA_DEBUG_ALIGNMENT);
|
||||
fprintf(m_File, "Macro,VMA_MIN_ALIGNMENT,%llu\n", (VkDeviceSize)VMA_MIN_ALIGNMENT);
|
||||
fprintf(m_File, "Macro,VMA_DEBUG_MARGIN,%llu\n", (VkDeviceSize)VMA_DEBUG_MARGIN);
|
||||
fprintf(m_File, "Macro,VMA_DEBUG_INITIALIZE_ALLOCATIONS,%u\n", VMA_DEBUG_INITIALIZE_ALLOCATIONS ? 1 : 0);
|
||||
fprintf(m_File, "Macro,VMA_DEBUG_DETECT_CORRUPTION,%u\n", VMA_DEBUG_DETECT_CORRUPTION ? 1 : 0);
|
||||
|
@ -16090,7 +16094,7 @@ VmaAllocator_T::VmaAllocator_T(const VmaAllocatorCreateInfo* pCreateInfo) :
|
|||
(*m_VulkanFunctions.vkGetPhysicalDeviceProperties)(m_PhysicalDevice, &m_PhysicalDeviceProperties);
|
||||
(*m_VulkanFunctions.vkGetPhysicalDeviceMemoryProperties)(m_PhysicalDevice, &m_MemProps);
|
||||
|
||||
VMA_ASSERT(VmaIsPow2(VMA_DEBUG_ALIGNMENT));
|
||||
VMA_ASSERT(VmaIsPow2(VMA_MIN_ALIGNMENT));
|
||||
VMA_ASSERT(VmaIsPow2(VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY));
|
||||
VMA_ASSERT(VmaIsPow2(m_PhysicalDeviceProperties.limits.bufferImageGranularity));
|
||||
VMA_ASSERT(VmaIsPow2(m_PhysicalDeviceProperties.limits.nonCoherentAtomSize));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue