fix(agc): handle the fill kernel that reads its pattern from a buffer #4465
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4465"
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 mrzacarias on 2026-10-12T12:35:03Z.
What
The fill HLE knows the 16-byte fill kernel that takes its pattern from the user SGPRs s[4:7]. Some titles use a variant that loads the pattern with
s_buffer_load_dwordx4through the V# in s[4:7] instead:That variant ran as a shader, so a uniform fill over an HTILE was never seen as a depth fast clear. Vampire Crawlers clears its 1080p UI canvas HTILE this way every frame. The depth surface kept old depth, every UI draw (reverse-Z,
GEQUAL) failed its depth test, and the screen stayed black while the 3D scene rendered into its own target.matchesFillKernelnow accepts the variant, andfillBufferreads the 16-byte pattern from the V# base address, so the existing HTILE and DCC key handling applies. The descriptor's size and stride are not checked.depth_fast_clear_submitgets a case that fills with the buffer pattern 0xffffffff (no clear) and 0 (clear).Context: https://github.com/boykopovar/AnyPS5/issues/1#issuecomment-6114613325
Tested
macOS arm64 (M1 Pro, MoltenVK), on
mainplus a local macOS arm64 port, FEXCore runner. Vampire Crawlers: black screen before, renders and plays after.depth_fast_clear_submit: the new case fails without the fix and passes with it.agc_driver_graphics_tests,dword_pattern_fill,pattern_buffer_fill,fill_cover_keys,vertex_fetchpass. Linux and Windows not tested.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 kr4y4 on 2026-10-12T16:09:34Z.
Windows run, since the description lists Linux and Windows as not tested.
Setup: Windows 11 (26200), WinLibs GCC 15.2.0 r7, Release, CI configure flags, an RTX 4070 Laptop GPU and an Intel Raptor Lake-S iGPU. The head
3bc3e35a0merged intomain2a5eca11c.agc_driver_depth_fast_clear_submit,depth_fast_clear,dword_pattern_fill,pattern_buffer_fill,fill_cover_keys,vertex_fetchandgraphicspass on both GPUs with--repeat until-fail:3.depth fast clear submit tests passed, not thewithout the compute fillline.main'sBufferFill.cppand the new test,agc_driver_depth_fast_clear_submitfails on both GPUs:a compute fill with the buffer pattern 0 over the HTILE did not clear the depth to DB_DEPTH_CLEAR (1.0).ctest --timeout 120 --parallel 4): 973 of 973 on the RTX 4070. On the iGPU 972 of 973; the one failure,agc_driver_f32_dot2_rounding, fails the same way onmain(noshaderFloat64, #4528).Written with AI assistance.