feat(agc): multisampled color and depth targets with CB resolves #419
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/419"
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 MichonGoddijn231849 on 2026-10-02T23:10:12Z.
What
Draws with multisampling enabled were refused (
multisampling or coverage conversion is unsupported). They now render:CB_COLOR_CONTROLresolve over a multisampled CB0 runs as a render pass whose resolve attachment is CB1's resident image. A single-sample resolve is still refused as before.CB_COLOR_CLEAR_WORD.EQAA (fewer fragments than samples), coverage conversion, nonstandard sample locations and multisampled mips stay refused. The draw key gains the sample-location and CMASK_BASE_EXT registers.
GTA V renders its reflection cube's faces into a 256x256 2x target and resolves each face into the cube.
Tested
Windows 11 Pro, AMD Ryzen 5 7600, NVIDIA GeForce RTX 5080 (driver 32.0.16.1074), 32 GB DDR5-5600, MinGW-w64 GCC 15.2.0.
ctest: all tests pass. New cases cover:Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repositoryDrawKeyRegisters; whichever merges second keeps both sets of ranges. GTA V resolves into 4 KiB standard targets, which #377 adds: whichever of #377 and this merges second letsRunColorMetadataPassacceptColorTileMode::Standard4KBdestinations too (one condition)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by ThisIsAkill on 2026-10-04T01:00:31Z.
A data point on the fast-clear part, in case it helps scope it: PPSA21567 (Astro Bot) fast-clears single-sample color targets through their CMASK, which this PR's
multisampleInfo(applied only whensamples > 1) leaves refused onmainand here.What the title's draws show (Linux,
mainwith other open PRs and local changes, not cleanmain):CB_COLOR_INFO=0x00042730and0x10042730(with DCC) on 11 distinct targets. The only bit theState.cppmask rejects is 13 (FAST_CLEAR); DCC (28) andROUND_MODE(18) are already accepted.CB_COLOR_ATTRIB= 0 on all of them (1 sample, 1 fragment).FAST_CLEARset has a non-zeroCB_COLOR_CMASK; the two targets without it have none.CB_COLOR_CLEAR_WORD0/1=0x38003800/0x00005650and0x00000000/0xbc003c00.These draws are currently skipped (
color compression, DCC, ... is unsupported (CB_COLOR_INFO 0x00042730)), so the title's main targets are never rendered. I have not yet checked whether its CMASK clears are whole-target zero fills like the ones this PR hooks.Do you plan to cover single-sample targets in this PR, or would you welcome that as a follow-up on top of it? I'm trying the obvious extension locally (the same zero-fill hook and clear-on-next-use for 1-sample targets, anything else refused) and can report how it behaves.
Imported from boykopovar/AnyPS5. Originally posted by ThisIsAkill on 2026-10-04T01:37:47Z.
Follow-up on the single-sample case, with what Mesa's AMD drivers say about the CMASK codes (Mesa
e5f06878):src/amd/common/ac_descriptors.h:57-58: single-sample CMASK codes areCMASK_NOAA_COLOR_CLEAR_REG = 0x0(fast-cleared to the clear register, "illegal with DCC") andCMASK_NOAA_COLOR_EXPANDED = 0xF(0xffffffffas a fill: expanded, not fast-cleared). Caveat: both are commented "only valid on gfx6-9".COLOR_EXPANDED(radv_init_color_image_metadatainradv_cmd_buffer.c). When it fast-clears an image that has both DCC and CMASK, it writesCOLOR_EXPANDEDto the CMASK and carries the clear in the DCC keys (radv_get_cmask_fast_clear_value,meta/radv_meta_clear.c:771-786).gfx_level >= GFX10path ofsi_clear.c(around lines 654-707) it fast-clears a single-sample texture without DCC by filling a separately allocated CMASK withCMASK_NOAA_COLOR_CLEAR_REG. So the "gfx6-9" comment does not hold for that code, at least.That matches what PPSA21567 does. Its non-DCC targets (
CB_COLOR_INFO 0x00042730) get zero fills over the whole CMASK. Its DCC targets (0x10042730) get0xfffffffffills, with the clear expected in the DCC keys, whichmainalready models.I tried the extension locally on top of this PR (Linux, with other open PRs and local changes, not clean
main). A single-sample target may set FAST_CLEAR when it has a CMASK. A full zero fill fast-clears it toCB_COLOR_CLEAR_WORDon its next use or eliminate pass, a full0xfffffffffill cancels a pending clear, and any other pattern or partial fill throws. Result: 8 targets were fast-cleared through their CMASK, the0xfffffffffills cancel without error, and the title's distinct skipped-draw reasons went from 23 to 3. The run then stops at an unrelated depth storage-image path (#425's area). The branch is ready if you'd like it as a follow-up.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T07:10:17Z.
@boykopovar this one needs your call: should multisampled colour targets be host-only images? With this PR their guest sample planes and FMASK are never written or read, so guest memory never holds an MSAA target's contents. Sampling one stays refused, and a CB resolve lands in the single-sample destination's resident image. That is the model main already uses for depth surfaces (a host image with no write-back), so it's an architecture choice more than a correctness question.
My read: fine as a step, because every shader path that would read the sample planes still throws, but a CPU or DMA read of that memory would see stale bytes without an error, as with depth today. Either way it needs a rebase: it conflicts with main in
Graphics/src/Draw.cppnow.Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-04T08:13:39Z.
Thanks. Yes, host-only multisampled color targets are meant as a step. Every shader path that would read the sample planes or FMASK still throws, so the gap is the one you name: a CPU or DMA read of that memory sees stale bytes, as with depth surfaces on
main. If @boykopovar wants write-back for both, I'd do depth and MSAA together in one follow-up, since they need the same machinery (see #425). I'll rebase this today.@ThisIsAkill, thanks for the CMASK data and the Mesa references. Single-sample CMASK fast clears fit better as a follow-up on top of this than in it. Your rules (a whole zero fill fast-clears to
CB_COLOR_CLEAR_WORD, a whole0xfffffffffill cancels, anything else throws) match how I'd scope it, so please open it as a PR once this lands.Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-04T08:39:43Z.
Rebased onto
mainand the updated #374 (which it builds on). TheDraw.cppconflict was with the draw templates' moved-buffer rebinding from #424; multisampled draws still take no recipe. Build and ctest are clean apart from the failuresmainhas locally.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T09:52:09Z.
Thanks for the rebase. The #374 commits it carries now match #374's head, and the
Draw.cppresolution keeps multisampled draws out of the recipe path next to #424's moved-buffer check. The host-only question is still with @boykopovar.Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-05T15:41:10Z.
Rebased onto current
mainand today's rebase of #374. The conflicts wereColorTarget's fields and the colour-target loop inState.cpp, againstmain's 3D colour targets and compacted exports. Both sides stay:depth,depthSliceandexportIndexfrommain,samplesandcmaskAddressfrom this PR, with the sample-count check afterexportIndexis set. Build and ctest are clean apart from the failuresmainhas locally.Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-06T15:43:56Z.
Rebased onto current
mainand #374, which is rebased too so the commits this PR carries match its head (now d7ce17d0). The only conflict was inTexture.cpp:maingaveStorageTexture::createViewa format parameter, next to this PR'sClearColorForTexel. Both are kept. #790'simage_msaa_loadis the shader side of multisampled images and doesn't overlap with the targets and resolves here. Builds; the driver tests pass apart fromagc_driver_scalar_sop1, which fails without this PR too.Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-07T17:31:11Z.
Rebased onto current
mainand the rebased #374 (now 8aef734c), no conflicts. One more commit drops code comments that the conventions check now rejects. #1189 (CB resolve into any tiled target) builds on this one. Build and ctest pass.Imported from boykopovar/AnyPS5. Originally posted by TheAggie on 2026-10-08T04:05:17Z.
Tested #419 with a second title: ProsperoPuzzles (PPSA99006, blackbearreloaded/ProsperoPuzzles, Mesa 26.2 via ps5-opengl), which renders its puzzle thumbnails into 4× MSAA canvases. Merged onto a local branch that also carries other pending fixes (#1412, #1414, #1415, #1419 and a few unpublished ones).
With #419, the 48 draws that failed on
PA_SC_AA_CONFIG/CB_COLOR_ATTRIBget past those checks. Two gaps remain for this title, both outside what #419 sets out to do:PA_SC_AA_CONFIG= 0,PA_SC_MODE_CNTL_0= 0x22 (noMSAA_ENABLE),CB_COLOR0_ATTRIB= 0x12000. These are rejected witha color target's sample count differs from the rasterizer's. radeonsi does the same whenever GL multisampling is disabled on a multisampled framebuffer:si_emit_msaa_config(si_state.c) leavesPA_SC_AA_CONFIGat 0 unlessmultisample_enableis set. Rasterizing at the target's sample count with every sample location at the pixel centre (VK_EXT_sample_locations) would match the hardware's broadcast.image_loadfrom a multisampled image (89 draws): the resolve is a pixel shader doing fourimage_loads at sample indices 0–3 and averaging them (a box-filter resolve), failing withDescriptorBindingBuilder::Populate multisampled image resources have no descriptor image shape. You note sampling multisampled surfaces is still refused.Are either of these on your list? If not, I'm happy to try them as a follow-up PR based on #419. I'd rather not overlap with you. Shader dumps and register files are available if useful.
Investigated with AI assistance.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-08T06:09:04Z.
Heads-up: #1072 (single-sample CMASK fast clear) is merging first and adds
ColorTarget::cmaskAddressplus theCB_COLOR0_CMASK/CMASK_BASE_EXTdecode. Please rebase this PR on top of it and reuse that decode for the multisampled path.Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-08T16:37:15Z.
Rebased onto main and onto the updated #374. Main gained CMASK fast-clear color targets meanwhile (
61a61016), which this PR duplicated, so it now builds on them:ColorTarget::cmaskAddress, its decode and its size helper are gone; multisampled targets use main'scmaskAddress/cmaskBytes(whole metablocks). Single-sample targets keep main's rule (CMASK under FAST_CLEAR); a multisampled target takes its CMASK under FAST_CLEAR or COMPRESSION.agc_driver_graphicspin each of these; the inferred parts (which bit a multisampled CMASK follows, the fill-only state model) are in TechnicalDebt.md.GTA V ran with the previous version; it has not been re-run against the new refusals yet.
Imported from boykopovar/AnyPS5. Originally posted by Raghav314 on 2026-10-09T08:11:26Z.
Tested this with Hades II (PPSA36082) on Linux with an RTX 4090. With it (plus some unrelated fixes) the 4x targets work and I get all the way into gameplay. Three things in here stopped it or broke rendering on the way, all fixed on top of your branch:
I have all three on branches based on yours. Happy to open them as follow-ups after this lands, or share them if you'd rather pull them in here. Whatever's easier for you
LLM assistance was used in the investigation by me.
Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-09T08:33:32Z.
@Raghav314 thanks, that's a great test, and all three findings make sense (the ordered sample grid through VK_EXT_sample_locations, the resolve with a 1-sample rasterizer taking its count from CB0, and the fill clears sized with the MSAA tile layout). Please open them as follow-ups on top of this one. That keeps this PR reviewable, and they should land under your name.
Imported from boykopovar/AnyPS5. Originally posted by Raghav314 on 2026-10-09T08:40:14Z.
Alright, Will do that, Thanks for the reply
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T23:58:22Z.
Two things so this and the PRs stacked on it (#2169, #2121, #2132, #1189) can go in once #374 lands:
Texture.hpp. Could you rebase onto main after #374 is merged?sampling a multisampled depth surface is not implemented); a test that reads a resolved-only colour target's memory and expects the throw would cover the colour side. With that, keeping the targets host-only is exact, and it doesn't need to wait on the write-back question.Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-10T08:23:47Z.
Will do both once #374 is in. That's where its five HTILE commits come from, so one rebase onto
mainthen fixes this PR and the ones on top of it.mainafter #374 merges.Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-10T22:49:19Z.
Another title that stops at a multisampling-related state check: Resident Evil 4 (PPSA07411 v01.000.000). On Windows, with several start-up fixes that are not in
mainyet (kept on fork branches), it now reaches its first draws and aborts with:The check is
ScanModeMask = ~0x22ufor context register0x292inGraphics/src/State.cpp, so only bits 1 and 5 are accepted, and the title sets bit 0 as well. I did not look at the render target of that draw, so I cannot say whether it is actually multisampled or whether the bit is set for a single-sample target. I also did not check what bit 0 of this register means for gfx1013, so I am not claiming that it is the multisample enable bit.I mention it here because this is the open pull request about multisampled targets; if it already covers register
0x292, this title would be a test case for it. Windows 10 (19045), NVIDIA GeForce RTX 4080 SUPER, Release. Dump from my own digital copy; no game files shared. AI-assisted.Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-11T04:53:02Z.
Latest local integration validation (2026-10-12)
Sonic Unleashed PPSA99902 now reaches the post-opening-movie NOW LOADING screen, then stops at dithered/rounded alpha-to-coverage0x18701 in fork integration08891d938 (
13485ff9fsnapshots + constant-fill recognition/allocation accounting). This is the pinned-maina672688eintegration with prior color/depth, #4021/#4029, merged #3683 and the independently derived #4141 fixture correction (now merged upstream through #4159); fixedmain-f609conversion, shader cache disabled. Controlled menu-entry input is verified below. Interactive gameplay, audio, rendering accuracy, console/AMD equivalence and unchanged upstream main remain unverified.What changed and why
Compatible single-slice 2D/2D-array multisample reads copy the retained color image to an independent GPU snapshot, preserving every fragment and raw component before later writes. Ordered barriers and retained source/destination owners protect queued copies; actual image allocation is charged to the recorder's retained-memory budget. Actual CPU reads still use the existing sample-preserving publication path. Unsupported geometry/conversions and uncertain metadata transitions retain explicit failures. Copy/view rules: Vulkan image copies and format compatibility. No shader-instruction semantics changed.
The first snapshot-only experiment exposed a different clear kernel, rather than the previously validated 17-word mask kernel. Two guard-preserving captures agree: six user SGPRs, 11 words, 64×1×1 threads; full DCC552960 bytes become
00, CMASK81920 bytes becomeCC; tracked guest color/FMASK ranges remain unchanged. The captured constant-fill kernel matches pinned Mesa's fill-memory shader:offset=min((groupX*64+localX)*16,maxOffset), replicated DWORD×4 store. The generic matcher clips coverage to both dispatch count and maximum offset. Dispatch still runs; native reuse requires its newer completed-store evidence, the expected full uniform clear code, unchanged sample/FMASK ranges, no recorded pending writer, no observed CPU metadata race and no intervening native write. Unknown/partial/indirect cases remain unimplemented.StoredOveralone establishes overlap, not full coverage or writer ownership; these are separate checks. CPU atomic exclusion after the final check remains unverified. #3816 matches a distinct 9-word memory-value kernel and was inspected, not applied/tested here.Validation
Windows11 Enterprise26200 / RTX5080 / WinLibs GCC15.2 r7, Release/testing ON. Full build, all122 patched/unpatched modules, registration and conventions pass. 16 relevant groups ×5 and full recorder ×5.
13485ff9f, before / restored0xC000040908891d938, two normal runsA separate180s observer finishes at181.095s: 1895 native snapshot lookups,947 clear imports,zero dirty guest publications, no fatal diagnostic; eight distinct GPU frame payloads, visually inspected “PRESS START.” These operation counts are not FPS or presented-frame counts, and no new performance timing is claimed. The stable pre-snapshot
cfc9b0411control also reaches the title screen; this validates removing the sampled-lookup CPU round trip while preserving that milestone.Original ELF/module, converted guest libc and exact123-file runtime baseline restored/hash-verified; observer/fault sources byte-restored, full build/libs and16 groups ×5 pass again; checkout clean. The integration is now pushed to the fork as linked below; no new PR or proprietary data upload. AI-assisted code/investigation/report: Codex.
Controlled input and next startup boundary
Same production head
08891d938, no new production-code changes. Temporary pad-return transition logging and spaced GPU dumps use the existingAPS5_PAD_INPUT_FILEfacility; physical UI input is ignored in both control and input cases. The no-input180s control (181.075s including termination) stays at PRESS START. The input180s case (181.124s) records returned pad buttons0x8and0x4000, each released after its300ms pulse: Options advances to the readable autosave notice; Cross advances to the visible NEW GAME menu. Two fresh240s probes repeat this menu entry. Public port source maps these masks to Start/A, but the dump's exact source revision is unconfirmed; runtime pad-return logs and observed screen responses supply independent evidence.Selecting NEW GAME shows a dialog whose body text is not visible but whose Cross/Next prompt is visible. A Next press advances through loading to the opening cinematic. The later 480.719s observation captures43 spaced frames: four verified input pulses, then no further input; frames019/034/042 show later battleship, corridor and Super Sonic/Eggman cinematic scenes. No fatal diagnostic; the movie remains active at the observation limit. This establishes extended cinematic progress, not interactive gameplay, audio, FPS or rendering accuracy. Dumps may perturb timing.
Pre-snapshot parent control: frozen
cfc9b0411libraries, the same pad-return logging/frame gates and restored empty working saves; three verified1500ms input pulses,481.207s/43 spaced frames, no fatal diagnostic. Its final frame042 shows a fully visible dialog with the Next prompt and no visible body text. The observed absence therefore predates both13485ff9f and08891d938. Its underlying cause/purpose remains untraced; no new AnyPS5 defect is claimed. The parent is the earlier local integration, not unchanged current main; input timing differs, so no performance or pixel-exact comparison is claimed.All ten temporarily reverted/observer source files restored byte-for-byte to088; full build/libs and four relevant groups ×5 pass again (pad, native snapshots, metadata reset, constant fill). Previous17-group ×5 and full872 results above remain attributed to their prior runs on the unchanged production head; no full-suite rerun in this observation round. Original ELF/module, converted guest libc and exact123-file runtime baseline hash-verified. Generated working save files archived privately and pre-test empty saves/config/achievement-marker state restored exactly after both observations. No production-code change in these observations; the validated integration is now published to the fork, with no new PR or proprietary-data upload.
Fork solution links and refreshed verification
Published with the user's renewed authorization: experimental integration08891d938, pinned toa672688e. Focused commit diffs: completed native depth clears406838ac7, device-staged readback3d5c594c3, native GPU snapshots13485ff9f, constant-fill recognition/allocation accounting08891d938. These changes depend on the integration's earlier MSAA foundation and validated prerequisites; they are not standalone current-main patches. Snapshot-only134 reproduces the documented metadata refusal; use the corrected088 integration for this title. Existing #4021/#4029 and merged #3683 work remains credited to its authors in the history/commit records. #4159 by MarcZX100 has now merged the equivalent fixture correction and closed #4141; no additional fixture PR is proposed.
Immediately before pushing, exact088 full build/libs/registration/conventions pass; seven relevant groups ×5, then full872:867pass/0fail/5 explicit skips, maximum15.5141s. Windows11/RTX5080/WinLibs15.2, cache disabled; no new Linux/lavapipe or unchanged-current-main validation. Fork branch head independently verified as08891d938 after push. No new PR.
A further480.725s/43-frame movie-control probe repeats normal menu entry and logs an Options/Start pulse and a Cross/A pulse during the visible cinematic, both pressed/released. Later captures remain cinematic (final042: Super Sonic); no fatal diagnostic or verified skip/post-cinematic scene. Sparse captures do not exclude a brief prompt. Original/module/libc/exact123-file runtime and working saves/config/marker restored; no source changes or proprietary upload.
Movie end, new explicit blocker and measured FPS
The longer run is now terminal: 764.735s, exit0xC0000409, not a timeout,71 private spaced frames. Four verified normal menu pulses, then no further input; final070 shows the post-movie NOW LOADING/control-tutorial screen. It then fails with
dithered or rounded alpha-to-coverage is unsupported (register 0x2dc = 0x00018701). New issue4285 records this distinct mode, dependencies, exact diagnostic and main-source comparison. A private extension of the existing decoder fixture reproduces the exact DecodeState/precheck refusal 5/5, retaining disabled/undithered and separate dither/round controls. Test source restored; full build/libs and six relevant groups×5 pass. Main d146 still has the same guard, as did the pre-snapshot parent. This is a documented unsupported mode newly reached by this integration; no attributed regression, whole-current-main startup or interactive-gameplay claim. Original/module/libc/exact123 runtime and empty working data restored/hash-verified.Separate240.734s FPS observation on the unchanged088 frozen observer, same normal menu sequence,19 frames/no fatal. AnyPS5's two-second window-title counter, sampled about1.23s, with188 valid title samples; phase windows matched to actual images:
This counts successful VideoOut presentation calls (UpdateTitle), not verified displayed/unique movie frames, simulation rate or gameplay FPS. One instrumented run,3840×2160 display-buffer captures, AnyPS5 shader cache disabled; GPU dumps and title polling may perturb timing. No before/after FPS improvement claimed. Bundled PresentMon produced no usable trace. The metadata observer hit a PID-exit race after the scheduled game stop; persisted samples and terminal game outcome were retained, and original/baseline/working-data restoration independently reverified after the harness completed. No emulator source change.
Next: independent Windows/RTX5080 validation of discussion2242/phase-B#4152 as requested. The alpha gap stays explicit while its full draw and exact coverage behavior are investigated through4285; absent dialog body remains untraced. This canonical comment is edited in place.
Previous stable integration and staged-readback measurements
Latest local integration validation (2026-10-12)
PPSA99902 reaches the Sonic Unleashed “PRESS START” title screen in the local, unpushed
cfc9b0411integration, on pinned maina672688ewith earlier sampled/color/depth support, validated #4021/#4029 corrections, merged #3683 AMM placement and the corrected #4141 test fixture. The staged-readback measurements below remain attributed to3d5c594c3. This is the fixedmain-f609conversion, Vulkan required and shader cache disabled. There is no input, main-menu navigation, gameplay, rendering-accuracy or console/AMD-equivalence validation here.Confirmed readback improvement
Resident color samples now gather into a
DeviceBuffer, then cross to the host withCopyBuffer; shader→transfer and transfer→host barriers precede fence wait/invalidation. Every sample/component and the original byte count are retained. Upload/readback shaders are unchanged. Scratch adds a full linear sample payload in device memory; allocation failures throw. General behavior, no title check or sample collapse.Two original and two changed 180s timing observations, followed by a replay of the exact frozen original timing library:
These are CPU wall times of the instrumented operations, not GPU timestamps or FPS. Target: 3840×2160, eight samples, eight-byte elements; 530,841,600 linear bytes and 534,773,760 physical color bytes. Incomplete final publications are excluded. The earlier runner-NameError attempt is excluded. Remaining median CPU tiling is ~233ms and color guest-store work ~199ms per publication.
Reusable implementation outline in
ReadSamples:bytesis the existing four-byte-aligned sample count. The private transfer helper takes aVkBuffer; the existing producer barrier, submission/wait and host invalidation remain.Behavioral and startup evidence
Windows11 Enterprise26200 / RTX5080 / WinLibs GCC15.2 r7, Release/testing ON. Full build, all122 patched/unpatched modules, registration and conventions pass. 14 relevant groups ×5, full recorder ×5; target tests now cover 48/48 configurations, including full and forced256-byte descriptor ranges, exact sample/component values, metadata, padding, queued writers and reuse. Omitted DMA copy, four-byte-short copy and incorrect chunk starting element each fail for the expected assertion ×5. Fault/diagnostic sources are byte-restored; full build/libs and14 groups ×5 pass again after restoration.
Latest stability full suite: 865pass/0fail/5 explicit skips of870, maximum15.5673s. Merged #3683 is applied as local
cb2c3a7c5, with upstream credit: placement/markers groups each200 passes; restoring only the old fixed-address calculation fails5/5 occupied-top controls; source restored and rebuilt/restored groups ×5 pass. Localcfc9b0411corrects #4141: allocator guard gap/nonzero-charge assertion, registered cache test50/50; forced-adjacent/unguarded/separated controls ×5 show assertion/FPE/pass as intended. All244 library files stayed byte-identical across the test-only correction. Full build/libs/registration/conventions and14 native groups ×5 pass. Focused one-file local preparation on mainbca7a29d:d32ceb3c6, unpushed; not whole-current-main validation.The earlier869-test changed runs had the two confirmed failures documented above, before these corrections. The existing #3371 comment is maintained in place with the AMM verification. The four refreshed normal controls reach60s without a fatal diagnostic; a fresh180s GPU observer still captures PRESS START. Original/module/converted libc/exact123-file baseline verified after all runs; temporary source tags restored byte-for-byte, full build/libs and14 groups ×5 pass again. No Linux/lavapipe, rendering accuracy or whole-upstream-head claim.
Normal before/changed1/changed2/restored controls all reach the60s observation limit without a fatal diagnostic. Separate dirty-publication caller observations record 130/130 and122/122 publications from
ShaderResources.cpp:580,cachedTexture; standardsource_locationtags identify the actual requesting call, not an inferred stack. The early GPU dumps show changing intro imagery. A second observer gates dumps until45s after first display-buffer use, then captures every tenth presentation: black at73.916s, and the title prompt in inspected captures at120.243/166.439s. Five late GPU captures have distinct pixel payloads. These are local conditional observations; the readback change is not claimed to have enabled the early intro.Original ELF/module, converted guest libc and exact123-file runtime baseline restored/hash-verified; source checkout clean. Images, dumps, logs and probes remain private outside the repository. No push or new PR.
Read/write contract confirmed before changing sampling. A separate guard-preserving180s trace tags the active graphics draw with RAII: 131/131 dirty publications read eight-sample RGBA16F
0x405fc00000(534,773,760 physical bytes) while that draw writes a different single-sample/eight-byte 3840×2160 target0x404fc00000(66,846,720 bytes), with zero range overlap. 65 metadata transitions are imported withdirty=0after existing publication. No fatal diagnostic. This establishes the observed postprocessing relation, not a general absence of feedback.ImportPublishedClearcurrently rejects dirty native images, so simply removing sampled-lookup publication would violate that clear-state contract. The current MSAA color lookup also creates a fresh snapshot; a shared live view would require checking read-before-write/feedback behavior and lifetime. The establishedOwnedImageresource owner and Vulkan image-copy rules are relevant to preserving every sample on a GPU-only snapshot path.Next: implement and test the general native GPU sampling/copy path with complete known-clear transitions, every sample/component, queued producers, snapshot/feedback semantics, ownership and actual CPU-read publication/conflict guards. Current native images lack sampled/transfer-source usage; new view/copy capabilities need explicit queries. Unknown cases still throw. This canonical report is edited in place. AI-assisted code/investigation/report: Codex.
Earlier validation evidence and historical controls
The records below describe earlier checkpoints and retain their original observation limits. The latest section above supersedes historical statements that no frame had been demonstrated.
Maintained validation report (2026-10-12)
Current source reviewed: #419
c120d995472e2d49b01c7911401aa6675315c881, on maina11c8f7f. Its six commits were also applied without conflicts to our sampled-color/depth integration7b70443c0. The resulting663318a1is an adapted integration, not an unchanged whole-PR build.Confirmed current-head gap: guest-access guard misses tiled sample memory
The new guard registers
max(target.bytes, width * height * elementBytes * samples), butDecodeColorBufferstill supplies a single-sample layout size. This can omit valid texels in multisample tile padding.Concrete counterexample: 65x65, 4-byte elements, 4 fragments,
SW_64KB_R_X, one mip/slice. Single-sample size is 65,536 bytes; the guard covers 67,600 bytes; the fragment-aware physical footprint is 262,144 bytes. Texel(x=64,y=0,fragment=1)lies at byte offset 82,944, outside the guard. Geometry and this address match pinned AMD PAL/addrlib.I compiled the exact current PR's registration/refusal functions into a probe, installed that callback using the native
GuestMemory::SetReadGuard, registered real allocated guest memory, and called nativeGuestMemory::Read. All five original runs returned bytes from that valid sample without refusal. Giving the same guard the fragment-aware full extent refused all five control reads. A separate 18-configuration geometry/address probe (three extents, 4/8-byte elements, 2/4/8 fragments) also passed five repetitions per original/corrected variant. This exercises the extracted guard and real native CPU-read path; it does not run the whole PR's target constructor, GPU rendering or console hardware.Suggested correction: compute the supported target's physical sample-aware footprint and slice stride, and use that extent for guest-access checks; throw on layouts not established. #2132 already proposes sample-aware footprints for color fills, so that work should be considered when sharing the calculation. The counterexample is independent of title startup. A local current-base experiment now assigns the complete R_X sample footprint in
DecodeColorBuffer; other layouts remain refused by the initial-content path. PPSA99902 then reaches the retained initial-import refusal described below. The current upstream PR still has the footprint gap.Fresh covered-centroid boundary and initial contents
Two fresh PPSA99902 captures at the current boundary contain
PA_SC_AA_CONFIG=0x2030e003, standard 8x positions including sample7(7,-7), andSPI_PS_INPUT_ENA=SPI_PS_INPUT_ADDR=0x2(perspective-center only). Context/shader/user-config and all 12,288 effective constant-RAM words were captured; saved-context state was not captured.Pinned GFX10.3 schema names bit29
COVERED_CENTROID_IS_CENTER; RADV sets it on GFX10.3+. A bounded local follow-up admits that bit only without active perspective/linear centroid inputs, preserving active-centroid refusals in both precheck and decode. The raw captured draw now passes the coverage check and reaches the DCC MSAA-target refusal in five CPU-only repeats. No title register bit was cleared.Local integration
10103b27falso explicitly refuses multisample target creation because initial guest sample contents are not imported; it disables that render path and is not completed MSAA rendering. Full build/all 122 patched runtime libraries and conventions passed. Eleven relevant registered groups x5 and five actual full-recorder runs passed for both peer and guarded integrations; the guarded recorder fixture checks initial-content refusal, not GPU guest-access behavior. The guarded full suite: 843 total, 836 passed, five skipped, two already tracked failures (#3411, #3526).Two guarded title runs and an AGC-only replacement control reach
DCC over a multisampled color target is unsupported(30.828/29.822/29.722s). Restoring the peer profile reproduces the coverage refusal (29.795s). All use the same fixedmain-f609converted executable, Vulkan required/cache off; no timeout; original dump and exact 123-file baseline restored/hash-verified. These are conditional integration controls, not freshly relinked or stock-main startup.Refreshed complete metadata at the render refusal
Two new guard-preserving captures on integration
10103b27fconfirm CB0 is 3840x2160 RGBA16F, eight samples/fragments, one layer/mip,SW_64KB_R_X. The entire source-derived DCC range (552,960 bytes) is zero; the entire CMASK range (81,920 bytes) is0xCC. Raw/synchronized payloads and both captures agree; no tracked pending recorder/storage writes, flush or wait was reported. The physical color footprint is 534,773,760 bytes. Color and FMASK were captured only as 64 KiB prefixes; the FMASK prefix is0x76543210, not proof of its effective mapping.Against the current native library, ten state probes decode DCC as clear0000, encode all RGBA16F components as zero, and confirm CMASK
CCis classified as mixed with a retained refusal. Ten changed-DCC controls are rejected. Pinned Mesa definesCCas FMASK-clear0/color-expanded; it is not a color-register clear. A separate standalone probe calling the expected CMASK throw aborted across the DLL boundary; cause untraced, so the successful state probes do not validate that exception path.The capture diagnostics were restored byte-for-byte. Two further captures agree on the refusing reader: one-layer, one-mip, eight-sample RGBA16F R_X, 3840×2160, address
0x405fc00000, full footprint0x1fe00000, XOR0x8000, DCC0x40819f4000. This matches the recorded color target; the stop was incomplete residency coherence.The earlier local, unpushed experimental integration
fa08446d6(ona01b13ea0, maina11c8f7f) publishes each native color sample into guest R_X memory before guest-memory synchronization or sampled-texture lookup. It preserves tile padding and expands full DCC/CMASK/FMASK ranges; FMASK reimport requires a verified complete identity mapping. Expansion values follow PALGfx9Dcc::GetInitialValue,Gfx9Cmask::GetInitialValueandGfx9Fmask::GetPackedExpandedValueatc5e800072a32f68b6ccc4422936d96167c6e0728. Watched guest writes, pending external GPU writes, fills and unsupported transitions still throw. Direct CPU writes racing the final stores are not atomically excluded; eviction publication is incomplete. This remains local validation work, not an unchanged-PR-head test or console-equivalence claim.Full build, all 122 patched/unpatched libraries, registration and conventions pass. Ten relevant groups each pass five runs; each target run exercises 24/24 GPU configurations. Tests check physical fragments/XOR/padding, real native attachment writes, CPU publication, expanded metadata/reimport, conflict refusals and actual GPU sampled fetches of R32_UINT and RGBA16F/DCC. Five full recorder runs pass. Eight faulty variants are each rejected five times: zeroed samples, damaged padding, incorrect CMASK, incorrect FMASK, omitted dirty tracking, ignored publication conflicts, recursive publication and zeroed readback. Source bytes are restored and full build/tests repeated. Omitting the explicit recorder sync is a passing control five times:
CommandBatchstill submits prior work, waits on its fence and reaps completions. Ten full captured-metadata positives pass; ten changed-DCC controls reject. The current FMASK helper matches twelve pinned-PAL geometry cases five times.Full suite: 839 passed / 2 failed / 5 skipped, same failure names as the previous integration (
windows_exceptions,agc_driver_emulated_color_compare); slowest test 15.442 s. Those historical full suites were not green.Controlled before/after1/after2/restored runs take 30.692/32.268/33.964/30.357 s, all
0xC0000409, without timeout. Before/restored reproduce the resident color-texture refusal. Both after runs pass that boundary and stop atsample-preserving readback of a resident depth surface is not implemented. Source inspection confirms the depth-residency guard prevents sampling stale guest bytes; native multisample depth sampling/readback remains incomplete. All runs use the fixedmain-f609conversion and identical controls; original ELF/module and exact 123-file baseline hashes are verified after restoration. No frame or gameplay is established.Two temporary depth diagnostic captures now agree on the final reader and resident target: 3840×2160 D32, eight samples, Z_X, slice/mip zero, no XOR, depth
0x4081c00000, HTILE0x4091b00000. The reader is R32_SFLOAT with R/zero/zero/one components. Full physical depth footprint is0xff00000, while thefa08446d6overlap guard used the single-sample0x1fe0000range; the last logical sample is at0xfef9afc, outside that guard. Current native layout/HTILE helpers match 36 pinned-PAL geometry cases five times (180 comparisons). This guard undercount belongs to our local integration, not upstream main.Both full 640 KiB HTILE captures are byte-identical: 163840 clear-zero words, including padding, matching the native target's initial clear value. Ten native helper checks pass; changing the final word to unsupported compression or clear-one refuses in twenty controls. Refusals carry the expected runtime-error diagnostic but terminate through the current Windows libc path with
0xC0000409; they are not caught-exception passes. The second register capture additionally records earlierdepthWrite=1decode calls, so unchanged clear metadata does not establish that the native image was never written. At that capture stage there was no native multisample sampled-view test; arbitrary raw depth import remains unproven.Diagnostic sources are restored byte-for-byte; full build, all 122 patched/unpatched libraries, registration/conventions, ten relevant groups ×5 and full recorder ×5 pass again. Original dump/module and the 123-file baseline hashes are verified. The two diagnostic title runs stop at the unchanged resident-depth guard in 36.445/33.236 s, without timeout.
Local, unpushed
a8eac4dfenow corrects the full Z_X depth/stencil ranges used by overlap guards and array-slice strides; other multisampled attachment layouts throw. This is a prerequisite for resident-depth sampling, which remains refused. Full build/libs/registration/conventions pass, ten relevant groups ×5 and full recorder ×5 pass. Eighteen depth/stencil footprint cases run five times; the actual native helper matches 270 pinned-PAL comparisons. Four old-behavior variants—single-sample depth/stencil guards and depth/stencil strides—each fail five times. Both the library and the separately compiled graphics executable are rebuilt for those controls; the first stale-executable harness observation is preserved and excluded. Sources are restored byte-for-byte.Full suite: 839 passed / 2 failed / 5 skipped, no new failure names versus
fa08446d6, slowest 15.521 s; not green. Controlled before/after1/after2/restored runs take 33.314/33.421/32.850/32.426 s, all stop at the same resident-depth guard without timeout. Original/module and exact baseline hashes are restored and verified after each run. No startup advancement or native per-sample depth rendering/sampling is established by this correction. Array stride arithmetic is tested; slice XOR rotation and metadata slice identity remain unverified.Two additional pre-construction captures agree: initial depth clear is zero; the full depth/HTILE ranges are mapped and watched; no recorder pending writer overlaps; all 163840 HTILE words are zero. Raw
DB_HTILE_SURFACE=0x00040002retains pipe alignment and zero VRS encoding. These unsynchronized observations are not atomic against CPU stores and do not establish native per-sample contents after draws. Diagnostic sources were restored and full build/tests repeated.The intermediate local, unpushed integration
7731aa3d1was based on pinned main0a8b1d32. The old validated branch is preserved. Rebase dropped the Windows symlink/directory-time changes already merged upstream; the include conflict kept both required headers. Full build/libs/registration/conventions, ten relevant groups ×5 and full recorder ×5 pass. On intermediate main12c2266, full suite is 841 passed / 1 failed / 5 skipped; onlywindows_exceptionsfails, including five targeted repeats. sRGB comparison now passes. Later main0a8b1d32replaces the failing guest-exception-through-call_oncetest with guest-frame-only coverage and records runtime-DLL unwinding as technical debt. Its registered suite is 842 passed / 0 failed / 5 skipped, slowest 15.362 s; six upstream-related groups pass five repeats. All 244 patched/unpatched production-library outputs are byte-identical across this test-only rebase, so the green result does not establish a runtime-unwind fix.Controlled old/new/new/restored startup runs on the two rebases take 33.295/30.652/33.611/32.680 s and 32.864/33.267/32.228/32.641 s. All eight retain the resident-depth refusal and
0xC0000409, without timeout; fixedmain-f609conversion, original/module and exact 123-file baseline hashes checked after every restoration. Those rebases established no startup advancement, native multisample depth sampled-view verification, frame or gameplay.Local native multisample depth sampled views and next boundary
Previous validated local, unpushed integration
2d16b4316on pinned main0a8b1d32adds native one-layer D16/D32 Z_X depth sampled views. Import synchronizes producers, requires watched complete depth/HTILE ranges and uniform HTILE proving the registered zero/one clear, then retains exact attachment/reader identity. Guest CPU writes, external tracked GPU writes, arrays, stencil, VRS, unsupported raw imports, guest publication and metadata clear/fill transitions still throw. CPU stores racing the final generation check are not atomically excluded. This is adapted local integration work, not a change to #419's head or an unchanged-main test.Full build, all 122 patched/unpatched libraries, registration and conventions pass. Twelve relevant groups ×5 and full recorder ×5 pass. New native GPU tests exercise 12/12 D16/D32 ×2/4/8 samples ×initial-zero/one configurations, synchronize a queued initial metadata producer, rasterize two rounds of distinct per-sample depth values into the actual attachment, and fetch each sample through the retained sampled view with R/zero/zero/one components. D32 values are exact; D16 is within one normalized step. Full-range CPU read/write and external-write refusals, cache identity, metadata/layout and unwatched-memory controls are tested; a separate group checks 21 refusal cases. Six deliberate faults are caught five times each: omitted HTILE proof, ignored guest generations, ignored reader identity, disabled guest-publication guard, all raster masks selecting sample zero, and fetches selecting sample zero. Sources were restored byte-for-byte, full build/libs and native tests ×5 repeated. Full suite: 844 passed / 0 failed / 5 skipped, slowest 15.466 s. Linux/lavapipe and console/AMD semantics remain unverified.
Controlled before/after1/after2/restored runs take 33.144/34.708/34.598/32.777 s, all
0xC0000409, without timeout. Before/restored reproduce the resident-depth readback refusal; both changed runs pass it and stop atguest writes to a resident multisample target or its metadata are not implemented. Fixedmain-f609conversion and identical controls; original ELF/module and exact 123-file runtime baseline restored/hash-verified after every run. This establishes advancement past that conditional startup boundary, not a frame or gameplay.Two further guard-preserving captures (33.687/35.076 s) agree on the new boundary: existing 3840×2160 RGBA16F, eight-sample R_X color target
0x405fc00000, XOR0x8000, residentdirty=false. The full 552,960-byte DCC at0x40819f4000is zero and full 81,920-byte CMASK at0x40819e0000isCC, byte-identical across captures. Both ranges have newer driver-write stamps andStoredOver=true, with no newer CPU-write stamps; color and FMASK have no changed tracker blocks at this boundary. At that capture stage, the exact writer and ordering had not yet been traced; the follow-up below resolves the immediate writer. This is a retained local residency-transition refusal; it is not evidence of an upstream bug or a reason to accept stale native samples. Temporary diagnostics are removed byte-for-byte; full build/libs and twelve relevant groups ×5 pass again, baseline/original hashes verified.Latest local color metadata reset and HTILE boundary
Two follow-up immediate-caller captures map all post-publication CMASK and DCC
MarkWrittencalls toBdaResources::markWrittenPages(), reached from shader completion/fault checking. The CMASK extent and five DCC chunks cover the complete recorded metadata. The earlier Windows stack walker returned zero usable frames and is excluded as caller evidence.Current local, unpushed integration
fca91606con pinned main0a8b1d32admits a complete supported numeric DCC clear after native color publication. It requires unchanged color/FMASK, full uniform supported DCC/CMASK, watched generations and no pending external writer; it clears the retained native image and marks it for later publication. Unpublished samples, partial/mixed/unknown metadata, sample writes and recognized fill transitions still throw. CPU stores racing the final generation check remain unexcluded. No title-specific production branch or descriptor bypass was added.Full build, all 122 patched/unpatched libraries, registration/conventions, 13 relevant groups ×5 and full recorder ×5 pass. The new reset test checks 24/24 RGBA8/RGBA16F ×2/4/8-sample ×four-clear-code cycles, actual per-sample GPU values, cached RGBA16F fetches, same-view retention, physical publication/padding, pending-producer refusal and ten negative transition cases per format/sample configuration. Six faults are each caught ×5: ignored unpublished state, ignored sample conflicts, first-byte-only DCC proof, forced zero clear, omitted dirty tracking and omitted generation refresh. An initial fault-harness line-ending anchor failure applied no dirty-tracking mutation; it is recorded and excluded, and that fault was subsequently run successfully. Sources restored byte-for-byte; full build/libs and tests repeated. Full suite: 845 passed /0 failed /5 skipped of 850, slowest 15.429 s. Windows11/RTX5080/WinLibs GCC15.2; no Linux/lavapipe or console/AMD equivalence claim.
Controlled before/after1/after2/restored runs: 36.083/30.816/33.249/34.784 s, all
0xC0000409, no timeout. Before/restored retain the color metadata refusal; both changed runs pass it and stop atnative multisample depth fast-clear transition is not implemented. Same fixedmain-f609conversion and controls; original ELF/module and exact 123-file runtime baseline restored/hash-verified after every run. These timings do not establish a performance change; no frame or gameplay is established.Two guard-preserving HTILE captures (35.217/34.640 s) agree on the retained 3840×2160 D32, 8-sample depth target
0x4081c00000, HTILE0x4091b00000. The recognized mask kernel uses 640×1×1 groups, 64×1×1 threads, flags0x2045, replacement0, keep mask0xff0, with no indirect or partial dispatch. The complete 655360-byte pre-dispatch HTILE is zero in both captures. These are pre-dispatch contents, not proof of the resulting HTILE or native depth samples. The current matcher checks kernel/user inputs but not dispatch coverage. Diagnostic sources are removed byte-for-byte; full build/libs and 13 relevant groups ×5 pass again; baseline/original hashes verified.A subsequent completion-point diagnostic leaves the native refusal intact, calls
Recorder::SyncThroughfor the full HTILE, then captures it at the refusing reuse. Both runs (35.250/34.698 s) again contain 163840 zero words; they report no pending HTILE writer before/after the call, newer tracked stores (StoredOver=true), and unchanged tracked guest depth bytes. The synchronization call was not observed waiting for a pending writer. Native depth samples after draws and CPU-store atomic exclusion remain unverified; unchanged guest bytes are not proof that the native image was never rasterized.The exact 17-word public mask kernel decodes to a group/local linear index, 16-byte offset, global DWORD×4 load, four AND-OR operations and DWORD×4 store. Pinned Mesa NIR independently specifies
(old & keepMask) | replacementand 16 bytes per invocation. Thus the recorded 640×64 invocations span 655360 bytes when the group-ID/thread input controls match; those controls were not recorded by the earlier diagnostic. The0xff0user word is a keep mask, not the resulting HTILE clear word.An external adaptation of the existing production-kernel GPU test checks 36/36 wave32/64 ×groups1/63/64/639/640/641 ×three-replacement cases, every DWORD and head/tail guards, ×5 runs (0.660–1.550 s). Every input word has bits that must change, avoiding an all-zero no-write false pass. One-workgroup-short and wrong-keep-mask faults each fail ×5 with the expected DWORD mismatch; the correct probe then passes ×5 again. Existing masked-store and VOP3 integer-ALU groups also pass ×5. Diagnostic source bytes and full build/libs restored; 13 relevant groups ×5 pass again; source clean and original/module/exact baseline hashes verified.
Related work reviewed: #2053
9a62ec7ereads changed HTILE at bind and expands guest words; #381669a67ca8matches a different memory-value fill kernel. Neither PR head was built/tested in this round. These proposals are relevant context, not drop-in validated native multisample transitions. The same mask matcher remains in inspected upstream mainc5da8233.Local refresh onto pinned main
a672688e(2026-10-12). Preserved the validatedfca91606branch; rebased the local integration, retained adjacent upstream math/debt additions, and consolidated the independently addedColorTarget::arraySlicemember. Main's WindowsHostPollbuild failure was corrected with the exact existing #4021 change; its source/platform/network validation is recorded there. Local integration9ded7ba36, full build +libs, registration and convention checks pass; the same 13 native multisample groups ×5 and full recorder ×5 pass.The broader refresh is not a clean full-suite pass: 868 tests = 862 pass, one failure (
agc_driver_prepared_shaders_registered_workgroup_sync), five explicit skips; maximum test duration 15.535 s. Of 49 affected groups repeated ×5, 47 pass; synchronous registered-workgroup preparation fails in the group run and all five isolated reruns. An external copy of that test, changing only its error label, identifies the missed expectation asv_readlane_b32 of lane 63 is outside. The deferred preparation group had one heap-corruption exit (0xC0000374), then passes five isolated reruns and the full suite; cause remains unconfirmed. Existing test and library source were not changed to suppress either failure.Four controlled startup runs (preserved fca / refreshed twice / restored fca, 36.232/36.196/35.916/34.886 s) all stop at the same native multisample depth fast-clear refusal, exit
0xC0000409, without a timeout. No additional startup progress or frames claimed. Original executable/module, converted guest libc, exact 123-file runtime baseline and clean checkout verified after the runs.Refresh validation follow-up. The registration assertion was a constant-zero fixture; exact two-line correction and evidence preserve its negative check. Existing #4029 production changes now applied locally (
274d3f9b2); independent Windows validation records100/100 targeted runs and a full868-test suite of863pass/0fail/5skip, plus build/libs/conventions. Four startup controls (34.368/34.860/34.792/34.475 s) still stop at the same native depth fast-clear refusal, without timeout; exact originals/123-file baseline restored.Dispatch input controls confirmed on local
274d3f9b2: two guard-preserving captures (35.393/34.909 s) record six user SGPRs / decoded group-X registers6, group IDs(true,false,false), one thread-ID component (v0), no TG-size word, no LDS/scratch, wave64, rawCOMPUTE_PGM_RSRC2=0x8c. The refusing target has 640×1×1 groups of 64×1×1 threads, direct/non-partial dispatch. This closes the earlier input-placement caveat for this observed kernel:(s6*64+v0)*16covers the full655360-byte metadata allocation. The target records single slice, Z_X, XOR0, ITERATE_256/pipe alignment, no stencil plane and no VRS.Both full pre/completion payloads again contain163840 zero words (same SHA-256 as the earlier captures); metadata has newer tracked-store evidence, guest depth bytes remain tracked unchanged, and no pending writer is observed before/after
SyncThrough. This is not proof of native sampled values or CPU-store atomic exclusion. The captured decoded flags also do not independently settle every nonzero HTILE encoding; PAL'sTileStencilDisabledlayout choice must not be inferred solely from absence of a stencil plane.Diagnostic source bytes restored; full build/libs and13 relevant groups ×5 pass again. Original/module/converted libc/exact123-file runtime baseline verified and checkout clean.
Completed native depth-clear transition implemented locally (
406838ac7, unpushed; pinned maina672 integration). The exact mask kernel must have six user SGPRs, group X ins6, local X inv0, full 64-thread one-dimensional groups and complete HTILE coverage. The request records its metadata generation before dispatch. Reuse requires a newer tracked store, no tracked CPU writes after that generation, no pending recorded writer, unchanged guest depth samples, and a complete metadata range proving the register's zero/one clear. The retained native image is cleared with ordered barriers; cached readers keep the same image/view. DB_STENCIL_INFO.TILE_STENCIL_DISABLE selects depth-only versus depth/stencil metadata independently of whether a stencil image plane exists. Unknown, incomplete, partial/indirect, racing and mixed transitions still throw; CPU atomic exclusion after the last check and console/AMD equivalence remain unverified.Source-audit clarification:
StoredOveraccepts CPU or driver stores. The earlier diagnostic's true value alone did not establish writer ownership; that wording is corrected above. This implementation separately checksUnchangedSinceCollectedto reject observed CPU writes. Clear layouts follow PAL GetClearValue; coverage/mask arithmetic follow the pinned Mesa kernel linked above.Full build/libs/registration/conventions pass. 14 relevant groups ×5, full recorder ×5; new GPU tests cover 24/24 D16/D32 ×2/4/8 samples ×two metadata layouts ×zero/one configurations, three raster→clear→cached-fetch cycles each, every sample/component and output guards. There are31 refusal cases including ten new transition cases, plus pure malformed-dispatch/layout controls. Six deliberate faults each fail ×5 for the expected assertion: one-byte-short coverage accepted, missing post-dispatch store proof, disabled CPU-write guards, ignored final metadata word, wrong native clear value, and omitted cached-holder validation. Source byte-restored; full build/libs and14 groups ×5 pass again. Full suite: 864 pass /0 fail /5 skip of869, maximum15.299s. Windows11/RTX5080/WinLibs15.2; no Linux/lavapipe or unchanged-main claim.
Controlled title runs: before36.653s and restored34.425s reproduce the old native depth fast-clear exception (
0xC0000409); changed runs reach the60s observation limit (61.332/61.266s including termination) without that exception. This is not a demonstrated boot/frame/menu. A180s observation of the same clean profile, with three successful own-process debugger attachments/detaches, remains active until stopped at181.158s. At45/95/145s the same worker is sampled inCommandBatch::Wait,WindowsMappings::Collect/host import, thenMultisampleTextureLayout::Tile; aggregate CPU time grows34.891→75.328→113.328s and log size grows100864→102792→103370 bytes. These show ongoing activity; the snapshots do not establish the dominant cost or explain every wait. No new fatal guard is observed.Original executable/module, converted guest libc and exact123-file runtime baseline restored/hash-verified after the normal and debugger observations. Sources clean; no pushes/new PRs or proprietary data attached.
Next: measure the newly reachable host-import, readback and multisample-tiling work, then distinguish startup cost from repeated work or a missing synchronization/implementation condition before proposing the next general fix. This canonical report is updated in place.
Addressed and historical findings
The current PR has the corrected standard8 sample7
(7,-7); the old decoder correction needs no further fix. The inherited #374 HTILE issue was corrected and merged.The historical CMASK
CCclassification proposal is preserved in fork b4893764; it distinguishes FMASK-clear/color-expanded from a color-register clear using pinned Mesa codes. Sample-preserving readback dd443ad2 remains separate from initial imports/residency/write-back. Broader sampled-color/depth findings: #3036, #3262; FMASK semantics: #3219.Windows11/RTX5080/WinLibs GCC15.2. No frame/gameplay, console/AMD hardware or Linux/lavapipe claim. Full logs/private captures/probes remain outside the repository. AI-assisted investigation/code/report: Codex. This canonical comment is edited as findings change; no new PR or upstream publication.
Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-11T07:59:35Z.
@Amoenus thanks, fixed in
9a1a0672(credited): sample 7 of the standard 8x table is(7, -7), with a regression row decoding your two capturedPA_SC_AA_SAMPLE_LOCSwords as the standard pattern (it fails with the old entry). This PR also picks up #374's HTILE extent fix when it is re-stacked on #374.COVERED_CENTROID_IS_CENTERand DCC over a multisampled target stay refused in this PR; they need their own handling (centroid inputs, initial MSAA contents and the CMASK 0xC state), as you found.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T08:40:28Z.
Review: CHANGES_REQUESTED
#374 is merged now, so this needs the rebase you mentioned. Two things before it can land:
main. The branch still carries #374's old commits (501ac6951…b8ae1f4b7); drop them. A merge against currentmainconflicts inlibSceAgcDriver/CMakeLists.txt,BufferFill.cpp,PacketMemory.cpp,DepthSurface.hpp/.cpp,State.hpp/.cpp,Texture.hpp/.cppandtests/Graphics.cpp. Please rerun the PR's tests after the rebase, not just check that it applies.Once both are in I'll review the rest on the rebased head (build, ctest, negative check on the new cases).
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T10:12:12Z.
One thing to add now that #2636 is on
main: on GPL devices, graphics pipelines are linked from per-stage libraries cached bylibraryKeys(Graphics/src/Pipeline.cpp), and those keys don't include the multisample state. The fragment shader and fragment output libraries are built withrasterizationSamples(and aVkPipelineSampleLocationsStateCreateInfoEXTwhen the locations are custom), so with this PR a 1x and a 4x pipeline with the same shaders and formats would share libraries. @Raghav314 found it in #2242 while testing this PR on PPSA36082.Please append the sample count and the sample locations to
keys.fragmentShaderandkeys.fragmentOutput, and add a case to the library-reuse test that draws the same shaders at 1x and 4x and checks they don't share those two libraries. It doesn't affectmaintoday because every pipeline there is 1x.Imported from boykopovar/AnyPS5. Originally posted by exefer on 2026-10-11T10:29:26Z.
Hit this exact error on Wobbly Life (PPSA29413, Unity) in-tutorial:
register 0x2f8 = 0x0030e003, which decodes per yourdecodeSamplesas standard 8x (log2 3, 8 exposed, all set bits in the accepted mask). Bring-up #2211. Looks like #419 covers this draw; leaving the rebase to you.Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-11T12:14:55Z.
@adriadam10 thanks, all three go in with the rebase tonight once main is quiet: #374's commits dropped and the branch rerun on
main; guest access to a multisampled colour target (CPU read through write tracking, DMA copy, texture/image read) throws, with a resolved-only test; and the multisample state (sample count, plus the locations when custom) appended tokeys.fragmentShaderandkeys.fragmentOutput, with a library-reuse case drawing the same shaders at 1x and 4x.@exefer yes,
0x0030e003is standard 8x and #419 takes it.@Amoenus thanks for the CMASK model and the
COVERED_CENTROID_IS_CENTERanalysis. Both are real gaps, but this PR keeps refusing them. The centroid guard (admitted only without active centroid inputs) and the CMASK state split would be best as your own follow-up PRs on top of #419 once it lands, with you as author.Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-11T13:45:40Z.
A title that stops where this PR applies: ProsperoPuzzles (PPSA99006), on
maina11c8f7f(Windows 11, RTX 4070, catalog build witheboot.binandsce_module/libc.prxunwrapped):CB_COLOR0_ATTRIB = 0x00012000isNUM_SAMPLES2 andNUM_FRAGMENTS2: a 4x MSAA color target. The title prints this only to its own log (download0/prosperopuzzles/app.log); the console shows only the entry-point line and exit0xc0000409.I wanted to run it with this branch, but the head currently conflicts with
main(libSceAgcDriver/CMakeLists.txt,BufferFill.cpp,PacketMemory.cpp,TechnicalDebt.md). I'm happy to run ProsperoPuzzles on Windows once it's rebased.Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T14:30:02Z.
Data point: New Joe & Mac: Caveman Ninja (PPSA02801, Unity) on Windows, current
maina11c8f7f7plus--module-dir Media/Modules --module-dir Media/Plugins. It gets through start-up and aborts on the first presentation withmultisampling or coverage conversion is unsupported (register 0x2f8 = 0x00108001), which is the check inState.cppon context register 0x2f8. I did not test this PR on it.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-11T14:52:44Z.
@adriadam10 rebased onto
maina11c8f7f7(headc120d9954). #374's commits are dropped, and the PR's tests were rerun on the rebased head.Rebase. The conflicts were resolved against main's versions, keeping main's behaviour:
SW_64KB_Z_X). The 8-byte element limit and the CMASK range check now apply to single-sample targets only.multisampled()fixture intests/Graphics.cppsets the CMASK layout bits main now requires, and the fast-clear resolve case uses real CMASK memory.Guest access to a multisampled colour target throws (
c120d9954). Each target registers its guest range when acquired, sized to cover all its samples, andClearMultisampleTargetsdrops the ranges. These overlaps throw... overlaps multisampled color target ..., whose samples are only on the host: guest access to it is not implemented:GuestMemory::Read/ReadCommitted, before the GPU-write flush);DMA_DATAcopy from memory;multisampleGuestAccessTestsintests/Recorder.cppcreates a 4x RGBA8 target and expects the throw from all three paths. It also checks that a read outside the target, and a read after the targets are cleared, still succeed.GPL libraries keyed by the sample count (
e3b870c91).state.samplesis appended tokeys.fragmentShaderandkeys.fragmentOutput. Sample locations are not keyed after all: anything other than the standard 2x/4x/8x pattern is refused indecodeSamples, so the count determines them. The library-reuse case draws the same shaders at 4x, expects the fragment libraries to be rebuilt, then goes back to 1x and expects no rebuild. Negative check: with the two key lines removed, that case fails with "a 4x pipeline shared the 1x fragment shader or fragment output library".Results on the rebased head:
agc_driver_graphics,agc_driver_recorder_tests(including--pipeline-library-only) andagc_pipeline_library/_offpass.agc_suite has the same failures as onmain. The deferred prepared-shaders and disk-cache tests fail under-j4and pass alone; the emulated colour-compare sRGB failure fails onmaintoo.check_conventions.pypasses.@AchrafReyani
CB_COLOR0_ATTRIB = 0x00012000(4 samples, 4 fragments) is a target this PR accepts.@xXPBSXx
0x2f8 = 0x00108001is 2x with 2 samples exposed, which this PR's decode accepts as long as the title uses the standard 2x sample locations.Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T16:02:21Z.
Static check for New Joe & Mac (PPSA02801), which stops on
PA_SC_AA_CONFIG(0x2f8) =0x00108001("multisampling or coverage conversion"). Fields from Linuxgc_10_1_0_sh_mask.h: bit 0 isMSAA_NUM_SAMPLES= 1 (2 samples), bit 15 is insideMAX_SAMPLE_DIST(bits 16:13, value 4), bit 20 isMSAA_EXPOSED_SAMPLES= 1. The state check this PR adds masks out0x7 | 0x1e000 | 0x700000, so0x00108001is accepted by that register check; whether the title then passes the rest (2-sample color and depth targets, standard sample locations) I have not run. I only read the diff againsta11c8f7f7, so this says the register is covered, not that the title renders.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T16:12:21Z.
Static check for Resident Evil 4 (PPSA07411), which stops on
scan conversion mode is unsupported (register 0x292 = 0x00000003). Register 0x292 isPA_SC_MODE_CNTL_0(Linuxgc_10_1_0_offset.h);0x3isMSAA_ENABLE(bit 0) plusVPORT_SCISSOR_ENABLE(bit 1, whichState.cppalready handles). In this PR the bit 0 exemption is conditional:zero(cx, 0x292, result.samples > 1 ? ScanModeMask & ~1u : ScanModeMask, ...), and the same condition in the draw-rejection check. So a draw withMSAA_ENABLEset and single-sample targets is still refused with the same message, and a draw with multisampled targets passes. I have not seen RE4's target sample counts (it stops before that), so I can not say which case it is, and I do not know what the hardware does forMSAA_ENABLE=1with 1-sample targets, so I am not proposing to relax the single-sample case. Read-only check against the PR diff, no run.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-11T16:12:54Z.
Windows check of the rebased head
c120d9954with ProsperoPuzzles (PPSA99006): Windows 11, RTX 4070, WinLibs GCC 15.2.0 r7, catalog build witheboot.binandsce_module/libc.prxunwrapped.The
register 0x31d = 0x00012000stop from my earlier comment is gone. The title now stops on one of this PR's own checks, at the first draw into its 4x target:Register values at that check (from a local debug print, not part of any branch):
CB_COLOR0_ATTRIB(0x31d)0x00012000CB_COLOR0_INFO(0x31c)0x00008028PA_SC_AA_CONFIG(0x2f8)0x00000000MSAA_NUM_SAMPLES= 0)PA_SC_MODE_CNTL_0(0x292)0x00000022MSAA_ENABLEoffSo the draw rasterizes at one sample into a 4-sample colour target with no depth. The title renders through blackbearreloaded/ps5-opengl (Mesa gallium on AGC, GL 4.6 core). I haven't found which GL operation emits this draw.
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T17:05:14Z.
Test of this PR on titles, built as
maina11c8f7f7+ this PR (6 files merged without conflicts) + #425 (see the note there), Windows, RX/NVIDIA 10de:2702 driver, 60 s per run, no claim about the image:scan conversion mode(0x292) andmultisampling or coverage conversion(0x2f8 =0x00108001). New first stop, exact line:[videoout] presentation failed: AGC graphics: nonstandard sample locations are unsupported. I have not looked at which registers hold those locations or whether they are really nonstandard for this title.PA_CL_VS_OUT_CNTLclip-distance stop from #423 is not reached in that time, so I can not say whether this PR affects it).mainit does not start (33 imports are absent in the audit, e.g. severalsce::Jsonfunctions andsceHmd2*, covered by branches not inmain), so the0x292 = 0x3stop could not be reached.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T17:19:42Z.
Follow-up on my Kena (PPSA01746) line above (
maina11c8f7f7+ this PR + #425): a second run of 100 s instead of 60 s ends withFATAL: unhandled exception 0xc0000005, a write of address 0 atapp.exe+0x1c7a46bon a game thread, called fromapp.exe+0x1c1ba79. It is a crash inside the title's own code (null pointer store), not an AGC error line, and I have not run plainmainto check whether this PR or #425 matter for it; thePA_CL_VS_OUT_CNTLclip-distance stop of #423 was not reached either way. So for Kena the PR makes no visible difference in my runs.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by billythemenace2 on 2026-10-11T17:32:22Z.
Test of the rebased head
c120d9954with PPSA06888 (Unity), Windows 11, RX 5700 XT (AMD proprietary driver), MinGW GCC. Built asmaina11c8f7f7+ this PR + #2169's sample-location commits (567f69eef,16e0e5a12, and thePipeline.cpppart of55cc2824f) + fivelibSceRudpexports the title needs (separate PR coming). Full relink with that build's relinker.1.
PA_SC_AA_CONFIG=0x00108001(2x, 2 exposed, max distance 4) is accepted, as you said for New Joe & Mac.2. Sample locations. With this PR alone the title stops at
nonstandard sample locations are unsupported. All four pixels ofPA_SC_AA_SAMPLE_LOCShold0x0000c44c: sample 0 at (-4, 4), sample 1 at (4, -4). That is the other diagonal from the standard 2x pattern in this PR's table, which matches Mesa (radv_device.c:975FILL_SREG(4, 4, -4, -4, ...), radeonsisi_state_msaa.c:77FILL_SREG(-4, -4, 4, 4, ...)), so the table is right and the title really uses a custom pattern. It is uniform across the quad, so #2169 takes it: with its commits the state decodes as custom locations and the title draws. New Joe & Mac stops on the same check with the same0x2f8value; I have not checked its registers, so I can't say whether it uses the same pattern.3. New stop: the guest-access guard from
c120d9954, hit by memory reuse.Local debug prints (not in any branch):
0x226a10000,0x229c90000,0x22cf50000,0x230f10000,0x243090000,0x244a50000,0x2483d0000), all without CMASK.0x38, starting at0x22cf41000, 0xF000 bytes before the target. Descriptor words:022cf410 c3800000 006b813f 90500fac 00000000 00700000 00000000 00000000.So this isn't a read of the multisampled image. It is a different, smaller resource in memory that a 2x target occupied earlier, which looks like Unity reusing render-texture memory. Guard ranges are only dropped in
ClearMultisampleTargets(device teardown), so once a title's allocator hands that memory to something else, every read of it throws.Suggestion: retire a multisampled target (its guard range and host image) when something else writes its memory, for example a single-sample colour or depth target bound over it, a fill or
DMA_DATAwrite, or a CPU write seen by write tracking, and keep throwing only when the bytes being read were last written by the multisampled target. I have not established which of those wrote the 1280x431 texture here. I can add a print for whichever hook you pick and rerun.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T20:06:42Z.
Follow-up on New Joe & Mac (PPSA02801), the
nonstandard sample locations are unsupportedstop, onmain12c226628+ this PR. I printed the failing sample (temporary local trace, not committed): 2 samples, pixel 0, register0x2fe(PA_SC_AA_SAMPLE_LOCS_PIXEL_X0Y0_0) =0x0000c44c. With the decode used bydecodeSamples(low nibble x, high nibble y, both signed, in 1/16 pixel): sample 0 = (-4, +4), sample 1 = (+4, -4). The PR's table for 2 samples is {(4, 4), (-4, -4)}, so the title programs the other diagonal. The trace stops at the first mismatch, so I do not know the other three pixels' values. I make no claim about whether the console's own default for 2x is this diagonal; the PR rejects it correctly as it stands, because Vulkan's standard 2x positions are the PR's table and a different diagonal would needVK_EXT_sample_locationsor a mirrored resolve.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T20:24:02Z.
Sources for the sample-location stop of New Joe & Mac (PPSA02801), which programs 2 samples at (-4, +4) and (+4, -4) (see my comment above):
gc_10_1_0_offset.hhasmmPA_SC_AA_SAMPLE_LOCS_PIXEL_X0Y0_0 = 0x02fethroughmmPA_SC_AA_SAMPLE_LOCS_PIXEL_X1Y1_3 = 0x030d(16 registers, four per pixel);gc_10_1_0_sh_mask.hdefines per register eight 4-bit fieldsS0_X(bits 3:0),S0_Y(7:4),S1_X,S1_Y, ...S3_Y(31:28), which is whatdecodeSamplesreads (signed, 1/16 pixel).radv_device.chassample_locs_2x = FILL_SREG(4, 4, -4, -4, 0, 0, 0, 0), the same two points as this PR'sStandardLocations2;radv_cmd_buffer.c(around line 2451) also writes these registers from application-provided positions forVK_EXT_sample_locations.VK_EXT_sample_locations(sampleLocationsEnableplusVkSampleLocationEXTper sample, and the device'ssampleLocationSampleCountslimit) for the draw, and the guest's resolve then averages samples regardless of position. I did not check the device limits, did not find a shadPS4 or KytyPS5 implementation to cite, and have not seen the title's other three pixels, so this is a pointer to the mechanism, not a claim that it would be correct for this title.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T21:36:16Z.
Review: APPROVED
Rebased view checked on current
main: build + ctest of the touched components pass (690/690),agc_driver_graphicsand the guest-access test run, not skipped.Added as our own commits on your branch:
TechnicalDebt.md: your rebase leftHost importsandCube texture descriptorstwice (the older text); removed the duplicates.MultisampleTarget.cpp): it coveredmax(single-sample bytes, w*h*element*samples), which misses the tile padding of the later sample planes (Amoenus' 65x65 4x case: texel(64, 0, fragment 1)is at byte 82944, outside the 67600-byte range). It now coversCB bytes * samplesat least. The test has a row for that padding and fails with the old formula.multisampleGuestAccessTestsonly ran in the full recorder binary, which no ctest entry starts. It has a--multisample-onlymode and theagc_multisample_guest_accesstest.TechnicalDebt.md: the guard bound (inferred, not addrlib's exact fragment-aware footprint) and that multisampled targets are never evicted;ARCHITECTURE.md: a bullet on host-only multisampled targets, the guard and the resolve.Not covered by any test here: an actual MSAA draw and
ResolveMultisampleTargeton a GPU (the tests pin decoding, library keys and the guard). The title reports in the thread (Hades II on an RTX 4090, ProsperoPuzzles on Windows) are the evidence for that part; the stops they report next (sample locations of New Joe & Mac / Hades II, the sample-count check of ProsperoPuzzles) are follow-ups.Merging once CI is green.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T21:50:07Z.
Rebased again on current
main(it conflicted with the newagc_draw_snapshot_captest registration inlibSceAgcDriver/CMakeLists.txt; both tests are kept, no logic changed). Build + ctest of the touched components pass,agc_driver_graphicsandagc_multisample_guest_accessrun, not skipped.Our commits on your branch are unchanged: duplicate TechnicalDebt lines removed, the guest-access guard covering
CB bytes * samples, the guard test registered in ctest, and the TechnicalDebt/ARCHITECTURE notes.Not covered by any test here: an actual MSAA draw and
ResolveMultisampleTargeton a GPU; the title reports in the thread are the evidence for that part.Merging once CI is green.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T21:59:50Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppL44core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppL832-838core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppL44core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppL832-838core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppL44core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppL832-838core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppL833-836core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppL290-291core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppL4Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-11T22:15:12Z.
@billythemenace2 thanks, that reading is right: the guard ranges only go away at device teardown, so once Unity hands a former 2x target's memory to another resource, every read of it throws. With #419 merged that is on
mainnow, so I'll do the follow-up PR: a multisampled target is retired (its guard range and host image) when its memory is written as something else, for example a single-sample color or depth target bound over it, a fill orDMA_DATA, or a CPU write the write tracking sees. The guard then throws only for reads of bytes the multisampled target still owns.It would help to know which of those wrote the 1280x431 texture in PPSA06888. If you can add a print, the cheapest place to start is the single-sample color/depth target setup over the range: that's the hook I'd put first.
The sample-location stops (New Joe & Mac, PPSA06888) are #2169's path, as you found.
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T04:47:49Z.
Source for how another PS5 emulator treats the
PA_SC_AA_SAMPLE_LOCS_*registers (addition to my comment above on the registers and Mesa): KytyPS5 stores the 16 registers0x2FE..0x30D(pm4.h) aslocations[16]of a context struct (HwCtxSetAaSampleControlinpm4Handlers.cpp, which also takes them as a 20-dword block together withPA_SC_CENTROID_PRIORITY_0/1), andrenderer/debug.cpp(AaCheck) does not render with them: for any non-zero location, non-zero centroid priority or sample count it only logs, at most 16 times,warning: unsupported PS5 sample locations use native Vulkan locations: samples=..., exposed=..., max_dist=.... So Kyty's behavior is to ignore the guest locations and use Vulkan's native ones with a warning. That is a precedent, not a statement about what is correct for New Joe & Mac (its 2-sample locations are the mirrored diagonal from my earlier comment); if this PR or a follow-up wanted the same tolerance, it would be a deliberate approximation and belongs inTechnicalDebt.md, not a silent accept. shadPS4 only has the register names in its devtools (gcn_context_regs.cpp), no handling.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T05:22:43Z.
Summary of the registers behind
nonstandard sample locations are unsupported, with the origin of each statement:PA_SC_AA_SAMPLE_LOCS_PIXEL_X0Y0_0 .. X1Y1_3=0x2fe .. 0x30d(16 registers; four per pixel of the 2x2 quad; each register has four samples as 4-bit signed x/y fields in 1/16 pixel). Origin: Linuxgc_10_1_0_offset.h/gc_10_1_0_sh_mask.h(non-PS5). KytyPS5 (pm4.h) uses the same block of 16 starting at0x2FE.PA_SC_CENTROID_PRIORITY_0/1=0x2f5/0x2f6(same Linux headers, 8 four-bitDISTANCE_nfields per register). Mesaradv_cmd_buffer.c(radv_compute_centroid_priority) derives them from the sample locations: it sorts the samples by squared distance from the pixel center and writes the order. They only affect which sample is used for centroid-interpolated inputs, not coverage.radv_device.chas the standard tables (2x: (4,4), (-4,-4)); the title here programs (-4,+4), (+4,-4).renderer/debug.cpp,AaCheck); shadPS4 only names the registers (gcn_context_regs.cpp).What a minimum treatment could be, as far as these sources support it: (1) keep rejecting unless the 16 location registers equal a standard table, as this PR does; (2) if an approximation is accepted, accept the mirrored 2x pattern only, explicitly, and list in
TechnicalDebt.mdthat the host uses Vulkan's native positions (same trade-off as Kyty), because with equal-weight resolves the sample positions change only where geometry edges fall within the pixel, and with centroid inputs; the sources do not say how visible this is on the console. I would not accept arbitrary locations silently. No code from me.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T11:52:16Z.
Update for New Joe & Mac: Caveman Ninja (PPSA02801), the title that stopped on
nonstandard sample locations are unsupportedin my earlier comment: on currentmaine7c70a2df+ #425 + #4408 + #3840 (plus local diagnostic prints, not committed), relinked with 0 absent imports, Windows, RTX 4080 SUPER, 240 s limit: no stop. The run reached the time limit; apart from my diagnostic lines the log has only the[SAVEDATA:native]memory calls and the usual start-up lines, nopresentation failed, noFATAL. The log shows thousands of indexed draws and dword fills, so the title is drawing. I have not looked at the image. The sample-locations stop is therefore gone with the changes that landed after this PR (custom sample locations from #2169 and #4309), at least for this title.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by KingDarkHN on 2026-10-13T03:54:31Z.
Following up on the retire-on-write idea from #4199/#1189: I implemented and tested it locally against Fallen Legion (PPSA07645), and wanted to share the results.
Implementation
storeOwn(the innermost guest store: the game's memory-operation shims and the driver's own writes).storeOwn: DMA_DATA destinations, WRITE_DATA/COPY_DATA stores (ResolveStore) and buffer fills.Result in the game. Fallen Legion aborts on a real macro that reuses a multisampled color target's memory after a resolve (the same 4x 3840x2160 target that #2121's resolve involves). With this change the store now retires that target instead of leaving a stale guard that crashes the next frame:
One observation for the follow-up. The remaining overlapping reads in the title do not have a tracked preceding write: parts of the reuse come from GPU shader stores (or writes that happen before the target/guard exists). Retiring on writes alone therefore does not fully un-hang the game. Since true MSAA sampling/readback is not implemented, refusing those reads only ever aborts the title; letting them read the (now foreign) memory would turn a hard crash into a minor visual artifact while a real read-side test proves the region was repurposed.
Happy to turn the write-guard core + test into a PR if useful, or to adjust the read-side behavior to match what you prefer.