From 4bd9f0817a9b59b545908857f4feeea1ce5d3adf Mon Sep 17 00:00:00 2001 From: Kah Wei Date: Mon, 7 Nov 2022 12:55:18 +0800 Subject: [PATCH] Buffers are now tagged as buffers for debug labels --- SHADE_Engine/src/Graphics/Buffers/SHVkBuffer.cpp | 3 ++- SHADE_Engine/src/Graphics/Devices/SHVkLogicalDevice.cpp | 2 +- SHADE_Engine/src/Graphics/Devices/SHVkLogicalDevice.hpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/SHADE_Engine/src/Graphics/Buffers/SHVkBuffer.cpp b/SHADE_Engine/src/Graphics/Buffers/SHVkBuffer.cpp index 63f580b9..37dd2c74 100644 --- a/SHADE_Engine/src/Graphics/Buffers/SHVkBuffer.cpp +++ b/SHADE_Engine/src/Graphics/Buffers/SHVkBuffer.cpp @@ -410,7 +410,8 @@ namespace SHADE auto [tempBuffer, allocInfo] = createBuffer(sizeStored); vkBuffer = tempBuffer; - SET_VK_OBJ_NAME(*device, vk::ObjectType::eBuffer, vkBuffer, name); + if (!name.empty()) + SET_VK_OBJ_NAME(device, vk::ObjectType::eBuffer, vkBuffer, "[Buffer] " + name); // This probably means that a HOST_CACHED memory type is used on allocation if (allocFlags & VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT) diff --git a/SHADE_Engine/src/Graphics/Devices/SHVkLogicalDevice.cpp b/SHADE_Engine/src/Graphics/Devices/SHVkLogicalDevice.cpp index 35c104ee..20332f1d 100644 --- a/SHADE_Engine/src/Graphics/Devices/SHVkLogicalDevice.cpp +++ b/SHADE_Engine/src/Graphics/Devices/SHVkLogicalDevice.cpp @@ -220,7 +220,7 @@ namespace SHADE else { SHVulkanDebugUtil::ReportVkSuccess("Successfully created a Logical Device. "); - SET_VK_OBJ_NAME((*this), vk::ObjectType::eDevice, vkLogicalDevice, "Logical Device"); + SET_VK_OBJ_NAME(this, vk::ObjectType::eDevice, vkLogicalDevice, "Logical Device"); } InitializeVMA(); diff --git a/SHADE_Engine/src/Graphics/Devices/SHVkLogicalDevice.hpp b/SHADE_Engine/src/Graphics/Devices/SHVkLogicalDevice.hpp index dd7ff609..d72ab09e 100644 --- a/SHADE_Engine/src/Graphics/Devices/SHVkLogicalDevice.hpp +++ b/SHADE_Engine/src/Graphics/Devices/SHVkLogicalDevice.hpp @@ -40,7 +40,7 @@ namespace SHADE /*-------------------------------------------------------------------------------------*/ #ifdef _DEBUG #define SET_VK_OBJ_NAME(DEVICE, OBJ_TYPE, OBJ_HDL, OBJ_NAME) \ - (DEVICE).SetVulkanObjectName(OBJ_TYPE, OBJ_HDL, OBJ_NAME); + DEVICE->SetVulkanObjectName(OBJ_TYPE, OBJ_HDL, OBJ_NAME); #else #define SET_VK_OBJ_NAME(DEVICE, OBJ_TYPE, OBJ_HDL, OBJ_NAME) #endif