Repository navigation
fix(shader): DPP16 operands of v_pk_fmac_f16 and the relative moves - #514
Conversation
v_pk_fmac_f16 read its accumulator through the permuted destination and wrote without the DPP write mask. v_movrels/movrelsd/movrelsd_2 dropped the source permute, and the relative writes dropped the DPP write mask. Co-Authored-By: Claude <noreply@anthropic.com>
0857c9b to
cebc1e8
Compare
|
Rebased on current main: the only Windows failure was |
|
Thanks, good catch. I re-checked the rebased head: the commit is unchanged from the one I first looked at, and it still merges cleanly onto current main. On main the source DPP is copied into Ready to merge from my side. |
|
Gated on PPSA21564: no visual or FPS change. |
Takes upstream's merged versions of our boykopovar#586 boykopovar#611 boykopovar#612 boykopovar#505 boykopovar#490 boykopovar#619 boykopovar#503 boykopovar#627 boykopovar#628 boykopovar#618 and drops astrobot's local copies, plus gate-batch-3 (boykopovar#469 boykopovar#500 boykopovar#504 boykopovar#509 boykopovar#510 boykopovar#514 boykopovar#525 boykopovar#526 boykopovar#528), round o/p (boykopovar#617 boykopovar#620 boykopovar#621 boykopovar#622 boykopovar#623 boykopovar#624 boykopovar#501 boykopovar#508 boykopovar#629 boykopovar#630 boykopovar#631). Conflicts: - SpirvAnalysis.hpp/.cpp, SpirvBufferAccess.cpp: upstream's boykopovar#586/boykopovar#612. The 64-bit LDS atomics keep the full array (f27d6e5 no longer needed). - SpirvMemoryInstructions.cpp: upstream's constant slot plus offset; astrobot's split-wave append/consume kept. - GuestTextureResource.cpp, TextureTiling.cpp and their tests: upstream's boykopovar#490/boykopovar#503 (astrobot had no other change there). - MaskedSelect.cpp test, ShaderMemory.cpp LDS test: upstream's. - State.cpp: upstream's boykopovar#505 export count and boykopovar#469 null pixel program; astrobot's depth export rejection and depth target model kept. - Pipeline.cpp: upstream's pipeline key; astrobot's depth attachment and blend check (a trailing unused attachment stays valid, as colorGapPipelineTests expects). - Draw.cpp, Recorder.cpp, ShaderResources.cpp: astrobot's (renderPassKey with depth, moved sample functions, residency maintenance), which already hold the merged boykopovar#505/boykopovar#628/boykopovar#490 changes. - ShaderInputState.cpp: both register sets. - State.hpp: the duplicate exportIndex member from the auto-merge removed. - CMakeLists.txt: astrobot's test list (a superset of upstream's). - tests/Graphics.cpp: upstream's CompactedExportTests replaces astrobot's inline copy; tests/Recorder.cpp: upstream's viewPastLastMipTests added.
What
Four VOP1/VOP2 opcodes gave wrong results with a DPP16 modifier on
main. #513 found them with its differential sweep and refuses them for DPP8.v_pk_fmac_f16: the accumulator was read through the destination, whichdestinationOperandgives the source DPP, so the accumulator was permuted too. The result was then written throughplainOperand, which dropped the DPP write mask (row/bank mask, out-of-range lanes). It now reads the accumulator withaccumulatorOperandlikev_fmac_f32does and writes with the destination's DPP.v_movrels_b32,v_movrelsd_b32,v_movrelsd_2_b32:readRelativeVectorread the registers directly and ignored the source DPP. It now applies the source modifiers to the relatively indexed value. The decoder already refuses SDWA on these opcodes, so in practice this only adds the permute.v_movrelsd_b32,v_movrelsd_2_b32,v_movreld_b32:writeRelativeVectorwrote throughplainOperand, which dropped the DPP write mask. Now it keeps it.Behaviour measured on HW (RDNA2 gfx1035, wave32)
v_pk_fmac_f16_dpp: the DPP permutes only src0. The accumulator is the lane's ownvdst.v_movrels*_dpp: lanelgets the relatively indexed register of the DPP source lane, i.e.v[base + m0]permuted.v_mov_b32_dpp: row_mask, bank_mask, exec, and no write for an out-of-range source withoutbound_ctrl. The relative destination isvdst + m0(orm0[25:16]for_2).Tested
Arch Linux, RADV (RDNA2) and lavapipe; no title.
agc_driver_dpp16_operands_tests: the five opcodes under three DPP16 controls. quad_perm with full exec;row_shr:1withoutbound_ctrl, so the first lane of each row is not written; quad_perm withrow_mask:0x5 bank_mask:0xaand partial exec. Expected values come from HW. One extra row checks that the relative base registers stay untouched. lavapipe skips it (subgroup size 8 can't hold a 16-lane row), the same way DsPermute does.agc_driver_pixel_helper_lanes, which also fails onmainon local RADV since fix(recompiler): start pixel waves without their helper invocations in EXEC #305.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 (attach them to this PR)