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:
authorDominik <55330408+Dom-in@users.noreply.github.com>2026-11-22 12:20:56 +0000
committerDominik <55330408+Dom-in@users.noreply.github.com>2026-11-22 13:42:22 +0000
commit52c3a88947366f1f3e513b7bdd0282ba7ae5ef5b (patch)
tree987427834ac21c26492184708d229309220f6ee2 /scripts/run_gpu_tests.py
parent89b047cd8fab50675a43d76722a6a8a881f55dc2 (diff)
GPU test: image atomics in a pixel shader (ps_imgatomic)
1,018 of the corpus's 1,038 image-atomic shaders are pixel shaders, but every GPU test of image atomics ran in a compute shader (found by @aslan2142). ps_imgatomic does the corpus's forms in a pixel shader: image_atomic_umax, umin and or on three 8x8 2D r32ui images (64 pixels contend for each texel) and umax on a 4x4x4 3D image, each found through its own T# in the descriptor table and the set-0 r32ui storage arrays. Odd pixels are discarded after their atomics, which must still count. vk_bindless_test runs it when given ps_imgatomic.spv: it enables fragmentStoresAndAtomics (exit 77 without it), clears the images (umin to all ones), draws, and checks all 256 texels against a model of the 4096 pixels and the render target's discarded columns. run_gpu_tests.py and check.py run it next to ps_tex. 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.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py
index 670e3255a..875cc4eef 100644
--- a/scripts/run_gpu_tests.py
+++ b/scripts/run_gpu_tests.py
@@ -547,7 +547,7 @@ OTHER_HARNESS = {"ps_m15": "d3d12_translated_draw_test", "vs_m15": "d3d12_transl
547# Shaders a selected test draws with, built even when the filter leaves them out (#192). 547# Shaders a selected test draws with, built even when the filter leaves them out (#192).
548DRAWN_WITH = {GATHER_LOD_TEST: "vs_ids.asm", "ps_flat": "vs_ids.asm", "ps_texture_sample": "vs_ids.asm", "ps_cube_sample": "vs_ids.asm", 548DRAWN_WITH = {GATHER_LOD_TEST: "vs_ids.asm", "ps_flat": "vs_ids.asm", "ps_texture_sample": "vs_ids.asm", "ps_cube_sample": "vs_ids.asm",
549 "ps_texture_sample_d16": "vs_ids.asm", "ps_sample_c_lz": "vs_ids.asm", "ps_sample_c_lz_a16": "vs_ids.asm", 549 "ps_texture_sample_d16": "vs_ids.asm", "ps_sample_c_lz": "vs_ids.asm", "ps_sample_c_lz_a16": "vs_ids.asm",
550 **{name: "vs_ids.asm" for name in TEXTURE_CONSTANTS}, "ps_ssharp": "vs_ids.asm", 550 **{name: "vs_ids.asm" for name in TEXTURE_CONSTANTS}, "ps_ssharp": "vs_ids.asm", "ps_imgatomic": "vs_ids.asm",
551 **{name: "vs_ids.asm" for name in GRADIENT_TESTS}, "vs_clip": "ps_clip_color.asm", 551 **{name: "vs_ids.asm" for name in GRADIENT_TESTS}, "vs_clip": "ps_clip_color.asm",
552 "ps_interp_f16_high": "vs_f16_pack.asm", "ms_f16_pack": "ps_interp_f16_high.asm", 552 "ps_interp_f16_high": "vs_f16_pack.asm", "ms_f16_pack": "ps_interp_f16_high.asm",
553 "ps_interp_f32_mods": "vs_interp_consts.asm", "ps_interp_mov_mods": "vs_interp_consts.asm", 553 "ps_interp_f32_mods": "vs_interp_consts.asm", "ps_interp_mov_mods": "vs_interp_consts.asm",
@@ -1031,10 +1031,12 @@ def run_suite(a, work: str) -> int:
1031 else: 1031 else:
1032 results.append((name, rc == 0 and bad == 0, "4096/4096 pixels exact" if bad == 0 else 1032 results.append((name, rc == 0 and bad == 0, "4096/4096 pixels exact" if bad == 0 else
1033 f"{bad} pixels differ from {expected}: {msg.splitlines()[-1] if msg else ''}")) 1033 f"{bad} pixels differ from {expected}: {msg.splitlines()[-1] if msg else ''}"))
1034 elif name == "ps_tex": 1034 elif name in ("ps_tex", "ps_imgatomic"):
1035 # A texture through the descriptor hash table and the bindless set. vk_bindless_test compares the 1035 # A texture through the descriptor hash table and the bindless set (ps_tex), or image atomics in a pixel
1036 # pixels itself, and exits 77 where the device lacks a feature the set or the shader needs. 1036 # shader through the set's r32ui storage arrays (ps_imgatomic, drawn with vs_ids). vk_bindless_test
1037 rc, msg = run_cmd([vk_bindless, vs_tri, spv]) 1037 # compares the result itself, and exits 77 where the device lacks a feature the set or shader needs.
1038 vs = os.path.join(spirv_dir, "vs_ids.spv") if name == "ps_imgatomic" else vs_tri
1039 rc, msg = run_cmd([vk_bindless, vs, spv])
1038 lines = msg.splitlines() 1040 lines = msg.splitlines()
1039 if rc == 77: 1041 if rc == 77:
1040 reason = next((ln for ln in lines if ln.startswith("unsupported:")), "unsupported device") 1042 reason = next((ln for ln in lines if ln.startswith("unsupported:")), "unsupported device")