fix(agc): read 128-bit T#s that start past MAX_MIP from their resident levels #8962
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8962"
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 Celegans12 on 2026-10-21T07:38:02Z.
What
An R128 image instruction reads only words 0-3 of its T#, and the recompiler passes words 4-7 as zero (
getImageResource), soDecodeTextureResourcesees MAX_MIP 0. A 128-bit T# with a BASE_LEVEL above 0 then throws "starts past the surface's last mip level at levels that would move the surface's own". Ghost of Yōtei's streamed textures are like that: a 2048x2048 BC3 T# naming levels 2..11, of which only those 10 levels are resident.DescribeSurfacegives each of those levels the same offset, size and tail slot as in the full chain (GFX10 places a chain from its last level up, so the resident levels start the allocation).Overlaps: #8564 adds
EncodeTextureResourceright below the refusal this PR changes (textual only). #7948 and #8429 edit other parts ofDecodeTextureResourceand its test and merge cleanly with this PR. #6977 edits the same function too but already conflicts withmain.Tested
-DBUILD_TESTING=ON, RTX 3080 Laptop, based onmain65c393a684: ctest 1834/1838.log_macros,log_macros_timestampsandagc_driver_image_array_window_past_layer_limit(doesn't compile with MinGW) fail onmaintoo;guest_raise_in_host_codetimed out under load and passed 3/3 alone.main.agc_driver_graphics: the streamed T# decodes as 512x512 with 10 levels, each equal to level n+2 of the 12-level chain; a 1024x2048 T# of levels 4..11 as 64x128 with 8; MIN_LOD moves with the base level. They fail onmainwith the "starts past" message. The old 1920x1080 refusal case gets a PERF_MOD so it stays a 256-bit T#.main.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)