feat(agc-driver): blend into COLOR_8_8 SWAP_ALT targets with a separate alpha equation #3194
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3194"
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 XairRrR on 2026-10-11T00:52:10Z.
What
#2916 added
COLOR_8_8targets withCB_COLOR_INFO.COMP_SWAP1 (SWAP_ALT), but blending into them still throws. PPSA05684 stops in its first level on such a draw: its color blendSRC_ALPHA, ONE_MINUS_SRC_ALPHA, ADDdiffers from its alpha blendONE, ONE_MINUS_SRC_ALPHA, ADD.SWAP_ALT on a two-channel format keeps the x export in the first channel and the alpha export in the second (Mesa
si_translate_colorswap, "X__Y"; radeonsi uses it for the luminance-alpha formats, whose second channel is alpha). The color block blends that second channel with the alpha equation.Changes:
Same equation for color and alpha: the draw blends as before, in one pass.
Separate alpha equation: the pipeline draws twice.
The split throws for:
Those draws would run twice.
Factors of the destination alpha throw (
DST_ALPHA,ONE_MINUS_DST_ALPHA,SRC_ALPHA_SATURATE), since the target keeps that alpha in its second channel.Split pipelines don't use pipeline libraries.
Tests:
tests/execution/SwapAltBlend.cppdraws into an 8_8 SWAP_ALT target over known destinations and checks every pixel: three separate-alpha cases (including a reverse-subtract alpha) and one shared equation. Without the second pass the second channel reads 63 where 127.5 is expected.tests/Graphics.cpp(ReversedComponentOrderTests) checks the decode and the split decision.Tested
BUILD_TESTING=ON.f1ae427b: 751/752; the one failure,agc_driver_dcc_keys_first_write, fails the same way on plain main. Conventions check passed.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)Imported from boykopovar/AnyPS5. Originally posted by Silverash-i8 on 2026-10-11T01:35:10Z.
Windows run, since the PR has no Windows results yet: Windows 11, WinLibs GCC 15.2.0 r7, Release, merged onto
maind31b57a4in one build with #3039, #3134, #3175 and #3194, on an RTX 5060 Laptop and the Arrow Lake iGPU (ANYPS5_GPU=Intel).agc_driver_swap_alt_blendandagc_driver_graphicspass on both GPUs.Across all
agc_*tests in that build, the only new failure on either GPU isagc_driver_flat_store, which comes from #3175 alone (reported there). The Intel failures besides it are the known ones from #2114 and #3207.AI-assisted (Claude Code); I ran this on my machine.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T05:05:43Z.
Two things before this is tested:
CONSTANT_COLORandONE_MINUS_CONSTANT_COLORneed a throw next to the destination-alpha factors (State.cpp:751). The second channel holds the guest's alpha, but Vulkan applies blend constant G to it instead of A. That affects the shared-equation pass and the alpha factors moved into the color equation (Pipeline.cpp:391-392).fragmentWritesMemory(Pipeline.cpp:131) only checks the pixel stage, but the second pass runs the earlier stages again too. A vertex or geometry stage that writes memory needs the same throw.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T07:13:47Z.
Checked on RADV:
agc_driver_swap_alt_blendandagc_driver_graphicspass on the PR merged onto main (full AgcDriver ctest scope green after the rebase), the new tests don't build without the change, and the Windows run by @Silverash-i8 covers NVIDIA and Intel.Added as a commit on your branch:
docs/dev/TechnicalDebt.md("Functional", next to per-face depth bias): the second pass runs the vertex stages again and occlusion counts include both passes; the second-channel/alpha-equation mapping comes from Mesa, not measured on hardware.docs/dev/ARCHITECTURE.md: split pipelines are created whole, without pipeline libraries.Merging once CI is green.