AGC: a whole-HTILE fill of an inactive native multisample depth surface is refused as a "metadata fill transition" #28612

Open
opened 2026-12-02 01:55:40 +00:00 by JJenkx · 0 comments
JJenkx commented 2026-12-02 01:55:40 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-12-02T01:55:40Z.


Correction (2026-12-02): the diagnosis below is wrong for the stop that matters. The full-cover fills counted below go to surfaces that already hold a creation-time refusal, so line 5571 changes nothing for them, and the suggested change would not help. The surface that stops the title is a different one: an active 1024x1024 4x surface with no refusal, and the fill covers only the first half of its HTILE (0x8000 of 0x10000, pattern 0). Details and the diagnostic lines: https://github.com/boykopovar/AnyPS5/issues/28612#issuecomment-7349810623

Summary

On main 7d3d015fee, NoteDepthMetadataFill refuses sampling of a native multisample depth surface with "native multisample depth metadata fill transition is not implemented" when a DMA fill covers that surface's whole HTILE, if the surface's sampling is not active. The message suggests a partial fill, but Blue Prince (PPSA25009) only issues whole-HTILE fills here, and this refusal is the most common reason it stops: 4 of its 7 stops in my 12-run session on 12-01 (discussion #9189).

Where

core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp, NoteDepthMetadataFill:

const bool overlaps = target.samples != 1u && target.htileAddress != 0u && /* fill overlaps the HTILE */;
if (overlaps && htileUnmapped) continue;
if (overlaps && surface->samplingActive && HtileFillCovers(target.htileAddress, target.extent, address, bytes)) {
    /* whole-HTILE fill of an active surface: handled as a clear */
    continue;
}
if (overlaps) surface->sampling.Refuse("native multisample depth metadata fill transition is not implemented");   // line 5571
if (HtileFillCovers(target.htileAddress, target.extent, address, bytes)) {
    surface->ForgetClear(written);
    surface->NoteHtileClear(HtileFillClears(pattern, target.htileStencil));
    continue;
}

A whole-HTILE fill of a surface whose sampling is not active skips the first branch, because of samplingActive. It is then refused at line 5571 before the HtileFillCovers block that follows, which records exactly that case as an HTILE clear.

Git history: the blanket if (overlaps) Refuse(...) came with ee1ba73a2f (10-13, "sample native multisampled depth attachments"), when no multisample fill was handled. The samplingActive whole-fill branch came after it.

Evidence

Windows 11 22621, RX 6700 XT, MinGW-w64 GCC 15.2 UCRT r7, Release. Blue Prince entrance hall, 3 runs of 240 s. I used a local diagnostic build of 7d3d015fee, not for merging, that prints one line just before that Refuse. For example:

[diag-fill] metadata fill transition: fill 0x2fe440000+0x30000 pattern 0x00000000, htile 0x2fe440000+0x30000, extent 1920x1080, samples 4, depth 0x335e50000
  • 6089 complete lines across the 3 runs: 137, 114 and 5838. A few more were cut by interleaved log output. All 6089 have the fill range equal to the HTILE range, and all have pattern 0x00000000.
  • The targets are 4x 1920x1080 depth with a 0x30000-byte HTILE. There are four distinct HTILE addresses.
  • None of these three runs stopped. When the refused surface is later sampled, the title stops on this message: 4 of the 7 stops in my 12-run session.

Possible direction (not verified)

The refusal looks like it was meant for fills that do not cover the HTILE:

if (overlaps && !HtileFillCovers(target.htileAddress, target.extent, address, bytes)) surface->sampling.Refuse("...");

With that change, an inactive surface's whole fill would reach NoteHtileClear. The partial-fill refusal asserted by agc_driver_* in NativeMultisampleDepth.cpp (CheckDriverPathTarget, DriverFill::Partial) would stay. I have not checked whether the pending-clear path is correct for a native multisample surface that later becomes sampled, so I am not opening a PR. I can test a candidate on this title and machine.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6735035897 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/28612). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-12-02T01:55:40Z. --- > **Correction (2026-12-02):** the diagnosis below is wrong for the stop that matters. The full-cover fills counted below go to surfaces that already hold a creation-time refusal, so line 5571 changes nothing for them, and the suggested change would not help. The surface that stops the title is a different one: an **active** 1024x1024 4x surface with no refusal, and the fill covers only the first half of its HTILE (`0x8000` of `0x10000`, pattern 0). Details and the diagnostic lines: https://github.com/boykopovar/AnyPS5/issues/28612#issuecomment-7349810623 ### Summary On `main` `7d3d015fee`, `NoteDepthMetadataFill` refuses sampling of a native multisample depth surface with "native multisample depth metadata fill transition is not implemented" when a DMA fill covers that surface's **whole** HTILE, if the surface's sampling is not active. The message suggests a partial fill, but Blue Prince (PPSA25009) only issues whole-HTILE fills here, and this refusal is the most common reason it stops: 4 of its 7 stops in my 12-run session on 12-01 (discussion #9189). ### Where `core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp`, `NoteDepthMetadataFill`: ```cpp const bool overlaps = target.samples != 1u && target.htileAddress != 0u && /* fill overlaps the HTILE */; if (overlaps && htileUnmapped) continue; if (overlaps && surface->samplingActive && HtileFillCovers(target.htileAddress, target.extent, address, bytes)) { /* whole-HTILE fill of an active surface: handled as a clear */ continue; } if (overlaps) surface->sampling.Refuse("native multisample depth metadata fill transition is not implemented"); // line 5571 if (HtileFillCovers(target.htileAddress, target.extent, address, bytes)) { surface->ForgetClear(written); surface->NoteHtileClear(HtileFillClears(pattern, target.htileStencil)); continue; } ``` A whole-HTILE fill of a surface whose sampling is **not** active skips the first branch, because of `samplingActive`. It is then refused at line 5571 before the `HtileFillCovers` block that follows, which records exactly that case as an HTILE clear. Git history: the blanket `if (overlaps) Refuse(...)` came with ee1ba73a2fd (10-13, "sample native multisampled depth attachments"), when no multisample fill was handled. The `samplingActive` whole-fill branch came after it. ### Evidence Windows 11 22621, RX 6700 XT, MinGW-w64 GCC 15.2 UCRT r7, Release. Blue Prince entrance hall, 3 runs of 240 s. I used a local diagnostic build of `7d3d015fee`, not for merging, that prints one line just before that `Refuse`. For example: ``` [diag-fill] metadata fill transition: fill 0x2fe440000+0x30000 pattern 0x00000000, htile 0x2fe440000+0x30000, extent 1920x1080, samples 4, depth 0x335e50000 ``` - 6089 complete lines across the 3 runs: 137, 114 and 5838. A few more were cut by interleaved log output. **All 6089 have the fill range equal to the HTILE range**, and all have pattern `0x00000000`. - The targets are 4x 1920x1080 depth with a 0x30000-byte HTILE. There are four distinct HTILE addresses. - None of these three runs stopped. When the refused surface is later sampled, the title stops on this message: 4 of the 7 stops in my 12-run session. ### Possible direction (not verified) The refusal looks like it was meant for fills that do **not** cover the HTILE: ```cpp if (overlaps && !HtileFillCovers(target.htileAddress, target.extent, address, bytes)) surface->sampling.Refuse("..."); ``` With that change, an inactive surface's whole fill would reach `NoteHtileClear`. The partial-fill refusal asserted by `agc_driver_*` in `NativeMultisampleDepth.cpp` (`CheckDriverPathTarget`, `DriverFill::Partial`) would stay. **I have not checked** whether the pending-clear path is correct for a native multisample surface that later becomes sampled, so I am not opening a PR. I can test a candidate on this title and machine. AI-assisted: yes.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#28612
No description provided.