]> git.xonotic.org Git - xonotic/xonotic.git/blobdiff - misc/tools/the-big-benchmark/the-big-benchmark.bat
Fix an endless loop in the-big-benchmark on Windows affecting all users.
[xonotic/xonotic.git] / misc / tools / the-big-benchmark / the-big-benchmark.bat
index 862dc0a26616f6b65402e307437384a68afd86c5..4fb4a10dd6653b29b62930caf062f234e1578950 100644 (file)
@@ -1,4 +1,4 @@
-@echo on\r
+@echo off\r
 \r
 cd %~dp0\r
 cd ..\..\..\r
@@ -16,78 +16,91 @@ goto postarg
 :noarg\r
 if "%ProgramFiles(x86)%" == "" goto bit32\r
 :bit64\r
-set xonotic=xonotic-64.exe\r
+set xonotic=xonotic-x64.exe\r
 goto postarg\r
 :bit32\r
 set xonotic=xonotic.exe\r
 goto postarg\r
 :postarg\r
 \r
-del data\the-big-benchmark.log\r
-del data\benchmark.log\r
-del data\engine.log\r
-set p=+developer 1 -nohome -benchmarkruns 4 -benchmarkruns_skipfirst -benchmark demos/the-big-keybench.dem\r
+if exist data\the-big-benchmark.log del data\the-big-benchmark.log\r
+if exist data\benchmark.log del data\benchmark.log\r
+if exist data\engine.log del data\engine.log\r
+set p=+vid_width 1024 +vid_height 768 +vid_desktopfullscreen 0 +cl_curl_enabled 0 +r_texture_dds_load 1 +cl_playerdetailreduction 0 +developer 1 -nohome -benchmarkruns 4 -benchmarkruns_skipfirst -benchmark demos/the-big-keybench.dem\r
 \r
-del data/benchmark.log\r
-echo + %xonotic% %2 %3 %4 %5 %6 %7 %8 %9 +exec effects-omg.cfg %p% >> data\engine.log\r
-%xonotic% %2 %3 %4 %5 %6 %7 %8 %9 +exec effects-omg.cfg %p% >> data\engine.log 2>&1\r
-find "]quit" data\engine.log >nul\r
-if not errorlevel 1 goto done\r
-type data\engine.log >> data\the-big-benchmark.log\r
-type data\benchmark.log >> data\the-big-benchmark.log\r
+goto start\r
 \r
-del data/benchmark.log\r
-echo + %xonotic% %2 %3 %4 %5 %6 %7 %8 %9 +exec effects-low.cfg %p% >> data\engine.log\r
-%xonotic% %2 %3 %4 %5 %6 %7 %8 %9 +exec effects-low.cfg %p% >> data\engine.log 2>&1\r
+:benchmark\r
+echo Benchmarking on %e%\r
+if exist data\benchmark.log del data\benchmark.log\r
+echo + %xonotic% %2 %3 %4 %5 %6 %7 %8 %9 +exec effects-%e%.cfg %p% > data\engine.log\r
+%xonotic% %2 %3 %4 %5 %6 %7 %8 %9 +exec effects-%e%.cfg %p% >> data\engine.log 2>&1\r
+find "MED: " data\engine.log\r
 find "]quit" data\engine.log >nul\r
 if not errorlevel 1 goto done\r
 type data\engine.log >> data\the-big-benchmark.log\r
 type data\benchmark.log >> data\the-big-benchmark.log\r
+if not "%e%" == "med" goto nomed\r
+find "checking for OpenGL 2.0 core features...  not detected" data\engine.log >nul\r
+if errorlevel 1 goto nomed\r
+echo OpenGL 2.0 or later required for Normal quality and higher, exiting.\r
+goto done\r
+:nomed\r
+if not "%e%" == "med" goto nomed2\r
+find "Using GL1.3 rendering path" data\engine.log >nul\r
+if errorlevel 1 goto nomed2\r
+echo OpenGL 2.0 rendering disabled, exiting.\r
+goto done\r
+:nomed2\r
+if not "%e%" == "high" goto nohigh\r
+find "vid_soft 1" data\engine.log >nul\r
+if errorlevel 1 goto nohigh\r
+echo Software rendering does not support Ultra and Ultimate quality settings, exiting.\r
+goto done\r
+:nohigh\r
+goto z%e%\r
 \r
