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:
authorS1m0ne1997 <347981799+S1m0ne1997@users.noreply.github.com>2026-11-22 00:51:57 +0100
committerS1m0ne1997 <347981799+S1m0ne1997@users.noreply.github.com>2026-11-22 11:59:04 +0100
commit07bd05fa95c2c47be1d1f0b671fb5e484b23a904 (patch)
tree0021b22b12f60c13dc7ee98e247cbcdea7bd7101 /scripts/run_gpu_tests.py
parentc2967a5e60060e4068fb992196d8f4b494a5046c (diff)
Translator: zero-based VS v0/v3 (VertexIndex - BaseVertex, InstanceIndex - BaseInstance); VS is legacy, not NGG (SHADER-33)
Corpus (scripts/vs_input_survey.py, all 2,236 VS): no exp prim, no s_sendmsg, no v_mbcnt, every VS exports pos0/param, so the console runs them as legacy hardware VS. Their input VGPRs are Mesa's GFX10 legacy layout (radv_shader_args.c, declare_vs_input_vgprs, not is_ngg): v0 vertex id, v1 unused, v2 primitive id, v3 instance id; no VS reads v1/v2 on entry, 788 start with the fetch call and read attributes from v4. Those ids are zero-based on the hardware (ac_nir_lower_intrinsics_to_args.c: vertex_id is load_vertex_id_zero_base, instance_id is load_instance_id; the bases come in SGPRs), while Vulkan's VertexIndex/InstanceIndex include firstVertex|vertexOffset/firstInstance. The translator now seeds v0 = VertexIndex - BaseVertex and v3 = InstanceIndex - BaseInstance (DrawParameters; feature shaderDrawParameters in every VS's metadata). GPU test vs_base_ids.asm, drawn with VKH_DRAW=16,7 (new vk_harness option): 0x101 on every pixel, where before it was 0x7111. Run by check.py and run_gpu_tests.py. vk_harness, vk_pipeline_check, vk_bindless_test, vk_texture_test and the runtime's Vulkan device enable shaderDrawParameters. design.md's "Inputs and outputs" row replaces the "unverified" note. 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.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py
index b63617b6e..d5fb01b64 100644
--- a/scripts/run_gpu_tests.py
+++ b/scripts/run_gpu_tests.py
@@ -493,7 +493,8 @@ DRAWN_WITH = {GATHER_LOD_TEST: "vs_ids.asm", "ps_flat": "vs_ids.asm", "ps_textur
493 "ps_gather_wrap": "vs_ids.asm", 493 "ps_gather_wrap": "vs_ids.asm",
494 **{name: "vs_ids.asm" for name in GRADIENT_TESTS}, "vs_clip": "ps_ops.asm", 494 **{name: "vs_ids.asm" for name in GRADIENT_TESTS}, "vs_clip": "ps_ops.asm",
495 "ps_interp_f16_high": "vs_f16_pack.asm", "ms_f16_pack": "ps_interp_f16_high.asm", 495 "ps_interp_f16_high": "vs_f16_pack.asm", "ms_f16_pack": "ps_interp_f16_high.asm",
496 "ps_interp_f32_mods": "vs_interp_consts.asm", "ps_interp_mov_mods": "vs_interp_consts.asm"} 496 "ps_interp_f32_mods": "vs_interp_consts.asm", "ps_interp_mov_mods": "vs_interp_consts.asm",
497 "vs_base_ids": "ps_flat.asm"}
497 498
498 499
499def with_draw_shaders(asm_files: list[str]) -> list[str]: 500def with_draw_shaders(asm_files: list[str]) -> list[str]:
@@ -1087,6 +1088,19 @@ def run_suite(a, work: str) -> int:
1087 else: 1088 else:
1088 ok, detail = check_clip_half(raw, 0.5, 1.0) 1089 ok, detail = check_clip_half(raw, 0.5, 1.0)
1089 results.append((name, ok, detail)) 1090 results.append((name, ok, detail))
1091 elif name == "vs_base_ids":
1092 # Zero-based v0 / v3 (the hardware's VS input VGPRs): drawn with firstVertex 16 and firstInstance 7,
1093 # ps_flat must still see vertex 0 of instance 0 (0x101), as check.py checks.
1094 raw = os.path.join(raw_dir, f"{name}.raw")
1095 env = dict(gfx_env or os.environ, VKH_DRAW="16,7")
1096 rc, msg = run_cmd([vk_harness, spv, os.path.join(spirv_dir, "ps_flat.spv"), raw], env=env)
1097 if rc == UNSUPPORTED:
1098 results.append((name, None, unsupported_skip(msg)))
1099 elif rc != 0:
1100 results.append((name, False, msg))
1101 else:
1102 ok, detail = check_flat(raw)
1103 results.append((name, ok, detail))
1090 1104
1091 if a.filter and not results: # the filter matched only inputs/partners: say so rather than "0/0 passed" 1105 if a.filter and not results: # the filter matched only inputs/partners: say so rather than "0/0 passed"
1092 names = [os.path.splitext(f)[0] for f in asm_files] 1106 names = [os.path.splitext(f)[0] for f in asm_files]