Automatically name image/buffer allocations
This commit is contained in:
@@ -131,6 +131,12 @@ public:
|
||||
std::tie(resource, allocation) = traits::create(device, create_info, alloc_info);
|
||||
|
||||
vmaSetAllocationName(vk_allocator::instance(), allocation, name.c_str());
|
||||
if (vk_allocator::instance().has_debug_utils)
|
||||
device.setDebugUtilsObjectNameEXT(vk::DebugUtilsObjectNameInfoEXT{
|
||||
.objectType = T::objectType,
|
||||
.objectHandle = uint64_t(CType(*resource)),
|
||||
.pObjectName = name.c_str(),
|
||||
});
|
||||
}
|
||||
|
||||
basic_allocation(const basic_allocation &) = delete;
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
#include "vk_allocator.h"
|
||||
#include "vk/check.h"
|
||||
|
||||
vk_allocator::vk_allocator(const VmaAllocatorCreateInfo & info)
|
||||
vk_allocator::vk_allocator(const VmaAllocatorCreateInfo & info, bool has_debug_utils) :
|
||||
has_debug_utils(has_debug_utils)
|
||||
{
|
||||
CHECK_VK(vmaCreateAllocator(&info, &handle));
|
||||
}
|
||||
|
||||
@@ -27,7 +27,8 @@ class vk_allocator : public singleton<vk_allocator>
|
||||
VmaAllocator handle = nullptr;
|
||||
|
||||
public:
|
||||
vk_allocator(const VmaAllocatorCreateInfo &);
|
||||
const bool has_debug_utils;
|
||||
vk_allocator(const VmaAllocatorCreateInfo &, bool has_debug_utils);
|
||||
~vk_allocator();
|
||||
|
||||
operator VmaAllocator()
|
||||
|
||||
Reference in New Issue
Block a user