Repository navigation
fix(agc): store and read DCC keys over the console's metadata extent - #788
Conversation
|
Thanks. The 8x8-block mapping checks out: the low byte of
|
|
Thanks, both points are right.
I'll convert this to a draft until the reworked version is up. |
|
Correction to my earlier reply: the row-major reading was wrong, and neither order nor padding is the cause.
So the fix is to store and read keys over the console's metadata size for these surfaces, and to classify all of them. Nothing about padding is needed. I'll rework this PR that way, with a test that reproduces the three numbers, and the pending-image comparison will use the same range. The DCC addressing derivation goes in the PR text. |
40729c8 to
173518f
Compare
|
Reworked as described above, and ready for review again. The new title is "store and read DCC keys over the console's metadata extent". It is one commit on
@merwie, if you can run PPSA12544 on this version, it should present without the padding experiment. If it still throws, the message now names the first differing key and its pixels in the displayable order, and |
|
Thanks for the rework. Both earlier points are covered: the padding runs are gone, and the pending-image check now reads the display keys over the same extent as the flip. Reproducing merwie's 33552 / 1008 / 32784 numbers from a retile in One question about the store side.
I'll run this through PPSA21564 before it lands, since its color target and storage image write-backs take the new store path. |
173518f to
8710433
Compare
|
Good question. I checked the render (pipe-aligned) metadata and small targets. The size holds for them too, and one key per 256 bytes does not describe that metadata. What the CB addresses. For the render DCC (16 pipes, non-RB+,
How libSceAgc sizes it (PPSA26344 eboot):
Why not store only the CB's keys. I simulated the retile at 1920x1080 with the padding left at the allocation's 0x00:
Proposal.
What changed in the PR. I amended the commit that way (now on
|
|
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.
|
|
@oneandonlydean ready from our side; you said you'd run it through PPSA21564 before it lands, so the merge is yours once that's done.
|
|
A PPSA12544 data point for this head ( Windows 11, Intel i9-10850K, NVIDIA RTX 3080. PPSA12544 v1.0.30021 on AI-assisted (Claude Code) testing and write-up. |
8710433 to
f6d6675
Compare
|
Rebased onto |
|
The windows failure is |
4765284 to
e3406c2
Compare
e3406c2 to
766e948
Compare
766e948 to
0165070
Compare
|
Tested 0165070 on main 73ac9ef: ctest 433/433, and the full game check passes the same with and without this (no new skipped draws, no visual differences). I couldn't do the second, heavier title on main yet: it stops before the intro on a separate issue unrelated to this PR. From our side this is good to merge. It now conflicts with main in |
The console's DCC of a single-level 4-byte SW_64KB_R_X surface is ceil(W/512) * ceil(H/512) * 4096 bytes, 49152 for 1920x1080, but the driver stored and read one key per 256 surface bytes (34560). PPSA26344 retiles its render DCC into the displayable copy it registers (cs_dcc_retile_32bpp); a retile of the stale tail gives the mixed keys PPSA12544 stops on. DccKeyCount gives that extent. Color target and storage image key stores cover it when the DCC is pipe-aligned (CB_COLOR_ATTRIB3 bit 30, T# word 6 bit 19), whose CB keys reach its last meta block, and throw where it is not writable; unaligned DCC keeps one key per 256 bytes, as do texture and color target key reads. DisplayBufferKeys reads the display DCC over the extent, presents only when every key agrees, names the first differing key's pixels and checks a pending image against those keys.
0165070 to
1816aea
Compare
What
@merwie's PPSA12544 report on #648 (1920x1080: 33552
0xff, 10080x00of 34560 keys, first differing 32784) comes from the extent of the driver's key stores, not from key order or padding (my row-major reading here was wrong).ceil(W/512) * ceil(H/512) * 4096bytes (addrlib; PPSA26344's 0x161d760; GTA V's 0x6000 at 1280x720), 49152 at 1920x1080.MarkDccUncompressedstored 34560.cs_dcc_retile_32bppcopy of its render DCC; that retile (addrlib patterns 25 to 2) of a 34560-key store gives merwie's numbers.DccKeyCountgives the extent for single-level, single-layer 4-byte SW_64KB_R_X surfaces. Color target and storage image key stores cover it for pipe-aligned DCC (CB_COLOR_ATTRIB3bit 30, T# word 6 bit 19; libSceAgc's size query returns it, and at 128x128, 1920x1080 and 3840x2160 its CB keys end within 240 bytes of it), throwing where it is not writable; unaligned DCC keepsbytes/256.DisplayBufferKeysreads the extent and presents only uniform keys.bytes/256differ or are unreadable now throws; pipe-aligned driver stores leave no differing tail, unaligned ones can. Texture and CB key reads keepbytes/256(TechnicalDebt).DecodeColorBufferandRunColorMetadataPassnext to code changed here and refuses multisampled DCC.Tested
mainc73ee44: configure-DBUILD_TESTING=ON, full build,--target libs,ctest:ctest --output-on-failure)VK_DRIVER_FILES): 402/402 pass;agc_driver_flat_storeis left out there because it takes several minutes on Windows llvmpipeagc_display_buffer_dccandagc_driver_graphics(do not build onmain): merwie's keys reproduce, the driver's store, retiled, presents, and the flip reads keys past 34560; pipe-aligned stores cover the extent (or throw if not writable), unaligned onesbytes/256. Pipe-aligned rows fail on the old extent, unaligned ones without the gate.agc_driver_recorder_tests,video_out_flip_tests dcc.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)