MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / SetName

Method SetName

Source/Engine/Graphics/GPUDevice.cpp:267–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265}
266
267void GPUResource::SetName(const StringView& name)
268{
269 if (_nameCapacity < name.Length() + 1)
270 {
271 if (_namePtr)
272 Platform::Free(_namePtr);
273 _nameCapacity = name.Length() + 1;
274 _namePtr = (Char*)Platform::Allocate(_nameCapacity * sizeof(Char), 16);
275 }
276 _nameSize = name.Length();
277 if (name.HasChars())
278 {
279 Platform::MemoryCopy(_namePtr, name.Get(), _nameSize * sizeof(Char));
280 _namePtr[_nameSize] = 0;
281 }
282 OnRenamed();
283}
284
285void GPUResource::OnRenamed()
286{

Callers 5

SetDebugObjectNameFunction · 0.45
FinalizeMethod · 0.45
InitMethod · 0.45
RequestAllocatorMethod · 0.45
GPUContextDX12Method · 0.45

Calls 4

FreeFunction · 0.50
LengthMethod · 0.45
HasCharsMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected