diff options
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/build_llvm_mc.ps1 | 8 | ||||
| -rw-r--r-- | scripts/merge_check.py | 37 | ||||
| -rwxr-xr-x | scripts/play-linux.sh | 3 | ||||
| -rwxr-xr-x | scripts/run_game_wine.sh | 24 | ||||
| -rw-r--r-- | scripts/run_gpu_tests.py | 40 |
5 files changed, 98 insertions, 14 deletions
diff --git a/scripts/build_llvm_mc.ps1 b/scripts/build_llvm_mc.ps1 index 387a77d83..97015a9db 100644 --- a/scripts/build_llvm_mc.ps1 +++ b/scripts/build_llvm_mc.ps1 | |||
| @@ -7,11 +7,17 @@ | |||
| 7 | # powershell -ExecutionPolicy Bypass -File scripts\build_llvm_mc.ps1 | 7 | # powershell -ExecutionPolicy Bypass -File scripts\build_llvm_mc.ps1 |
| 8 | # powershell -ExecutionPolicy Bypass -File scripts\build_llvm_mc.ps1 -Dest D:\tools\llvm-mc -NoEnv | 8 | # powershell -ExecutionPolicy Bypass -File scripts\build_llvm_mc.ps1 -Dest D:\tools\llvm-mc -NoEnv |
| 9 | # | 9 | # |
| 10 | # -Version defaults to 23.1.5, the release the shader corpus was measured with. LLVM 21.1.8's gfx1013 decoder | ||
| 11 | # cannot decode 840 of the 2,684 pipeline-library compute programs: their listings carry 79,490 undecodable words and | ||
| 12 | # the translator refuses them ("fall-through into undecodable words"), which leaves the shaders stage at 1,844 of | ||
| 13 | # 2,684. llvm-mc 23.1.5 disassembles those 840 with no rejected word, and the stage then translates 2,683 of 2,684 | ||
| 14 | # (the last wants s_sethalt, which the translator does not implement). docs/design.md, "Disassembling shaders". | ||
| 15 | # | ||
| 10 | # The default -Dest is outside AppData on purpose: `python` from the Python install manager (the app execution alias | 16 | # The default -Dest is outside AppData on purpose: `python` from the Python install manager (the app execution alias |
| 11 | # in WindowsApps) doesn't see folders that other programs create under %LOCALAPPDATA% or %APPDATA%, so an llvm-mc.exe | 17 | # in WindowsApps) doesn't see folders that other programs create under %LOCALAPPDATA% or %APPDATA%, so an llvm-mc.exe |
| 12 | # there looks missing to make_game.py and the tools, although LLVM_MC names it. | 18 | # there looks missing to make_game.py and the tools, although LLVM_MC names it. |
| 13 | param( | 19 | param( |
| 14 | [string]$Version = "21.1.8", | 20 | [string]$Version = "23.1.5", |
| 15 | [string]$Dest = (Join-Path $env:USERPROFILE ".leonida\llvm-mc"), | 21 | [string]$Dest = (Join-Path $env:USERPROFILE ".leonida\llvm-mc"), |
| 16 | [string]$Temp = (Join-Path $env:TEMP "leonida-llvm-mc"), | 22 | [string]$Temp = (Join-Path $env:TEMP "leonida-llvm-mc"), |
| 17 | [switch]$NoEnv, # don't set LLVM_MC for the current user | 23 | [switch]$NoEnv, # don't set LLVM_MC for the current user |
diff --git a/scripts/merge_check.py b/scripts/merge_check.py index 5499da29c..be2b69176 100644 --- a/scripts/merge_check.py +++ b/scripts/merge_check.py | |||
| @@ -35,15 +35,18 @@ REVERT_SUBJECT = re.compile(r"^Revert\b", re.IGNORECASE) | |||
| 35 | # Where a doubled block is the repeated-merge damage. In code, three equal lines in two functions are ordinary, so a | 35 | # Where a doubled block is the repeated-merge damage. In code, three equal lines in two functions are ordinary, so a |
| 36 | # block there is listed but does not change the verdict. | 36 | # block there is listed but does not change the verdict. |
| 37 | TEXT_SUFFIXES = (".md", ".txt", ".rst") | 37 | TEXT_SUFFIXES = (".md", ".txt", ".rst") |
| 38 | GIT_TIMEOUT = 120 | ||
| 38 | 39 | ||
| 39 | 40 | ||
| 40 | class GitError(Exception): | 41 | class GitError(Exception): |
| 41 | pass | 42 | pass |
| 42 | 43 | ||
| 43 | 44 | ||
| 44 | def git(repo, *args, check=True, stdout_errors="replace"): | 45 | def git(repo, *args, check=True, stdout_errors="replace", timeout=GIT_TIMEOUT): |
| 45 | try: | 46 | try: |
| 46 | r = subprocess.run(["git", "-C", repo, *args], capture_output=True) | 47 | r = subprocess.run(["git", "-C", repo, *args], capture_output=True, timeout=timeout) |
| 48 | except subprocess.TimeoutExpired: | ||
| 49 | raise GitError(f"git {' '.join(args)}: timed out after {timeout}s") from None | ||
| 47 | except OSError as e: # git is not on PATH, or cannot be executed: a usage error (exit 2), not a traceback | 50 | except OSError as e: # git is not on PATH, or cannot be executed: a usage error (exit 2), not a traceback |
| 48 | raise GitError(f"cannot run git: {e.strerror or e}") from None | 51 | raise GitError(f"cannot run git: {e.strerror or e}") from None |
| 49 | # Decode without universal-newline translation: a bare CR inside a Git line is content. | 52 | # Decode without universal-newline translation: a bare CR inside a Git line is content. |
| @@ -179,20 +182,40 @@ def check(repo, main, number, ref, min_length, merges): | |||
| 179 | "duplicate_samples": {p: v[:3] for p, v in dups.items()}} | 182 | "duplicate_samples": {p: v[:3] for p, v in dups.items()}} |
| 180 | 183 | ||
| 181 | 184 | ||
| 185 | def _positive_int(text): | ||
| 186 | try: | ||
| 187 | value = int(text) | ||
| 188 | except ValueError: | ||
| 189 | raise argparse.ArgumentTypeError(f"expected a positive integer, got {text!r}") from None | ||
| 190 | if value < 1: | ||
| 191 | raise argparse.ArgumentTypeError(f"must be at least 1, got {text!r}") | ||
| 192 | return value | ||
| 193 | |||
| 194 | |||
| 195 | def _validate_ref(ref, label): | ||
| 196 | if not ref or ref != ref.strip() or ref.startswith("-"): | ||
| 197 | raise argparse.ArgumentTypeError(f"invalid {label} ref: {ref!r}") | ||
| 198 | return ref | ||
| 199 | |||
| 200 | |||
| 182 | def parse_pair(text): | 201 | def parse_pair(text): |
| 183 | number, sep, ref = text.partition("=") | 202 | number, sep, ref = text.partition("=") |
| 184 | if not sep or not number.lstrip("#").isdigit() or not ref: | 203 | raw_num = number[1:] if number.startswith("#") else number |
| 204 | if not sep or not raw_num.isascii() or not raw_num.isdigit() or int(raw_num) < 1: | ||
| 185 | raise argparse.ArgumentTypeError(f"expected PR=REF, got {text!r}") | 205 | raise argparse.ArgumentTypeError(f"expected PR=REF, got {text!r}") |
| 186 | return int(number.lstrip("#")), ref | 206 | return int(raw_num), _validate_ref(ref, "PR target") |
| 187 | 207 | ||
| 188 | 208 | ||
| 189 | def main(argv=None): | 209 | def main(argv=None): |
| 190 | ap = argparse.ArgumentParser(description=__doc__.strip().splitlines()[0]) | 210 | ap = argparse.ArgumentParser(description=__doc__.strip().splitlines()[0]) |
| 191 | ap.add_argument("pairs", nargs="+", type=parse_pair, metavar="PR=REF") | 211 | ap.add_argument("pairs", nargs="+", type=parse_pair, metavar="PR=REF") |
| 192 | ap.add_argument("--main", default="origin/main", help="the branch the round merges into (default origin/main)") | 212 | ap.add_argument("--main", default="origin/main", type=lambda s: _validate_ref(s, "--main"), |
| 213 | help="the branch the round merges into (default origin/main)") | ||
| 193 | ap.add_argument("--repo", default=".", help="repository folder (default: the current one)") | 214 | ap.add_argument("--repo", default=".", help="repository folder (default: the current one)") |
| 194 | ap.add_argument("--min-length", type=int, default=40, help="shortest stripped line counted as a duplicate (40)") | 215 | ap.add_argument("--min-length", type=_positive_int, default=40, |
| 195 | ap.add_argument("--depth", type=int, default=5000, help="first-parent commits searched for earlier merges (5000)") | 216 | help="shortest stripped line counted as a duplicate (40)") |
| 217 | ap.add_argument("--depth", type=_positive_int, default=5000, | ||
| 218 | help="first-parent commits searched for earlier merges (5000)") | ||
| 196 | ap.add_argument("--json", action="store_true", help="one JSON report instead of text") | 219 | ap.add_argument("--json", action="store_true", help="one JSON report instead of text") |
| 197 | args = ap.parse_args(argv) | 220 | args = ap.parse_args(argv) |
| 198 | try: | 221 | try: |
diff --git a/scripts/play-linux.sh b/scripts/play-linux.sh index e7d48d78e..35a44256f 100755 --- a/scripts/play-linux.sh +++ b/scripts/play-linux.sh | |||
| @@ -66,6 +66,9 @@ set_default LEONIDA_COMPOSE 1 | |||
| 66 | set_default LEONIDA_NAN_SCRUB 1 | 66 | set_default LEONIDA_NAN_SCRUB 1 |
| 67 | set_default LEONIDA_AMBIENT_AIR 1.5 | 67 | set_default LEONIDA_AMBIENT_AIR 1.5 |
| 68 | set_default LEONIDA_AMBIENT_MOST 2 | 68 | set_default LEONIDA_AMBIENT_MOST 2 |
| 69 | # Match the Windows launcher defaults; explicit 0 keeps either path off for comparisons. | ||
| 70 | set_default LEONIDA_COPY_SCOPED 1 | ||
| 71 | set_default LEONIDA_PORT_DESCRIPTORS 1 | ||
| 69 | 72 | ||
| 70 | echo "Leonida: $console under Wine with the bundled VKD3D-Proton ($(head -n 1 "$vkd3d/SOURCE.txt" 2>/dev/null || echo bundled))" | 73 | echo "Leonida: $console under Wine with the bundled VKD3D-Proton ($(head -n 1 "$vkd3d/SOURCE.txt" 2>/dev/null || echo bundled))" |
| 71 | exec wine "$runtime" run "$game_exe" --execute --console "$console" | 74 | exec wine "$runtime" run "$game_exe" --execute --console "$console" |
diff --git a/scripts/run_game_wine.sh b/scripts/run_game_wine.sh index cc60d6767..96daae6d0 100755 --- a/scripts/run_game_wine.sh +++ b/scripts/run_game_wine.sh | |||
| @@ -34,6 +34,10 @@ Options: | |||
| 34 | --device VID:DID the Vulkan device, as MESA_VK_DEVICE_SELECT=VID:DID! (e.g. 1002:744c); without it Mesa picks | 34 | --device VID:DID the Vulkan device, as MESA_VK_DEVICE_SELECT=VID:DID! (e.g. 1002:744c); without it Mesa picks |
| 35 | --screenshot-every S capture the game window into <out>/shots every S seconds (needs ImageMagick's import and | 35 | --screenshot-every S capture the game window into <out>/shots every S seconds (needs ImageMagick's import and |
| 36 | xprop); the shots are game content and stay local | 36 | xprop); the shots are game content and stay local |
| 37 | --cache DIR|fresh XDG_CACHE_HOME of the run, where the drivers keep their shader caches (NVIDIA's GLCache, | ||
| 38 | Mesa's shader cache): DIR is kept from run to run, fresh is a new one in the run folder | ||
| 39 | (default: the caller's XDG_CACHE_HOME when it is set, otherwise fresh); fresh also | ||
| 40 | unsets MESA_SHADER_CACHE_DIR, MESA_GLSL_CACHE_DIR and __GL_SHADER_DISK_CACHE_PATH | ||
| 37 | --lock FILE the lock that allows one run at a time (default $XDG_RUNTIME_DIR/leonida-run-game-wine.lock, | 41 | --lock FILE the lock that allows one run at a time (default $XDG_RUNTIME_DIR/leonida-run-game-wine.lock, |
| 38 | or <out>/run.lock without XDG_RUNTIME_DIR) | 42 | or <out>/run.lock without XDG_RUNTIME_DIR) |
| 39 | -h, --help this text | 43 | -h, --help this text |
| @@ -108,7 +112,7 @@ if [ "${1:-}" = --inner ]; then | |||
| 108 | fi | 112 | fi |
| 109 | 113 | ||
| 110 | # ---- arguments ---- | 114 | # ---- arguments ---- |
| 111 | SRC= BUILD_DIR= OUT= PREFIX=${WINEPREFIX:-} LIMIT=600 VISIBLE=0 DEVICE= SHOT_EVERY=0 LOCK= | 115 | SRC= BUILD_DIR= OUT= PREFIX=${WINEPREFIX:-} LIMIT=600 VISIBLE=0 DEVICE= SHOT_EVERY=0 LOCK= CACHE=${XDG_CACHE_HOME:-fresh} |
| 112 | EXE=${LEONIDA_GAME_EXE:-} GAME=${LEONIDA_GAME_DIR:-} SHADERS=${LEONIDA_SHADERS:-} | 116 | EXE=${LEONIDA_GAME_EXE:-} GAME=${LEONIDA_GAME_DIR:-} SHADERS=${LEONIDA_SHADERS:-} |
| 113 | need() { [ $# -ge 2 ] && [ -n "$2" ] || die "$1 needs a value (see --help)"; } | 117 | need() { [ $# -ge 2 ] && [ -n "$2" ] || die "$1 needs a value (see --help)"; } |
| 114 | while [ $# -gt 0 ]; do | 118 | while [ $# -gt 0 ]; do |
| @@ -126,6 +130,7 @@ while [ $# -gt 0 ]; do | |||
| 126 | --device) need "$@"; DEVICE=$2; shift 2 ;; | 130 | --device) need "$@"; DEVICE=$2; shift 2 ;; |
| 127 | --screenshot-every) need "$@"; SHOT_EVERY=$2; shift 2 ;; | 131 | --screenshot-every) need "$@"; SHOT_EVERY=$2; shift 2 ;; |
| 128 | --lock) need "$@"; LOCK=$2; shift 2 ;; | 132 | --lock) need "$@"; LOCK=$2; shift 2 ;; |
| 133 | --cache) need "$@"; CACHE=$2; shift 2 ;; | ||
| 129 | --) shift; break ;; | 134 | --) shift; break ;; |
| 130 | *) die "unknown argument: $1 (see --help)" ;; | 135 | *) die "unknown argument: $1 (see --help)" ;; |
| 131 | esac | 136 | esac |
| @@ -144,6 +149,10 @@ fi | |||
| 144 | [ -e "$SRC" ] || die "no build path at $SRC" | 149 | [ -e "$SRC" ] || die "no build path at $SRC" |
| 145 | [ -f "$EXE" ] || die "no game executable at $EXE" | 150 | [ -f "$EXE" ] || die "no game executable at $EXE" |
| 146 | [ -d "$GAME" ] || die "no package folder at $GAME" | 151 | [ -d "$GAME" ] || die "no package folder at $GAME" |
| 152 | if [ "$CACHE" != fresh ]; then | ||
| 153 | mkdir -p "$CACHE" || die "cannot create the cache folder $CACHE" | ||
| 154 | CACHE=$(readlink -f "$CACHE") | ||
| 155 | fi | ||
| 147 | if [ "$SHADERS" != none ]; then | 156 | if [ "$SHADERS" != none ]; then |
| 148 | SHADERS=${SHADERS#Z:} | 157 | SHADERS=${SHADERS#Z:} |
| 149 | [ -d "$SHADERS" ] || die "no shader library at $SHADERS" | 158 | [ -d "$SHADERS" ] || die "no shader library at $SHADERS" |
| @@ -212,9 +221,20 @@ unset LEONIDA_GAME_EXE LEONIDA_GAME_DIR # launcher inputs; LEONIDA_GAME_DIR als | |||
| 212 | export WINE | 221 | export WINE |
| 213 | export XDG_RUNTIME_DIR=$RUN/xdg | 222 | export XDG_RUNTIME_DIR=$RUN/xdg |
| 214 | rm -rf "$XDG_RUNTIME_DIR"; mkdir -p -m 700 "$XDG_RUNTIME_DIR" | 223 | rm -rf "$XDG_RUNTIME_DIR"; mkdir -p -m 700 "$XDG_RUNTIME_DIR" |
| 215 | export XDG_CONFIG_HOME=$RUN/session/config XDG_DATA_HOME=$RUN/session/data XDG_CACHE_HOME=$RUN/session/cache \ | 224 | # The cache folder alone may outlive the run: a fresh one makes every launch compile its pipelines again in the driver. |
| 225 | # A driver's own cache variable wins over XDG_CACHE_HOME, so a fresh run drops them, and an accepted run folder's old | ||
| 226 | # session/cache goes too: fresh means empty. With a kept cache the caller's variables stay, and win. | ||
| 227 | if [ "$CACHE" = fresh ]; then | ||
| 228 | XDG_CACHE_HOME=$RUN/session/cache | ||
| 229 | rm -rf "$XDG_CACHE_HOME" | ||
| 230 | unset MESA_SHADER_CACHE_DIR MESA_GLSL_CACHE_DIR __GL_SHADER_DISK_CACHE_PATH | ||
| 231 | else | ||
| 232 | XDG_CACHE_HOME=$CACHE | ||
| 233 | fi | ||
| 234 | export XDG_CONFIG_HOME=$RUN/session/config XDG_DATA_HOME=$RUN/session/data XDG_CACHE_HOME \ | ||
| 216 | XDG_STATE_HOME=$RUN/session/state | 235 | XDG_STATE_HOME=$RUN/session/state |
| 217 | mkdir -p "$XDG_CONFIG_HOME" "$XDG_DATA_HOME" "$XDG_CACHE_HOME" "$XDG_STATE_HOME" | 236 | mkdir -p "$XDG_CONFIG_HOME" "$XDG_DATA_HOME" "$XDG_CACHE_HOME" "$XDG_STATE_HOME" |
| 237 | if [ "$CACHE" = fresh ]; then echo "shader cache: fresh"; else echo "shader cache: kept in $CACHE"; fi > "$RUN/session.txt" | ||
| 218 | unset WAYLAND_DISPLAY WAYLAND_SOCKET DBUS_SESSION_BUS_ADDRESS | 238 | unset WAYLAND_DISPLAY WAYLAND_SOCKET DBUS_SESSION_BUS_ADDRESS |
| 219 | if [ "$VISIBLE" = 1 ]; then | 239 | if [ "$VISIBLE" = 1 ]; then |
| 220 | if command -v xdpyinfo >/dev/null 2>&1 && ! xdpyinfo >/dev/null 2>&1; then | 240 | if command -v xdpyinfo >/dev/null 2>&1 && ! xdpyinfo >/dev/null 2>&1; then |
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py index 7f299b0be..c9f8bfd65 100644 --- a/scripts/run_gpu_tests.py +++ b/scripts/run_gpu_tests.py | |||
| @@ -28,7 +28,7 @@ from build import CLIP_CASES, clip_container, shader_source | |||
| 28 | from check import (Skip, clip_test, fmt_1010102_test, fmt_d16_xyz_test, fmt_int_narrow_test, | 28 | from check import (Skip, clip_test, fmt_1010102_test, fmt_d16_xyz_test, fmt_int_narrow_test, |
| 29 | fmt_sint32_test, fmt_xy_xyz_test, tbuffer_store_test, compute_unsupported) | 29 | fmt_sint32_test, fmt_xy_xyz_test, tbuffer_store_test, compute_unsupported) |
| 30 | from compute_fixture import compute_header | 30 | from compute_fixture import compute_header |
| 31 | from check import SAMPLER_CASES, sampler_test # ps_ssharp: the S#/T# mip fields (vk_sampler_test) | 31 | from check import SAMPLER_CASES, SAMPLER_FIXTURES, sampler_test # ps_ssharp*: the S#/T# mip fields (vk_sampler_test) |
| 32 | from check import (CS_SMEM_VCC, CMPX_CLASS_WORDS, CVT_F32_SAT_CASES, CVT_PK_U8_WORDS, PK_MUL_LO_WORDS, PK_MUL_LO_ENV, GRADIENT_TESTS, TEST_PROGRAMS, TEXTURE_MIP_DEPENDENCIES, | 32 | from check import (CS_SMEM_VCC, CMPX_CLASS_WORDS, CVT_F32_SAT_CASES, CVT_PK_U8_WORDS, PK_MUL_LO_WORDS, PK_MUL_LO_ENV, GRADIENT_TESTS, TEST_PROGRAMS, TEXTURE_MIP_DEPENDENCIES, |
| 33 | TEXTURE_MIP_TEST, GATHER_LOD_TEST, MIP_TEST_PASSES, TEXTURE_CONSTANTS, USER_SGPRS_ENV, USER_SGPRS_WORDS, Skip, mesh_v5_test, not_found_message, | 33 | TEXTURE_MIP_TEST, GATHER_LOD_TEST, MIP_TEST_PASSES, TEXTURE_CONSTANTS, USER_SGPRS_ENV, USER_SGPRS_WORDS, Skip, mesh_v5_test, not_found_message, |
| 34 | pick_build_dir, start_failure, table_fetch_test, texture_gradient_a16_test, texture_mip_test) | 34 | pick_build_dir, start_failure, table_fetch_test, texture_gradient_a16_test, texture_mip_test) |
| @@ -378,6 +378,7 @@ def no_ftz32() -> bool: | |||
| 378 | 378 | ||
| 379 | _PER_VERTEX = [] | 379 | _PER_VERTEX = [] |
| 380 | _BARYCENTRIC_FALLBACK = [] | 380 | _BARYCENTRIC_FALLBACK = [] |
| 381 | _EXPLICIT_LOD_BIAS = [] | ||
| 381 | _DENORM_FTZ_F32 = [] | 382 | _DENORM_FTZ_F32 = [] |
| 382 | 383 | ||
| 383 | 384 | ||
| @@ -414,6 +415,33 @@ def _device_barycentric_fallback(): | |||
| 414 | return _BARYCENTRIC_FALLBACK[0] | 415 | return _BARYCENTRIC_FALLBACK[0] |
| 415 | 416 | ||
| 416 | 417 | ||
| 418 | def _device_explicit_lod_bias(build: str | None): | ||
| 419 | """tools/lod_bias_probe.py's answer for the device the tests run on (cached per suite), or None: vk_subgroup_info.py | ||
| 420 | --lod-bias's compute measurement, else (with the test programs) ps_ssharp drawn without the flag.""" | ||
| 421 | if not _EXPLICIT_LOD_BIAS: | ||
| 422 | answer = None | ||
| 423 | try: | ||
| 424 | r = subprocess.run([sys.executable, "-I", os.path.join(ROOT, "tools", "lod_bias_probe.py"), | ||
| 425 | *(["--build", build] if build else [])], capture_output=True, text=True, timeout=300) | ||
| 426 | answer = json.loads(r.stdout.strip().splitlines()[-1]).get("explicit_lod_bias") | ||
| 427 | except (OSError, ValueError, IndexError, subprocess.SubprocessError): | ||
| 428 | pass | ||
| 429 | _EXPLICIT_LOD_BIAS.append(answer) | ||
| 430 | return _EXPLICIT_LOD_BIAS[0] | ||
| 431 | |||
| 432 | |||
| 433 | def explicit_lod_bias(build: str | None) -> bool: | ||
| 434 | """LEONIDA_EXPLICIT_LOD_BIAS=1 (or 0): translate with --explicit-lod-bias, so samples take the S# LOD_BIAS in the | ||
| 435 | shader. Unset, it is on where tools/lod_bias_probe.py measures that the sampler drops mipLodBias (MoltenVK on an | ||
| 436 | Apple M3, not on an M5 Pro: a driver ID can't tell); a probe without an answer leaves it off.""" | ||
| 437 | v = (os.environ.get("LEONIDA_EXPLICIT_LOD_BIAS") or "").strip().lower() | ||
| 438 | if v in ("1", "true", "yes", "on"): | ||
| 439 | return True | ||
| 440 | if v in ("0", "false", "no", "off"): | ||
| 441 | return False | ||
| 442 | return _device_explicit_lod_bias(build) is True | ||
| 443 | |||
| 444 | |||
| 417 | def _device_denorm_ftz_f32(): | 445 | def _device_denorm_ftz_f32(): |
| 418 | """denorm_flush_to_zero_f32 from tools/vk_subgroup_info.py for the device the tests run on (cached), or None.""" | 446 | """denorm_flush_to_zero_f32 from tools/vk_subgroup_info.py for the device the tests run on (cached), or None.""" |
| 419 | if not _DENORM_FTZ_F32: | 447 | if not _DENORM_FTZ_F32: |
| @@ -494,6 +522,7 @@ CS_DUMP_WANTS: dict[str, list[int]] = { | |||
| 494 | "cs_dpp_row": [0, 0, 1, 2, 3, 4, 5, 6], | 522 | "cs_dpp_row": [0, 0, 1, 2, 3, 4, 5, 6], |
| 495 | "cs_dpp_w64": [1, 0, 3, 2, 5, 4, 7, 6], | 523 | "cs_dpp_w64": [1, 0, 3, 2, 5, 4, 7, 6], |
| 496 | "cs_exec_const": [16, 8, 2, 16, 0, 16], | 524 | "cs_exec_const": [16, 8, 2, 16, 0, 16], |
| 525 | "cs_exec_copy": [0xAAAAAAAA, 0xFFFFFFFF, 0xAAAAAAAA, 0, 0xAAAAAAAA, 0xFFFFFFFF, 0xAAAAAAAA, 1], | ||
| 497 | "cs_lds_atomics_ext": [0xF0F11234, 0xAB34CD78, 0x12345678, 0xF0F00F0F, 0xA5A55A5A, 0x00AA00AA, 0x7FB00000, 0xFE090700], | 526 | "cs_lds_atomics_ext": [0xF0F11234, 0xAB34CD78, 0x12345678, 0xF0F00F0F, 0xA5A55A5A, 0x00AA00AA, 0x7FB00000, 0xFE090700], |
| 498 | "cs_lds_b64_cmpst": [0x11110001, 0x22220002, 0x33330003, 0x44440004, 0xCCCC000C, 0x44440004, 0xBBBB000B, 0x3579BADC], | 527 | "cs_lds_b64_cmpst": [0x11110001, 0x22220002, 0x33330003, 0x44440004, 0xCCCC000C, 0x44440004, 0xBBBB000B, 0x3579BADC], |
| 499 | "cs_lds_xchg64_ext": [0x11110003, 0x33333333, 0xF00FF000, 0x04030201, 0x40302010, 0x70500705, 0x3FC00000, 0x80000000], | 528 | "cs_lds_xchg64_ext": [0x11110003, 0x33333333, 0xF00FF000, 0x04030201, 0x40302010, 0x70500705, 0x3FC00000, 0x80000000], |
| @@ -576,6 +605,7 @@ CS_DUMP_NON_WAVE64: frozenset[str] = frozenset({ | |||
| 576 | "cs_dpp_ops", | 605 | "cs_dpp_ops", |
| 577 | "cs_dpp_row", | 606 | "cs_dpp_row", |
| 578 | "cs_exec_const", | 607 | "cs_exec_const", |
| 608 | "cs_exec_copy", | ||
| 579 | "cs_lds_atomics_ext", | 609 | "cs_lds_atomics_ext", |
| 580 | "cs_lds_b64_cmpst", | 610 | "cs_lds_b64_cmpst", |
| 581 | "cs_lds_xchg64_ext", | 611 | "cs_lds_xchg64_ext", |
| @@ -887,7 +917,7 @@ OTHER_HARNESS = {"ps_m15": "d3d12_translated_draw_test", "ps_m15_dual": "d3d12_t | |||
| 887 | DRAWN_WITH = {GATHER_LOD_TEST: "vs_ids.asm", "ps_flat": "vs_ids.asm", "ps_persp_bary": "vs_persp.asm", "ps_texture_sample": "vs_ids.asm", "ps_cube_sample": "vs_ids.asm", | 917 | DRAWN_WITH = {GATHER_LOD_TEST: "vs_ids.asm", "ps_flat": "vs_ids.asm", "ps_persp_bary": "vs_persp.asm", "ps_texture_sample": "vs_ids.asm", "ps_cube_sample": "vs_ids.asm", |
| 888 | "ps_texture_sample_d16": "vs_ids.asm", "ps_sample_c_lz": "vs_ids.asm", "ps_sample_c_lz_a16": "vs_ids.asm", | 918 | "ps_texture_sample_d16": "vs_ids.asm", "ps_sample_c_lz": "vs_ids.asm", "ps_sample_c_lz_a16": "vs_ids.asm", |
| 889 | "ps_table_fetch": "vs_ids.asm", "ps_sample_c": "vs_ids.asm", "ps_sample_c_b": "vs_ids.asm", | 919 | "ps_table_fetch": "vs_ids.asm", "ps_sample_c": "vs_ids.asm", "ps_sample_c_b": "vs_ids.asm", |
| 890 | **{name: "vs_ids.asm" for name in TEXTURE_CONSTANTS}, "ps_ssharp": "vs_ids.asm", "ps_imgatomic": "vs_ids.asm", | 920 | **{name: "vs_ids.asm" for name in TEXTURE_CONSTANTS}, **{name: "vs_ids.asm" for name in SAMPLER_FIXTURES}, "ps_imgatomic": "vs_ids.asm", |
| 891 | **{name: "vs_ids.asm" for name in GRADIENT_TESTS}, "vs_clip": "ps_clip_color.asm", | 921 | **{name: "vs_ids.asm" for name in GRADIENT_TESTS}, "vs_clip": "ps_clip_color.asm", |
| 892 | "ps_interp_f16_high": "vs_f16_pack.asm", "ms_f16_pack": "ps_interp_f16_high.asm", | 922 | "ps_interp_f16_high": "vs_f16_pack.asm", "ms_f16_pack": "ps_interp_f16_high.asm", |
| 893 | "ps_interp_f32_mods": "vs_interp_consts.asm", "ps_interp_mov_mods": "vs_interp_consts.asm", | 923 | "ps_interp_f32_mods": "vs_interp_consts.asm", "ps_interp_mov_mods": "vs_interp_consts.asm", |
| @@ -1154,6 +1184,8 @@ def run_suite(a, work: str) -> int: | |||
| 1154 | cmd.append("--no-ftz32") | 1184 | cmd.append("--no-ftz32") |
| 1155 | if TEXOFF_FALLBACK: # image_sample*_o: offset folded into the coordinate, no VK_KHR_maintenance8 | 1185 | if TEXOFF_FALLBACK: # image_sample*_o: offset folded into the coordinate, no VK_KHR_maintenance8 |
| 1156 | cmd.append("--texel-offset-fallback") | 1186 | cmd.append("--texel-offset-fallback") |
| 1187 | if explicit_lod_bias(getattr(a, "build", None)): # the S# LOD bias in the shader, where the sampler drops it (measured) | ||
| 1188 | cmd.append("--explicit-lod-bias") | ||
| 1157 | if MESH_COMPUTE: # mesh shaders as compute writing to a buffer, drawn by tools/mesh_compute_vs.py | 1189 | if MESH_COMPUTE: # mesh shaders as compute writing to a buffer, drawn by tools/mesh_compute_vs.py |
| 1158 | cmd.append("--mesh-compute") | 1190 | cmd.append("--mesh-compute") |
| 1159 | if os.environ.get("LEONIDA_MESH_SERIAL_WAVES") == "1": # with --wave64-emulate: one pass per wave | 1191 | if os.environ.get("LEONIDA_MESH_SERIAL_WAVES") == "1": # with --wave64-emulate: one pass per wave |
| @@ -1536,9 +1568,9 @@ def run_suite(a, work: str) -> int: | |||
| 1536 | results.append((name, None, f"SKIP ({reason})")) | 1568 | results.append((name, None, f"SKIP ({reason})")) |
| 1537 | else: | 1569 | else: |
| 1538 | results.append((name, rc == 0, verdict_line(rc, msg))) | 1570 | results.append((name, rc == 0, verdict_line(rc, msg))) |
| 1539 | elif name == "ps_ssharp": | 1571 | elif name in SAMPLER_FIXTURES: |
| 1540 | # The S#/T# mip fields through vulkan_sampler() and the view range (check.py's SAMPLER_CASES). | 1572 | # The S#/T# mip fields through vulkan_sampler() and the view range (check.py's SAMPLER_CASES). |
| 1541 | problem = sampler_test(a.build, spirv_dir) | 1573 | problem = sampler_test(a.build, spirv_dir, name) |
| 1542 | results.append((name, None if isinstance(problem, Skip) else not problem, | 1574 | results.append((name, None if isinstance(problem, Skip) else not problem, |
| 1543 | problem or f"{len(SAMPLER_CASES)} S#/T# cases, 4096 pixels each exact")) | 1575 | problem or f"{len(SAMPLER_CASES)} S#/T# cases, 4096 pixels each exact")) |
| 1544 | elif name in ("ps_texoff", "ps_texoff_implicit", "ps_texoff_forms"): | 1576 | elif name in ("ps_texoff", "ps_texoff_implicit", "ps_texoff_forms"): |