FWindowedGPUTimer

Syntax

class FWindowedGPUTimer

Remarks

Simple moving window averaged GPU timer; create an instance, call Begin() and End() around the block to time, then call GetElapsedAverage to get the averaged timings; BufferSize determines the number of queries in the window, FramesBehind determines how long we wait to grab query results, so we don't have to block on them, so the effective window size is BufferSize - FramesBehind The timer keeps track of failed queries; GetElapsedAverage returns a float [0;1] that indicates fail rate: 0 means no queries have failed, 1 means all queries within the window have failed. If more than 0.1, it's a good indication that FramesBehind has to be increased.

Constructors

Name Description

Public function

FWindowedGPUTimer

(
    FRHICommandListImmediate & RHICmdLi...
)

Public function

FWindowedGPUTimer

(
    uint32 BufferSize,
    uint32 FramesBehind,
    FRHICommandListImmediate & RHICmdLi...
)

Functions

Name Description

Public function

void

 

Begin

(
    FRHICommandListImmediate & RHICmdLi...
)

Public function

void

 

End

(
    FRHICommandListImmediate & RHICmdLi...
)

Public function

float

 

GetElapsedAverage

(
    FRHICommandListImmediate & RHICmdLi...,
    float& OutAvgTimeInSeconds
)

Public function

void

 

RotateQueryBuffer

(
    TArray < FRenderQueryRHIRef >& Quer...
)

References

Module

RHI

Header

Runtime/RHI/Public/GPUProfiler.h