fix(agc): render into 1D color targets as one-row 2D targets #2095
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2095"
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 Raghav314 on 2026-10-09T08:19:40Z.
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 mainf1451396(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)Imported from boykopovar/AnyPS5. Originally posted by Raghav314 on 2026-10-09T08:58:03Z.
Heads up: main's CI is currently broken by
ShaderFusion.cppnot findingspirv/unified1/spirv.hpp(missing SPIRV-Headers include, fails on main6cc0503dtoo), so linux/windows will likely fail here for that reason, not this change. #2093 / #2099 fix it, and I'll rebase once one of them lands.Imported from boykopovar/AnyPS5. Originally posted by Raghav314 on 2026-10-09T09:15:28Z.
Rebased on main
d9484c71(with #2099). Ran the linux job from build.yml locally on the new head (SPIRV tools on, test registration check, build, libs): ctest 504/504 pass.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T12:39:18Z.
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.
main)core/libs/prx/libSceAgcDriver/tests/Graphics.cppL824, L2963Imported from boykopovar/AnyPS5. Originally posted by rmz-24 on 2026-10-09T13:30:59Z.
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,
-DANYPS5_ENABLE_SPIRV_TOOLS=ON, full build pluslibs.7638ade7cherry-picked onto currentmaind70b8998(applies cleanly).agc_driver_graphics(with the new 1D target checks) passes.AI-assisted: yes