fix(agc): write a replace blend into a packed color target without blending #7243
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7243"
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 gjonn on 2026-10-17T18:54:37Z.
What
A packed color target (
ColorExportPackingother thanNone: the 10_11_11 unorm target and, since #7207, the 11_11_10 float target) renders through anR32_UINTattachment, which cannot blend, soDecodeStaterefused any enabled blend withblending into a 10_11_11 unorm color target is unsupported(or... an 11_11_10 float color target ...).A blend whose color equation is
ONE * source + ZERO * destination(CB_BLEND_CONTROLwithCOLOR_SRCBLEND = ONE,COLOR_DESTBLEND = ZERO,COLOR_COMB_FCN = ADD) writes the source color unchanged, and a packed target has no alpha channel for the alpha equation to affect, so such a draw is now decoded with blending disabled. Every other blend into a packed target is still refused.On PPSA01317 a draw enables
CB_BLEND_CONTROL 0x60010001on a packed target during boot and the title aborts with the refusal above; with this change it gets past it onmain.unorm10_11_11TargetTests(agc_driver_graphics) now decodes two replace blends (0x40010001, and0x60050001whose alpha equation differs) into a 10_11_11 unorm target and requires blending to be disabled with the packing kept, and still requires an additive blend (0x40010101) and aSRC_ALPHAblend (0x40010005) to be refused.float11_11_10TargetTestslikewise decodes three replace blends (0x40010001,0x60010001as PPSA01317 sets it, and0x60050001) into an 11_11_10 float target and requires blending to be disabled with the packing and the reversed component mapping kept, and still requires0x60010101and0x40010005to be refused. Onmainthe test fails withblending into a 10_11_11 unorm color target is unsupported; it passes with the change.The check sits on the shared packed-target path, so one line covers both packings. Rebased onto
mainafter #7207 merged.Tested
Windows 11, MinGW GCC Release build with
BUILD_TESTING=ON.agc_driver_graphicsfails onmain(with only the test applied) and passes with the change.agc_shader_memory_tests,agc_shader_device_profile_tests,agc_driver_graphics_tests,agc_driver_packed_float_color_target_testsandagc_driver_packed_unorm_color_target_tests(26 tests) passes.python tools/check_conventions.py --base origin/mainpasses;tools/check_test_registration.pyreports no unregistered tests.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)Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-17T20:05:51Z.
Independent hardware run, head
b7fa91320e, Windows 11, MinGW (WinLibs GCC 15.2.0), Release:agc_driver_graphics(incl. the new replace-blend packed-target case),agc_shader_memory,agc_shader_device_profileall pass on NVIDIA RTX 3070 (driver 617.42);agc_driver_graphicsalso passes on Intel UHD 630 (ANYPS5_GPU=UHD, igvk64).Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T23:09:30Z.
#7207 has merged, and this PR builds on the same code. Could you rebase onto current main? We will run full CI on the new head from there.
Imported from boykopovar/AnyPS5. Originally posted by gjonn on 2026-10-17T23:38:13Z.
Rebased onto main
5de7a46e0after #7207. The replace rule (ONE * src + ZERO * dst drawn with blending disabled) now covers 11_11_10 float targets too:float11_11_10TargetTestsdecodes0x40010001,0x60010001and0x60050001into an 11_11_10 float target without blending (packing and component mapping kept) and still refuses0x60010101and0x40010005.agc_driver_graphics,agc_driver_packed_float_color_target,agc_driver_packed_unorm_color_targetand the other ctests on those executables (26) pass;check_conventions.py --base origin/mainandcheck_test_registration.pyare clean.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by frankea on 2026-10-18T02:53:51Z.
RTX 4090 data point on PPSA01317, the title this PR lists under Unblocks. Short version: with the PR, the
blending into an 11_11_10 float color target is unsupportedabort is gone on this GPU too, 3 of 3 runs, and the next stop is the dynamic-mip storage image that #7238 covers. On currentmainitself the title no longer reaches that draw: #7323 (merged today) makes its PS VR2 probe succeed, and it aborts 5 s in onsceHmd2ReprojectionQueryBufferSizeAlign not implemented, so the A/B below is on the lastmainbase that gets to the blend.Setup. Gran Turismo 7 PPSA01317 01.000.001 (base package), Windows 11 (26200), RTX 4090 (NVIDIA 616.92), AMD Ryzen 7 5800X, MinGW-w64 GCC 15.2.0 r7 (UCRT), Release
libstarget only (no tests built).app.exeis the relink frommain31cbb55d7(--windows --registry --module-dir .); onlylibs/is swapped between runs. Two trees:main:mainb39d90bf1+ #71372aa6bfca6+ #7243da158d61f(both merge clean, 9936fd9be). #7175 is left out: it still conflicts withmain(as a cherry-pick only indocs/dev/debt/libSceAgcDriver.md).maine1041f6a5+ #71372aa6bfca6+ #7207 ec28b6be8 + #7175 555b7e824 + #5958 87a9b8d28 (my 10/17 set from D4697) + #7243da158d61fcherry-picked (f76397990; the only conflict is intests/Graphics.cpp, taken from the PR, not compiled here). The same set without #7243 is the control.Both sets carry the
libSceSsl.prxfrom #7319 (1f267559e) in place of the stock one, because the title callssceSslConnectright after its save-data mount and the stock export throws there, before any 11_11_10 draw. No controller, no input, nobody at the keyboard; one-shot interactive task per run, 300 s cap, box otherwise idle.Result on B (the A/B that tests this PR). Without #7243, 3 of 3 runs abort on
AGC graphics: blending into an 11_11_10 float color target is unsupported27 to 45 s after launch (10/17 evening, samelibsset otherwise). With #7243, 3 of 3 runs get past it: the "Sony Interactive Entertainment presents" splash is drawn, then the black loading screen with the GT spinner in the corner, title-bar counter at 50 to 60 FPS (59.94 FPS, 445 to 500 frames presented by the time of the last capture), save data mounted (mount3 ... dir=DRFILEIV ... -> 0x809f0008), threesceNetResolverStartNtoa -> host DNS lookup failed, and then, identically every time:That is the
ResourceMaterializer.cppreject that #7238 raises the slot count for, and gjonn describes the same boot abort on PPSA01317 there; this PR plus #7238 is the next combination to try here. Nothing else new appears in between: nopartial writes of an 11_11_10 float color target, nocolor export formatrefusal, no unsupported primitive, no device loss.blending into an 11_11_10 float color target is unsupportedcompute shader 0x1258d58300: runtime storage image mip capacity exceededmainb39d90bf1+ #7137 + #7243)sceHmd2ReprojectionQueryBufferSizeAlign not implementedResult on A, for the record. On current
mainthe title dies in its module initialisation, on the main thread, before the first draw:libSceHmd2.prx+0x1b70called fromapp.exe+0x952effunderlibSceSysmodule.prx+0x347e. On the 10/17 basessceHmd2InitializereturnedSCE_HMD2_ERROR_UNSUPPORTED_FEATUREand the title skipped its VR path; since #7323sceHmd2InitializeandsceHmd2Opensucceed and the title goes on to query the reprojection buffer sizes, which are stillNotImplemented_nid_no_patch. That is not this PR's problem, but anyone retesting PPSA01317 onmainafter today will hit it first. I will note it on D4697.stderr of run B-3 (warm, box idle) from the second 10 s summary to the abort, per-shader
ShaderRegistrylines removedThe abort block of run A-3 (
mainb39d90bf1+ #7137 + #7243), for comparison:AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by frankea on 2026-10-18T22:50:52Z.
RTX 4090 data point on PPSA01317 for the blend this PR leaves refused. After today's chain on D4697 (this PR + #7254 / #7256 + #5958 + #6815 + #7550 on
main48d61f53b) the title's next stop isblending into an 11_11_10 float color target is unsupported, and a local print at thatRequireshows which equation it is, 3 of 3 runs, always the same:That is
COLOR_SRCBLEND = SRC_ALPHA,COLOR_DESTBLEND = ONE_MINUS_SRC_ALPHA,COLOR_COMB_FCN = ADD, withSEPARATE_ALPHA_BLENDset and the alpha equation identical (SRC_ALPHA,ONE_MINUS_SRC_ALPHA,ADD); in Vulkan termsVK_BLEND_FACTOR_SRC_ALPHA/VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA/VK_BLEND_OP_ADDon both. Full colour write mask, all four components exported, the reversed component mapping0xc6this target carries,CB_COLOR_INFO 0x0004171c. A plain source-over alpha blend, so unlike the0x60010001replace this PR decodes it needs the destination texel and cannot be turned into a write; theR32_UINTattachment the packed path renders through cannot blend it in fixed function. The two ways I can see are a realVK_FORMAT_B10G11R11_UFLOAT_PACK32attachment for draws that blend into such a target (the format is blendable on this GPU, but the packing andROUND_MODEhandling that made #7207 choose a uint attachment would have to be re-checked there), or blending in the fragment shader with a destination read; which one fits the driver's design is yours to call, this is only the measurement.Setup. Gran Turismo 7 PPSA01317 01.000.001 (base package), Windows 11 (26200), RTX 4090 (NVIDIA 616.92), AMD Ryzen 7 5800X, MinGW-w64 GCC 15.2.0 r7 (UCRT), Release
libstarget only.app.exeis the relink frommain31cbb55d7(--windows --registry --module-dir .); onlylibs/is swapped. Tree:main48d61f53b(2026-10-18) + #7256 (with #7254) + #7243da158d61f+ #5958 + #6815 d513fb987 + #7550 de6d94daf (thefieldCount<ImageResource>()assertion set to 40, since #5958 and #7550 each add a field), plus four local environment-gated lines, none of which changes a result: the print above, placed right before theRequire(!state.blendEnable, ...)inDecodeState(State.cpp, after this PR's replace-blend fold), a bypass that makessceHmd2Initializeanswer0x81110016again (currentmainaborts 5 to 12 s in onsceHmd2ReprojectionQueryBufferSizeAlign not implemented, the #7323 regression), a print ofsceSslConnect's return, and a display-buffer print that was off here. No controller, no input, one-shot interactive task per run, 420 s cap, box otherwise idle.Runs. The print fires once per run, immediately before the refusal, and no other blend into a packed target is reported before it (the
0x60010001replace this PR folds does not reach the print, since the fold clearsblendEnablefirst).CB_BLEND0_CONTROL 0x65040504(SRC_ALPHA, ONE_MINUS_SRC_ALPHA, ADD, colour and alpha)blending into an 11_11_10 float color target is unsupportedScreen: the "Sony Interactive Entertainment presents" splash, then a black window, title-bar counter about 1,325 frames and 12 FPS at the abort. Nothing gets further; the equation above is the only thing between this tree and whatever comes next on this box.
One note on timing, since it affects anyone measuring this title: the same tree took 188 s and more than 300 s to reach this draw in earlier runs today. That was host pipeline compilation, not the title: the
pipeline-journalthe runtime loads at start grew from 0 to 321, 519, 673 and 757 pipelines over those runs, and once it held 757 the draw is reached in about 50 s every time. During the long runs the process used close to three cores with no socket activity.stderr of run 3 (warm, box idle) from the save-data mount to the abort, the per-shader
ShaderRegistrylines, thesceKernelOpenmisses and the cache and texture bookkeeping removed, the[shadow]lines collapsed, the[log]lines shortenedAI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by janzezno on 2026-10-20T21:25:11Z.
Linux run on AMD; the Tested section covers Windows only.
Host: Arch Linux, kernel 7.2.11, AMD Radeon RX 7900 GRE (RADV NAVI31), Mesa 26.2.5, GCC 16.2.1, Release,
BUILD_TESTING=ON.mainca74ef217; PR headda158d61fapplied on top.ctest --test-dir build -R '^agc_driver_graphics$' --repeat until-fail:3: 1 of 1 pass, 3 repeats, as onmain. These tests do not open a Vulkan device.ctest -j12: no new failures. The three that fail also fail onmainon this machine:agc_driver_guest_memory_lifetime(#7849),agc_driver_image_array_window_past_layer_limit(#8361) andagc_driver_tessellation(Mesa, #5444).