AGC: sampled MSAA surface geometry omits fragment storage #6439

Closed
opened 2026-10-15 15:24:01 +00:00 by Amoenus · 1 comment
Amoenus commented 2026-10-15 15:24:01 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-15T15:24:01Z.


Summary

DescribeSurface uses single-sample mip geometry for a sampled MSAA T#. Its reported guest-memory range omits most fragment storage. ShaderResources::precollectImages uses that range for write collection and resource records.

This is a CPU reproduction using the already-public Sonic Unleashed Recompiled descriptor from #3036 (PPSA99902, 01.003.000), not a new game run or identification of its current loading-stage failure.

Version and setup

Main ff23657f3437427fc5421857a6f9545e41806f2c; Windows 11 Enterprise 26200, WinLibs GCC 15.2.0 r7, Release/bundled dependencies. The geometry assertion is independent of a GPU.

Actual and expected

Descriptor Main DescribeSurface().guestBytes Fragment-aware footprint
Sonic's 3840×2160, RGBA16F, 8 fragments, R64KBX 66,846,720 (0x3fc0000) 534,773,760 (0x1fe00000)
Existing 297×297 RGBA8 canvas fixture, 4 fragments, R64KBX 589,824 (0x90000) 1,638,400 (0x190000)

For Sonic, Addrlib gives 32×32-pixel blocks, pitch 3840 and padded height 2176. Multiplying a single-sample allocation by the sample count is not a general correction: fragment-dependent block orientation and padding matter, as the 297×297 case shows.

The public descriptor is:

405fc080 c4700000 821bc3bf e1b30fac 00000000 00400030 406b0000 0040819f

Reproduction and reference

Unmodified main production plus seven assertion lines in tests/GuestTextureResource.cpp, local test commit faae9e53fc0bc2d4e26dad6c8f6d40d5d4ee57ad: agc_driver_graphics fails 5/5 fresh processes at:

AGC graphics: the PPSA99902 8x surface footprint omits fragments: 66846720

The expected allocation follows pinned AMD Addrlib ComputeThinBlockDimension and its macro-tiled surface sizing. Independent Addr2ComputeSurfaceInfo calls reproduce these values with chip engine 0x0d, family 0x8f, revision 0x82, GB_ADDR_CONFIG=0x00100044, 2D/one mip/one slice and numSamples=numFrags. Permitting metadata or setting noMetadata=1 gives identical allocation sizes in this probe. This is published-source consistency, not raw PS5 hardware measurement.

#4199 corrected the native target's guest-access guard; this defect is in the separate sampled-resource geometry helper. #3036 remains the broader bring-up report. #6297 extends undrawn Z/D imports, and #6280 caps host mip chains; neither implements fragment-aware DescribeSurface sizing.

The focused correction is proposed in #6445, rebased fork commit f32f6797a, on main44df. Production and fixture blobs are unchanged by the rebase; its sole conflict was debt-entry placement. The exact head passes the ten-group/five-repeat matrix under both GPU selectors, nine groups on each verified physical GPU and graphics on CPU/mock. The current-main test-only control 3c5d15c811d67f1d3440111b7c945de077bc9848 fails 5/5 fresh processes per selector at the captured footprint assertion.

The current production DLL repeats all 1,440 matching pinned Addrlib comparisons; Cppcheck/clang-tidy report no selected diagnostics. Full Windows app/libs/checkers pass on separate composition 55d75837b69c040159ee0cd4a4b2e5c52e0da410, adding only #6452 for the existing Windows test-build alignment problem. The PR declares that dependency and its exact source pins, devices and limits. No new startup or performance result is claimed. Equivalent #6444 is being consolidated with its author, as linked below.

AI-assisted: Codex; author responsible.