-del data/benchmark.log\r
-echo + %xonotic% %2 %3 %4 %5 %6 %7 %8 %9 +exec effects-med.cfg %p% >> data\engine.log\r
-%xonotic% %2 %3 %4 %5 %6 %7 %8 %9 +exec effects-med.cfg %p% >> data\engine.log 2>&1\r
-find "]quit" data\engine.log >nul\r
-if not errorlevel 1 goto done\r
-type data\engine.log >> data\the-big-benchmark.log\r
-type data\benchmark.log >> data\the-big-benchmark.log\r
+:start\r
 \r
-del data/benchmark.log\r
-echo + %xonotic% %2 %3 %4 %5 %6 %7 %8 %9 +exec effects-normal.cfg %p% >> data\engine.log\r
-%xonotic% %2 %3 %4 %5 %6 %7 %8 %9 +exec effects-normal.cfg %p% >> data\engine.log 2>&1\r
-find "]quit" data\engine.log >nul\r
-if not errorlevel 1 goto done\r
-type data\engine.log >> data\the-big-benchmark.log\r
-type data\benchmark.log >> data\the-big-benchmark.log\r
+set e=omg\r
+goto benchmark\r
+:zomg\r
 \r
-del data/benchmark.log\r
-echo + %xonotic% %2 %3 %4 %5 %6 %7 %8 %9 +exec effects-high.cfg %p% >> data\engine.log\r
-%xonotic% %2 %3 %4 %5 %6 %7 %8 %9 +exec effects-high.cfg %p% >> data\engine.log 2>&1\r
-find "]quit" data\engine.log >nul\r
-if not errorlevel 1 goto done\r
-type data\engine.log >> data\the-big-benchmark.log\r
-type data\benchmark.log >> data\the-big-benchmark.log\r
+set e=low\r
+goto benchmark\r
+:zlow\r
 \r
-del data/benchmark.log\r
-echo + %xonotic% %2 %3 %4 %5 %6 %7 %8 %9 +exec effects-ultra.cfg %p% >> data\engine.log\r
-%xonotic% %2 %3 %4 %5 %6 %7 %8 %9 +exec effects-ultra.cfg %p% >> data\engine.log 2>&1\r
-find "]quit" data\engine.log >nul\r
-if not errorlevel 1 goto done\r
-type data\engine.log >> data\the-big-benchmark.log\r
-type data\benchmark.log >> data\the-big-benchmark.log\r
+set e=med\r
+goto benchmark\r
+:zmed\r
 \r
-del data/benchmark.log\r
-echo + %xonotic% %2 %3 %4 %5 %6 %7 %8 %9 +exec effects-ultimate.cfg %p% >> data\engine.log\r
-%xonotic% %2 %3 %4 %5 %6 %7 %8 %9 +exec effects-ultimate.cfg %p% >> data\engine.log 2>&1\r
-find "]quit" data\engine.log >nul\r
-if not errorlevel 1 goto done\r
-type data\engine.log >> data\the-big-benchmark.log\r
-type data\benchmark.log >> data\the-big-benchmark.log\r
+set e=normal\r
+goto benchmark\r
+:znormal\r
+\r
+set e=high\r
+goto benchmark\r
+:zhigh\r
+\r
+set e=ultra\r
+goto benchmark\r
+:zultra\r
+\r
+set e=ultimate\r
+goto benchmark\r
+:zultimate\r
 \r
 :done\r
 \r
-del data\benchmark.log\r
-del data\engine.log\r
+if exist data\benchmark.log del data\benchmark.log\r
+if exist data\engine.log del data\engine.log\r
+\r
+if exist data\the-big-benchmark.log goto logisgood\r
+echo.\r
+echo The benchmark has been aborted. No log file has been written.\r
+goto end\r
+\r
+:logisgood\r
 echo.\r
 echo Please provide the the following info to the Xonotic developers:\r
 echo  - CPU speed\r