shader: take the high half per lane in V_PK_FMAC_F16 #404
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!404
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/404/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?
@brandostrong on GitHub · 2026-08-29 19:03 UTC · original
brandostrong:fix/vop2-pk-fmac-f16→main· +74 −2 · 3 files · 1 commits · merged 2026-08-30 11:08 UTCProblem
V_PK_FMAC_F16is the only packed opcode reachable through VOP2, so it carries noOP_SELfield and the decoder leftOP_SEL_HIclear.ReadF16LaneAsF32picks a lane's half fromOP_SEL_HI, so the high lane read the low half ofsrc0,src1andvdstand recomputed the low lane's result.vdstis also a source, so the error accumulates across a packed FMA chain.Change
Set
op_sel_hion both sources and the destination inFinalizeVop2Instruction. Decoder only.PackedFmacF16AccumulatesEachHalfIndependentlyfails on the previous decoder with[0x49804980]against expected[0x4fc04980]— the high half repeating the low lane's11.0hinstead of31.0h.--pk-fmac-onlyruns it alone.AI assistance
Claude again. This specific bug broke a compute shader in gta 5 and likely would also be causing problems across other game shaders that rely on fp16 multiply-accumulate operations(at least on vop2), since the bug would be sending valid but incorrect values.