fix(agc): read blend constant registers only for active channels #21241
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/21241"
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 birdmarty on 2026-11-16T01:21:26Z.
What
DecodeStatepreviously calledreadFloat(cx, 0x105 + i)on all fourCB_BLEND0..3registers (DWORD 261..264) whenever color blending was enabled, causingAGC graphics: non-finite register at DWORD 261if a draw left staleNaN/Infbits in blend constant registers it did not use (for example when blending did not use constant factors, usedMIN/MAX, or masked off those channels).translateReversedBlendWithso reversed-order target decoding reads0x105 + componentonly for constant-factor channels that are actually needed, while keepingTranslateReversedBlendunchanged.DecodeState(and deduplicatedrecordBlendConstant) so0x105..0x108are only read for unmasked written channels whose active blend factor and blend operation actually consume those constants, leaving unused channels zero-initialized.Color565TargetTestsandReversedComponentOrderBlendTestscoveringNaN/Infin unusedCB_BLENDregisters as well as rejection when an active constant channel is non-finite.Tested
10.0.26300), AMD Radeon RX 6800 (AMD proprietary driver26.10.1/32.0.21045.16010):PPSA01870,01.000.013): Before the change, crashed during presentation with[gpu] driver failure: AGC graphics: non-finite register at DWORD 261/FATAL: abort() (SIGABRT). With theState.cppfix inlibSceAgcDriver.prx, a178.879 srun presented7367frames (43.167 fpsavg,firstPresentat7.830 s), compiled3489shaders (0failed,984cache hits), and exited cleanly on window close.ctestcomparison (origin/maind31916ed37vs. branch) withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LOADER_DEBUG=layer:ctest --test-dir build -R "^(agc_driver_graphics|agc_driver_reversed_order_blend)$" -Vorigin/main:2/2passed (agc_driver_reversed_order_blend1.80 sec,agc_driver_graphics19.45 sec),Insert instance layer "VK_LAYER_KHRONOS_validation"confirmed,0was not found,0VUID-errors.2/2passed (agc_driver_reversed_order_blend1.20 sec,agc_driver_graphics20.18 sec),Insert instance layer "VK_LAYER_KHRONOS_validation"confirmed,0was not found,0VUID-errors.python tools/check_conventions.py --base origin/main: passed.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 MarcZX10 on 2026-11-16T02:28:30Z.
Review: APPROVED
Reviewed — looks good
The changed blend decoding and its regression cases are supported by the inspected code; the review is complete, but the reported test runs were not independently rerun here.
What I ran
Read the prepared diff at head
9d5df0a28fe29ecd2dab27aa6fbf95c6771cb6d3and inspected the changed decode logic and regression cases throughrepo_read.py. No tests or build commands were run. The author-reported test results are not independent runs.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The full
Graphics.cppfile was excluded from the review folder, but the changed test ranges were read throughrepo_read.py. Other parts of that test file were not read. Tests, builds, Vulkan validation, and the reported Far Cry 6 run were not independently verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T02:42:47Z.
Review: COMMENTED
Reviewed — no blocking findings
The changed blend decoding and regression tests appear sound at head
915b83cbe07c62a915d2e8b0fbf7f04e6eeeff3b; no checks were run during this review, and the reported hardware and CI runs are author-supplied.What I ran
Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
ctestcomparison, and conventions check in the description are author-reported and were not run here.To get this to a good state
Nothing is required.