summaryrefslogtreecommitdiff
path: root/tests.d
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-08-15 15:48:22 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2015-08-15 16:10:52 +0100
commit25b61fe9aa0e9a9fa5bdc0af5f22c67ff8c240e5 (patch)
tree64fc07673871a2c2693db8923a45fed3f8c80111 /tests.d
parent4d1517ed5f19ff738936691313ae5b09a2d4141e (diff)
tests: Add GpuTest benchmarks
Diffstat (limited to 'tests.d')
-rw-r--r--tests.d/mesa/gputest.test41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests.d/mesa/gputest.test b/tests.d/mesa/gputest.test
new file mode 100644
index 0000000..73cceb7
--- /dev/null
+++ b/tests.d/mesa/gputest.test
@@ -0,0 +1,41 @@
+# WARNING: Requires libframetime: https://github.com/clbr/libframetime
+
+test -e "$GPUTEST_FOLDER/GpuTest" || return 1
+test -e "$LIBFRAMETIME64_SO" || return 1
+
+__gputest__() {
+ cd "$GPUTEST_FOLDER" # Set this variable in test_options.sh
+ local benchmark="/benchmark /no_scorebox"
+
+ for (( c=0; c<$1; c++ )); do
+ rm -f /tmp/frametime.log
+
+ echo ./GpuTest /test=$3 $benchmark $4 >> /tmp/gputest
+
+ LIBFRAMETIME_FILE=/tmp/frametime.log LD_PRELOAD=$LIBFRAMETIME64_SO \
+ ./GpuTest /test=$3 $benchmark $4 > /dev/null
+
+ # 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}}' > $2#$c
+ awk '{sum=sum+$1} END {print sum/NR}' $2#$c
+ done
+}
+
+fullscreen="/width=1920 /height=1080 /fullscreen"
+window="/width=1024 /height=768"
+
+GL2_1="fur pixmark_julia_fp32 pixmark_piano pixmark_volplosion plot3d triangle"
+GL3_3="gi"
+GL4_0="tess_x8 tess_x16 tess_x32 tess_x64 pixmark_julia_fp64"
+
+for t in $GL2_1 $GL3_3 $GL4_0; do
+ name="gputest:$t:fullscreen"
+ test_name="$test_name $name"
+ eval "${name}_run() { __gputest__ \$1 \$2 $t \"$fullscreen\"; }"
+
+ name="gputest:$t:window"
+ test_name="$test_name $name"
+ eval "${name}_run() { __gputest__ \$1 \$2 $t \"$window\"; }"
+done
+
+test_exec_time=60