Repository navigation
fix(agc): retire an unwritten native multisample depth surface on guest access - #6727
Conversation
|
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.
|
…HTILE clears Guest titles (e.g. Sonic Superstars) render into a native multisampled colour target and then reuse that guest memory for something else while the driver still guards it as a resident target; every such access aborted and closed the title as soon as a level began. Drop a reused multisampled colour guard instead of throwing (issue boykopovar#5933). Supporting fixes that fall out of the same depth paths: - Honour a guest HTILE fast clear the driver has no producer note for when the whole HTILE proves the surface's clear value and neither the depth nor the stencil plane changed, instead of aborting. - Retire a depth surface only over the bytes its plane actually stores. The tiled footprint rounds the plane up to whole 128x128 blocks, so a neighbouring allocation could land in the padding and wrongly retire a surface it never reused. - Accept a stencil plane whose clear state is in the raw plane when HTILE stencil metadata is disabled, and accept a clear-proven HTILE without ITERATE_256 or pipe alignment. A guest read over a resident native multisample depth guard is not retired: it keeps refusing ("sample-preserving guest publication of native multisample depth is not implemented"), matching the contract of boykopovar#6727 for an unwritten surface, until sample-preserving publication of the depth, stencil and HTILE planes to guest memory exists. The read-site classification, whole-fill HTILE note and exact-plane overlap work are intended to be rebased onto boykopovar#6727 once it lands. Tests: agc_driver_native_multisample_depth, agc_driver_depth_fast_clear and agc_driver_depth_surface_last_writer exercise the new paths; the full agc_driver suite stays at its pre-existing pass rate.
74413ec to
0e4eccd
Compare
0e4eccd to
c72a102
Compare
c72a102 to
f2eb6a7
Compare
|
Thanks. The first commit on this branch (the ITERATE_256 HTILE import) is already on |
f47436b to
8328c2f
Compare
|
@oneandonlydean rebased onto current
Tested on Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release,
AI-assisted: yes |
|
@simonbronk Thanks for the rebase. The conflict resolution against 84e3b73 looks right (both call sites keep
|
…st access A guest read over the depth or HTILE range of a native multisample depth surface threw even when the host had not written the surface since its import. Its samples are then still the clear value the import took from the guest HTILE, so the guest bytes already describe it. Retire such a surface and its guards instead, and keep the refusal for a surface the host wrote: draws with depth or stencil writes, depth/stencil copies and storage write-back. Onimusha: Way of the Sword (PPSA27836) imports a 4-sample D32 target, draws into it once with depth tests only and no color target, then reads the memory back as a structured buffer in a compute dispatch. Unblocks PPSA27836. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@oneandonlydean both done, on a rebase onto
Tested: only partly, and I'd ask you to run the full CI on this head.
AI-assisted: yes |
8328c2f to
bf0806e
Compare
|
@simonbronk a merge-order note: #9533, with #9717 and #9742 stacked on it, passes the draw's |
What
Part of #6570. A guest read over the depth or HTILE range of a resident native multisample depth surface throws
sample-preserving guest publication of native multisample depth is not implemented. That includes a surface the host never wrote after its import. In that case its samples are still the clear value the import took from the guest HTILE, so the guest bytes already describe the surface and nothing needs publishing.Each native depth surface now records whether the host wrote it after the import. These count as host writes:
NoteDepthSurfaceWrite, called fromDraw.cpp);CopyAspectFrom);Host clears that follow a proven guest HTILE clear do not count: they keep the host equal to what the guest memory describes.
RequireNoResidentDepthRead_nid_no_patchretires an unwritten surface instead of throwing: it clears the surface'sactiveflag and removes its guards. A later bind imports it again from the guest memory.A surface the host wrote still throws the same refusal. Publishing it needs the layout and readback foundations in feat(agc): add fragment-preserving R_X and Z_X layouts #6588 and feat(agc): read individual multisample image samples #6601 and stays the follow-up in AGC: compute buffer read of a native 4-sample D32 depth target needs sample-preserving publication (Onimusha: Way of the Sword, PPSA27836) #6570.
The debt entry says what counts as a host write, and that a draw without depth or stencil writes leaving the console's Z planes and HTILE unchanged is inferred, not measured.
This depends on #6557 (its commit is the first one here). Both edit the same debt entry, and the title needs both.
The title's case, measured with local prints:
ITERATE_256).GREATER_OR_EQUALdepth tests, no depth or stencil writes and no color target.buffer_load_dwordx4withidxen, 96-byte records) and stores into it.Details are in #6570.
Tested
Windows 11 Pro 26200, Onimusha: Way of the Sword (PPSA27836),
APS5_NO_HOST_IMPORT=1(AGC: VK_ERROR_DEVICE_LOST (read invalid) on the first scene load only with host imports (Onimusha: Way of the Sword, PPSA27836, NVIDIA) #6374). The build wasmain5d9dcc4 + feat(agc): rasterize a multisampled draw into one-sample targets at sample 0's locations #5907 + feat(agc): draw line-strip output of NGG geometry programs as mesh lines #5884 + fix(agc): rasterize a single-sample scan into a multisampled depth target at the pixel center #5915 + fix(agc): import native multisample depth whose HTILE is not ITERATE_256 #6557 + this PR.main4eb91ea.depth export, shader coverage or ordered fragment execution is unsupported (register 0x203 = 0x00000045)(DB_SHADER_CONTROL).agc_driver_native_multisample_depthhas a new case per format and sample count: D16 and D32 at 2, 4 and 8 samples, 6 cases on each GPU. Each case checks that:The existing cases now note a host write before their refusal checks, since they rasterize into the surface directly. With retirement replaced by the old refusal, the new case fails.
ctest -R "agc|shader|video_out" -j 8on both GPUs:agc_driver_gpu_indirect_arguments_misaligned_writer_ahead(frommain) does not build with WinLibs GCC (test(agc): align the indirect arguments block at run time #6452).python tools/check_conventions.py --base upstream/main: passed.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)🤖 Generated with Claude Code