Equivalent implementation #6444 is also open. Consolidation with its author is requested; #6445 retains the broader tested controls, but the final landing choice is not agreed yet. No separate implementation is needed for this issue.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5868952505 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6439). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-15T15:24:01Z. --- ### Summary `DescribeSurface` uses single-sample mip geometry for a sampled MSAA T#. Its reported guest-memory range omits most fragment storage. `ShaderResources::precollectImages` uses that range for write collection and resource records. This is a CPU reproduction using the already-public Sonic Unleashed Recompiled descriptor from #3036 (PPSA99902, 01.003.000), not a new game run or identification of its current loading-stage failure. ### Version and setup Main `ff23657f3437427fc5421857a6f9545e41806f2c`; Windows 11 Enterprise 26200, WinLibs GCC 15.2.0 r7, Release/bundled dependencies. The geometry assertion is independent of a GPU. ### Actual and expected | Descriptor | Main `DescribeSurface().guestBytes` | Fragment-aware footprint | |---|---:|---:| | Sonic's 3840×2160, RGBA16F, 8 fragments, R64KBX | 66,846,720 (`0x3fc0000`) | 534,773,760 (`0x1fe00000`) | | Existing 297×297 RGBA8 canvas fixture, 4 fragments, R64KBX | 589,824 (`0x90000`) | 1,638,400 (`0x190000`) | For Sonic, Addrlib gives 32×32-pixel blocks, pitch 3840 and padded height 2176. Multiplying a single-sample allocation by the sample count is not a general correction: fragment-dependent block orientation and padding matter, as the 297×297 case shows. The public descriptor is: ```text 405fc080 c4700000 821bc3bf e1b30fac 00000000 00400030 406b0000 0040819f ``` ### Reproduction and reference Unmodified main production plus seven assertion lines in `tests/GuestTextureResource.cpp`, local test commit `faae9e53fc0bc2d4e26dad6c8f6d40d5d4ee57ad`: `agc_driver_graphics` fails 5/5 fresh processes at: ```text AGC graphics: the PPSA99902 8x surface footprint omits fragments: 66846720 ``` The expected allocation follows pinned [AMD Addrlib `ComputeThinBlockDimension`](https://github.com/GPUOpen-Drivers/pal/blob/c5e800072a32f68b6ccc4422936d96167c6e0728/src/core/imported/addrlib/src/core/addrlib2.cpp#L1680-L1708) and its [macro-tiled surface sizing](https://github.com/GPUOpen-Drivers/pal/blob/c5e800072a32f68b6ccc4422936d96167c6e0728/src/core/imported/addrlib/src/gfx10/gfx10addrlib.cpp#L3801). Independent `Addr2ComputeSurfaceInfo` calls reproduce these values with chip engine `0x0d`, family `0x8f`, revision `0x82`, `GB_ADDR_CONFIG=0x00100044`, 2D/one mip/one slice and `numSamples=numFrags`. Permitting metadata or setting `noMetadata=1` gives identical allocation sizes in this probe. This is published-source consistency, not raw PS5 hardware measurement. ### Related scope #4199 corrected the native target's guest-access guard; this defect is in the separate sampled-resource geometry helper. #3036 remains the broader bring-up report. #6297 extends undrawn Z/D imports, and #6280 caps host mip chains; neither implements fragment-aware `DescribeSurface` sizing. The focused correction is proposed in [#6445](https://github.com/boykopovar/AnyPS5/pull/6445), [rebased fork commit `f32f6797a`](https://github.com/Amoenus/AnyPS5/commit/f32f6797ada9eaced60f5e02cf7e14758f30db2b), on main44df. Production and fixture blobs are unchanged by the rebase; its sole conflict was debt-entry placement. The exact head passes the ten-group/five-repeat matrix under both GPU selectors, nine groups on each verified physical GPU and graphics on CPU/mock. The current-main test-only control `3c5d15c811d67f1d3440111b7c945de077bc9848` fails 5/5 fresh processes per selector at the captured footprint assertion. The current production DLL repeats all 1,440 matching pinned Addrlib comparisons; Cppcheck/clang-tidy report no selected diagnostics. Full Windows app/libs/checkers pass on separate composition `55d75837b69c040159ee0cd4a4b2e5c52e0da410`, adding only #6452 for the existing Windows test-build alignment problem. The PR declares that dependency and its exact source pins, devices and limits. No new startup or performance result is claimed. Equivalent #6444 is being consolidated with its author, as linked below. AI-assisted: Codex; author responsible. <!-- codex-sampled-msaa-footprint-v1 --> <!-- codex-msaa-footprint-overlap-v1 --> Equivalent implementation #6444 is also open. [Consolidation with its author is requested](https://github.com/boykopovar/AnyPS5/pull/6444#issuecomment-6200027881); #6445 retains the broader tested controls, but the final landing choice is not agreed yet. No separate implementation is needed for this issue. <!-- /codex-msaa-footprint-overlap-v1 -->
MarcZX10 commented 2026-10-15 15:43:03 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T15:43:03Z.


I opened #6444 with the fragment-aware DescribeSurface() sizing and a CPU regression using the existing PPSA99006 4× canvas fixture. The production geometry and descriptor decoder compile independently with GCC 12, and a standalone harness using those production objects returns 0x190000. The full graphics test target still stops before linking on the unrelated GCC 12 parse error in SrtDescriptorEvaluation.cpp:183. The PR has been rebased to current main; conventions, eligibility, intake and report checks pass, with platform build checks skipped.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6196085376 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6439#issuecomment-6196085376). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T15:43:03Z. --- I opened #6444 with the fragment-aware `DescribeSurface()` sizing and a CPU regression using the existing PPSA99006 4× canvas fixture. The production geometry and descriptor decoder compile independently with GCC 12, and a standalone harness using those production objects returns `0x190000`. The full graphics test target still stops before linking on the unrelated GCC 12 parse error in `SrtDescriptorEvaluation.cpp:183`. The PR has been rebased to current `main`; conventions, eligibility, intake and report checks pass, with platform build checks skipped.
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#6439
No description provided.