buildaworldnet / IrrlichtBAW

Build A World fork of Irrlicht
http://www.buildaworld.net
Apache License 2.0
122 stars 27 forks source link

Create a better FPS Counter (Frame Time Graph) #215

Open devshgraphicsprogramming opened 5 years ago

devshgraphicsprogramming commented 5 years ago

Provide this via an irr::ext::perf_counter, get the times via GPU time elapsed query ( actually have two modes to measure elapsed time queries between start_lap/stop_lap, one for CPU and one for GPU time taken) .

Keep the last N frametimes (in uint32_t microseconds) in a pre-allocated uint32_t* buffer (use %N addressing). Doesn't matter if measuring GPU or CPU timestamp.

Provide an irr::ext::perf_graph extension to visualize graphs on screen (with anti-aliased lines with blending), with a user specified sample delay (show data from K frames behind).

Preferrrably irr::ext::perf_counter would output into a persistenly mapped IGPUBuffer which would be used by irr::ext::perf_graph as an UBO for the pixel shader that would draw the graph.

We want to measure multiple things and have multiple graphs.

Also irr::ext:perf_counter should have an option to serialize to a std::string .csv style.

devshgraphicsprogramming commented 5 years ago

The heuristics of this thing https://github.com/buildaworldnet/IrrlichtBAW/blob/master/source/Irrlicht/CFPSCounter.cpp are abysmal

devshgraphicsprogramming commented 5 years ago

Also make it possible to collect other statistics within the time period, such as:

devshgraphicsprogramming commented 3 years ago

Should probably integrate Tracy or some other CPU and GPU profiler