feat(agc): emulate undithered alpha-to-coverage #3228
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3228"
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 GustavoGamarra95 on 2026-10-11T02:08:28Z.
What
God of War Sons of Sparta (PPSA28997) stopped a few minutes into play with
alpha-to-coverage is unsupported (register 0x2dc = 0x0000aa01).DB_ALPHA_TO_MASK = 0xaa01is accepted: the enable bit with the four quad offsets at 2 and noOFFSET_ROUND, the undithered setting radeonsi programs. The following still throw:OFFSET_ROUND;alphaToCoverageflag. Such a variant declaresSampleMaskand starts with every sample covered. At its MRT0 export it writes 0 when the alpha is below one half or NaN, and all ones otherwise. It runs with late fragment tests. The shader keeps running after the export, so later stores still happen, as they do with a zero coverage mask on the GPU.CacheKey) and of the request serialization, now version 16.alphaToCoverageEnableis not used: the NVIDIA driver 615.78.08 dithers single-sample coverage. An alpha of 0.25 writes half the pixels of an RTX 3050 Laptop target.Tested
RADV_DEBUG=noatocdithering, which programsDB_ALPHA_TO_MASK = 0xaa01. I compared the GPU's own Vulkan alpha-to-coverage with this emulation for 16 alpha values: 0, -0, 0.25, the two floats below one half, one half, the two floats above it, 0.75, 1, 2, -1, both infinities and both NaNs. All 16 matched on the 660M, and the emulation gave the same result on the RTX 3050. The rows are pinned intests/execution/AlphaToCoverage.cpp. They are not measured on gfx1013, asTechnicalDebt.mdsays.maind31b57a4:ctest752/753 passed on the RTX 3050. The failure isagc_driver_dcc_keys_first_write, which fails onmainon this GPU too. Each commit builds and passes the tests it touches (agc_shader_memory,agc_driver_graphics,agc_driver_dual_source_blend).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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T02:08:43Z.
Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T05:30:23Z.
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/Graphics/src/State.cppL600-602, L989-991Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-11T06:28:41Z.
Windows run, since the PR has only Linux results. Windows 11 (10.0.26200), WinLibs GCC 15.2.0 r7, Release, NVIDIA RTX 4070 Laptop GPU (driver 616.92), head
50e84c7cmerged onto currentmain, withVK_LOADER_DRIVERS_DISABLE=*dzn*(this machine's Dozen ICD crashes on its own, #3255).nodiscardones inAttributeInstructions.cppandtests/Graphics.cppthatmainalready has; the header changes just cause those files to recompile.agc_driver_alpha_to_coverage(the pinned 16-value rows),agc_shader_memory,agc_driver_graphicsandagc_driver_dual_source_blendpass.ctest -R "^agc_|video_out|^shader|recompiler": 358/358 pass.agc_driver_dcc_keys_first_write, which fails on your RTX 3050, passes on this GPU both with and without the change.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T07:22:19Z.
Checked on current main: scoped build and ctest (
agc_driver_graphics,agc_shader_memory,agc_driver_prepared_graphics,agc_driver_alpha_to_coverage) pass. I also swapped the emulation for Vulkan'salphaToCoverageEnableon RADV (Radeon 660M,RADV_DEBUG=noatocdithering) and the new test passes all rows, so the 0.5/NaN rule matches the hardware path; with dithering on it differs, as the description says.Notes, not blocking:
Merging.