pushing for vavaas to debug

This commit is contained in:
2024-10-27 20:55:21 +01:00
parent 028cb57ff4
commit dbf4d3cc5b
7 changed files with 36 additions and 20 deletions

View File

@@ -118,7 +118,16 @@ namespace mlx
return;
RenderCore::Get().GetAllocator().UnmapMemory(m_allocation);
#ifdef DEBUG
RenderCore::Get().GetAllocator().DestroyBuffer(m_allocation, m_buffer, m_debug_name.c_str());
std::string alloc_name{ m_debug_name };
if(m_usage & VK_BUFFER_USAGE_INDEX_BUFFER_BIT)
alloc_name.append("_index_buffer");
else if(m_usage & VK_BUFFER_USAGE_VERTEX_BUFFER_BIT)
alloc_name.append("_vertex_buffer");
else if(m_usage & VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT)
alloc_name.append("_uniform_buffer");
else
alloc_name.append("_buffer");
RenderCore::Get().GetAllocator().DestroyBuffer(m_allocation, m_buffer, alloc_name.c_str());
#else
RenderCore::Get().GetAllocator().DestroyBuffer(m_allocation, m_buffer, nullptr);
#endif