add debugname to settings table for texture and buffer,
which can be used for debugging in e.g. RenderDoc.
This commit is contained in:
niki
2023-12-13 14:28:34 +01:00
parent 8951635abc
commit a5d7ba1589
14 changed files with 76 additions and 0 deletions
+14
View File
@@ -34,6 +34,7 @@ namespace vulkan
Texture::Texture(love::graphics::Graphics *gfx, const Settings &settings, const Slices *data)
: love::graphics::Texture(gfx, settings, data)
, vgfx(dynamic_cast<Graphics*>(gfx))
, debugName(settings.debugName)
, slices(settings.type)
, imageAspect(0)
{
@@ -201,6 +202,19 @@ bool Texture::loadVolatile()
setGraphicsMemorySize(memsize);
if (!debugName.empty())
{
if (vgfx->getEnabledOptionalInstanceExtensions().debugInfo)
{
VkDebugUtilsObjectNameInfoEXT nameInfo{};
nameInfo.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT;
nameInfo.objectType = VK_OBJECT_TYPE_IMAGE;
nameInfo.objectHandle = (uint64_t)textureImage;
nameInfo.pObjectName = debugName.c_str();
vkSetDebugUtilsObjectNameEXT(device, &nameInfo);
}
}
return true;
}