fix(agc): ignore a stencil clear on a target without a stencil plane #8099
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8099"
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 LuisAguilarDev on 2026-10-19T21:36:57Z.
What
Dragon Ball Xenoverse 2 (PPSA08587) stops at its first frames:
The draw clears depth and stencil together on a depth-only D16 target:
DB_RENDER_CONTROL0x00000003DEPTH_CLEAR_ENABLEandSTENCIL_CLEAR_ENABLEDB_DEPTH_VIEW0x00000000DB_Z_INFO0xa0000181Z_16DB_STENCIL_INFO0x20000180STENCIL_INVALID, no stencil planedecodeDepthandDrawRejectioninState.cpprefuse a stencil clear when the stencil plane is absent or read-only. A target without a stencil plane has no storage for the clear to write, so the stencil clear is now dropped there; the depth clear and colour writes proceed. A stencil clear on a read-only stencil plane still throws. The skip for draws with no depth surface bound (depthPlanesAbsent) is unchanged; it does not cover this case, because the depth plane is present.Sources (inferred, no source states the hardware behaviour):
gfx9RsrcProcMgr.cppbuilds the clear mask from the image's planes, so it never setsSTENCIL_CLEAR_ENABLEon a depth-only image.si_clear.cdropsPIPE_CLEAR_STENCILwhen the format has no stencil.vk_rasterizer.cppapplies the stencil clear only whenStencilValid(), which is false for an invalid stencil format.The console was not measured; this is recorded under Functional in
docs/dev/debt/libSceAgcDriver.md.Tested
agc_driver_graphicspasses in 7.5 s. The test that asserted the rejection of a stencil clear without a stencil plane now expects the depth clear alone and an empty precheck; without theState.cppchange it fails withstencil clear requires a writable stencil plane.agc_driver_bda_device(#7584) andagc_driver_image_table_reuse(#7710) fail the same way with and without this change.tools/check_conventions.py --base upstream/mainandgit diff --checkpass.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)🤖 Generated with Claude Code
Replaces #7720, which GitHub does not allow to reopen after the open PR limit closed it. Same branch and commit; the discussion is there.
Imported from boykopovar/AnyPS5. Originally posted by slick-daddy on 2026-10-19T22:14:23Z.
Rebase please.
Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-20T02:37:53Z.
Another title needs the same rule. Trivial Pursuit Live! (CUSA03312, Hasbro Family Fun Pack, PS4) stops at character selection on the PS4 path of #6977 with
AGC graphics: stencil clear requires a writable stencil plane. Its Unity clear sets both clear bits on aZ_32_FLOATdepth target whoseDB_STENCIL_INFOformat is invalid.I had written the same change before I found this PR: drop the clear in
decodeDepthandDrawRejectionwhen there is no stencil plane, and keep the read-only throw. I'm not opening a second PR. With the rule applied to the PS4 build, the title gets past that screen and renders the selected character.On Windows 11 (WinLibs GCC 15.2),
agc_driver_graphicspasses onmainand with the rule, on an RX 9070 XT and a UHD 770, underVK_LAYER_KHRONOS_validationwith noVUID-lines. That run used my copy of the change, not this branch.Imported from boykopovar/AnyPS5. Originally posted by TheSovietWaffle on 2026-10-20T07:40:30Z.
AMD data point: RTX 3080 (NVIDIA 617.42) and AMD Radeon RDNA 2 iGPU (
1002:164e, 32.0.21045.5002), Windows 10 Pro 22H2, WinLibs GCC 15.2.0, Release, head342252f52:agc_driver_graphicspasses 3 of 3 on both GPUs. (The head is about 1,240 commits behind currentmain; I tested it as is, not rebased.)AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-20T07:52:33Z.
Rebase handoff — rebased onto current
main(3fd1cc393, authorship unchanged). One debt-entry conflict withmain's newer "Color export type" entry, unioned (both entries kept).Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, AMD RX 9070 XT / RADV): builds; 1672/1675 — green apart from the three knownmainfailures (#7584 BDA, #7784 guest-memory, tessellation), none from this PR; conventions pass.To pick it up:
Head is
ecc8a5029.