tombox-xshader: decode and translate the VOP3-encoded v_interp f32 forms #253
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!253
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/253/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?
@azerioxfr on GitHub · 2026-11-23 07:54 UTC · original
azerioxfr:xshader-vop3-interp-forms→main· +101 −34 · 4 files · 1 commits · closed without mergingLibrary / area: tombox-xshader, pixel-shader attribute interpolation (
rdna2VOP3 decode,hlsl.rsinterp lowering)Exports changed (exports.txt rows): none
Source of the behaviour: opcodes from
tests/isa_table/gfx1013.txt(VOP3 0x200, 0x201, 0x202). The VOP3-interp operand layout is attr in dword1[5:0], chan in [7:6], the f16 high bit in [8] and vsrc in [17:9]. Semantics are those of the VINTRP forms the translator already lowers.One topic, +101 / -34: the existing
Enc::Vinterplowering moves unchanged intoemit_interp, shared by both encodings.What was missing
tests/isa_table.rslistsv_interp_p1_f32,v_interp_p2_f32andv_interp_mov_f32(VOP3) under "vop3: gfx1013 opcodes not named by the decoder", so a pixel shader that uses the VOP3 encoding failed translation.The change
ps_attrs)Tests (
tests/synthetic.rs)v_interp_p1_f32with neg--test synthetic/opcodes/isa_tableisa_table "vop3" unnamed count: 14 → 11.
cargo test -p tombox-xshader --test syntheticpassesmissingwith a noteThe `--test isa_table -- --nocapture` vop3 line listed v_interp_p1_f32 (0x200), v_interp_p2_f32 (0x201) and v_interp_mov_f32 (0x202) among the gfx1013 opcodes the decoder does not name. The VINTRP-encoded forms already decode and lower through Enc::Vinterp, so a title that emits the VOP3 forms (a VOP3-interp dword1 holds {high, chan, attr} in the src0 field and the vsrc VGPR in the src1 field) failed to translate. Name the three opcodes, decode the interp operand layout instead of the generic VOP3 src0/1/2 triple (attr d1[5:0], chan d1[7:6], vsrc d1[17:9]), and route them to the VINTRP lowering, which resolves the attribute through ps_attrs. The VOP3 forms carry abs (d0 bit 9), neg (d1 bit 30), clamp (d0 bit 15), omod (d1[28:27]), opsel (d0[14:11]) and the f16 high bit (d1 bit 8); the f32 forms are refused with an exact Err when any of these is set rather than dropping them silently. The f16 forms (0x342, 0x343, 0x35a) stay unnamed: their low/high half selection is not unambiguous here. Tests (tests/synthetic.rs): a PS with one of each VOP3 form produces the same HLSL as the VINTRP program (only the instruction-offset comments differ), and a neg-modified VOP3 p1 is refused with the exact message. Mutation: forcing chan to 0 fails the equality test; disabling the modifier check fails the refusal test; both restored. isa_table vop3 unnamed: 14 -> 11.@omonkeyz on GitHub · 2026-11-23 14:08 UTC · original
Applied locally on main with your authorship kept (cherry-picked,
19d0be4); 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
19d0be4(cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.Pull request closed