Repository navigation
fix(shader): retain adjacent anchor byte loads on RADV - #7829
Conversation
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
AMD's own Windows driver, as a non-RADV check. AMD Radeon 860M (RDNA 3.5,
So the case is RADV-specific, as the title says, and the change doesn't break this driver. AI-assisted: yes (Claude Code) |
|
A discrete RDNA 2 card on AMD's own Windows driver, to help separate an RDNA 2 cause from a RADV one: RX 6700 XT (gfx1031, same family as the RX 6650 XT), driver 32.0.21045.5002, Windows 11 26200, WinLibs GCC 15.2.0 r7, Release,
So with the same RDNA 2 hardware family, the wrong halfword shows up under RADV and not under AMD's Windows compiler, which points at RADV's transformation rather than the hardware, consistent with the 860M result. No regression from the change on this driver. |
What
On RX 6650 XT / RADV,
agc_driver_bda_deviceon current main fails the anchored 16-bit read comparison. The optimized anchor path can return a different halfword from the checked lookup path. Keep the two adjacent physical byte loads volatile for 16-bit anchored reads, retaining the original masks for single-byte reads and the existing bounds/fallback logic.Adds small uniform-lane and mixed direct/fallback halfword cases before the original boundary, permission, overlap and overflow comparisons. Records the workaround and unresolved driver transformation in shader debt. This is the previously validated follow-up from fork PR #67, isolated from the anchor optimization that has since merged. No title performance or bring-up gain is claimed.
Tested
Linux 7.2.9-arch1-1, GCC, RX 6650 XT / RADV Mesa 26.2.4-arch1.1, same machine and current-main base
8816fd772005585886f19b3f6c13a99931e41241.agc_driver_bda_devicefails at anchor0x7fff12340101, offset 0, immediate -1, 16 bits. A temporary diagnostic reports first differing output word 4: lookup 41376 (0xa1a0), anchor 160 (0x00a0). That diagnostic is excluded from this patch.ctest --test-dir build-full --output-on-failure -R '^(agc_driver_bda_device|agc_driver_graphics|agc_shader_memory)$': 3/3 passed, 5.19 seconds, no CTest skips. The physical Radeon executes the hardware readback section.python3 tools/check_conventions.py --base origin/mainandgit diff origin/main --checkpass.Our own Windows execution, other physical GPUs beyond the independent Windows reports below, title runtime on this isolated patch and full hosted CI have not been tested. The cause inside the driver remains unisolated; this is a measured workaround, not a claim about PS5 halfword semantics.
Independent Windows validation reported by @LeandroLP23 (full report): AMD Radeon 860M (RDNA 3.5), AMD Windows driver 32.0.13058.8001, Windows 11 (reported by @LeandroLP23); WinLibs GCC 15.2.0, Release,
ANYPS5_NO_SHADER_CACHE=1. With the PR head merged into main118266aec,agc_driver_bda_device,agc_driver_graphicsandagc_shader_memorypass 3/3. The same three also pass with main'sSpirvBdaRead.cppand this PR's tests: the RADV anchor mismatch does not reproduce on that Windows driver. These are the tester's results; they show no regression on this tested driver.Independent discrete RDNA 2 Windows validation by @thuanquang (full report): RX 6700 XT (gfx1031), AMD Windows driver 32.0.21045.5002, Windows 11 26200, WinLibs GCC 15.2.0 r7, Release, full builds on main
54e4adde5. Main with only this PR'sBdaExecution.cppand main'sSpirvBdaRead.cpppasses the three core BDA/graphics/shader-memory tests; the anchored halfword mismatch does not reproduce. The tester also reports the patched variant passing, including the anchor/span/native-depth cases. This supports a driver/compiler distinction within RDNA 2 rather than a hardware-family-wide failure; it does not isolate the responsible transformation. Test counts for the expanded selection are not inferred from the comment.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)