Optimize GPU Resource name to prevent memory allocs when changing name frequently

This commit is contained in:
Wojciech Figat
2023-01-06 08:56:03 +01:00
parent 34cc546f00
commit 1e046c0033
5 changed files with 29 additions and 12 deletions

View File

@@ -175,7 +175,7 @@ bool GPUBufferDX12::OnInit()
if (_desc.Flags & GPUBufferFlags::Counter || _desc.Flags & GPUBufferFlags::Append)
{
#if GPU_ENABLE_RESOURCE_NAMING
String name = GetName() + TEXT(".Counter");
String name = String(GetName()) + TEXT(".Counter");
_counter = ::New<GPUBufferDX12>(_device, name);
#else
_counter = ::New<GPUBufferDX12>(_device, String::Empty);