@@ -2523,7 +2523,7 @@ VMA_CALL_PRE void VMA_CALL_POST vmaGetPoolName(
25232523 VmaPool pool,
25242524 const char** ppName);
25252525
2526- /* \brief Sets name of a custom pool.
2526+ /** \brief Sets name of a custom pool.
25272527
25282528`pName` can be either null or pointer to a null-terminated string with new name for the pool.
25292529Function makes internal copy of the string, so it can be changed or freed immediately after this call.
@@ -6702,6 +6702,9 @@ class VmaRecorder
67026702 VmaDefragmentationContext ctx);
67036703 void RecordDefragmentationEnd(uint32_t frameIndex,
67046704 VmaDefragmentationContext ctx);
6705+ void RecordSetPoolName(uint32_t frameIndex,
6706+ VmaPool pool,
6707+ const char* name);
67056708
67066709private:
67076710 struct CallParams
@@ -13659,7 +13662,7 @@ VkResult VmaRecorder::Init(const VmaRecordSettings& settings, bool useMutex)
1365913662
1366013663 // Write header.
1366113664 fprintf(m_File, "%s\n", "Vulkan Memory Allocator,Calls recording");
13662- fprintf(m_File, "%s\n", "1,6 ");
13665+ fprintf(m_File, "%s\n", "1,7 ");
1366313666
1366413667 return VK_SUCCESS;
1366513668}
@@ -14092,6 +14095,19 @@ void VmaRecorder::RecordDefragmentationEnd(uint32_t frameIndex,
1409214095 Flush();
1409314096}
1409414097
14098+ void VmaRecorder::RecordSetPoolName(uint32_t frameIndex,
14099+ VmaPool pool,
14100+ const char* name)
14101+ {
14102+ CallParams callParams;
14103+ GetBasicParams(callParams);
14104+
14105+ VmaMutexLock lock(m_FileMutex, m_UseMutex);
14106+ fprintf(m_File, "%u,%.3f,%u,vmaSetPoolName,%p,%s\n", callParams.threadId, callParams.time, frameIndex,
14107+ pool, name != VMA_NULL ? name : "");
14108+ Flush();
14109+ }
14110+
1409514111VmaRecorder::UserDataString::UserDataString(VmaAllocationCreateFlags allocFlags, const void* pUserData)
1409614112{
1409714113 if(pUserData != VMA_NULL)
@@ -16303,6 +16319,13 @@ VMA_CALL_PRE void VMA_CALL_POST vmaSetPoolName(
1630316319 VMA_DEBUG_GLOBAL_MUTEX_LOCK
1630416320
1630516321 pool->SetName(pName);
16322+
16323+ #if VMA_RECORDING_ENABLED
16324+ if(allocator->GetRecorder() != VMA_NULL)
16325+ {
16326+ allocator->GetRecorder()->RecordSetPoolName(allocator->GetCurrentFrameIndex(), pool, pName);
16327+ }
16328+ #endif
1630616329}
1630716330
1630816331VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemory(
0 commit comments