diff options
| author | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-29 11:41:49 -0500 |
|---|---|---|
| committer | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-29 11:41:49 -0500 |
| commit | f051ae51831cb2e6a79bc73e113b4fa4a201dc91 (patch) | |
| tree | 314a505800001668261b594382faf80b4a34d8fa /scripts | |
| parent | ac93aac0d49ff20ff4f2b7ca4bc4a32120e15825 (diff) | |
d3d12/tests: fix Windows MSVC build, CopyMemory collision, copy parity guard, and --no-ftz32 probe
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/run_gpu_tests.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py index 8a6e2a15c..779839b14 100644 --- a/scripts/run_gpu_tests.py +++ b/scripts/run_gpu_tests.py | |||
| @@ -369,8 +369,15 @@ def f16_interp_fallback() -> bool: | |||
| 369 | return _device_per_vertex() is False | 369 | return _device_per_vertex() is False |
| 370 | 370 | ||
| 371 | 371 | ||
| 372 | def no_ftz32() -> bool: | ||
| 373 | """Translate with --no-ftz32 when tools/vk_subgroup_info.py reports denorm_flush_to_zero_f32: false | ||
| 374 | (drivers such as NVIDIA Vulkan that do not advertise DenormFlushToZero 32).""" | ||
| 375 | return _device_denorm_ftz_f32() is False | ||
| 376 | |||
| 377 | |||
| 372 | _PER_VERTEX = [] | 378 | _PER_VERTEX = [] |
| 373 | _BARYCENTRIC_FALLBACK = [] | 379 | _BARYCENTRIC_FALLBACK = [] |
| 380 | _DENORM_FTZ_F32 = [] | ||
| 374 | 381 | ||
| 375 | 382 | ||
| 376 | def _device_per_vertex(): | 383 | def _device_per_vertex(): |
| @@ -406,6 +413,22 @@ def _device_barycentric_fallback(): | |||
| 406 | return _BARYCENTRIC_FALLBACK[0] | 413 | return _BARYCENTRIC_FALLBACK[0] |
| 407 | 414 | ||
| 408 | 415 | ||
| 416 | def _device_denorm_ftz_f32(): | ||
| 417 | """denorm_flush_to_zero_f32 from tools/vk_subgroup_info.py for the device the tests run on (cached), or None.""" | ||
| 418 | if not _DENORM_FTZ_F32: | ||
| 419 | answer = None | ||
| 420 | try: | ||
| 421 | r = subprocess.run([sys.executable, "-I", os.path.join(ROOT, "tools", "vk_subgroup_info.py")], | ||
| 422 | capture_output=True, text=True, timeout=60) | ||
| 423 | report = json.loads(r.stdout.strip().splitlines()[-1]) | ||
| 424 | if isinstance(report, dict) and isinstance(report.get("denorm_flush_to_zero_f32"), bool): | ||
| 425 | answer = report["denorm_flush_to_zero_f32"] | ||
| 426 | except (OSError, ValueError, IndexError, subprocess.SubprocessError): | ||
| 427 | pass | ||
| 428 | _DENORM_FTZ_F32.append(answer) | ||
| 429 | return _DENORM_FTZ_F32[0] | ||
| 430 | |||
| 431 | |||
| 409 | def w64_emulated() -> bool: | 432 | def w64_emulated() -> bool: |
| 410 | # Wave64 emulation on: the suite runs every wave64 check without asking for a 64-wide | 433 | # Wave64 emulation on: the suite runs every wave64 check without asking for a 64-wide |
| 411 | # subgroup, matching check.py (W64_EMULATED). Accepts "1"/"true"/"yes"/"on" and tolerates | 434 | # subgroup, matching check.py (W64_EMULATED). Accepts "1"/"true"/"yes"/"on" and tolerates |
| @@ -798,6 +821,9 @@ def main() -> int: | |||
| 798 | ap.add_argument("--no-validate", action="store_true", | 821 | ap.add_argument("--no-validate", action="store_true", |
| 799 | help="skip spirv-val during translation (automatic when --assembler resolves to python " | 822 | help="skip spirv-val during translation (automatic when --assembler resolves to python " |
| 800 | "and spirv-val is not on PATH)") | 823 | "and spirv-val is not on PATH)") |
| 824 | ap.add_argument("--no-ftz32", action="store_true", | ||
| 825 | help="translate shaders with --no-ftz32 (automatic when tools/vk_subgroup_info.py reports " | ||
| 826 | "denorm_flush_to_zero_f32: false)") | ||
| 801 | ap.add_argument("--disasm-dir", default=None, | 827 | ap.add_argument("--disasm-dir", default=None, |
| 802 | help="folder of pre-disassembled <name>.s listings (e.g. tests/semantic/fixtures/disasm); " | 828 | help="folder of pre-disassembled <name>.s listings (e.g. tests/semantic/fixtures/disasm); " |
| 803 | "skips llvm-mc and runs only fixtures present there") | 829 | "skips llvm-mc and runs only fixtures present there") |
| @@ -974,6 +1000,8 @@ def run_suite(a, work: str) -> int: | |||
| 974 | cmd.append("--bary-fallback") | 1000 | cmd.append("--bary-fallback") |
| 975 | if f16_interp_fallback(): # *_f16 interps from decoded-half inputs, no PerVertexKHR (MoltenVK) | 1001 | if f16_interp_fallback(): # *_f16 interps from decoded-half inputs, no PerVertexKHR (MoltenVK) |
| 976 | cmd.append("--f16-interp-fallback") | 1002 | cmd.append("--f16-interp-fallback") |
| 1003 | if getattr(a, "no_ftz32", False) or no_ftz32(): # no DenormFlushToZero 32 (e.g. NVIDIA Vulkan) | ||
| 1004 | cmd.append("--no-ftz32") | ||
| 977 | if TEXOFF_FALLBACK: # image_sample*_o: offset folded into the coordinate, no VK_KHR_maintenance8 | 1005 | if TEXOFF_FALLBACK: # image_sample*_o: offset folded into the coordinate, no VK_KHR_maintenance8 |
| 978 | cmd.append("--texel-offset-fallback") | 1006 | cmd.append("--texel-offset-fallback") |
| 979 | if MESH_COMPUTE: # mesh shaders as compute writing to a buffer, drawn by tools/mesh_compute_vs.py | 1007 | if MESH_COMPUTE: # mesh shaders as compute writing to a buffer, drawn by tools/mesh_compute_vs.py |