Files
AnyPS5/docs/dev
Yunus Shaikh 2d4c1da61d fix(agc): take a stencil plane aliased by a host-only colour target from that target
Ghost of Tsushima Director's Cut (PPSA02225) renders a 2-sample R8
colour target over the memory of a D32S8 target's separate stencil
plane. The native import proved the plane by reading it, and that read
hit the colour target's guard: "a CPU read of ... overlaps multisampled
color target ..., whose samples are only on the host".

MultisampleTarget gains a query that does not throw: the active colour
target whose guarded range overlaps a range, with its format, samples,
footprint and newest content. A pending fill the target absorbed, a
CMASK fast clear, or a clear it recorded with no draw since is a known
uniform value; a draw, a storage write or any refused metadata is not.
The target records its clears and whether it was drawn since.

prepareDepthSampling asks it for the depth, HTILE and stencil plane
ranges before reading guest memory. An R8 UNORM or UINT target with the
depth's sample count over exactly the plane, holding a known value,
gives the plane's initial stencil, which the first host clear uses. Any
other overlap refuses sampling ("native multisample stencil plane
aliases a multisampled colour target whose samples are only on the
host", or the depth or HTILE form) and prints the colour target's
address, format, samples and newest operation, at most eight times.
CheckCurrent runs the same query: a plane fill over an aliased plane is
proven from the colour target's value, not by reading the plane, and a
colour target that drew, changed value or appeared since the last proof
refuses sampling.

Tested: agc_driver_native_depth_aliased_stencil. A 4-sample R8 target
over the plane with an absorbed fill imports and the next stencil test
passes the fill value and not another; a second absorbed fill is proven
and taken; a colour draw after it refuses. The target drawn after its
fill, and an R8G8 target over the plane, refuse with the new reason. The
guest plane keeps its 0xa5 bytes throughout. Two and eight samples, and
another colour sample count, are not available on lavapipe. With the
product change reverted the cleared case throws the guard text above
(1 of 1); with it the mode passes 5 of 5.
2026-10-22 02:25:42 +00:00
..