Port mesa-demos perf tests

Erik Faye-Lund requested to merge kusma/piglit:port-perf-tests into main

There's some perf-tests in the mesa-demos repo that hasn't been ported over here yet. Let's move them over here instead, because this code is more actively tested and maintained.

One test was already ported, the drawoverhead one.

There's two tests that aren't ported, because they're not as trivial:

  1. glslstatechange: This test uses support-code from mesa-demos that isn't available here.
  2. swapbuffers: This test needs to be able to resize the window.

I don't think either of those are particularly useful, so I don't plan on porting them over.

Some implementation notes:

  • PerfMeasureRate(x)-calls has been replaced with perf_measure_cpu_rate(x, 1.0). These functions don't quite do the same, but this is as close as it gets, and the new behavior is probably better than the old.
  • I've avoided trying to cleverly format things in more human-readable ways (e.g PerfHumanFloat), and instead used "%f" and/or "%g", depending on the expected magnitude of the numbers. This better matches what we're doing in other tests here.
Edited by Erik Faye-Lund

Merge request reports