Add IsDebugToolAttached to GPUDevice for detecting gpu debugger tools attached and auto-enable GPU profiler in that case

This commit is contained in:
Wojtek Figat
2024-06-03 09:24:27 +02:00
parent bd819b1f5f
commit 1cbcddf410
7 changed files with 90 additions and 27 deletions

View File

@@ -8,6 +8,7 @@
#include "Engine/Core/Config/GraphicsSettings.h"
#include "Engine/Engine/CommandLine.h"
#include "Engine/Engine/EngineService.h"
#include "Engine/Profiler/ProfilerGPU.h"
#include "Engine/Render2D/Font.h"
bool Graphics::UseVSync = false;
@@ -186,6 +187,13 @@ bool GraphicsService::Init()
);
// Initialize
if (device->IsDebugToolAttached)
{
#if COMPILE_WITH_PROFILER
// Auto-enable GPU profiler
ProfilerGPU::Enabled = true;
#endif
}
if (device->LoadContent())
{
return true;