tombox-xshader tests: bit-exact v_interp_p1_f32, v_interp_p2_f32 and v_interp_mov_f32 through a real vertex shader #287
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
library
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/omonkeyz--xbox-emulator!287
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/287/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@MeNoSkills on GitHub · 2026-11-23 13:02 UTC · original
MeNoSkills:test/pixel-interpolation→main· +62 −0 · 2 files · 1 commits · closed without mergingTest only, no change to the translator. It adds the first exec tests for the three pixel interpolation instructions, which are in no verified group (the list in #286: of 817 mnemonics, 40 are in no group, and these are the most used of them in the analysed titles:
v_interp_p1_f3255,320 uses,v_interp_p2_f3255,320,v_interp_mov_f3215,330, fromtools/progress/data/mnemonics.txt). Per the answer in #187, one more step for the Pixel stage.What is added (
tests/exec_vop/interp.rs)The interpolation instructions need a vertex shader that exports a known attribute, which the default exec harness does not have (its vertex shader exports only
SV_Position). These tests usedraw_graphicswith their own HLSL vertex shader, the same hook the vertex-fetch test inexec.rsuses, and a pixel shader translated from hand-written RDNA2 words with a three-elementTEXCOORDinput signature (registers 1 to 3, afterSV_Positionin register 0, so the stages link).The vertex shader emits, for vertex ids 0, 1 and 2:
TEXCOORD0 = (4, 8, 16, 32) * (1, 2, 3),TEXCOORD1 = (1, 2, 3, 4) * (1, 3, 5)and anointerpolation uint4 TEXCOORD2 = (0x11, 0x22, 0x33, 0x44) + id * 0x100. The draw is the usual full-screen triangle into one pixel, whose centre has barycentric weights 0.5, 0.25 and 0.25 (powers of two), so the interpolated values are exact in binary floating point and the check is on bits, not within a tolerance.v_interp_p1_and_p2_give_the_attribute_at_the_pixel_centre: thep1/p2pair for all four channels of attribute 0 (7, 14, 28, 56), all four of attribute 1 (2.5, 5, 7.5, 10), and a mixed order across both attributes.v_interp_mov_reads_the_flat_attribute_of_the_provoking_vertex:v_interp_mov_f32on the flat attribute returns the provoking (first) vertex value for each channel (0x11, 0x22, 0x33, 0x44), not the value of the other vertices.Results
Both pass on WARP and on an NVIDIA RTX 4070 Ti (Windows 10 build 19045, MSVC,
TOMBOX_EXEC_HW=1). Sensitivity check: with the channel lookup in theEnc::Vinterparm ofhlsl.rsmutated to always read channel x, both tests fail (all four channels come back equal to the first); I reverted that mutation, it is not in the PR.python .github/scripts/pr_gate.py --base upstream/main --head HEAD: 0 problems; the branch is on mainf89e410.What this does not check
vsrcoperand ofv_interp_mov_f32(the p0 / p10 / p20 selector) and the barycentric registers ofp1/p2, as its own comment says. These tests usep0(selector 2) on a flat attribute and do not claim anything aboutp10/p20on an interpolated one.centroid.rs), and no half-precisionv_interp_p1ll_f16family.@omonkeyz on GitHub · 2026-11-23 14:08 UTC · original
Applied locally on main with your authorship kept (cherry-picked,
9f353b9); the tombox-xshader suite passes in a sandbox (exec 155/155 on WARP). It ships in the next release; this PR will be closed when that is pushed. Thanks.@omonkeyz on GitHub · 2026-11-25 13:08 UTC · original
Applied on main in
9f353b9(cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.Pull request closed