fix(agc): render a color view of several array slices into its first slice #3633
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3633"
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 tv7 on 2026-10-11T14:29:09Z.
What
DecodeColorBufferrejected everyCB_COLOR_VIEWwhoseSLICE_MAXis pastSLICE_START("color views of several array slices are unsupported"). The layer a primitive lands in isSLICE_STARTplus its render target index, which is 0 when the draw does not export one. So for a 2D array target, such a view renders intoSLICE_START, the same as a one-slice view of that slice. This accepts it that way.Still rejected:
PA_CL_VS_OUT_CNTLenables the render target index export (bit 18): layered draws are not routed (existing comment aboveLayerExports), and sending them all to the first slice would be wrong;SLICE_MAXbelowSLICE_START, or past the last array slice.Marvel's Wolverine (PPSA03671) binds 2D array color targets through views of several slices, without the render target index export. On main its first presentation stops on this check.
Tested
Windows 11, RTX 3070, GCC 15.2.0 UCRT, Release, on main
a11c8f7f7.agc_driver_graphics(DepthStencilTests): a 0..1 view of a 2D array target renders into slice 0; the same view with the render target index export, a view past the last array slice, a reversed view and a view of several 3D slices still throw. Fails on main ("color views of several array slices are unsupported"), passes with the fix.guest_kernel_sys,windows_exceptions,guest_filesystem,agc_driver_emulated_color_compare) fail the same way on main on this machine.tools/check_conventions.pypasses.Checklist
main; no other open PR implements the same functions (#1077 touches the same check for 3D targets only)NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-11T15:19:56Z.
Independent pre-review on Linux (full CI runs only happen on manual trigger, so recording one): CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON.tools/check_conventions.py --base origin/mainpasses.Imported from boykopovar/AnyPS5. Originally posted by tv7 on 2026-10-11T17:53:45Z.
Note on overlap: #3524 (XairRrR) touches the same lines in
DecodeColorBuffer. The two are complementary, not duplicates. #3524 addresses a one-slice view of a 2D array through the array's swizzle, and this PR accepts a view whoseSLICE_MAXis pastSLICE_START(rendered intoSLICE_START). They conflict textually on thebeyond the array surfaceline. If both land, the check should testlastSliceand keep #3524'sarraySlice=SLICE_START.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T23:15:51Z.
A view of several slices on a target with no array slices is now accepted. In
DecodeColorBufferthelastSlicebound is only checked insideelse if ((attrib3 & 0x1fffu) != 0), and the test row that covered this case (0x31b = 1u << 13uon the plain target) was changed to a reversed view. Please checklastSlicefor every non-3D target and keep that row, expectingbeyond the array surface.Imported from boykopovar/AnyPS5. Originally posted by Pacuka on 2026-10-12T16:18:30Z.
Data point from Minecraft (PPSA17221), Linux / RX 6650 XT (RADV), on main
d592d54e1+ #4215 #4218 #454: without this PR the title aborts about 2.5 minutes in, from the presenter, withAGC graphics: color views of several array slices are unsupported. With it, the title keeps running: menu, world load and rendering of the world. #1077 conflicts with current main in 13 files, so this was the change I could apply. It merged cleanly.Imported from boykopovar/AnyPS5. Originally posted by tv7 on 2026-10-12T17:20:34Z.
Fixed in 7215ff34f: a target with no array slices now requires the view to cover one slice, so a view of several slices on it throws
beyond the array surface. One-slice views on such a target (the existing "move the target by one slice" case) still work. The0x31b = 1u << 13urow on the plain target is back, expectingbeyond the array surface, next to the reversed-view row. Also rebased on main2a5eca11c. Windows/MinGW: 973/973.Thanks @Pacuka for the Minecraft data point.
Imported from boykopovar/AnyPS5. Originally posted by tv7 on 2026-10-12T20:39:24Z.
@oneandonlydean I need to take back part of 7215ff34f. Running Marvel's Wolverine (PPSA03671) on main
3e0e01f35showed a title that uses exactly the case it refused. It draws into a 256x256 mipmapped 2D target with no array slices (CB_COLOR_ATTRIB3=0x4dc6c000,CB_COLOR_ATTRIB2=0x503fc0ff) throughCB_COLOR_VIEW=0x4046000: slices 0 to 35 at mip 1. With the plain-target bound it stops atthe color view slice is beyond the array surfacein the presenter, within the first minute. Without the bound it renders into slice 0 and continues.So the branch (rebased on
44ab0c39e) now leaves a view's last slice unbounded on a target with no array slices. That target has only one slice to render into. Instead of thebeyond the array surfacerow, there is a test with Wolverine's shape: a view of slices 0 to 35 on the plain target decodes to the same address, size and slice range as a one-slice view. Array targets keep the bound, 3D targets still refuse several slices, and a reversed view still throws. Windows/MinGW: 1006/1006.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T02:17: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/Graphics/src/State.cppL1011, L1023-1024, L1026-1030core/libs/prx/libSceAgcDriver/tests/Graphics.cppL1345