mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
synced 2024-11-24 04:50:13 +00:00
parent
51bac8e0ea
commit
c23192cfc1
@ -2938,6 +2938,10 @@ static void vma_aligned_free(void* VMA_NULLABLE ptr)
|
||||
#define VMA_DEBUG_LOG(str) VMA_DEBUG_LOG_FORMAT("%s", (str))
|
||||
#endif
|
||||
|
||||
#ifndef VMA_LEAK_LOG_FORMAT
|
||||
#define VMA_LEAK_LOG_FORMAT(format, ...) VMA_DEBUG_LOG_FORMAT(format, __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#ifndef VMA_CLASS_NO_COPY
|
||||
#define VMA_CLASS_NO_COPY(className) \
|
||||
private: \
|
||||
@ -6508,7 +6512,7 @@ void VmaBlockMetadata::DebugLogAllocation(VkDeviceSize offset, VkDeviceSize size
|
||||
{
|
||||
if (IsVirtual())
|
||||
{
|
||||
VMA_DEBUG_LOG_FORMAT("UNFREED VIRTUAL ALLOCATION; Offset: %" PRIu64 "; Size: %" PRIu64 "; UserData: %p", offset, size, userData);
|
||||
VMA_LEAK_LOG_FORMAT("UNFREED VIRTUAL ALLOCATION; Offset: %" PRIu64 "; Size: %" PRIu64 "; UserData: %p", offset, size, userData);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -6519,12 +6523,12 @@ void VmaBlockMetadata::DebugLogAllocation(VkDeviceSize offset, VkDeviceSize size
|
||||
const char* name = allocation->GetName();
|
||||
|
||||
#if VMA_STATS_STRING_ENABLED
|
||||
VMA_DEBUG_LOG_FORMAT("UNFREED ALLOCATION; Offset: %" PRIu64 "; Size: %" PRIu64 "; UserData: %p; Name: %s; Type: %s; Usage: %u",
|
||||
VMA_LEAK_LOG_FORMAT("UNFREED ALLOCATION; Offset: %" PRIu64 "; Size: %" PRIu64 "; UserData: %p; Name: %s; Type: %s; Usage: %u",
|
||||
offset, size, userData, name ? name : "vma_empty",
|
||||
VMA_SUBALLOCATION_TYPE_NAMES[allocation->GetSuballocationType()],
|
||||
allocation->GetBufferImageUsage());
|
||||
#else
|
||||
VMA_DEBUG_LOG_FORMAT("UNFREED ALLOCATION; Offset: %" PRIu64 "; Size: %" PRIu64 "; UserData: %p; Name: %s; Type: %u",
|
||||
VMA_LEAK_LOG_FORMAT("UNFREED ALLOCATION; Offset: %" PRIu64 "; Size: %" PRIu64 "; UserData: %p; Name: %s; Type: %u",
|
||||
offset, size, userData, name ? name : "vma_empty",
|
||||
(uint32_t)allocation->GetSuballocationType());
|
||||
#endif // VMA_STATS_STRING_ENABLED
|
||||
@ -11345,7 +11349,8 @@ VmaVirtualBlock_T::VmaVirtualBlock_T(const VmaVirtualBlockCreateInfo& createInfo
|
||||
|
||||
VmaVirtualBlock_T::~VmaVirtualBlock_T()
|
||||
{
|
||||
// Define macro VMA_DEBUG_LOG_FORMAT to receive the list of the unfreed allocations
|
||||
// Define macro VMA_DEBUG_LOG_FORMAT or more specialized VMA_LEAK_LOG_FORMAT
|
||||
// to receive the list of the unfreed allocations.
|
||||
if (!m_Metadata->IsEmpty())
|
||||
m_Metadata->DebugLogAllAllocations();
|
||||
// This is the most important assert in the entire library.
|
||||
@ -11840,7 +11845,8 @@ void VmaDeviceMemoryBlock::Init(
|
||||
|
||||
void VmaDeviceMemoryBlock::Destroy(VmaAllocator allocator)
|
||||
{
|
||||
// Define macro VMA_DEBUG_LOG_FORMAT to receive the list of the unfreed allocations
|
||||
// Define macro VMA_DEBUG_LOG_FORMAT or more specialized VMA_LEAK_LOG_FORMAT
|
||||
// to receive the list of the unfreed allocations.
|
||||
if (!m_pMetadata->IsEmpty())
|
||||
m_pMetadata->DebugLogAllAllocations();
|
||||
// This is the most important assert in the entire library.
|
||||
|
Loading…
Reference in New Issue
Block a user