Hey,
in UE Version 4.18 and earlier, I was able to profile GPU time in C++ code as follows:
First I declared a GPU stat at the beginning of my *.cpp:
DECLARE_FLOAT_COUNTER_STAT(TEXT("MyFunctionToProfile"), Stat_GPU_MyFunctionToProfile, STATGROUP_GPU);
Then I called this stat macro in the scope I wanted to profile:
FRHICommandListImmediate& RHICmdList = GRHICommandList.GetImmediateCommandList();
SCOPED_GPU_STAT(RHICmdList, Stat_GPU_MyFunctionToProfile);
Since version 4.19, the makro SCOPED_GPU_STAT seems to be missing (“identifier “SCOPED_GPU_STAT” is undefined”) and I get the following compiler error:
What can I use to profile GPU times again?
Best regards!
EDIT:
SCOPED_DRAW_EVENT works, but this stat doesn’t show up in “stat gpu” or in the session frontend when profiling with “stat startfile / stat stopfile”. It only shows in the GPU visualizer (CTRL+SHIFT+,), but since this only shows a single frame it’s not a viable replacement for the old SCOPED_GPU_STAT.