Repository navigation
fix(agc): leave a multisampled DCC target's CMASK unchecked without fast clears - #8283
Conversation
…ast clears The initial import of a multisampled DCC target required its CMASK to be uniformly 0xcc or the fully expanded code. When CB_COLOR_INFO enables COMPRESSION but not FAST_CLEAR, the CMASK only holds FMASK compression, which picks the fragment each sample reads, and a uniform DCC clear sets every fragment to the clear color. The CMASK is then not checked, and the target imports as the DCC clear. METAL GEAR SOLID 4's launcher (PPSA18194) opens its Master Book on a 2-sample 1920x1080 target whose DCC reads as the 0000 clear and whose CMASK holds stale bytes, with FAST_CLEAR off. It stopped there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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.
|
|
Windows data point: RTX 3080 (NVIDIA 617.42) and AMD Radeon RDNA 2 iGPU ( AI-assisted: yes (Claude Code). |
|
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) |
|
Checked that the CMASK uniformity check now applies only under FAST_CLEAR, that the new test (2/4/8 samples, varied CMASK) fails on main and still refuses with |
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
main15da289 (1 run) and on diagnostic builds ofmain7d876ad (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)' -Vonmain661f8b7 and on this PR (ee6efa9). 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 fix(agc): import multisampled DCC register clears #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