Files
mandy/runtime/test/shaders/vs_interp_consts.asm
cxchhh 8c4e3832d9 GPU fixtures for the CPU-only nlg, cvt_off, output-modifier and constant-modifier rules (TEST-175)
docs/design.md marked four translator rules "not GPU-verified": v_cmp(x)_nlg,
v_cvt_off_f32_i4, the VOP3 output modifiers on v_fmac_f16 and
v_interp_p2/mov_f32, and VOP3 FP modifiers on constants. This adds one pixel
fixture per rule group, each writing four constant mrt0 words derived in its
header: ps_cmp_nlg, ps_cvt_off, ps_fmac_f16_mods, ps_vop3_const_mods,
ps_interp_f32_mods and ps_interp_mov_mods. The two interp fixtures are drawn
with a new vertex shader, vs_interp_consts, whose params are constant over the
triangle.

Every word is a normal float or zero, so the R32G32B32A32_SFLOAT target can't
change it. All six are wired into check.py and run_gpu_tests.py.
tests/semantic/test_rule_gpu_fixtures.py checks that the interpreter, both
runners and the headers agree. run_gpu_tests.py now skips only
ps_interp_f16_high under --bary-fallback, as check.py does, rather than every
PIXEL_VERTEX fixture.

On a Tesla V100 (NVIDIA 580.95.05, Linux), all six write their words on 4096
of 4096 pixels, natively and with LEONIDA_W64_EMULATE=1
LEONIDA_BARY_FALLBACK=1. docs/design.md now cites them. The integer clamp row
stays with quackottu's part of TEST-175, and the denormal-flush row still
needs an RDNA1/2 part.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 09:41:50 +00:00

27 lines
899 B
NASM

; Vertex shader for ps_interp_f32_mods and ps_interp_mov_mods: the vs_ids full-screen triangle, with the same constant
; in each param channel at all three vertices, so interpolation gives that constant at every pixel:
; param0 = (1.5, -0.25, 0.375, 0.625), param1 = (1.5, -0.5, 0.25, 4.0), param2 = (0.25, 3.0, 0, 0).
v_lshlrev_b32_e32 v1, 1, v0
v_and_b32_e32 v1, 2, v1
v_and_b32_e32 v2, 2, v0
v_cvt_f32_u32_e32 v1, v1
v_cvt_f32_u32_e32 v2, v2
v_fma_f32 v3, v1, 2.0, -1.0
v_fma_f32 v4, v2, 2.0, -1.0
v_mov_b32_e32 v5, 0
v_mov_b32_e32 v6, 1.0
exp pos0 v3, v4, v5, v6 done
v_mov_b32_e32 v7, 0x3fc00000
v_mov_b32_e32 v8, 0xbe800000
v_mov_b32_e32 v9, 0x3ec00000
v_mov_b32_e32 v10, 0x3f200000
exp param0 v7, v8, v9, v10
v_mov_b32_e32 v8, -0.5
v_mov_b32_e32 v9, 0.25
v_mov_b32_e32 v10, 4.0
exp param1 v7, v8, v9, v10
v_mov_b32_e32 v7, 0.25
v_mov_b32_e32 v8, 0x40400000
exp param2 v7, v8, v5, v5
s_endpgm