Optimize editor profiler native allocations when capturing data

This commit is contained in:
Wojtek Figat
2025-06-09 15:23:31 +02:00
parent 057ec9d41e
commit d7ff9fdade
7 changed files with 83 additions and 3 deletions

View File

@@ -648,6 +648,23 @@ GPUTasksExecutor* GPUDevice::CreateTasksExecutor()
return New<DefaultGPUTasksExecutor>();
}
#if !COMPILE_WITHOUT_CSHARP
#include "Engine/Scripting/ManagedCLR/MUtils.h"
void* GPUDevice::GetResourcesInternal()
{
_resourcesLock.Lock();
MArray* result = MCore::Array::New(GPUResource::TypeInitializer.GetClass(), _resources.Count());
int32 i = 0;
for (const auto& e : _resources)
MCore::GC::WriteArrayRef(result, e->GetOrCreateManagedInstance(), i++);
_resourcesLock.Unlock();
return result;
}
#endif
void GPUDevice::Draw()
{
PROFILE_MEM(Graphics);