From 746bd2273f2ace5a4079dbeb5298d3821bd4e107 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 12 May 2026 17:10:28 +0200 Subject: [PATCH] Fix memory alloc when renaming GPU resource on Vulkan --- Source/Engine/GraphicsDevice/Vulkan/RenderToolsVulkan.cpp | 4 ++-- Source/Engine/GraphicsDevice/Vulkan/RenderToolsVulkan.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Engine/GraphicsDevice/Vulkan/RenderToolsVulkan.cpp b/Source/Engine/GraphicsDevice/Vulkan/RenderToolsVulkan.cpp index 7a504c93f..c43cab271 100644 --- a/Source/Engine/GraphicsDevice/Vulkan/RenderToolsVulkan.cpp +++ b/Source/Engine/GraphicsDevice/Vulkan/RenderToolsVulkan.cpp @@ -153,10 +153,10 @@ VkCompareOp RenderToolsVulkan::ComparisonFuncToVkCompareOp[9] = #if GPU_ENABLE_RESOURCE_NAMING -void RenderToolsVulkan::SetObjectName(VkDevice device, uint64 objectHandle, VkObjectType objectType, const String& name) +void RenderToolsVulkan::SetObjectName(VkDevice device, uint64 objectHandle, VkObjectType objectType, const StringView& name) { #if VK_EXT_debug_utils - auto str = name.ToStringAnsi(); + StringAsANSI<> str(name.Get(), name.Length()); SetObjectName(device, objectHandle, objectType, str.Get()); #endif } diff --git a/Source/Engine/GraphicsDevice/Vulkan/RenderToolsVulkan.h b/Source/Engine/GraphicsDevice/Vulkan/RenderToolsVulkan.h index 82167fd6c..d359442f4 100644 --- a/Source/Engine/GraphicsDevice/Vulkan/RenderToolsVulkan.h +++ b/Source/Engine/GraphicsDevice/Vulkan/RenderToolsVulkan.h @@ -35,7 +35,7 @@ private: public: #if GPU_ENABLE_RESOURCE_NAMING - static void SetObjectName(VkDevice device, uint64 objectHandle, VkObjectType objectType, const String& name); + static void SetObjectName(VkDevice device, uint64 objectHandle, VkObjectType objectType, const StringView& name); static void SetObjectName(VkDevice device, uint64 objectHandle, VkObjectType objectType, const char* name); #endif