feat(agc): import cleared native multisample D32S8 targets and whole HTILE fills #6300
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6300"
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 Gashrod1 on 2026-10-15T10:19:48Z.
What
Follow-up to #5554 (merged), offered in https://github.com/boykopovar/AnyPS5/pull/5554#issuecomment-6184204253, with the data of https://github.com/boykopovar/AnyPS5/pull/5554#issuecomment-6181490234. Rebased on
main8dc92ae29; it keeps the HTILE routing check from #5627.#5554 refuses every native multisampled depth target with a stencil plane. DAVE THE DIVER (PPSA19115) has a 2-sample 1920x1080
D32_SFLOAT_S8_UINTtarget with its stencil in HTILE. A fill of 0 then covers that whole HTILE (0x21be48000,0x30000bytes) and the title samples the depth at frame 17. With #5496 and #6297 it stops there (the D32S8 refusal is behind the fill one):D32S8 import. A
D32_SFLOAT_S8_UINTtarget with HTILE stencil (TILE_STENCIL_DISABLEclear) is imported when every HTILE word proves both planes cleared:htileProvesClear, stencil encoding);DB_STENCIL_CLEAR. The host image is already cleared to that value.Each proof has its own refusal. The stencil plane (
MultisampledDepthBytes(extent, 1, samples)) joins the depth and HTILE ranges. It must be accessible and watched, is generation-checked and guarded against guest publication, and must not overlap either of them. A depth-only HTILE (htileStencilfalse) and an unaligned stencil plane are refused. D16S8 is still refused.Whole HTILE fill. A DMA or compute fill covering the whole HTILE of a sampled native target is a clear transition. It is proven at the next sample the way #5554 proves an HTILE mask clear:
StoredAllSince);The clear is then recorded on both planes. This applies to D16 and D32 targets too. A partial fill keeps the old refusal.
Fill still queued on the GPU. A fill the driver records on the GPU (
VulkanDevice::FillBuffer) is often still pending when the title binds or samples the depth in the same frame. The HTILE words in guest memory are then not the fill's yet, and the queued write was refused as "external GPU writes".Recorder::LastWriteNote) and its pattern.NewestWriteNote), the clear is proven from the pattern, not from memory.HTILE mask clear on a stencil target is refused. The mask kernel's effect on the stencil fields is not modeled.
Windows.
GuestMemory::Watchedexcludes host-imported regions there, so the import keeps refusing with "requires watched accessible guest memory" until that memory is owned and tracked. This change does not touch that boundary, and a test pins it for the stencil plane.The native multisampled depth entry in
docs/dev/debt/libSceAgcDriver.mdnow describes the stencil plane and the fill transition.Tested
Linux, Intel Alder Lake-P iGPU (Mesa 26.2.4), on
main8dc92ae29:agc_driver_native_depth_stencil(--stencil): D32S8 at 2, 4 and 8 samples, depth clear 0 and 1, both with an all-zero (or all 1.0) initial HTILE and with a later whole HTILE fill, covered separately.EQUAL clearStencil + 1leaves the depth untouched;EQUAL clearStencilwrites every sample.0xc3(REPLACE) and confirms that the old clear value no longer passes. It then fills with new clear values, depth 0/1 and stencil0x5a/0x33, and checks both planes again.agc_driver_native_depth_clear_refusalsadds four queued-fill refusals: a later queued write, a CPU write to the HTILE, a depth plane write, and a fill pattern that does not prove the clear.agc_driver_native_depth_clearsalso runs every completed-clear case through a whole HTILE fill and through a whole HTILE fill still queued on the GPU when the depth is checked (72 cases). The eligibility test now expects a partial fill to refuse as before, and a whole fill with no store to refuse for lack of a complete tracked store.agc*test (596) passes or skips exceptagc_driver_multisample_fill_host_only, which fails the same way onmain(vkWaitSemaphoresKHR-4, noted in #6297), andagc_driver_store_over_untracked, which failed once in the parallel run and once in three runs alone: the known #6347 race fixed by #6359. Rerun with the queued-fill commit: the same two, plusagc_pending_key_storesonce in the parallel run, which passes three runs out of three alone and does not touch depth surfaces.Not proven in a title. PPSA19115 on Linux (Intel Alder Lake-P, Mesa 26.2.4) with this branch and #6297 still refuses its D32S8 target when the surface is created: "requires watched accessible guest memory". Its allocation (
0x231580000,0x10f4000) is host-imported by host pointer there (the import probe reports that host imports resolve write protection), so the depth range is unwatched and the fill path above is never reached. The title then reports "metadata fill transition" only because that later fill overwrites the first refusal. The watched-memory boundary therefore blocks this title on Linux as well as on Windows.On Windows (RTX 5060, NVIDIA 596.36), PPSA19115 gets past that boundary only with local, unpublished changes: the private-import write watch prototype discussed in https://github.com/boykopovar/AnyPS5/pull/6300#issuecomment-6193282566, #6297, and page-precise write checks over the native depth ranges (a follow-up PR). With those, the queued-fill case above is what stopped it at frame 14: a
FillBufferof the whole HTILE (0x21be48000,0x30000bytes) still pending when the depth was bound. With this commit it runs past it, holds 60 fps on the title screen and reaches gameplay; the next refusal comes when the player dives and is not addressed here.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)Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-15T11:20:31Z.
@Gashrod1 Parent #5554 is now merged at
c9a96a548cd7e63161f069433cdfc56cbae26ac6; #5524 is merged. Its single post-drain notification carries the native extent. Our independent Windows composition (c9 plus the now-merged #6333 PM4 build dependency) passes the full app/libs build, checkers and27 groups once plus five repeats per selector:324 executions, no skips/timeouts, maximum5.73s. Fourteen runtime groups report each actual GPU. Exact pins, analysis advisory and scope; published5554 is unchanged.Update on the Windows boundary: our separate native-color integration now has an explicit private-import watch promotion prototype and controls. It keeps the1MiB default, settles before the initial snapshot and rejects unsupported ownership/exclusion transitions. The previously failing fixture passes5/5 on each GPU and fails5/5 with only the promotion call disabled. #3036 maintains the full scope and82-group results. This could inform the depth-side transition; I have not applied it to #6300 or tested D32S8 or a new title replay. AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by Gashrod1 on 2026-10-15T13:31:11Z.
@Amoenus Thanks. Rebased on
main8dc92ae29and marked ready. The only conflict was inNativeMultisampleDepth.cpp, against #5627'sCheckHtileRouting; both functions are kept. All four native depth tests pass, and the three stencil mutations listed in the description still fail the test on this base.A title result, for the depth-side transition. PPSA19115 on Linux (Alder Lake-P, Mesa 26.2.4), with this PR and #6297, refuses its 2-sample 1920x1080 D32S8 target when it is created: "native multisample depth import requires watched accessible guest memory". The depth range
0x231590000+0x10e0000is accessible but unwatched. Its allocation (0x231580000+0x10f4000) is host-imported by host pointer: the probe reports that host imports resolve write protection.ImportWatchedandrefreshImportsthen unwatch it. The dma-buf import, which the probe reports keeps the watch, is only tried when the host-pointer import fails. So on Linux too, the fill path is never reached for this title.Both the Linux and the earlier Windows logs ended on "native multisample depth metadata fill transition is not implemented". That is because
NoteDepthMetadataFilloverwritessampling.refusalfor any overlapping surface, including one already refused at creation, so the first reason is lost. Keeping the first refusal would make title logs point at the real boundary. I can open that as a small separate fix if you agree.Your private-import promotion looks like the right shape for the Windows depth side:
RequireGuestWriteWatchover the depth, HTILE and (for D32S8) stencil ranges before the initial snapshot inprepareDepthSampling, asMultisampleTargetdoes for color. Do you plan to open it as a PR? If so, I would stack the depth-side call and its D32S8 controls on it and run this title on Windows.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by Neithennn on 2026-10-15T15:52:29Z.
Windows NVIDIA run, since the description lists an Intel iGPU only.
Windows 11 Pro 26200, NVIDIA GeForce RTX 4080 (driver 617.42), AMD Ryzen 7 5800X, WinLibs GCC 15.2.0 r7, Ninja, Release, bundled dependencies,
BUILD_TESTING=ON,ANYPS5_NO_SHADER_CACHE=1. Headc11074be8merged onto main92e50418f; full build succeeds.ANYPS5_REQUIRE_VULKAN=1:agc_driver_native_depth_stencil,agc_driver_native_multisample_depth,agc_driver_native_depth_clears,agc_driver_native_depth_clear_refusals,agc_driver_native_depth_retirement,agc_driver_depth_htile_write,agc_driver_sample_mask_multisample,agc_driver_sample_multisample_target,agc_multisample_guest_access,agc_driver_multisample_fill_host_only: 10/10 pass.agc_driver_native_depth_stencilreports every case as run on the RTX 4080 (2, 4 and 8 samples, clear 0 and 1, with and without fill; the fill casesrefilled three times), none skipped.ctest -j 8: 1295/1295. Unchanged main on the same machine: 1294/1294.No title run.
AI-assisted: yes (runs done with Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by billythemenace2 on 2026-10-15T16:54:09Z.
A title case for this PR: SONIC SUPERSTARS (PPSA06888) on
mainec1193dc3plus #5865, #5882 and #6297 stops about 30 s in, with no input, at:A debug print in
NoteDepthMetadataFillshows whole-HTILE fills of 0 over two 1920x1080 2-sample depth targets without stencil metadata, repeated every frame:With this PR (
c11074be8) added, two runs gave two different results. The first stopped at the samefill transitionrefusal. The second, with the debug print, got past it and stopped at:That is a D32S8 target whose HTILE has no stencil metadata. I have not identified which target it is yet. The two targets above report
stencil=0, so it may be a third one.Setup: Windows 11, MinGW-w64 GCC 15, Release, AMD Radeon RX 5700 XT (driver 32.0.21045.5002). Game bring-up: #5382.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by Gashrod1 on 2026-10-16T08:08:51Z.
@billythemenace2 thanks for the detailed report. Both messages fit one explanation.
fill transition:NoteDepthMetadataFillonly takes the whole-HTILE fill path whensamplingActiveis set. Your print showscovers=1, so the fill took the generic branch because those surfaces were already refused when they were created. That branch then replaces the creation reason withmetadata fill transition, so the message hides the real cause. #6423 keeps the first refusal. With it added, the first run should report the same reason as the second.requires HTILE stencil metadata: this is the creation refusal.prepareDepthSamplingrefuses a D32S8 target whose HTILE has no stencil metadata (!htileStencil || htileDepthOnly). If thestencil=0in your print is the HTILE stencil bit, and not the stencil address, those two 1920x1080 targets are likely this case rather than a third target. Printingtarget.stencilAddress,htileStencilandhtileDepthOnlyfromprepareDepthSamplingwould confirm it. Without HTILE stencil metadata the stencil plane stays uncompressed, so it could probably be imported straight from its plane. I have not written that yet. It would be a follow-up to this PR and is not part of it.On Windows, once these targets are accepted, the next stop may be
metadata fill over unwatched memoryorunproven fast-clear transition, if the HTILE or depth lands on host imports that write watching does not cover. I hit that on Dave the Diver (PPSA19115).Further Dave fixes are on my local branch and will come as separate PRs that depend on this one:
The queued fill that changed between your two runs is already handled in
c11074be8. Run-to-run timing likely decides which surface is refused first.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by billythemenace2 on 2026-10-16T12:09:10Z.
@Gashrod1 thanks, your reading was right. On
mainaff725bf6plus #6297 (c63485076), #6300 (c11074be8) and #6423 (cbf964ed7), SONIC SUPERSTARS (PPSA06888) now reports the creation refusal straight away, in the first run:#6423 conflicted with #6300 in
NoteHtileDepthClearandNoteDepthMetadataFill. I kept #6300's branches and changed theirrefusal =assignments toRefuse(...).The print you suggested, at the top of that check in
prepareDepthSampling, shows eight depth targets before the stop. All of them are 1920x1080, 2 samples,D32_SFLOAT_S8_UINT, with a stencil plane and HTILE without stencil metadata:The first two are the targets from my earlier fill print (HTILE
0x225188000and0x2251c0000), so they are not a third target. Thestencil=0in that print was the HTILE stencil bit.So for this title, importing the stencil plane directly when HTILE carries no stencil metadata looks like the next step. I can run it on PPSA06888 when you have it.
Windows 11, MinGW-w64 GCC 15, Release, AMD Radeon RX 5700 XT.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T20:45:07Z.
Coordination note from the #7233 completion fix: the recognized HTILE mask-kernel path now marks its exact metadata range complete only after that dispatch’s completion checks succeed, while
CheckCurrentkeeps requiringStoredAllSince. #6300’s separate queued whole-HTILE fill proof remains necessary. The overlap audit flags the sharedCheckCurrenthunk; when combining, preserve the queued-fill allowance alongside the complete-store check (gpuFill || StoredAllSince). There is no dependency between the two changes.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-18T19:52:21Z.
Review: CHANGES_REQUESTED
Thanks for the work. The diff matches the description and the tests pin per-sample depth values and stencil outcomes. One blocker:
maininNoteDepthMetadataFill(core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp).mainreplaced thependingClearassignment withsurface->ForgetClear(written)/surface->NoteHtileClear(...)and added the single-sample plane-fill branch (PlaneFillCovers,NotePlaneFill). Please rebase and merge both: keep the native-MSAA whole-HTILE fill branch (samplingActive && HtileFillCovers) ahead of the generic branch, and keepForgetClear/NoteHtileClearfor the non-sampling path.gpuFill || StoredAllSince), as noted by @MarcZX10.agc_driver_native_depth_stencil,agc_driver_native_depth_clearsandagc_driver_native_depth_clear_refusals.Once it is rebased and the full Build is green, it can go to the merge queue.
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T11:47:30Z.
@Gashrod1 a rebase handoff, in case it saves you time, since adriadam10's review asks for a rebase.
rebase/6300(b74b5d42e8) is both your commits onmain62e946f114, with authorship unchanged. The conflicts were inDepthSurface.cpp, resolved as the review asks:NoteHtileDepthClear: your stencil-surface refusal andclearAspects, written withmain'ssampling.Refuse(...)in place of assigningrefusal.NoteDepthMetadataFill: your native-MSAA whole-HTILE fill branch (samplingActive && HtileFillCovers) comes first. After it comemain's generic branch (ForgetClear/NoteHtileClear) and its single-sample plane fills (PlaneFillCovers,NotePlaneFill), unchanged. The second commit'sclearPatternandclearFillNoteapplied cleanly on top.Tests (RTX 4070 Ti, Linux, Release):
agc_driver_native_multisample_depthpasses 3 of 3.native_multisample_depth|native_depth|depth_clear|htile|multisample|msaa|^agc_driver_graphics$|write_trackingpass, against 29 of 29 onmain.native_multisample_depth|native_depth): nothing new againstmain, only the layer's knownpNext-pNextandpLibraries-06681.debt-lengthcheck, on the entry this PR edits (1552 characters).To take it, run
git fetch https://github.com/milescoviello/AnyPS5 rebase/6300 && git reset --hard FETCH_HEADon your branch, then force-push.A data point for what comes after this PR. Ghost of Tsushima (PPSA02225) samples a 2x D32S8 1920x2160 target that #6300 still refuses. Its stencil is a separate plane, and its HTILE is depth-only (no stencil state in HTILE), not ITERATE_256 and not pipe-aligned. A logging build shows two whole-range fills before the sample, both with pattern 0:
HtileMetadataBytesfor that extent, so the footprint formula holds for this non-pipe-aligned HTILE;With the format, stencil and HTILE refusals relaxed locally, the title stops at the next step,
native multisample depth metadata fill transition is not implemented. Would you be OK with me doing this as a follow-up on top of #6300 (Depends on: #6300, #6557)? It would cover:I'd rather build on your PR than overlap it.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-10-20T18:12:33Z.
For information, not a request to widen this PR: The Grinch: Christmas Adventures (PPSA07656) stops on the D32S8 refusal on
main892a4f132(Windows, RX 9070 XT), with the depth-only HTILE case this PR refuses: a 2-sample 2560x1440D32_SFLOAT_S8_UINTtarget with a separate stencil plane,htileStencil0, its stencil plane all at the clear stencil (0), and all three rangesWatchedon Windows. After that it samples the depth through a descriptor without HTILE (native multisample depth sampled metadata or XOR mismatch). Details: https://github.com/boykopovar/AnyPS5/discussions/8606Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T18:50:00Z.
Picking this up for our testing: it addresses the stop we see in PPSA03208 on current main, one of the titles we're bringing up, and we'd like to move it into main. We'll review, test and merge it under the normal process. Your comments and review are still very welcome, @adriadam10.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T19:25:18Z.
@Gashrod1 thanks for this. It now conflicts with
mainin a way we can't resolve mechanically:NoteDepthMetadataFillincore/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppchanged onmain, along with the native multisample depth test and the debt note. That's also the blocker in the open review. Could you rebase it onto currentmain? @milescoviello offered a rebase branch earlier, which may be a useful starting point. Once it's rebased we'll run CI and test it.Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-20T20:13:50Z.
I prepared a refreshed branch for the author/maintainers to use: fix/native-depth-whole-htile-refresh, tip
b0d031a94f71.It is two commits on main
29e4c46b4d74, without merge commits or the descriptor integration stack:33c9c5ae87: refreshes the implementation from this PR's4cbd7a4701andc11074be82, preserving m.peau's authorship. The conflict resolution retains main's single-sample plane-fill handling, first-refusal reporting and ITERATE_256-off eligibility.b0d031a94f: test-only correction. On RADV, the stencil fixture's direct raster writes were followed by a fetch from a stale sampled shadow (expected 0.3125, observed 0). Submit the raster batch, refresh throughCachedSampledTexture, and synchronize before fetching. A failure-only diagnostic records the affected case.Same-machine focused checks: main 4/4, refreshed branch 5/5, including stencil. Both used
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationandctest --test-dir build-full -R '^agc_driver_native_(multisample_depth|depth_retirement|depth_clears|depth_clear_refusals|depth_stencil)$' -V. No skips, missing-layer warnings orVUID-messages in either log. GPU: AMD Radeon RX 6650 XT, RADV/Mesa 26.2.4, Arch Linux. Full runtime libraries build passes. Conventions: zero errors, one existing-length warning for the refreshed 1810-character debt entry.Hades II (PPSA36082, bring-up #1965) reaches a rendered gameplay scene on this reduced stack, past the previous metadata-fill stop; scripted startup was observed through 190 seconds, then ordinary close returned native exit 0 with the PID gone and configuration restored. This is a bring-up result, not a performance comparison or verification of combat.
Matched test logs and compact native evidence. A local merge-tree check against newer main
9a97ac784da5is clean; that newer revision was not rebuilt for these results. This does not update your PR branch; it is an offered rebase handoff. AI-assisted.Imported from boykopovar/AnyPS5. Originally posted by DavidSamir on 2026-10-21T06:25:02Z.
@Gashrod1, a question about scope. The Grinch: Christmas Adventures (PPSA07656, discussion #8606) stops in
prepareDepthSamplingwithnative multisample stencil or depth format import is not implemented, on a target this PR doesn't import yet:D32_SFLOAT_S8_UINT, 2 samples, 2560x1440, one slice,Z_X, pipe-aligned,pipeBankXor0, clear depth 0;htileStencil0,htileDepthOnly1);dccAddress0, not pipe-aligned). With only the import let through, it next stops atnative multisample depth sampled metadata or XOR mismatch.The reporter's details are on #8606. Is a depth-only HTILE with an uncompressed stencil plane something you plan to cover in this PR, or should it be a separate one on top of it?
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T06:32:58Z.
@Gashrod1 your call on the scope @DavidSamir asks about. From our side, a depth-only HTILE with an uncompressed stencil plane is fine as a separate PR on top of this one, which keeps this one reviewable. Thanks @DavidSamir for the detailed target description.
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-21T12:17:00Z.
Refreshed the offered author handoff branch to
3f43eff06c06affa1ef573a0642283adf00e8d89, four linear commits on main1381826358ef3d20644608bfc1c54c9232bba81b. This is a handoff for this PR; your branch is unchanged.c2a622691erefreshes yourc11074be82implementation with m.peau authorship preserved.174b12d5aeretains the stencil fixture shadow-refresh correction from the earlier handoff.5a9ab8e2c4fixes the initial layout barrier for a sampled shadow with a combined depth/stencil format: transition both aspects. The earlier candidate producedVUID-VkImageMemoryBarrier-image-03320; the corrected candidate produces none. The depth-only copy remains depth-only.3f43eff06cinitializes host HTILE to the opposite value before a successful queued fill, so stale host bytes cannot satisfy the regression.Same-machine focused GPU checks: main 4/4, candidate 5/5, zero VUIDs, zero unavailable cases and no skips. Loader diagnostics confirm Khronos validation loading separately for every test. Completed-clear coverage is 24 cases on main and 72 on the candidate (HTILE dispatch, completed fill and queued fill); candidate stencil coverage is 12 cases plus 15 refusal cases. Seven common clear refusals pass on both, and the candidate additionally passes four queued-fill refusals. Full runtime libraries build on both; the candidate was restored and rebuilt afterward. Conventions: zero errors, one existing debt-entry-length warning.
Commands and pinned scripts are in the full paired evidence archive, including
ctest --test-dir build-full -R '^agc_driver_native_(multisample_depth|depth_retirement|depth_clears|depth_clear_refusals|depth_stencil)$' -VwithANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1, explicitVK_ADD_LAYER_PATH,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationand loader diagnostics. Archive SHA-256:8e258cdb81b02a9ce8bfa2d2054b92e76fc8875fb51363ad623e38a77ef792a2. GPU: AMD Radeon RX 6650 XT, RADV/Mesa 26.2.4, Arch Linux.Hades II (PPSA36082) native follow-up is now complete on this exact
3f43eff06c06head: 192 seconds, ordinary close with launcher exit 0, and configuration restored. The three candidate-only single-sample depth regressions also pass with loader-confirmed Khronos validation per test and zero VUIDs. The 175-second screenshot shows the character in the rendered outdoor starting scene; inspection found no obvious full-screen corruption in that frame. This is startup/scene regression evidence only, with no main-versus-candidate performance comparison, combat coverage or full visual-correctness claim. Native follow-up archive includes the screenshot, native report/log, exact harness and regression logs. SHA-256:86141c6645fd20950af2e9c171828589b8ad2d12a65440f876c1f7ec04b06363(download verified). The Grinch depth-only-HTILE/uncompressed-stencil extension is outside this refresh, as discussed above. AI-assisted: yes.Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-21T12:44:11Z.
@milescoviello @Gashrod1 I have a private follow-up prototype for the depth-only HTILE / separate uncompressed stencil case discussed here. Before opening another PR, I wanted to check whether this overlaps work you have already started.
It proves the complete initial stencil plane equals
DB_STENCIL_CLEAR, retains the existing watched-range and generation checks, and makes later depth-only HTILE fills preserve raster-written stencil. The first focused GPU run passes 5/5 with validation loaded per test and no VUIDs; an expanded zero/nonzero stencil run is queued. This is fixture evidence only, on RX 6650 XT / RADV. I do not have Grinch or Ghost of Tsushima locally and am not claiming either title is unblocked.The prototype keeps pipe-aligned HTILE and matching sampled metadata requirements. It does not cover Ghost's non-pipe-aligned HTILE, separate stencil-fill transitions, or Grinch's metadata-less descriptor. If you already have the overlapping initial import or refill preservation implemented, I can hand over the regression coverage instead of duplicating that work. Otherwise I will prepare this as a separate follow-up depending on #6300.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-21T12:56:03Z.
@JJenkx no overlap from me. I haven't started anything on the initial stencil import or on depth-only HTILE fills preserving stencil, so please go ahead with your follow-up. My only part in #6300 was the rebase handoff for @Gashrod1.
Ghost of Tsushima needs more memory than the 16 GB cap I can give titles here, so I can't check the title side for you either.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-21T21:45:46Z.
@Gashrod1 @JJenkx a correction to my last comment: Ghost of Tsushima (PPSA02225) reaches this code early, so I could test it after all. Ubuntu 26.04.1, RTX 4070 Ti, NVIDIA 615.71.09, release libraries, 20 GB cap, pad input.
maina6dcea9279stops at 15 s with a warm shader cache (54 s cold) oncompute shader 0x20001ef700: AGC graphics: native multisample stencil or depth format import is not implemented(DepthSurface.cpp:102).mainwith the handoff branch 3f43eff06c merged in (clean merge) gets past the format check. It stops at 14 s on the next refusal inprepareDepthSampling:native multisample stencil import requires HTILE stencil metadata, fromstencil && (!target.htileStencil || target.htileDepthOnly).So this PR moves Ghost forward, and its D32S8 surface is the case without stencil metadata in HTILE: either the depth-only HTILE with a separate stencil plane that @JJenkx described, or no HTILE stencil at all. I haven't told those two apart yet. When the follow-up is up, I can run Ghost on it.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-21T22:09:05Z.
@Gashrod1, another title stops on a native multisample depth target with a stencil plane, but in a shape this PR doesn't cover. We'll prepare it as a PR stacked on this one.
The Grinch: Christmas Adventures (PPSA07656, 01.000.003) aborts about 2 s in, before its first present, on plain
main892a4f132(BunnyFl's report):BunnyFl's print of the
DepthTargetinprepareDepthSamplinggives:VK_FORMAT_D32_SFLOAT_S8_UINT, 2 samples, 2560x1440, one slice,Z_X,pipeBankXor0, clear depth 0;stencilAddressset) and a depth-only HTILE (htileStencil0,htileDepthOnly1), pipe-aligned;This PR imports D32S8 only with the stencil in HTILE, and it refuses a depth-only HTILE, so this target falls outside it.
BunnyFl also tried letting only this case through, then discarded the experiment. The title then stops at the next check, when it samples the depth:
The sampled descriptor has no metadata (
dccAddress0, not pipe-aligned) while the target has its HTILE;pipeBankXoranditerate256match. So the title needs both pieces: the import with a separate, uncompressed stencil plane, and a sample of that depth through a descriptor without HTILE.Since it's the same import path, we'll build it on this PR's head. If you'd rather fold it into this PR, the commits will be on a fork branch for you to take as they are.
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-21T22:23:44Z.
@EagleBearerYS Ghost of Tsushima (PPSA02225) is probably the same shape: with this PR it stops on the same refusal 14 s in (my comment above),
native multisample stencil import requires HTILE stencil metadata. When your stacked branch is up, I'll run Ghost on it at 20 GB, warm and cold, and post the next stop there.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by Raghav314 on 2026-10-21T23:49:52Z.
@Gashrod1 Hades II (PPSA36082) hits the same refusal on current
main(a6dcea927):native multisample depth metadata fill transition is not implemented, thrown while the hub loads, reproduced twice. I merged this PR locally onto thatmain(with my draw pipeline and heap PRs) and the game loads into the hub and runs.The merge with current
mainhas conflicts inDepthSurface.cpp(mainnow records refusals throughDepthSamplingState::Refuseand clears throughForgetClear/NoteHtileClear),NativeMultisampleDepth.cpp(CheckDepthTargetgained aniterate256parameter in the same position as yoursource) and the debt file. With my resolution,agc_driver_native_depth_stencilfails with "Native depth feedback refused through the draw resource path", so that part probably needs your own rebase. The fill tests pass.LLM assistance used.
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-21T23:52:25Z.
@EagleBearerYS, another data point for the stacked stencil-plane shape. Spirit of the Island (PPSA13934, 01.000.000) aborts at its first gameplay frame on
main, right after New Game, onnative multisample stencil or depth format import is not implemented. It is the format check inprepareDepthSampling. These are the target's fields, printed by a local diagnostic at the refusal:So it has a separate stencil plane, no HTILE stencil and an HTILE that is not pipe-aligned. That is #8319's gap as well as the stencil plane. It is 8x, not 2x.
Setup: Windows 11, AMD Radeon RX 6700 XT, AMD driver 26.10.1,
maina6dcea927with #8361 (test-only). Reproduced once, with the names typed through the IME dialog by gdb. I can run your branch on this title when it is up.Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-22T00:35:05Z.
@Gashrod1, the stacked draft is up: #9533. It carries this PR's two commits unchanged, merges
maininto them, and adds six commits for D32S8 targets whose stencil is a separate plane and whose HTILE is depth-only. It also lets that depth be sampled through a descriptor with no metadata.It covers the three titles with that shape, reported here and in discussion #8606:
It's tested only on lavapipe, which samples D32S8 at four samples, so two and eight samples haven't run on a GPU yet. If any of you can run the branch (
fix/agc-msaa-d32s8-separate-stencilon EagleBearerYS/AnyPS5) on your title, the first line it stops on after the native depth import would tell us the most. If Ghost of Tsushima creates its target before the two fills, it would print a creation reason such as "native multisample stencil plane does not hold its clear value", and that's worth knowing too.Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-22T15:26:50Z.
@Gashrod1 (cc @oneandonlydean, @adriadam10) #9533 carries this PR's two commits unchanged, with your authorship. On top of them it has a merge of
main(8eba29aeef) that resolves the conflict adriadam10's review describes:NoteDepthMetadataFillkeeps this PR'ssamplingActive && HtileFillCoversbranch ahead ofmain'sForgetClear/NoteHtileClearand plane-fill paths, written withmain'sDepthSamplingState::Refuse. #9533 is onmainb7d1d47a5f, which includes #7233 and #7371, and its native multisample depth tests, including this PR's, pass 10 of 10 on GitHub's Linux runner (run). On Windows they build, and the Vulkan ones skip.So #9533 can land this PR's part with your credit kept, if that suits you. If you'd rather update this PR yourself, either of the existing handoffs would do: milescoviello's rebase/6300 or JJenkx's refreshed branch. #9533 would then rebase onto it.