summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Peres <martin.peres@linux.intel.com>2016-01-21 20:15:46 +0200
committerMartin Peres <martin.peres@linux.intel.com>2016-01-22 16:02:58 +0200
commitf725064a34f24de774953404f47403d9da727082 (patch)
tree430670909949f6b334bdaf74cfbe6c24f7a90d0e
parente25c9e4b951bf62879aafcc712ef8469b934462d (diff)
test/gputest: use the logs to compute the framerate
-rw-r--r--tests.d/mesa/gputest.test17
1 files changed, 7 insertions, 10 deletions
diff --git a/tests.d/mesa/gputest.test b/tests.d/mesa/gputest.test
index a524a57..1409ee9 100644
--- a/tests.d/mesa/gputest.test
+++ b/tests.d/mesa/gputest.test
@@ -1,20 +1,17 @@
-# WARNING: Requires libframetime: https://github.com/clbr/libframetime
-
test -e "$GPUTEST_FOLDER/GpuTest" || return 1
-test -e "$LIBFRAMETIME64_SO" || return 1
# 2 arguments: $benchmark $benchmark_opts
__gputest__() {
cd "$GPUTEST_FOLDER" # Set this variable in test_options.sh
- local benchmark="/benchmark /no_scorebox"
-
- rm -f /tmp/frametime.log
+ duration_s=30
+ local benchmark="/benchmark /no_scorebox /msaa=0 /benchmark_duration_ms=${duration_s}000"
- LIBFRAMETIME_FILE=/tmp/frametime.log LD_PRELOAD=$LIBFRAMETIME64_SO \
+ rm _geeks3d_gputest_log.txt
+ MESA_GL_VERSION_OVERRIDE=4.0 MESA_GLSL_VERSION_OVERRIDE=400 \
run_bench 0 ./GpuTest /test=$1 $benchmark $2 > /dev/null || return 1
+ frames_rendered=$(cat _geeks3d_gputest_log.txt | grep "# frames rendered" | cut -d '#' -f 2 | cut -d ':' -f2)
- # read back the result, skip the first frames since they are the loading frames
- cat /tmp/frametime.log | awk '{if (++n > 10) {print 1000000/$2}}'
+ bc <<< "scale=3; ${frames_rendered}/${duration_s}"
}
fullscreen="/width=1920 /height=1080 /fullscreen"
@@ -35,4 +32,4 @@ for t in $GL2_1 $GL3_3 $GL4_0; do
eval "${name}_run() { __gputest__ $t \"$window\"; }"
done
-test_exec_time=60
+test_exec_time=37