fix(shader): v_mov_b32 SDWA writes byte destinations #499
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/499"
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?
Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-04T09:46:30Z.
What
v_mov_b32accepted SDWA destination selectors for the two words only. A byte destination (dst_selBYTE_0..3) threwVOP1 SDWA destination selector is not supported. GTA V (PPSA04264) aborted during boot on such a move in one of its eboot compute shaders:v_mov_b32_sdwawithdst_sel:BYTE_0 dst_unused:UNUSED_PRESERVE src0_sel:DWORD. The compute recompile failure reached presentation, which terminates.The write itself already handles byte destinations and every
dst_unusedmode (TranslationContext::writeRawU32, which other VOP1 conversions use for bytes). So the rule table now allows byte destinations forv_mov_b32too, with the same source selectors as before. The error message now names the destination selector,dst_unused, the source selector, the opcode and the pc.Tested
Windows 11 Pro, AMD Ryzen 5 7600, NVIDIA GeForce RTX 5080 (driver 32.0.16.1074), 32 GB DDR5-5600, MinGW-w64 GCC 15.2.0.
agc_driver_sdwa_destinationnow also runsv_mov_b32_sdwawith BYTE_0 and BYTE_2 under UNUSED_PRESERVE, and BYTE_1 under UNUSED_PAD, and checks each result byte. It passes on the GPU.ctest: everything that passes onmainhere passes.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T23:09:25Z.
Thanks, this is the right fix. Byte destinations already go through
writeRawU32(the f32 to int conversions use it with byte selectors today), so widening thev_mov_b32rule is all that was missing. I checked the three new test instructions with llvm-mc (dst_sel:BYTE_0andBYTE_2withUNUSED_PRESERVE,BYTE_1withUNUSED_PAD, allsrc0_sel:DWORD), and the expected values follow the SDWA rule: the low byte of the result lands in the selected byte, and the other bytes are kept or zeroed. The longer error message will make the next one of these quicker to find.agc_driver_sdwa_destinationpasses on my machine at this head. With only the test file on main's code it fails with the old "VOP1 SDWA destination selector is not supported".Optional, not blocking: with a byte destination,
v_mov_b32still refuses byte source selectors (partialDstSourceSelectorsis words plus DWORD), andUNUSED_SEXTwith a byte destination is accepted but not covered by a test row. If GTA V turns up asrc0_sel:BYTE_nmove next, that is the line to widen.