feat(agc-driver): draw DB_RENDER_CONTROL depth clears #2219
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2219"
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-09T11:55:12Z.
What
Uncharted: Legacy of Thieves Collection (PPSA05684) clears depth and stencil with draws that set
DB_RENDER_CONTROLto 0x3 and stops onmainwith:#1534 handles
STENCIL_CLEAR_ENABLE; this addsDEPTH_CLEAR_ENABLE(bit 0, Mesasid.h) on top of it, as suggested in #1479.DB_DEPTH_CLEAR. It therefore writes the clear value exactly where the title's geometry covers; nothing is inferred from viewport or scissor state (the blocker #1395 describes).tests/Graphics.cpp(DepthStencilTests): depth clear state, read-only plane, combined 0x3 clear; the old expectation that bit 0 throws is replaced.The first two commits are #1534's.
Tested
Arch Linux, GCC 16.2.1, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.71.09).
main(d70b8998) with #1534:tools/check_conventions.pypasses; of the 513 ctest tests all pass exceptagc_driver_dcc_keys_first_write, which fails the same way onmain, andagc_driver_storage_cache_budget, which passes run alone (a local 3 GB RSS limit stopped it underctest -j8).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 EdouardSence on 2026-10-09T12:31:36Z.
Another title that needs this: Ratchet & Clank: Rift Apart (PPSA01474), on Linux with an RX 9070 XT (RADV).
Base:
main43972e69plus the fixes it needs to get there: #1673, #1339, #1836, #1837, #1893, #2105, #2184, #2226.depth/stencil clear, copy, resummarize or decompress draws (DB_RENDER_CONTROL) is unsupported (register 0x0 = 0x00000001). That is a depth-only clear (DEPTH_CLEAR_ENABLE).TechnicalDebt.mdconflict), the clear draws go through. The next stop is the null pixel program (#1902), then a rect-list draw (#1928), thencolor views of several array slices are unsupported(#2102).No frame is presented yet, so I can't comment on the clear's visual result.
Tested and written by Claude (AI assistant) on a contributor's machine.
Imported from boykopovar/AnyPS5. Originally posted by NahuelGenchi on 2026-10-09T14:47:30Z.
Tested with Sonic Origins (PPSA05324) on Linux, R9 380 (RADV, Mesa 26.0.8). It issues the same clears: first
DB_RENDER_CONTROL0x3, then repeated 0x1, withDB_DEPTH_CLEAR0.0,DB_DEPTH_CONTROL0x777 and no pixel program.On
maind70b8998with this PR, #2022, #1902, #1928, #1837, #425 and #1544, plus local workarounds for #1789, the clears run and the title presents its boot frames, including the SEGA logo. Runs of 6 minutes end on the time limit. I had an equivalent depth half on a branch (mentioned on #1479), but this one also turns off depth bounds and bias, so I'm not opening mine.Bring-up thread: #2021
Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T15:47:13Z.
Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head
d7770574, merged ontomaind70b8998in one build with 38 other PRs that had no Windows run.State.cpp, so it was tested onmainwithout it.agc_driver_graphics. None of them reported skipping a case.No title was run.
🤖 Addressed by Claude Code
Imported from boykopovar/AnyPS5. Originally posted by tv7 on 2026-10-10T01:51:47Z.
Tested on Windows with a second title that stops on the same draw: Marvel's Wolverine (PPSA03671), also
DB_RENDER_CONTROL= 0x3.Setup: Windows 11 Pro (10.0.26200), RTX 3070, GCC 15.2.0 UCRT (WinLibs), Release. This PR (d7770574) merged onto main
54f28f2d3with #1836, #1893, #1709, #1837, #1940, #2022, and a local change that letssceKernelSignalSemaaccept a count of 0. The merge conflicted only indocs/dev/TechnicalDebt.md.Without this PR: the first presentation fails with
depth/stencil clear, copy, resummarize or decompress draws (DB_RENDER_CONTROL) is unsupported (register 0x0 = 0x00000003).With this PR: the clear draws pass. The next stop is a null pixel program static ABI miss (#1901, fixed by #1902).
Limits: one title, one run each way. No frame is presented yet, so I can't confirm the clear values on screen.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T05:18:11Z.
#1534 is in main now, so this needs a rebase onto main (conflicts in
State.cpp,tests/Graphics.cppandTechnicalDebt.md).Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T06:49:13Z.
Rebased onto current
mainnow that #1534 is in. Conflicts were inState.cpp(the viewport line andDrawRejection, wheremaingained the collapsed-viewport path and the depth-bounds/absent-plane rule) andTechnicalDebt.md(adjacency); both sides kept. Scoped build + ctest:agc_driver_graphicsandagc_driver_prepared_graphicspass, andagc_driver_graphicsfails when theState.cpp/TechnicalDebt change is reverted. The unmeasured DB behaviour is recorded in TechnicalDebt. Also confirmed by @popcoder565, @tv7, @EdouardSence and @NahuelGenchi on Windows/Linux titles. Merging the rebase.