Repository navigation
fix(agc): render into 1D color targets as one-row 2D targets - #2095
Merged
oneandonlydean merged 1 commit intoOct 10, 2026
Merged
Conversation
Raghav314
force-pushed
the
fix/agc-1d-color-targets
branch
2 times, most recently
from
October 9, 2026 08:48
2bdce57 to
d26b6fa
Compare
Contributor
Author
CB_COLOR_ATTRIB3.RESOURCE_TYPE 0 is a 1D surface (AddrResourceType ADDR_RSRC_TEX_1D in addrlib). On GFX10, addrlib allows a 1D surface the linear and render swizzle modes (Gfx10Rsrc1dSwModeMask) and picks its swizzle pattern the same way as for a 2D surface (GetSwizzlePatternInfo only tells 3D apart). So a 1D color target one row high is laid out exactly like a 2D target one row tall, and is decoded as one. A 1D target with a standard swizzle mode is rejected as invalid; one with more than one row is not modeled and is rejected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Raghav314
force-pushed
the
fix/agc-1d-color-targets
branch
from
October 9, 2026 09:14
d26b6fa to
7638ade
Compare
Contributor
Author
9 tasks done
|
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.
|
9 tasks done
Contributor
|
Windows run: Windows 11 Pro 25H2 (10.0.26200.9457), RTX 5060 Ti (NVIDIA 617.42), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release,
AI-assisted: yes |
7 tasks done
oneandonlydean
added a commit
to oneandonlydean/AnyPS5
that referenced
this pull request
Oct 10, 2026
oneandonlydean
added a commit
to oneandonlydean/AnyPS5
that referenced
this pull request
Oct 10, 2026
SleglJan
pushed a commit
to SleglJan/AnyPS5
that referenced
this pull request
Oct 10, 2026
…rgets fix(agc): render into 1D color targets as one-row 2D targets
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
DecodeColorTileModeaccepted only 2D (RESOURCE_TYPE1, depth 0) and 3D (RESOURCE_TYPE2) color targets. A 1D target (RESOURCE_TYPE0) threw "unsupported color depth, dimension, resource level or metadata mode".In addrlib,
RESOURCE_TYPE0 isADDR_RSRC_TEX_1D. On GFX10 a 1D surface may use the linear and render swizzle modes (Gfx10Rsrc1dSwModeMask), and it gets its swizzle pattern the same way as a 2D surface:GetSwizzlePatternInfoonly tells 3D apart. So a 1D color target one row high is laid out exactly like a 2D target one row tall.DecodeColorTileModeacceptsRESOURCE_TYPE0 with depth 0, like 2D. It rejects a 1D target with a standard swizzle mode (SW_4KB_S,SW_64KB_S), which addrlib does not allow for 1D.DecodeColorBufferdecodes a 1D target as that one-row 2D target. One taller than a row (CB_COLOR_ATTRIB2.MIP0_HEIGHTnot 0) is rejected as unsupported: addrlib only limits 1D to one row on its linear paths (HwlComputeSurfaceInfoLinear,ComputeSurfaceAddrFromCoordLinear), so a tiled one is not modeled.PPSA36082
Hades II renders into a 512x1 sRGB 8_8_8_8 target with
CB_COLOR_ATTRIB3=0x4cc6c000(RESOURCE_TYPE0,SW_64KB_R_X, resource level 1) while it loads a level. Plain main stops earlier than that. On main f145139 (where I tested the game; this branch is rebased on current main) with the fixes it needs to get there (#861, #1367, #1249, #1905, #1961, #1959, #1960, #1928 and a fix for the null pixel program miss from #1901), it threw at that draw; with this change it renders it and goes on to the next problem (MSAA, #419).Tested
Linux (CachyOS), x86-64, GCC, 7800X3D / RTX 4090.
agc_driver_graphics(new checks):RESOURCE_TYPE3, orSW_4KB_S/SW_64KB_Sis rejected.CB_COLOR_ATTRIB2is rejected.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)