Class ProfilerGPU
Provides GPU performance measuring methods.
Inheritance
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public static class ProfilerGPU : Object
Properties
Enabled
True if GPU profiling is enabled, otherwise false to disable events collecting and GPU timer queries usage. Can be changed during rendering.
Declaration
[DebugCommand]
[Unmanaged]
public static bool Enabled { get; set; }
Property Value
|
System.Boolean
|
EventsEnabled
True if GPU events are enabled (see GPUContext.EventBegin), otherwise false. Cannot be changed during rendering.
Declaration
[DebugCommand]
[Unmanaged]
public static bool EventsEnabled { get; set; }
Property Value
|
System.Boolean
|
Methods
Dump(Int32)
Profiles next frame(s) rendering performance and dumps the results to the log (as a hierarchy structure). When using more than 1 frame, the results are averaged for more accurate profiling (especially for A/B testing).
Declaration
[DebugCommand]
[Unmanaged]
public static void Dump(int frames = 4)
Parameters
|
System.Int32
frames
Amount of frames to profile for more stable results (event durations are averaged). Value 0 uses default of 4 frames. |
GetLastFrameData(Single, Single, RenderStatsData)
Tries to get the rendering stats from the last frame drawing (that has been resolved and has valid data).
Declaration
[Unmanaged]
public static bool GetLastFrameData(float drawTimeMs, float presentTimeMs, RenderStatsData statsData)
Parameters
|
System.Single
drawTimeMs
The draw execution time on a GPU (in milliseconds). |
|
System.Single
presentTimeMs
The final frame present time on a CPU (in milliseconds). Time game waited for vsync or GPU to finish previous frame rendering. |
|
RenderStatsData
statsData
The rendering stats data. |
Returns
|
System.Boolean
True if got the data, otherwise false. |