Repository navigation
fix(agc): compare the depth write base only when the depth plane is written - #6725
Conversation
…ritten decodeDepth required DB_Z_WRITE_BASE to equal DB_Z_READ_BASE whenever the depth plane was not read-only, also for draws that never write it. PPSA31327 01.015.000 stops there on a stencil-only draw: DB_DEPTH_CONTROL 0x00000701 (Z_ENABLE and Z_WRITE_ENABLE clear), DB_RENDER_CONTROL 0, DB_DEPTH_VIEW 0, Z read base 0xed11340000 and Z write base 0, with equal stencil read and write bases. The bases are now compared only when the depth plane can be written: a depth clear, a draw with both Z_ENABLE and Z_WRITE_ENABLE (the condition that sets depthWrite), or an expand pass with DEPTH_COMPRESS_DISABLE or STENCIL_COMPRESS_DISABLE in DB_RENDER_CONTROL, which still throws. The surface keeps the read base. The stencil check is unchanged. DepthStencilTests accepts a stencil-only draw, Z_WRITE_ENABLE without Z_ENABLE and a depth test without writes at another write base, and still rejects a written plane, a depth clear and the compress-disable bits there.
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Intel and AMD Windows data: no failures from this change. Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built,
Full CTest ( AI-assisted: yes (Claude Code) |
|
Thanks @savvaniss for the Intel and AMD runs. @EagleBearerYS the overlap comment lists #6146 on the same lines of As #6725 is a two-line change, I suggest it goes first; on your side the conflict resolves by using its condition in the Manual check of the PRs the overlap comment could not compare: #1395 also edits this |
|
@oneandonlydean, could you take a look when you have time? |
|
Checked |
What
decodeDepthrequiredDB_Z_WRITE_BASEto equalDB_Z_READ_BASEwhenever the depth plane was not read-only, also for draws that never write it. Yakuza 0 Director's Cut (PPSA31327, 01.015.000) stops on such a draw:A local diagnostic build (not part of this PR) printed the draw's registers:
DB_DEPTH_CONTROL0x00000701(stencil test only:Z_ENABLEandZ_WRITE_ENABLEclear)DB_RENDER_CONTROL0DB_DEPTH_VIEW00xed11340000/00xed14280000/0xed14280000DB_Z_INFO/DB_STENCIL_INFO0xa2900983/0x20000181DB_DEPTH_SIZE_XY0x0a1f11ff(4608x2592)The bases are now compared only when the depth plane can be written: a depth clear, a draw with both
Z_ENABLEandZ_WRITE_ENABLE(the condition that setsdepthWrite), or an expand pass withDEPTH_COMPRESS_DISABLEorSTENCIL_COMPRESS_DISABLEinDB_RENDER_CONTROL, which still throws. The surface keeps the read base. The stencil check is unchanged.Overlap: #6146 moves this check into its reworked
decodeDepthand runs out-of-place expands (DB_RENDER_CONTROL & 0x60) from the draw precheck. It keeps the strict comparison for every other draw, so it does not pass this one (DB_RENDER_CONTROL0). The behaviours are independent; I will rebase onto #6146 if it lands first.Tested
Windows 11 Pro 26200, WinLibs GCC 15.2.0 (ucrt, posix, seh, r7), NVIDIA GeForce RTX 4070 (driver 617.42).
agc_driver_graphics:DepthStencilTestsaccepts a stencil-only draw,Z_WRITE_ENABLEwithoutZ_ENABLEand a depth test without writes at another write base (depth not written, surface at the read base), and still rejects a written plane, a depth clear andDB_RENDER_CONTROL0x20, 0x40 and 0x60 there.agc_driver_depth_*(12),agc_driver_native_depth_*(3),agc_driver_native_multisample_depth,agc_driver_pipeline_optimized_readback_d16/d32(4),agc_driver_readonly_resummarize,agc_driver_sample_mask_depth_stencil,agc_driver_stencil_ref_export_unused,agc_driver_stencil_replay,agc_driver_stencil_replay_no_gpl,agc_driver_graphics);agc_driver_stencil_ref_exportskipped, the device lacksVK_EXT_shader_stencil_export.CMASK fast clears of a mipmapped, 3D or array color target are unsupported. Reaching the menus also needs the local changes listed in the bring-up discussion.tools/check_conventions.py --base origin/mainpasses.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)