Repository navigation
fix(agc): read 128-bit T#s that start past MAX_MIP from their resident levels - #8962
Merged
oneandonlydean merged 1 commit intoOct 22, 2026
Merged
Conversation
…t levels
An R128 image access reads only words 0-3 of its T#; the recompiler
passes words 4-7 as zero, so the decoder saw MAX_MIP 0 and refused a
128-bit T# with BASE_LEVEL above 0 ("starts past the surface's last mip
level at levels that would move the surface's own"). Streamed textures
such as a 2048x2048 BC3 T# naming its resident levels 2..11 hit this.
Where a T# with words 4-7 zero would be refused that way, it is now read
as a 128-bit T#: MAX_MIP = LAST_LEVEL, with levels BASE..LAST described
as their own chain (size and MIN_LOD rebased), but only for 1D and 2D
T#s whose rebased levels have the same offsets, sizes and tail slots as
in the full chain. Everything else still throws as before.
AI-assisted: yes
|
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.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 onmain65c393a: 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)