coverage_options.sh 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #!/usr/bin/env bash
  2. # The rendering options of a coverage build: bloom, HDR and 3D scenes of the library run under post processing levels,
  3. # MSAA and SSAA, shadow and volumetric quality, canvas expansion, debug switches and odd output sizes, none of which a
  4. # plain regression render touches.
  5. # Usage: tools/analysis/coverage_options.sh <engine binary> [assets dir] [workshop content dir]
  6. set -uo pipefail
  7. HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
  8. BINARY=${1:?engine binary}
  9. ASSETS=${2:-/workspace/SteamLibrary/steamapps/common/wallpaper_engine/assets}
  10. CONTENT=${3:-/workspace/SteamLibrary/steamapps/workshop/content/431960}
  11. work=$(mktemp -d /tmp/lwe-coverage-options.XXXXXX)
  12. trap 'rm -rf "$work"' EXIT
  13. scenes=${OPTION_SCENES:-"2321732083 2719499501 2802243144 3299228616 3777414605 3354366708 3509578940"}
  14. # size|engine options
  15. sets=(
  16. "800x450|--post-processing ultra --msaa x4"
  17. "800x450|--post-processing displayhdr --ssaa x2"
  18. "800x450|--post-processing disabled --disable-particles"
  19. "800x450|--volumetrics ultra --shadows ultra --msaa x8 --ssaa x3"
  20. "800x450|--volumetrics disabled --shadows disabled"
  21. "800x450|--expand-canvas --zoom 1.5 --offset 0.1,0.1 --scaling fill --clamp repeat"
  22. "800x450|--scaling stretch --clamp clamp --corner-color #204060 --image-filter none"
  23. "800x450|--fps 20 --speed 0.5 --disable-parallax --disable-mouse --disable-animations --no-shader-cache"
  24. "800x450|--render-debug base-only --render-debug pass-log --render-debug brightness-log"
  25. "800x450|--render-debug no-solid-final --render-debug no-puppet-animation"
  26. "450x800|--scaling fit"
  27. "3200x800|--scaling fill --ssaa x2"
  28. "320x180|--msaa x2"
  29. )
  30. for id in $scenes; do
  31. [ -d "$CONTENT/$id" ] || continue
  32. for entry in "${sets[@]}"; do
  33. size=${entry%%|*}
  34. options=${entry#*|}
  35. # shellcheck disable=SC2086
  36. if HEADLESS_RENDER_DELAY=40 HEADLESS_RENDER_TIMEOUT=120 HEADLESS_RENDER_SIZE=$size \
  37. "$HERE/headless_render.sh" "$BINARY" "$work/shot.png" --assets-dir "$ASSETS" --silent $options \
  38. "$CONTENT/$id" > "$work/run.log" 2>&1; then
  39. echo "ok $id $options"
  40. else
  41. echo "FAIL $id $options: $(tail -1 "$work/run.log" | cut -c1-100)"
  42. fi
  43. rm -f "$work/shot.png"
  44. done
  45. done
  46. stats_scenes=${STATS_SCENES:-3509578940 3299228616 2321732083}
  47. for id in $stats_scenes; do
  48. [ -d "$CONTENT/$id" ] || continue
  49. if LWE_FRAME_STATS=1 LWE_FRAME_STALL_MS=0 LWE_AUDIO_STATS=1 LWE_WEB_STATS=1 HEADLESS_RENDER_DELAY=200 \
  50. HEADLESS_RENDER_TIMEOUT=120 HEADLESS_RENDER_SIZE=800x450 \
  51. "$HERE/headless_render.sh" "$BINARY" "$work/shot.png" --assets-dir "$ASSETS" --silent "$CONTENT/$id" \
  52. > "$work/stats.log" 2>&1; then
  53. echo "ok $id frame stats"
  54. else
  55. echo "FAIL $id frame stats: $(tail -1 "$work/stats.log" | cut -c1-100)"
  56. fi
  57. rm -f "$work/shot.png"
  58. done