upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/scripts/run_gpu_tests.py
diff options
context:
space:
mode:
authorVonsek <45567075+Vonsek@users.noreply.github.com>2026-11-21 23:53:51 +0100
committerVonsek <45567075+Vonsek@users.noreply.github.com>2026-11-21 23:53:51 +0100
commite444c83335ea6f3cabf68539c2f6d63d39d0a868 (patch)
treedb4975ea49ee232cee770f5f37c5393e9225677b /scripts/run_gpu_tests.py
parent83d0637267da403735616991b42eb2b8e9e1443a (diff)
GPU test for the S# and T# mip fields through gfx10_descriptors.h
vk_sampler_test binds a 128x128 two-level texture with the VkSampler from vulkan_sampler(decode(S#)) and the view range from decode(T#). ps_ssharp samples it with image_sample_lz and image_sample. check.py judges eight S#/T# cases per pixel against levels worked out from the S# and T# bits. AI-assisted (Claude Code). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'scripts/run_gpu_tests.py')
-rw-r--r--scripts/run_gpu_tests.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py
index 69fccee0c..124bdeeb1 100644
--- a/scripts/run_gpu_tests.py
+++ b/scripts/run_gpu_tests.py
@@ -23,7 +23,7 @@ sys.path.insert(0, os.path.join(ROOT, "tools"))
23import mc_command # noqa: E402 23import mc_command # noqa: E402
24sys.path.insert(0, SHADER_DIR) 24sys.path.insert(0, SHADER_DIR)
25from compute_fixture import compute_header 25from compute_fixture import compute_header
26from check import Skip, mesh_v5_test 26from check import SAMPLER_CASES, Skip, mesh_v5_test, sampler_test
27 27
28 28
29def make_dxbc(chunks: list[tuple[bytes, bytes]]) -> bytes: 29def make_dxbc(chunks: list[tuple[bytes, bytes]]) -> bytes:
@@ -389,9 +389,9 @@ def run_suite(a, work: str) -> int:
389 asm_files = sorted(f for f in os.listdir(SHADER_DIR) if f.endswith(".asm")) 389 asm_files = sorted(f for f in os.listdir(SHADER_DIR) if f.endswith(".asm"))
390 if a.filter: 390 if a.filter:
391 asm_files = [f for f in asm_files if a.filter in f] 391 asm_files = [f for f in asm_files if a.filter in f]
392 # Shaders a selected test draws with are built even when the filter leaves them out (#192): ps_flat uses vs_ids. 392 # Shaders a selected test draws with are built even when the filter leaves them out (#192): ps_flat and ps_ssharp use vs_ids.
393 build_files = list(asm_files) 393 build_files = list(asm_files)
394 if any(f.startswith("ps_flat") for f in asm_files) and "vs_ids.asm" not in build_files: 394 if any(f.startswith(("ps_flat", "ps_ssharp")) for f in asm_files) and "vs_ids.asm" not in build_files:
395 build_files.append("vs_ids.asm") 395 build_files.append("vs_ids.asm")
396 396
397 # 1. Create synthetic DXBC / FSSM metadata + assemble .asm -> .s 397 # 1. Create synthetic DXBC / FSSM metadata + assemble .asm -> .s
@@ -577,6 +577,11 @@ def run_suite(a, work: str) -> int:
577 results.append((name, None, f"SKIP ({reason})")) 577 results.append((name, None, f"SKIP ({reason})"))
578 else: 578 else:
579 results.append((name, rc == 0, lines[-1] if lines else "")) 579 results.append((name, rc == 0, lines[-1] if lines else ""))
580 elif name == "ps_ssharp":
581 # The S#/T# mip fields through vulkan_sampler() and the view range (check.py's SAMPLER_CASES).
582 problem = sampler_test(a.build, spirv_dir)
583 results.append((name, None if isinstance(problem, Skip) else not problem,
584 problem or f"{len(SAMPLER_CASES)} S#/T# cases, 4096 pixels each exact"))
580 elif name.startswith("ps_"): 585 elif name.startswith("ps_"):
581 raw = os.path.join(raw_dir, f"{name}.raw") 586 raw = os.path.join(raw_dir, f"{name}.raw")
582 vs = os.path.join(spirv_dir, "vs_ids.spv") if name == "ps_flat" else vs_tri # check.py draws ps_flat with vs_ids 587 vs = os.path.join(spirv_dir, "vs_ids.spv") if name == "ps_flat" else vs_tri # check.py draws ps_flat with vs_ids