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:
authorDANISBR1 <210478648+DaniSBR1@users.noreply.github.com>2026-11-21 21:38:58 -0600
committerDANISBR1 <210478648+DaniSBR1@users.noreply.github.com>2026-11-22 16:37:21 -0600
commit1291a6878c0e2b34a8bb22edc820775c4407459e (patch)
tree717f9ecfdeed3802a93476f55d05c7a90cda5498 /scripts/run_gpu_tests.py
parentaa2988cc555bad7ecd508b48a702adbb32fe7c95 (diff)
GPU tests: raw barycentrics under perspective (ps_persp_bary, vs_persp)
The raw-barycentric tests draw with vs_ids, where clip w = 1 at every vertex, so nothing checked that the raw i/j (and the attributes) follow perspective-correct weights. vs_persp draws one triangle at screen (5,8), (57,16), (21,55) with clip w = 1, 2, 4 and per-vertex attr0; ps_persp_bary is ps_bary's code drawn with it. check.py's bary_persp_problem compares every pixel with CPU weights p_k = (l_k / w_k) / sum(l_m / w_m) from the screen-space weights l_k, checks that pixels outside stay clear, and requires the affine weights to differ by more than 100x the tolerance on every judged pixel, so a NoPerspective regression can't pass. run_gpu_tests.py uses the same reference (PIXEL_VS, DRAWN_WITH). Suggested by Vonsek in #794. On main it runs the native BaryCoordKHR path (it skips without VK_KHR_fragment_shader_barycentric, like ps_bary); any barycentric fallback that lands (#804) is exercised by it too. Checked on an RX 5700 XT (RADV) through a GS fallback: passes at wave32 and wave64; with NoPerspective on the fallback's input, all 1149 covered pixels fail while the interpolated attributes still match. New tests/test_bary_persp_oracle.py. 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.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py
index 94de20f26..021a8c02c 100644
--- a/scripts/run_gpu_tests.py
+++ b/scripts/run_gpu_tests.py
@@ -46,6 +46,7 @@ from check import barycentric_problem
46from check import GET_LOD_TESTS, STORE_WORDS, get_lod_test, store_words_problem # TEST-184: image atomics and queries 46from check import GET_LOD_TESTS, STORE_WORDS, get_lod_test, store_words_problem # TEST-184: image atomics and queries
47from check import wide_pixel_skip # ps_w64x_readlane: judged only where the fragment stage was required 64-wide 47from check import wide_pixel_skip # ps_w64x_readlane: judged only where the fragment stage was required 64-wide
48from check import FMA_FUSED_ENV, judge_fma_fused # cs_fma_fused: strict under LEONIDA_FMA=khr, fused/split under glsl 48from check import FMA_FUSED_ENV, judge_fma_fused # cs_fma_fused: strict under LEONIDA_FMA=khr, fused/split under glsl
49from check import bary_persp_problem # ps_persp_bary's perspective-correct reference
49 50
50 51
51def make_dxbc(chunks: list[tuple[bytes, bytes]]) -> bytes: 52def make_dxbc(chunks: list[tuple[bytes, bytes]]) -> bytes:
@@ -574,7 +575,7 @@ OTHER_HARNESS = {"ps_m15": "d3d12_translated_draw_test", "vs_m15": "d3d12_transl
574 575
575 576
576# Shaders a selected test draws with, built even when the filter leaves them out (#192). 577# Shaders a selected test draws with, built even when the filter leaves them out (#192).
577DRAWN_WITH = {GATHER_LOD_TEST: "vs_ids.asm", "ps_flat": "vs_ids.asm", "ps_texture_sample": "vs_ids.asm", "ps_cube_sample": "vs_ids.asm", 578DRAWN_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",
578 "ps_texture_sample_d16": "vs_ids.asm", "ps_sample_c_lz": "vs_ids.asm", "ps_sample_c_lz_a16": "vs_ids.asm", 579 "ps_texture_sample_d16": "vs_ids.asm", "ps_sample_c_lz": "vs_ids.asm", "ps_sample_c_lz_a16": "vs_ids.asm",
579 **{name: "vs_ids.asm" for name in TEXTURE_CONSTANTS}, "ps_ssharp": "vs_ids.asm", "ps_imgatomic": "vs_ids.asm", 580 **{name: "vs_ids.asm" for name in TEXTURE_CONSTANTS}, "ps_ssharp": "vs_ids.asm", "ps_imgatomic": "vs_ids.asm",
580 **{name: "vs_ids.asm" for name in GRADIENT_TESTS}, "vs_clip": "ps_clip_color.asm", 581 **{name: "vs_ids.asm" for name in GRADIENT_TESTS}, "vs_clip": "ps_clip_color.asm",
@@ -1257,6 +1258,9 @@ def run_suite(a, work: str) -> int:
1257 ok, detail = check_pixel_const(raw, const_wants[name]) 1258 ok, detail = check_pixel_const(raw, const_wants[name])
1258 elif name == "ps_bary": 1259 elif name == "ps_bary":
1259 ok, detail = check_bary(raw) 1260 ok, detail = check_bary(raw)
1261 elif name == "ps_persp_bary":
1262 problem = bary_persp_problem(read_raw_rgba32f(raw))
1263 ok, detail = not problem, problem or "perspective-correct on every covered pixel"
1260 elif name == "ps_bitmask_perm": 1264 elif name == "ps_bitmask_perm":
1261 m = re.search(r"subgroup \d+\.\.(\d+)", msg) 1265 m = re.search(r"subgroup \d+\.\.(\d+)", msg)
1262 if m and int(m.group(1)) < 32: 1266 if m and int(m.group(1)) < 32: