upleb.uk

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

summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com>2026-11-22 06:08:10 -0500
committerItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com>2026-11-22 06:08:10 -0500
commit5e9a2dc58dec4f91ff3fa507e26f0fb8150e4e4b (patch)
tree7b3889dce845dfa020ad819406cbe99c89b24b28 /runtime
parent481a5ee6ce615ae3f0a400a04529fb9c20ac5a42 (diff)
parentda3ebde8ca14a2c5a768221fa898af7c712255ae (diff)
Merge pull request #1393 from DomasUrbonas
Diffstat (limited to 'runtime')
-rw-r--r--runtime/test/shaders/check.py7
-rw-r--r--runtime/test/shaders/ps_clip_color.asm12
2 files changed, 16 insertions, 3 deletions
diff --git a/runtime/test/shaders/check.py b/runtime/test/shaders/check.py
index eb8b031e8..734b9d667 100644
--- a/runtime/test/shaders/check.py
+++ b/runtime/test/shaders/check.py
@@ -205,7 +205,8 @@ W64X_DUMPS = [("cs_dpp_w64", [1, 0, 3, 2, 5, 4, 7, 6]),
205# A 40-thread group (one partial wave) cannot use --require-wave64 (full subgroups), so it asks for subgroup size 64. 205# A 40-thread group (one partial wave) cannot use --require-wave64 (full subgroups), so it asks for subgroup size 64.
206W64X_PARTIAL = [("cs_w64x_partial", [40, 40, 528, 0, 0, 532, 539, 524820]), 206W64X_PARTIAL = [("cs_w64x_partial", [40, 40, 528, 0, 0, 532, 539, 524820]),
207 ("cs_w64x_partial_scmp", [0, 1, 0, 1, 1, 1, 1, 0])] 207 ("cs_w64x_partial_scmp", [0, 1, 0, 1, 1, 1, 1, 0])]
208PIXEL_BITS = {"ps_legacy_mul": (0, 0, 0, 0x40c00000), 208PIXEL_BITS = {"ps_clip_color": (0x3e800000, 0x3f000000, 0x3f400000, 0x3f800000),
209 "ps_legacy_mul": (0, 0, 0, 0x40c00000),
209 "ps_ops": (0x48804300, 5, 7, 0xfffffffc), "ps_ops2": (0xabcd4400, 0x46001234, 0xfffffffa, 7), 210 "ps_ops": (0x48804300, 5, 7, 0xfffffffc), "ps_ops2": (0xabcd4400, 0x46001234, 0xfffffffa, 7),
210 "ps_ops3": (0xfffffffa, 0x44660066, 0x44aabbcc, 16), "ps_ops4": (0x34000010, 0x00120800, 0xbeef0000, 0x12343c00), 211 "ps_ops3": (0xfffffffa, 0x44660066, 0x44aabbcc, 16), "ps_ops4": (0x34000010, 0x00120800, 0xbeef0000, 0x12343c00),
211 "ps_ops5": (0x12340010, 0xbeef0800, 0xaaaaffff, 0xdeadbc00), 212 "ps_ops5": (0x12340010, 0xbeef0800, 0xaaaaffff, 0xdeadbc00),
@@ -880,7 +881,7 @@ def clip_test(tools, spirv, name):
880 raw = Path(tmp) / "pixels.raw" 881 raw = Path(tmp) / "pixels.raw"
881 for clip_x, clip_y in ((False, False), (True, False), (False, True), (True, True)): 882 for clip_x, clip_y in ((False, False), (True, False), (False, True), (True, True)):
882 code, output = run(os.path.join(tools, "vk_harness" + EXE), os.path.join(spirv, name + ".spv"), 883 code, output = run(os.path.join(tools, "vk_harness" + EXE), os.path.join(spirv, name + ".spv"),
883 os.path.join(spirv, "ps_ops.spv"), raw, "64", "64", 884 os.path.join(spirv, "ps_clip_color.spv"), raw, "64", "64",
884 "0" if clip_x else "4", "0" if clip_y else "4") 885 "0" if clip_x else "4", "0" if clip_y else "4")
885 if code == UNSUPPORTED: 886 if code == UNSUPPORTED:
886 return Skip("SKIP (shaderClipDistance unavailable)") 887 return Skip("SKIP (shaderClipDistance unavailable)")
@@ -897,7 +898,7 @@ def clip_test(tools, spirv, name):
897 for i, pixel in enumerate(struct.iter_unpack("<4I", data)): 898 for i, pixel in enumerate(struct.iter_unpack("<4I", data)):
898 inside = (not clip_x or i % 64 < 32) and (not clip_y or i // 64 < 16) 899 inside = (not clip_x or i % 64 < 32) and (not clip_y or i // 64 < 16)
899 drawn = inside or name == "vs_clip_undeclared" 900 drawn = inside or name == "vs_clip_undeclared"
900 wrong += pixel != (PIXEL_BITS["ps_ops"] if drawn else clear) 901 wrong += pixel != (PIXEL_BITS["ps_clip_color"] if drawn else clear)
901 if wrong: 902 if wrong:
902 return f"x={clip_x} y={clip_y}: {wrong} of 4096 pixels differ" 903 return f"x={clip_x} y={clip_y}: {wrong} of 4096 pixels differ"
903 return "" 904 return ""
diff --git a/runtime/test/shaders/ps_clip_color.asm b/runtime/test/shaders/ps_clip_color.asm
new file mode 100644
index 000000000..7c354cbce
--- /dev/null
+++ b/runtime/test/shaders/ps_clip_color.asm
@@ -0,0 +1,12 @@
1; Dedicated fragment shader for vertex clipping tests.
2; Export finite, exactly representable RGBA32F values so
3; NaN payload canonicalization cannot affect clip validation.
4; Expected mrt0 bits: 0x3e800000, 0x3f000000,
5; 0x3f400000, 0x3f800000
6
7v_mov_b32 v0, 0x3e800000
8v_mov_b32 v1, 0x3f000000
9v_mov_b32 v2, 0x3f400000
10v_mov_b32 v3, 0x3f800000
11exp mrt0 v0, v1, v2, v3 done vm
12s_endpgm