Repository navigation
fix(agc): import undrawn R_X DCC textures and their colour-target state - #21479
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The reviewed change at e23cc4cd5c84785531b899fa05171750c0e1a3b8 has no verified blocking defects; author-reported checks passed, but I did not run them.
What I ran
Read the prepared diff and all three changed files through repo_read.py. No commands or tests were run; I did not fetch the diff again.
Results
| Check | Result | Note |
|---|---|---|
| Diff and changed code review | passed | All three changed files were read |
| Tests | not run | Results in the description are author-reported |
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not run the test suite, build, or check behavior on hardware. I reviewed all files marked reviewed in the manifest: core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp, core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_sample_multisample_target_tests.cmake, core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp, and docs/dev/debt/changes/fix-texture-dcc-owner.md. No files were excluded. The description reports Windows tests and limited title progress on a private integration branch; those results were not independently verified.
To get this to a good state
Nothing is required.
|
Real-AMD cross-HW confirmation across 3 gens (Linux/RADV) — head
Negative control (RDNA3): removing the fix's import block in No cross-gen divergence: the per-sample AI-assisted: yes |
|
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.
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.
|
Reuse the uniform DCC importer introduced by boykopovar#5939 when a compressed R_X texture is sampled without a resident owner. Preserve watched range and metadata generation checks, settle known-zero metadata before collecting writes, and refuse register clears whose colour is absent from the texture descriptor. Cover 2, 4 and 8 samples, fixed clear codes, alpha placement, repeated sampling, metadata stores, untouched metadata and unsupported states. AI-assisted: yes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CfHqvesLHKGJRvAoHQuocc
A multisampled R_X DCC owner created from a texture descriptor holds no DCC control, CMASK or FMASK. Its first colour-target use carries them and was refused as a changed layout. Import the owner again under the full layout when no draw has rendered to it, after the existing store checks on its imported planes. Other layout differences, drawn owners, stores since the texture import and later changes on a colour-target owner stay refused. Cover 2, 4 and 8 samples. AI-assisted: yes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CfHqvesLHKGJRvAoHQuocc
e23cc4c to
543bdaf
Compare
|
Ran the multisample target tests with the Khronos validation layer on NVIDIA's proprietary Linux driver, to complement the Windows (RTX 3080 Ti) run in the PR. Setup: Arch Linux (kernel 7.3.4), GCC 16.2.1, Release, NVIDIA GeForce RTX 4090 (vendor
The pattern covers every test of No new AI-assisted: yes (Claude Code) |
|
Heads-up: head AI-assisted: yes (Claude Code) |
|
Tested on Forza Horizon 5 (PPSA22327 01.685.672), where this fixes a stop we hit. Windows 11 Pro (build 26300), i9-9900K, RX 6800 (AMD 26.10.1, Vulkan 1.4.315), MinGW GCC 15.3.0 Release. Head 543bdaf, merged onto a local stack of open PRs for the game.
With this and the other open PRs listed in #25152, the game now gets through the title screen and menus into the start of the intro. So it fixes a real stop in this game, and its tests are clean here. Not done: other GPUs, Linux, console comparison. AI-assisted: yes (Claude Code). |
|
Thanks @AbuMshMsh24 — fixed in 8ed6ed3, in response to your build report. Merged Windows 11 build 26300, NVIDIA GeForce RTX 3080 Ti (610.88), WinLibs GCC 15.2.0 r7 UCRT, Release; Khronos validation 1.4.363.
The six failures on main are exactly The paired main/restored comparison uses main’s exact All runs used AI-assisted: yes (Codex). |
|
We hit the same build error when we merged this onto our Forza Horizon 5 stack, and fixed it the same way: AI-assisted: yes (Claude Code). |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The change was reviewed at head 8ed6ed3b4e05d9fb21926a523c53c785920bca1f; no verified blocking defects were found in the changed implementation or tests. Author-reported test results were not rerun in this review.
What I ran
Read the prepared diff and all four changed files. No build or tests were run.
Results
| Check | Result | Note |
|---|---|---|
| Changed code review | passed | All changed files read |
| Build and tests | not run | Results in description are author-reported |
Findings
Blocking
None.
Non-blocking
None.
Not verified
Build and runtime behavior were not independently verified. The prepared bundle contained the full text for each changed file, and all four were read: core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp, core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_sample_multisample_target_tests.cmake, core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp, and docs/dev/debt/changes/fix-texture-dcc-owner.md. No changed files were excluded.
To get this to a good state
Nothing is required.
What
Sampling a multisampled SW_64KB_R_X texture with DCC that no draw has rendered to stops with
whose compression metadata over a tile mode 7 surface is not modeled. Its metadata can still hold one of the uniform clear codes that #5939 already imports for colour targets. This change imports such a texture, then lets the owner it creates become a colour target.Texture import. When no resident owner covers the texture, reuse the uniform DCC importer from #5939. The owner is built from the texture descriptor under the same watched-range, metadata-generation and unchanged-during-import checks as a colour-target owner. Known-zero metadata is settled before its generation is collected. A texture descriptor carries no register clear colour, so key 0x20 still throws, as do mixed or expanded keys, non-pipe-aligned metadata, compressed payloads, arrays and mips.
First colour-target use. A texture descriptor has no DCC control word, CMASK or FMASK. When the same surface is then bound as a colour target, the register state adds them, and the reuse check stopped with
multisampled DCC target layout or metadata changed. A commercial title samples such a surface as a cleared texture for several hundred frames and hits this on its first draw into it.When the owner came from a texture, no draw or storage write has reached it, and the address, DCC address, alpha placement, pipe alignment, tile mode, element size and pipe/bank XOR all match, it is imported again under the colour target's full layout. This uses the path #7641 added for a changed pipe/bank XOR, so the clear, CMASK, FMASK and register clear colour come from the current guest state under the usual rules. Before that, the store checks of an ordinary reuse run on the planes the texture import tracked, accepting only a landed whole-range DCC fill, so a write since the texture import still refuses. The write checks move into a helper unchanged.
Any other layout difference, an owner a draw has rendered to, and a later change on the resulting colour-target owner stay refused.
Two commits, one per step; the second has no use without the first.
Related open PRs
#20534 and #21155 (same author) change the same initial-import statements, so this branch conflicts with them textually. The resolution is mechanical: keep their committed-colour and known-zero settling for each range, which already covers this change's metadata settling. That combination was built and tested before this rebase: on #21155's earlier head
75563731, these two commits passed the same selected tests that fail without them. Whichever merges second needs that resolution.tools/pr_overlap.py --branchagainst 1,693 open PRs reports line conflicts with #19686, #20534 and #21155. It stopped without a full result because 14 others conflict with main; the bot's run on this PR lists two more, #17338 and #19557.ensureGeneralLayout()next to the changedinitialDccClear(use, true)call inRecreate, and replacesApplyFastClearwithPrepareForColorAttachmentinacquire. The conflict is textual: keep both sides. A texture owner taken over here passes throughRecreateand then the colour-attachment preparation, so with fix(agc): sample multisampled targets in read-only layout #19686 it also leaves the read-only sampled layout before its clear.MultisampleTarget.cpppatches were checked by hand against the points this branch changes: the constructor,Recreate,initialDccClear,checkDccCurrent,acquire's reuse branch andcreateFilled.createFilled's written storage call; this branch adds an unwritten-texture path.checkDccCurrent(target, false)call; that signature is unchanged.dccRangesandmetadataValidwhen preserving baselines before unwatch; both are unchanged.forgetSingleClears,discardRetiredTargets, the unmap observer andHostOnlySampleRanges. They touch none of the points above.None implements the same behaviour.
Tested
16 November 2026, Windows 11 build 26300, NVIDIA GeForce RTX 3080 Ti, driver 610.88; WinLibs GCC 15.2, Release. Khronos validation 1.4.363.1, newer than the pinned Vulkan headers.
Three arms on main
0694c4cbd6f2df1e7cc95a6681746b4de40d1e70, using the same test executables built from this branch. Only the loaded graphics library and its libc/libkernel change between arms, with hashes recorded and the candidate's restored afterwards.initial_texture_dcc_2/4/8andtexture_dcc_target_2/4/8, at the tile-mode refusal abovetexture_dcc_target_2/4/8, atmultisampled DCC target layout or metadata changedinitial_texture_dcccovers 2, 4 and 8 samples, the four fixed clear codes, both alpha positions, repeated sampling and untouched zero metadata. It also checks refusals for the register-clear key, mixed keys, unaligned metadata and a metadata store after import.texture_dcc_targetsamples an R_X DCC texture, binds it as a colour target with CMASK, FMASK, fast clear and a nonzero DCC control, and checks the samples before, after and on reuse, with guest colour and metadata unchanged. Its controls that must still refuse are: another alpha placement, a colour store and a same-value metadata store before the bind, an owner a draw has rendered to, and another DCC control on the resulting colour-target owner. The alpha-to-coverage tests, which exercise the #7641 path this shares, pass in all arms.All 26 selected tests ran in every arm; none skipped, disabled or missing. Each arm's log shows the loader inserting the Khronos layer for the 24 tests that open a device (the two alpha-to-coverage state tests do not), with no missing-layer message and no
VUID-. All three arms log the same threeUndefined-Value-ShaderOutputNotConsumed-DynamicRenderingwarnings inagc_driver_alpha_to_coverage; this change adds none.On a private integration branch carrying further local fixes, the second commit takes a commercial title past this stop at 3840x2160 in SDR and HDR10. Without it, three of three launches stopped 1.3 to 1.9 s after the intro video. With it, three of three reached the main menu and new-game setup, and one reached a loading screen. That is menus, not gameplay. No Linux or macOS run and no performance claim.
check_conventions.py --base origin/mainandcheck_main_sync.pypass.debt_fold.py --checkreports one fragment that does not apply,docs-nkwebkit-drop-readded-count-lines.md, which is already on main and untouched here.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
https://claude.ai/code/session_01CfHqvesLHKGJRvAoHQuocc