Files
AnyPS5/docs/dev
Yunus Shaikh 439557b223 fix(agc): sample native multisample depth without metadata only after an in-place expand
5be005ea1 let a descriptor with no metadata (META_DATA_ADDRESS 0, not
pipe-aligned) sample a native multisample depth target from its
decompressed host image, assuming the guest had expanded the plane. On
hardware such a read sees decompressed depth only after an in-place
expand, a draw with DB_RENDER_CONTROL DEPTH_COMPRESS_DISABLE (bit 6)
and STENCIL_COMPRESS_DISABLE (bit 5) set, as radeonsi's in-place
decompress sets them.

DecodeDepthRenderControl reads DB_RENDER_CONTROL, DB_Z_INFO's format and
sample count and DB_Z_READ_BASE for a draw with clear or compress-disable
bits. The draw precheck hands it to NoteDepthRenderControl before the
draw is dropped as drawing nothing (an expand draw has no depth test and
no colour writes), draining the draw pipeline first for an expand, or
for a clear over an existing depth surface. A draw over the target with
the depth bit, and the stencil bit when the target has a stencil plane,
marks the surface expanded; a clear draw, an HTILE clear or fill
(NoteHtileDepthClear, NoteDepthMetadataFill, a cleared HTILE at
DepthSurfaceView) and a plane fill clear the mark. CheckResource takes a
descriptor without metadata only while the surface is marked, and
otherwise refuses with "native multisample depth sampled metadata or XOR
mismatch", printing the last DB_RENDER_CONTROL seen at most eight times.

Tested: agc_driver_native_depth_expand_gate, for D32 and D32S8 with a
separate stencil plane: a bare sample before any expand is refused, and
after only the depth bit on D32S8; after the expand draw it gets the
cleared and then the drawn depth; an HTILE fill, a clear draw and a
plane fill (an HTILE mask clear on D32) each refuse it again until the
next expand. The separate-stencil test now draws an expand before its
bare sample. With the gate reverted the first bare sample is accepted
(1 of 1); with it the mode passes 5 of 5.
2026-10-22 02:34:45 +00:00
..