From 294b4c400650e64c43ade1995ce4537ee5aefb8d Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Sat, 30 Mar 2024 22:20:41 +0100 Subject: [PATCH] Add CPU profiler events for UI drawing --- Source/Engine/UI/UICanvas.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/Engine/UI/UICanvas.cs b/Source/Engine/UI/UICanvas.cs index db78e428f..0ddac70e1 100644 --- a/Source/Engine/UI/UICanvas.cs +++ b/Source/Engine/UI/UICanvas.cs @@ -73,6 +73,7 @@ namespace FlaxEngine if (renderContext.View.Frustum.Contains(bounds.GetBoundingBox()) == ContainmentType.Disjoint) return; + Profiler.BeginEvent("UI Canvas"); Profiler.BeginEventGPU("UI Canvas"); // Calculate rendering matrix (world*view*projection) @@ -90,6 +91,7 @@ namespace FlaxEngine Render2D.CallDrawing(Canvas.GUI, context, input, depthBuffer, ref viewProjectionMatrix); Render2D.Features = features; + Profiler.EndEvent(); Profiler.EndEventGPU(); } }