fix(shader): preserve pixel helper lanes in EXEC copies #6291
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6291"
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 santhoshkumar-dev on 2026-10-15T09:15:43Z.
What
A pixel shader that enables whole-quad mode, copies
EXECto an SGPR, and restores that copy loses its helper lanes.hostExecWordintersects the saved mask with a Vulkan ballot of active invocations, which excludes those helpers. Subsequent interpolation leaves incorrect coordinates in the helper lanes, so implicit texture sampling selects the wrong mips. OlliOlli World (PPSA02327, #5316) shows maze patterns on characters and terrain, including dashed triangle edges on the Radlandia map.Pixel-stage EXEC reads now intersect against the whole-quad expansion of the host active-lane mask. This retains the helper bits already present in guest EXEC while still rejecting absent host quads. Other stages retain the existing host-lane mask. There are no title checks, fixed mip levels, sampler overrides, or diagnostic environment switches in this change.
The mask semantics follow the AMD RDNA 2 ISA, section 12.3,
S_MOV_B64andS_WQM_B32/B64, printed page 111. Vulkan permits helper invocations to be inactive for non-quad subgroup operations; see Helper Invocations. Console hardware was not measured.Tested
Windows 11 Pro build 26200, GCC 15.2 Release, AMD Radeon RX 6700 XT, AMD Vulkan 26.8.1 / Windows display driver 32.0.21045.5002.
maind92a8dad3: the first case fails with 983 incorrectly sampled pixels. Restoring only this EXEC correction makes all 12 cases pass. The branch was then rebased ontodb81992c5, whose intervening changes add optional draw-program tracing, and the library build and eight tests were rerun.d92a8dad3plus only the EXEC correction, with the shader disk cache disabled and all rendering overrides removed. It ran for 215 seconds and exited normally with code 0. No FPS or audio improvement is claimed.Before and after screenshots
Original screenshots supplied by the tester. The after images show the EXEC correction with normal automatic mip selection.
Original PNGs and screenshot provenance. Camera positions and UI state differ; these images document rendering correctness.
Checklist
main; no other open PR implements the same functionsImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T09:27:10Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceAgcDriver/CMakeLists.txtL1860core/libs/prx/libSceAgcDriver/CMakeLists.txtL1860core/libs/prx/libSceAgcDriver/CMakeLists.txtL1860docs/dev/debt/shader.mdL80Some 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.
core/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/shader.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/shader.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/shader.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/shader.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/shader.mddocs/dev/debt/shader.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/shader.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/shader.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/shader.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/shader.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/shader.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/shader.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/shader.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/shader.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/shader.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/shader.mddocs/dev/debt/shader.mddocs/dev/debt/shader.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtImported from boykopovar/AnyPS5. Originally posted by zaryabzip on 2026-10-15T11:49:15Z.
NVIDIA and Intel run, for the "Linux, other GPU vendors, and a full CTest-suite run were not tested locally." line. Windows 11 (26200), RTX 3060 Laptop GPU (NVIDIA 617.42) and Intel UHD Graphics (device 0x9a60), WinLibs GCC 15.2.0 r7 (UCRT), Release,
BUILD_TESTING=ON. Head27b196beemerged ontomain8856f180c(clean); the GPU was picked withANYPS5_GPU, and the verbose test logs show the selected device.agc_driver_pixel_implicit_derivativeswith the PR: passes on both GPUs,incorrect=0in all 12 cases.ExecMask.cppfrommainand the PR's test:emulate0 wave64 mip0 covered=7817 incorrect=983, thenAGC graphics: implicit derivatives selected the wrong mip at 983 pixels.incorrect=0in all 12 cases. The test does not detect the old behaviour on this NVIDIA GPU.ctest -R "agc|shader|guest_memory|write_watch" -j4on the RTX 3060: 592/592 pass with the PR, and 591/591 onmain(the new test is the difference). Both skip the same 3 tests (agc_host_import_sparse,agc_driver_sparse_dma_buf_import,agc_driver_stencil_ref_export).Not run: OlliOlli World, Linux, the suite on the Intel GPU.
AI-assisted: yes (Claude Code)