Skip to content

feat(agc): take a full DCC fill of a resident multisampled target as its fast clear - #7250

Merged
adriadam10 merged 3 commits into
boykopovar:mainfrom
milescoviello:feat/msaa-dcc-refill
Oct 19, 2026
Merged

adriadam10 merged 3 commits into
boykopovar:mainfrom
milescoviello:feat/msaa-dcc-refill

Conversation

@milescoviello

@milescoviello milescoviello commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

What

A native multisampled color target with DCC imports its uniform DCC fast clear on first use (initialDccClear). After that, checkDccCurrent refuses any change to its color, DCC or CMASK memory.

Titles built on the PS5 Mesa stack fast-clear such a target with two buffer fills. The RADV fill kernel, which #6543 takes as a buffer fill, writes the CMASK to 0xcc (FMASK cleared, color expanded) and the DCC to a uniform clear key. They do this every time they clear the target. So the target's second use stops on:

AGC graphics: writes to a resident multisampled DCC target or its metadata are not implemented

A local print in NoteColorMetadataFill showed the fills (main e383833 + #6543):

App Target CMASK fill DCC fill
Rush 2 (PPSA69423), 2x 320x241 0x40062c0000+0x1000 <- 0xcccccccc 0x40062c1000+0x1000 <- 0x40404040
Ruffle (PPSA68091), 4x 1920x1080 0x4004600000+0x6000 <- 0xcccccccc 0x4004606000+0x14000 <- 0xc0c0c0c0

The fills are recorded on the GPU. When the next draw binds the target, they're usually still pending in the same batch.

This PR handles that case in MultisampleTarget.cpp:

  • Noting fills. NoteColorMetadataFill now records, per resident DCC target, the last fill over its DCC range and the last one over its CMASK range. A fill that covers the range only partly clears the record.
  • Taking the clear. At the next use, ApplyFastClear first runs absorbDccFill. When a whole-range DCC fill was noted and the range holds that key once pending writes land, it computes the clear with MultisampledDccClear, as the import does, from those bytes. It then clears every sample to it and takes the ranges' new write generations. A CMASK written since the last use must also have been filled whole with what it now holds.
  • Reading the landed bytes. The new LandedUniformMetadataByte (DccMetadata.cpp) returns the uniform byte a range holds once pending recorded writes land (KeysAfterPendingWrites), or the bytes in memory when nothing is pending. It reads the bytes directly, after FlushGpuWrites, rather than through GuestMemory::Read, whose resident-image read guard refuses these ranges.
  • Skipping the metadata check. checkDccCurrent then checks only the color range, so the absorbed fill may still be pending.
  • Refusals kept. Partial fills, other keys, CMASK-only writes and any write to the color memory are refused as before.
  • CMASK-only tracker. Fills of a DCC target's CMASK no longer go to MultisampledCmask. That tracker models CMASK-only fast clears and refused 0xcc as mixed (its MSAA codes are fix(agc): read a multisampled target's CMASK by its MSAA codes #6669's topic).

Why the fill is enough: after a fill of uniform clear keys over the whole DCC range, every block reads as the clear color whatever its color bytes and FMASK hold. The guest's DCC bytes can't tell us this on their own, because draws don't update them on the host. A same-value CPU store to the keys stays refused (the existing case in DccFastClearTests).

Tested

Linux (Ubuntu 24.04, GCC 13.3, Release), RTX 4070 Ti, NVIDIA 595.99.02; main 5859889. Rebased onto main e0fcdb5 (c92d72c), which has #7132; the only conflict was this debt entry next to #7071's new one. On the rebased head agc_driver_msaa_dcc_clear_{2,4,8} pass 3 of 3, and the 20 tests matching msaa|multisample|dcc|cmask|fmask|alpha_to_coverage pass.

  • agc_driver_msaa_dcc_clear_{2,4,8} (new DccRefillTests, run by --dcc-fast-clear), at 2, 4 and 8 samples with and without a CMASK:

    • a resident target re-cleared to 1111 by a whole DCC fill, plus a whole CMASK fill, on the CPU and recorded on the GPU with VulkanDevice::FillBuffer, resolves to the new color under the next draw;
    • a whole DCC fill alone gives the same result;
    • a half DCC fill, a fill of 0xff keys and a CMASK-only fill are refused.

    On main all three tests fail with writes to a resident multisampled DCC target or its metadata are not implemented. With this change they pass 3 of 3.

  • ctest ^agc_ (662 tests, NVIDIA): all pass, on d73d04f7a. The head differs only in sending unwatched metadata to the existing refusal (below), which doesn't happen on this driver. The three DCC tests pass 3 of 3 on the head too.

  • On an Intel Arrow Lake iGPU (Mesa 26.1.6 ANV), the 19 ^agc_ tests whose names cover MSAA, multisample, DCC, CMASK, FMASK and alpha-to-coverage: 18 pass. agc_driver_sample_multisample_target fails the same way on main there; test(agc): skip the multisampled target test without storage image multisampling #7191 addresses it.

    • My first version took a recorded GPU fill there and failed with no write generation for the metadata. On that driver the fill leaves the range unwatched: the startup [write-watch] line reads "host imports resolve write protection: yes".
    • An unwatched range now goes to checkDccCurrent's existing requires watched guest memory refusal, and the GPU-fill case expects that refusal when the range is unwatched.
  • Titles, 60 s each with scripted pad input, measured on b4e35279a:

App main + #6543 + #7132 + this PR
Ruffle (PPSA68091) stops at 10 s: writes to a resident multisampled DCC target ... runs to the 60 s limit, 1064 presents in the first 10 s and 105 per 10 s after
Rush 2 (PPSA69423) stops at 2 s on the same line stops at 2 s on the next one: sampling multisampled color target 0x400c000000 (3840x2160, 8 samples, vk format 44) as a 3840x2160 texture of 8 samples and guest format 56 (vk 37) is not implemented
Wave Race 64 (PPSA69424) same as Rush 2 same as Rush 2

With #7253 on top, which samples that 8x target through a red/blue swizzle, Rush 2 runs to the 60 s limit at 600 presents per 10 s. Wave Race 64 presents at that rate until a segfault at 48 s that I haven't looked at yet.
Ruffle also needed #7132, now in main: without it, a store to a neighbouring range in a shared 64 KiB tracker block still trips the color or metadata check later. Rush 2 and Wave Race 64 reach their next stop with #6543 alone.

Validated on Windows by @Amoenus (RTX 5080 and an AMD Radeon) and by @screamm (RTX 4070, before the last two commits), and on macOS by @jotitadev (Apple M2 Max). Not checked on a console.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none (Ruffle runs only with fix(agc): take RADV's fill-memory kernel as a buffer fill #6543 as well)
  • Unblocks: none on its own; with fix(agc): take RADV's fill-memory kernel as a buffer fill #6543, Ruffle (PPSA68091), Rush 2 (PPSA69423) and Wave Race 64 (PPSA69424, until a segfault at 48 s). Past this stop: Sonic Unleashed Recompiled (PPSA99902) with Amoenus's integration (see above)
  • GPUs tested: NVIDIA GeForce RTX 4070 Ti (595.99.02, Linux); Intel Arrow Lake iGPU (Mesa 26.1.6 ANV, Linux), MSAA and DCC tests only
  • AI-assisted: yes

🤖 Generated with Claude Code

@akkadbakkad89

Copy link
Copy Markdown
Contributor

Windows datapoints, head 257a470712a, MinGW (WinLibs GCC 15.2.0), Release, serial fresh processes:

  • NVIDIA RTX 3070 (driver 617.42): agc_driver_msaa_dcc_state, agc_driver_msaa_dcc_clear_2/4/8, agc_driver_alpha_to_coverage, agc_driver_sample_mask_multisample, agc_driver_sample_multisample_target — 10/10 pass.
  • Intel UHD 630 (ANYPS5_GPU=UHD, igvk64): same ten, 10/10 pass.

@Amoenus

Amoenus commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Independent validation of head 257a470, composed with our retained Sonic integration in fork6d76fb2098, on main922dc8999e. Original PR commits/authorship are retained; #6543 is also present. This is a composed integration check, not an isolated upstream-main result.

Regression and devices (Windows11 Enterprise10.0.26200, GCC15.2):

  • Before this change, the new2/4/8-sample DCC refill tests each fail at the resident DCC guard on integration6146, on both physical GPUs. The intervening main922 changes only cache-test scheduling/timeouts.
  • With this change, seven groups (msaa_dcc_clear_{2,4,8}, clamped_global_fill, fill_cover_keys, multisample_retirement, sample_multisample_target) pass3 times each: 21 NVIDIA +21 AMD passes, no skips. Maximum invocation0.92s NVIDIA /0.83s AMD.
  • Verified selections: NVIDIA RTX5080 10de:2c02, driver32.0.16.1062; AMD Radeon(TM) Graphics 1002:13c0, driver32.0.21036.18.
  • Full Windows/Linux relinker+library builds pass. Linux/lavapipe (LLVM20.1.2) passes the five supported groups3 times each;2/8-sample DCC groups explicitly skip for unsupported sample counts. This is not a full-suite claim. Conventions passes.
  • An initial run used a stale sampled-target test executable and crashed; after rebuilding every selected test target, the repeated suite above passes. Only rebuilt-run results are counted.

Sonic Unleashed Recompiled (PPSA99902, #4443 / #5336): integration6146 previously stopped at NOW LOADING after28.101s on writes to a resident multisampled DCC target or its metadata are not implemented (0x40819f4000+0x87000,8samples). With this composition:

  • A no-input run reached PRESS START and ran to its120s observation limit (120.945s recorded,15 captures).
  • A second run with four recorded normal controller-file pulses reached the CONTINUE menu and opening cinematic, visually inspected. It ran to its240s observation limit (240.899s recorded,61 captures), with no fatal line or observed Khronos validation error. Exit0x00000001 is deliberate termination at the bound, not a natural clean exit. No gameplay or FPS claim.
  • All127 libraries were replaced from the frozen build; the standarda515 executable/guest-module conversion was retained. Both runs reused isolated assets/user state, not a fresh-state A/B. Protected originals/configs are unchanged, and142 prior code/frame/data/config files were hash-restored after each run; new code/captures are separately archived.

This corroborates the practical relevance of the resident-clear handoff preserved in our historical08891d938 menu/cinematic branch. Your current-backend implementation lets us recover that milestone without copying the broad historical stack. Thank you. AI-assisted validation/reporting: Codex.

Extended observation: same6d76/RTX5080 reaches the level-loading/tutorial screen after the movie, then exits0xC0000409 after758.222s without timeout on mipmapped 3D color targets are unsupported. The resident-DCC stop does not recur. Distinct issue7260 has scope and reproduction.96 captures, four normal inputs,142 prior files restored; no gameplay claim.

New main-only follow-up — 2026-10-19 UTC

On literal main bf2c63f853, RTX5080 now passes 2x/8x three fresh processes each, but 4x fails3/3 at multisampled DCC target reuse requires watched guest memory (color range 0x2002b0000+0x100000, 4 samples). Libraries/relinker and fixture rebuilt; explicit Khronos loaded, implicit layers disabled per process; zero VUID/errors/warnings. Host and drivers are unchanged. #7936 maintains the separate, earlier AMD resolve assertion and exact baseline scope.

A local test-only print probe narrows the NVIDIA4x failure to DccRefillTests, mode1 without CMASK, during resolve after the second draw succeeds. The color range is watched before that resolve. With existing APS5_TRACE_HOST_IMPORT=1, the next messages are:

step=before-resolve color=1 address=0x2002b0000 resolved=0x2003c0000
[gpu] host import of 0x200000000+0x400000 ok ... by access
AGC graphics: multisampled DCC target reuse requires watched guest memory (color range 0x2002b0000+0x100000, 4 samples)

That 4MiB import covers both the destination and resident source. This is a CPU metadata-fill case, earlier than the mode5 GPU-fill/rewatch case discussed above. #6457's aligned-import grouping is relevant context, not an established introducing commit. Production code/guards are unchanged in the probe; no fix or new game result is claimed. Import-window control completed: restricting this fixture to single-allocation imports passes4x3/3; restoring the default-window probe reproduces the refusal3/3. Production guards are unchanged. Distinct report #8103 holds the reproduction, control and limits; no global window reduction is proposed. AI-assisted: yes (Codex).

@milescoviello

Copy link
Copy Markdown
Contributor Author

@Amoenus, thank you for the two-GPU validation and the Sonic run. I've added both to the description, with Sonic noted as your integration composition rather than an upstream main result.

AI-assisted: yes (Claude Code)

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

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.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6973 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp L205-206, L255, L335
PR 6987 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp L22-23, L205-206, L255, L335
PR 6989 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp L22-23, L205-206, L255, L335
PR 6995 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp L22-23, L205-206, L255, L335
PR 7002 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp L22-23, L205-206, L255, L335

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 2434 docs/dev/debt/libSceAgcDriver.md
PR 4448 docs/dev/debt/libSceAgcDriver.md
PR 5058 docs/dev/debt/libSceAgcDriver.md
PR 5499 docs/dev/debt/libSceAgcDriver.md
PR 5925 docs/dev/debt/libSceAgcDriver.md
PR 6146 docs/dev/debt/libSceAgcDriver.md
PR 6186 core/libs/prx/libSceAgcDriver/Graphics/src/DccMetadata.cpp
PR 6194 docs/dev/debt/libSceAgcDriver.md
PR 6209 core/libs/prx/libSceAgcDriver/Graphics/include/DccMetadata.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DccMetadata.cpp
PR 6223 docs/dev/debt/libSceAgcDriver.md
PR 6252 docs/dev/debt/libSceAgcDriver.md
PR 6280 docs/dev/debt/libSceAgcDriver.md
PR 6292 core/libs/prx/libSceAgcDriver/Graphics/src/DccMetadata.cpp
PR 6300 docs/dev/debt/libSceAgcDriver.md
PR 6457 docs/dev/debt/libSceAgcDriver.md
PR 6479 docs/dev/debt/libSceAgcDriver.md
PR 6548 docs/dev/debt/libSceAgcDriver.md
PR 6549 docs/dev/debt/libSceAgcDriver.md
PR 6615 core/libs/prx/libSceAgcDriver/Graphics/src/DccMetadata.cpp
PR 6628 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
PR 6636 docs/dev/debt/libSceAgcDriver.md
PR 6683 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6727 docs/dev/debt/libSceAgcDriver.md
PR 6730 docs/dev/debt/libSceAgcDriver.md
PR 6808 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6867 docs/dev/debt/libSceAgcDriver.md
PR 6868 docs/dev/debt/libSceAgcDriver.md
PR 6946 docs/dev/debt/libSceAgcDriver.md
PR 6947 docs/dev/debt/libSceAgcDriver.md
PR 6971 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
PR 6977 docs/dev/debt/libSceAgcDriver.md
PR 7085 docs/dev/debt/libSceAgcDriver.md
PR 7256 docs/dev/debt/libSceAgcDriver.md
PR 7332 docs/dev/debt/libSceAgcDriver.md
PR 7446 docs/dev/debt/libSceAgcDriver.md
PR 7449 docs/dev/debt/libSceAgcDriver.md
PR 7505 docs/dev/debt/libSceAgcDriver.md
PR 7604 docs/dev/debt/libSceAgcDriver.md
PR 7642 docs/dev/debt/libSceAgcDriver.md
PR 7668 docs/dev/debt/libSceAgcDriver.md
PR 7800 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7986 docs/dev/debt/libSceAgcDriver.md

@github-actions github-actions Bot added docs agc libSceAgc* labels Oct 17, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 18, 2026
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 18, 2026
@screamm

screamm commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Windows title run on head c92d72cc1 (the PR has since been rebased to 802150f9e; the diff against the merge base is identical apart from hunk offsets, so this applies to the new head unchanged): Windows 11 Pro 26220, RTX 4070 (driver 596.21), WinLibs MinGW-w64 GCC 15.2.0 r7, Release. Stacked as main 0d078f75d (which has #7132) + #6543 7bfb645ff + this PR. The only conflict was the debt file, where main's new Polygon entry sits next to this PR's entry; I kept both. Full build: no failures.

Ruffle (PPSA68091), Cross to start the demo, 120 s, ANYPS5_NO_SHADER_CACHE=1:

Build Result
main + #6543 stops 2 of 2 at 25.9 s and 24.9 s: writes to a resident multisampled DCC target or its metadata are not implemented; with #6869's text: (DCC range 0x4004606000+0x14000, 4 samples)
+ this PR runs to the limit 2 of 2 (124.6 s / 926 frames, 121.9 s / 775 frames), no driver failure; the guest reports 16 to 20 frames drawn per 5 s, 0 readbacks failed

So your Linux result reproduces on Windows/NVIDIA. One question: from the demo start to the limit, every frame dump is uniform white (mean 255 per channel, cursor only), 13 and 11 dumps, and the screenshot at the limit looks the same. White is the 0xc0 (1111) clear that this PR takes from Ruffle's 0xc0c0c0c0 fill. Does the demo show content on Linux, or is it white there too?

Tests:

  • agc_driver_msaa_dcc_clear_{2,4,8}, agc_driver_msaa_dcc_state, agc_driver_clamped_global_fill and agc_driver_graphics pass 3 of 3 each.
  • Negative control: I set DccMetadata.hpp/.cpp and MultisampleTarget.cpp back to main + fix(agc): take RADV's fill-memory kernel as a buffer fill #6543 and kept the test. msaa_dcc_clear_{2,4,8} then fail 3 of 3 with writes to a resident multisampled DCC target or its metadata are not implemented. With the PR restored they pass again.
  • msaa_dcc_clear_8 is flaky here. It failed 3 times in 113 single runs; clear_2 and clear_4 passed 20 of 20. The failure is a write to resident multisampled DCC metadata that is not a full fast-clear fill was not refused. I added a local print to the test: the failing case is mode 5 (the fill recorded with VulkanDevice::FillBuffer), with CMASK, at 8 samples. The test expected requires watched guest memory, and the draw threw writes to a resident multisampled DCC target ... instead.
  • The same print shows the test sees the GPU-filled range unwatched in 120 of 120 mode-5 cases (2, 4 and 8 samples, with and without CMASK). So on this GPU the test checks only the refusal there, never the absorbed GPU fill. It looks like the Watched() check right after recording races with the watch state at the draw.
  • Non-GPU suite: 933 of 936 pass, 2 are skipped, and hardware_oracle_compare hit its 20 s limit once and passed on rerun. GPU pass -R '^agc_driver_': 529 of 531 pass, 2 skipped, none failed. check_conventions.py and git diff --check are clean.

Not checked: AMD, Intel, Linux, Rush 2, Wave Race 64.

Written with Claude Code assistance (validation by a subagent, reviewed in this session).

@milescoviello

Copy link
Copy Markdown
Contributor Author

Thanks @screamm for the Windows run, and for narrowing the clear_8 failure down to mode 5.

White frames. It's white on Linux too. On main 385ed71 + #6543 + this PR, every frame dumped after the demo starts is uniform white apart from the cursor (17 of 35 dumps in 60 s). That comes from the demo's SWF, not from the clear. Ruffle's own log (/data/ruffle/ruffle.log) says of the built-in demo:

[WARN] swf::read: SWF length doesn't match header, may be corrupt
[INFO] ruffle_core::context: Loaded SWF version 10, resolution 0x0 @ 0 FPS
[ERROR] ruffle_core::tag_utils: Unexpected EOF when reading tag

The demo is a 21-byte stub in the eboot (at file offset 0x140ec31: FWS, version 10, header length 21, an empty frame RECT). The stage has nothing on it, so Ruffle draws only Flash's default white background, which is the 1111 clear.

To check that drawn content survives the absorbed clear, I gave Ruffle a 180-byte SWF I generated. It has a white 960x540 stage with three rectangles: red 200x150, blue 300x200 and green 150x150. The red one moves between x = 100 and x = 300 on alternate frames (2 frames at 2 fps). Copied to /data/ruffle/games, it appears in the library, and Ruffle loads it as 960x540 @ 2 FPS. 60 s with Cross presses, every 30th frame dumped:

Build Result
main + #6543 stops at 11 s on writes to a resident multisampled DCC target or its metadata are not implemented, before the SWF's first frame is presented
+ this PR runs to the limit. Of the 85 dumps after the library, the first is white and the other 84 show the three rectangles on white: red 5.7 %, blue 11.4 % and green 4.2 % of the pixels (the rectangles cover 5.8, 11.6 and 4.3 % of the stage). The red one is at x = 100 in 41 dumps and at x = 300 in 43, never at both, so each frame's clear removes the previous frame's content.

The cover Ruffle saves from its own readback (/data/ruffle/covers/rects.png) shows the same picture.

The clear_8 failure. I think this comes from Windows watching settled imports again: rewatchSettledImports calls GuestMemory::Rewatch, and only the Windows build does anything there. The two FillBuffer calls make two imports. If a settle poll watches the DCC import again before the CMASK import, absorbDccFill returns at the CMASK's Watched check. checkDccCurrent then reached the DCC range first, which was watched again and changed, so it threw writes to ... instead of the unwatched-range message. I've pushed two commits:

  • checkDccCurrent checks that every range is watched before it checks any of them for writes. An unwatched range is now always reported as requires watched guest memory.
  • The test: off Windows, mode 5 runs with host imports kept watched (SetImportWatch, as DccKeysFirstWrite and DispatchMoveDepth do), and it requires the metadata to still be watched after the fill. So the absorbed GPU fill is checked on every driver, including ones whose imports are compared, like Intel's ANV. A new mode 6 runs the same fill with imports left unwatched and must be refused. On Windows, where a settled import can be watched again before the draw, an unwatched GPU fill may now either be refused with requires watched guest memory or be drawn, and a drawn one goes through the resolve check.

Tested on head 5be36f0:

  • Linux, RTX 4070 Ti (NVIDIA 595.99.02): agc_driver_msaa_dcc_clear_{2,4,8} pass 20 of 20 each. They also pass 5 of 5 each with APS5_WRITE_WATCH_IMPORTS=unwatch, which makes the CPU-fill cases run with imports compared. The 28 tests matching msaa|multisample|dcc|cmask|fmask|alpha_to_coverage|fill pass. A temporary print (not part of the PR) shows that mode 5 takes the fill and passes the resolve check and that mode 6 is refused, at 2, 4 and 8 samples, with and without a CMASK.
  • Intel Arrow Lake iGPU (Mesa 26.1 ANV), where host imports are compared (host imports resolve write protection: yes): clear_{2,4,8} pass 3 of 3 each.

I haven't run it on Windows. With these commits, your failing 8-sample case should either report requires watched guest memory or draw and pass the resolve check.

AI-assisted: yes (Claude Code)

@milescoviello

Copy link
Copy Markdown
Contributor Author

Title data on the current heads, now that #7253 is in main: main 5057673 + #6543 (7bfb645) + this PR (5be36f0). Rush 2 Recompiled runs to the 60 s limit and ends on its launcher. Wave Race 64 Recompiled presents until a segfault in guest code at 48 s. With #6543 alone, both stop at 2 s on writes to a resident multisampled DCC target or its metadata are not implemented. The description has the details.

AI-assisted: yes (Claude Code)

@github-actions github-actions Bot added unblocks title Names a title ID on the Unblocks line needs rebase Conflicts with main, rebase needed labels Oct 18, 2026
@milescoviello

Copy link
Copy Markdown
Contributor Author

Rebased onto main 6e27fc8 (58c28d9). The only conflict was next to main's new view-type parameter of MultisampleTarget::Sampled, which sits just below this PR's NoteMetadataFill, and both are kept. On the rebased head agc_driver_msaa_dcc_clear_{2,4,8} pass 3 of 3, and the 25 tests matching multisample|dcc|cmask|fill|msaa pass.

AI-assisted: yes (Claude Code)

@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Oct 18, 2026
@milescoviello

milescoviello commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Rebased onto main 0c25997 (cbae9e7). There were two conflicts:

  • In NoteColorMetadataFill, main's new HTILE check comes first, then this PR's DCC branch. That's the same resolution @wachi35676 used.
  • In ApplyFastClear, main's Keep() from the multisample retirement change (785f8f7) now runs after both the refill path and the CMASK path, since both record commands against the image.

agc_driver_msaa_dcc_clear_{2,4,8} pass 3 of 3, and the 27 tests matching multisample|dcc|cmask|fill|msaa pass.

AI-assisted: yes (Claude Code)

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 19, 2026

@jotitadev jotitadev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apple GPU / MoltenVK run of the new DccRefillTests, as another vendor next to the NVIDIA, AMD and Intel runs.

Machine: Apple M2 Max, macOS 27.2, x86_64 build under Rosetta 2. Head cbae9e7af. Method: macos-port platform (main a373e85 + the macOS series) + this PR's diff, not main. Stacked with #7600 (038f050) in the same build.

Test SDK MoltenVK 1.4.2 MoltenVK main + SPIRV-Cross #2704
agc_driver_msaa_dcc_clear_2 pass 3/3 pass 3/3
agc_driver_msaa_dcc_clear_4 pass 3/3 pass 3/3
agc_driver_msaa_dcc_clear_8 skipped skipped
  • clear_8 skips cleanly ("the device lacks the requested multisample color attachments"): MoltenVK reports framebufferColorSampleCounts 1/2/4 only on this GPU, so the 8x refill path has no coverage on Apple.
  • The write-watch probe reports "host imports resolve write protection: no ... imported ranges stay watched", so the GPU-fill case runs the watched path here (as on NVIDIA, not as on ANV).
  • Red check: with only this PR's tests/execution/AlphaToCoverage.cpp on the base, clear_2 and clear_4 fail on both drivers with writes to a resident multisampled DCC target or its metadata are not implemented.
  • Full ^agc suite (excluding flip/display/lds_atomics64, -j1, 30 s timeout): failure list identical to the base on both drivers (known MoltenVK capability gaps), no new failures.

GPUs tested: Apple M2 Max (MoltenVK 1.4.2 from Vulkan SDK 1.4.363, and MoltenVK main + SPIRV-Cross #2704), macOS 27.2.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

@milescoviello

Copy link
Copy Markdown
Contributor Author

@jotitadev thanks for the Metal runs. The 8x skip is useful to know: MoltenVK's 1, 2 and 4 color sample counts leave that refill path without Apple coverage. It's in the description now, along with the red check on both drivers.

AI-assisted: yes (Claude Code)

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 19, 2026
milescoviello and others added 3 commits October 19, 2026 12:23
…its fast clear

A multisampled DCC color target imports its uniform DCC fast clear on
first use and then refuses any later change to its color, DCC or CMASK
memory. Titles built on the PS5 Mesa stack fast-clear such a target
every frame with two buffer fills, the CMASK to 0xcc (FMASK cleared,
color expanded) and the DCC to a uniform clear key, so the second
frame stopped on "writes to a resident multisampled DCC target or its
metadata are not implemented".

The fills of a resident DCC target's metadata are now noted. When a
fill covered the whole DCC range since the last use and the range holds
its key once pending writes land (LandedUniformMetadataByte, which
reads the bytes directly rather than through the resident read guard),
the next use clears every sample to that key's color, as the import
does, and takes the new DCC and CMASK generations. A CMASK written
since must have been filled whole too. Partial fills, other keys,
CMASK-only writes and any write to the color memory are still refused.
Fills of a DCC target's CMASK no longer go to the CMASK-only fast-clear
tracker, which refused the expanded code 0xcc.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e their writes

When a fill of the metadata could not be taken because one of its ranges was
no longer watched, the check reached a watched range that the fill had
changed first and reported the write instead of the unwatched range.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Off Windows, the GPU fill case now runs with host imports kept watched, so it
always checks the absorbed clear, and a new case runs it with imports left
unwatched, which must be refused. On Windows a settled import is watched again
when its settle is polled, possibly before the draw takes the fill, so an
unwatched fill may be either refused or drawn, and a drawn one is checked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@milescoviello

Copy link
Copy Markdown
Contributor Author

Rebased onto main b106f6f (50264ab) after #6869 changed checkDccCurrent. The refill's shortened range list now goes through requireDccRange, and the watch check still covers every range before any write check. The 39 DCC/MSAA/fill tests pass, this PR's 8 tests pass 3 of 3, and the 1.4.363 validation layer reports nothing on either side. The debt line is also cut to the gap.

AI-assisted: yes (Claude Code)

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 19, 2026
@adriadam10 adriadam10 self-assigned this Oct 19, 2026
@adriadam10
adriadam10 merged commit 544f291 into boykopovar:main Oct 19, 2026
12 of 14 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the absorbed DCC/CMASK fill path against the refusals it keeps (partial fill, other keys, CMASK-only, color writes), the watch check running over every range before any write check, and the new DccRefillTests cases (GPU-recorded and CPU fills, watched and unwatched imports); the independent Windows, Intel/NVIDIA and Metal runs in the thread cover the drivers. Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* docs unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants