diff --git a/docs/Recording file format.md b/docs/Recording file format.md index 6ca218c..a48c58a 100644 --- a/docs/Recording file format.md +++ b/docs/Recording file format.md @@ -63,7 +63,7 @@ Between them there can be zero or more lines with configuration options. They st Extension,VK_AMD_device_coherent_memory, Macro,VMA_DEBUG_ALWAYS_DEDICATED_MEMORY, - Macro,VMA_DEBUG_ALIGNMENT, + Macro,VMA_MIN_ALIGNMENT, Macro,VMA_DEBUG_MARGIN, Macro,VMA_DEBUG_INITIALIZE_ALLOCATIONS, Macro,VMA_DEBUG_DETECT_CORRUPTION, @@ -313,7 +313,7 @@ An ordered sequence of values of some type, separated by single space. Extension,VK_KHR_bind_memory2,1 Extension,VK_EXT_memory_budget,1 Macro,VMA_DEBUG_ALWAYS_DEDICATED_MEMORY,0 - Macro,VMA_DEBUG_ALIGNMENT,1 + Macro,VMA_MIN_ALIGNMENT,1 Macro,VMA_DEBUG_MARGIN,0 Macro,VMA_DEBUG_INITIALIZE_ALLOCATIONS,0 Macro,VMA_DEBUG_DETECT_CORRUPTION,0 diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h index d1c4e34..852f86a 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -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)); diff --git a/src/VmaReplay/VmaReplay.cpp b/src/VmaReplay/VmaReplay.cpp index 6d01e92..d6b23c0 100644 --- a/src/VmaReplay/VmaReplay.cpp +++ b/src/VmaReplay/VmaReplay.cpp @@ -1089,7 +1089,7 @@ private: Extension_VK_EXT_memory_budget, Extension_VK_AMD_device_coherent_memory, Macro_VMA_DEBUG_ALWAYS_DEDICATED_MEMORY, - Macro_VMA_DEBUG_ALIGNMENT, + Macro_VMA_MIN_ALIGNMENT, Macro_VMA_DEBUG_MARGIN, Macro_VMA_DEBUG_INITIALIZE_ALLOCATIONS, Macro_VMA_DEBUG_DETECT_CORRUPTION, @@ -1237,8 +1237,8 @@ bool ConfigurationParser::Parse(LineSplit& lineSplit) const StrRange subOptionName = csvSplit.GetRange(1); if(StrRangeEq(subOptionName, "VMA_DEBUG_ALWAYS_DEDICATED_MEMORY")) SetOption(currLineNumber, OPTION::Macro_VMA_DEBUG_ALWAYS_DEDICATED_MEMORY, csvSplit.GetRange(2)); - else if(StrRangeEq(subOptionName, "VMA_DEBUG_ALIGNMENT")) - SetOption(currLineNumber, OPTION::Macro_VMA_DEBUG_ALIGNMENT, csvSplit.GetRange(2)); + else if(StrRangeEq(subOptionName, "VMA_MIN_ALIGNMENT") || StrRangeEq(subOptionName, "VMA_DEBUG_ALIGNMENT")) + SetOption(currLineNumber, OPTION::Macro_VMA_MIN_ALIGNMENT, csvSplit.GetRange(2)); else if(StrRangeEq(subOptionName, "VMA_DEBUG_MARGIN")) SetOption(currLineNumber, OPTION::Macro_VMA_DEBUG_MARGIN, csvSplit.GetRange(2)); else if(StrRangeEq(subOptionName, "VMA_DEBUG_INITIALIZE_ALLOCATIONS"))