feat(agc): implement dual-source blending from the MRT1 export #1492
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1492"
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 Celegans12 on 2026-10-08T09:08:46Z.
What
Blend factors 15–18 currently throw. This maps them to
VK_BLEND_FACTOR_SRC1_*, using the pixel shader's MRT1 export as MRT0's second source. The factor encodings follow Mesa's gfx103 register definitions.Accepted draws export slots 0 and 1, write only slot 0, use matching export formats and shader masks, identity component order, and ADD, SUBTRACT or REVERSE_SUBTRACT. Other layouts and MIN/MAX still throw; the remaining restrictions are recorded in TechnicalDebt.
Registered pixel shaders remain generic. Draw specialization places MRT1 at
Location 0, Index 1; pipelines requiredualSrcBlend, enabled when available. The flag participates in draw and materialization keys. Request version 15 follows main's packed-export version 14; older requests default the flag to false. Cache format 23 and runtime ABI 11 are unchanged.An earlier PPSA26344 v1.008 capture uses
ONE + SRC1_COLORwith FP16 MRT0/MRT1 exports into an RGBA16F target. This restack contains only dual-source changes now that #1485 has merged.Tested
mainf6af6d11. Current headb8cc4adbresolves only the TechnicalDebt conflict; all 599 added/removed topic lines are unchanged. Source reviews, conventions and whitespace checks pass. This head has not been rebuilt or retested.f97c1009, tested as merge0f3c7b5cwith frozen main092e133e, on Windows 11, MinGW-w64 GCC 15.2.0, RTX 3080 Laptop,-DBUILD_TESTING=ON: configure, five-target build, registration and 5/5 CTests pass; zero skips, 14.42 s.agc_driver_dual_source_blend),DualSourceBlendTestsinagc_driver_graphics, request compatibility inagc_shader_memory, packed-UNORM color targets and UINT16 exports.f1451396: Windows 490/490, Linux/llvmpipe 499/499. Not tested for this rebase: a fresh full suite, Linux, game execution or console behavior.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 yahya308 on 2026-10-08T15:28:54Z.
Tested on top of main
9e2ffe0d, Windows 11, MinGW-w64 GCC 16.2.0, full ctest withANYPS5_REQUIRE_VULKAN=1 --repeat until-fail:3, NVIDIA RTX 4070 Laptop (32.0.16.1074) and AMD Radeon 780M (32.0.31041.1004).vopc_compare_tablefails on the 780M on main too (#825, #1473).Head
67d4c898, with #1485 underneath: NVIDIA 459/459, 780M 458/459. The newdual_source_blendandpacked_unorm_color_targettests ran and passed on both.AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T00:02:28Z.
Review: CHANGES_REQUESTED
Thanks. This is stacked on #1485, which isn't merged yet, so this branch still carries its commit (
d41f24f29) and can't land as is. It also conflicts withmainincore/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp(the color-export validation changed with #1073/#1074).ShaderValidation.cppconflict.agc_driver_dual_source_blend,DualSourceBlendTests,agc_shader_memory) and update the request-version number ifmainor a merged PR took it meanwhile.I haven't reviewed the code itself yet; it'll be reviewed once the diff is just this change.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T09:01:13Z.
Review: APPROVED
Checked on current
main: build + ctest of libSceAgcDriver/libSceAgc green,agc_driver_dual_source_blendruns on RADV and on CI's lavapipe, the new tests don't compile without the change, blend factors 15-18 match Mesa's gfx103 encodings, unmodelled layouts and MIN/MAX still throw and the assumption is in TechnicalDebt. Windows runs by @yahya308 on NVIDIA and AMD also pass. Merging once the full Linux/Windows build is green.