Add **GPU profiling support to Tracy integration**

This commit is contained in:
Wojtek Figat
2025-07-30 19:08:45 +02:00
parent 8fcbef863e
commit 5e4d564338
26 changed files with 2716 additions and 46 deletions

View File

@@ -69,6 +69,10 @@ void GPUContext::FrameEnd()
FlushState();
}
void GPUContext::OnPresent()
{
}
void GPUContext::BindSR(int32 slot, GPUTexture* t)
{
ASSERT_LOW_LAYER(t == nullptr || t->ResidentMipLevels() == 0 || t->IsShaderResource());

View File

@@ -148,6 +148,11 @@ public:
/// </summary>
virtual void FrameEnd();
/// <summary>
/// Called after performing final swapchain presentation and submitting all GPU commands.
/// </summary>
virtual void OnPresent();
public:
#if GPU_ALLOW_PROFILE_EVENTS
/// <summary>

View File

@@ -646,6 +646,7 @@ void GPUDevice::DrawEnd()
const double presentEnd = Platform::GetTimeSeconds();
ProfilerGPU::OnPresentTime((float)((presentEnd - presentStart) * 1000.0));
#endif
GetMainContext()->OnPresent();
_wasVSyncUsed = anyVSync;
_isRendering = false;

View File

@@ -20,6 +20,12 @@ public abstract class GraphicsDeviceBaseModule : EngineModule
// Enables GPU diagnostic tools (debug layer etc.)
options.PublicDefinitions.Add("GPU_ENABLE_DIAGNOSTICS");
}
if (Profiler.Use(options) && tracy.GPU && true)
{
// Enables GPU profiling with Tracy
options.PrivateDefinitions.Add("GPU_ENABLE_TRACY");
}
}
/// <inheritdoc />