fix(agc): leave a multisampled DCC target's CMASK unchecked without fast clears #8283
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8283"
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 milescoviello on 2026-10-20T08:34:25Z.
What
The initial import of a native multisampled DCC target (
MultisampledDccClear) requires its CMASK to be uniformly0xccor the fully expanded code for its sample count, and throwsmultisampled DCC CMASK compression or register clear is not implementedotherwise. That check now applies only whenCB_COLOR_INFOenablesFAST_CLEAR(ColorTarget::cmaskFastClear).A multisampled target's CMASK is decoded when
FAST_CLEAR(bit 13) orCOMPRESSION(bit 14) is set. WithCOMPRESSIONand withoutFAST_CLEAR, the CMASK holds only the FMASK compression state, which picks the fragment each sample reads; its color fast-clear codes are not in use. A uniform DCC clear key sets every fragment of the target to the clear color, so whatever fragment the FMASK picks, the sample reads that color, and the target imports as the DCC clear. UnderFAST_CLEARthe CMASK can still be a register clear (code 0, the color inCB_COLOR_CLEAR_WORD), so that case keeps the existing check. For comparison, RADV's DCC fast clear of a multisampled image writes CMASK0xc(radv_get_cmask_fast_clear_value), and the PS5 SDK's path in this title doesn't write the CMASK at all.A new debt entry records the case: what the console reads where such an FMASK names no fragment, which stale CMASK bytes can select, is unverified.
Why
METAL GEAR SOLID 4 (PPSA18194): the Master Collection launcher (a Unity app) stops when its Master Book opens. Opening Master Book and confirming the spoiler prompt ends the run with the refusal above (EXIT-134). That happened on
main15da28937e(1 run) and on diagnostic builds ofmain7d876ad3ba(4 runs, 44 s in each). The diagnostic build logged the target:R8G8B8A8_UNORM,CB_COLOR_INFO0x1000c028: DCC_ENABLE and COMPRESSION, no FAST_CLEAR.0x00(the 0000 clear).CB_COLOR_CLEAR_WORD0.With this PR the book opens and shows its cover at 60 FPS, and the run continues until I stop it (2 of 2 runs).
Tested
Ubuntu 24.04 (Linux 6.8), GCC 13.3, NVIDIA RTX 4070 Ti, driver 595.99.02.
agc_driver_msaa_dcc_stategains a case for 2, 4 and 8 samples. It builds a 64x64 target with a uniform0x00DCC and a CMASK of varied bytes. WithoutcmaskFastClearit must import as 0000, and withcmaskFastClearit must still refuse. Withmain's check it fails 3 of 3 with the refusal above. With this PR it passes 3 of 3.Khronos validation layer (LunarG SDK 1.4.363), NVIDIA RTX 4070 Ti (595.99.02), Ubuntu 24.04:
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest -R '^agc_driver_(msaa|multisample|graphics$|alpha_to_coverage|dcc|sample_multisample|pixel_sample|cmask)' -Vonmain661f8b7171and on this PR (ee6efa9fce). 23 of 23 pass on each, among themagc_driver_msaa_dcc_clear_2,_4and_8. Neither log reports the layer missing. Both have the same two VUIDs,VUID-vkCmdDraw-multisampledRenderToSingleSampled-07285×2, and none is new.tools/check_conventions.py --base upstream/mainpasses.tools/pr_overlap.pylists no conflicting lines. The new debt entry sits beside the multisampled CMASK entries rather than below line 61, which #8123 edits.Windows 10 Pro 22H2, WinLibs GCC 15.2.0, Release, by @TheSovietWaffle on
ee6efa9fc:agc_driver_msaa_dcc_stateandagc_driver_graphicspass 3 of 3 on an NVIDIA RTX 3080 (617.42) and on an AMD Radeon RDNA 2 iGPU (1002:164e, 32.0.21045.5002).Not tested: the console itself.
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
Imported from boykopovar/AnyPS5. Originally posted by TheSovietWaffle on 2026-10-20T11:09:29Z.
Windows data point: RTX 3080 (NVIDIA 617.42) and AMD Radeon RDNA 2 iGPU (
1002:164e, 32.0.21045.5002), Windows 10 Pro 22H2, WinLibs GCC 15.2.0, Release, headee6efa9fc:agc_driver_msaa_dcc_stateandagc_driver_graphicspass 3 of 3 on both GPUs.AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-20T11:13:06Z.
Thanks @TheSovietWaffle. That is the first AMD run of this change, and the first on Windows. I added both GPUs to the Tested section of the description.
AI-assisted: yes (Claude Code)