feat(agc): accept texture BC swizzles that leave the sampled border unchanged #1733
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1733"
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 TheAggie on 2026-10-08T17:51:37Z.
What
DecodeTextureResourcerejected any nonzeroBC_SWIZZLE(T# word 3, bits 27:25). The field only reorders the border color, so the border lands in the right channels afterDST_SEL. Mesa sets it from the format's channel order on every image descriptor (ac_border_color_swizzleinsrc/amd/common/ac_formats.c, used by RADV and radeonsi). So every texture whose format is not stored as XYZW was dropped, for example ccleste's (PPSA59322) under RADV.Mesa's own comment there gives the rule: "For the pre-defined border color values (white, opaque black, transparent black), the only thing that matters is that the alpha channel winds up in the correct place."
BC_SWIZZLEvalues 0-5 decode intoGuestTextureResource::bcSwizzle(enumSQ_IMG_RSRC_WORD3__BC_SWIZZLEingfx10-rsrc.json). The reserved values 6 and 7 still throw.RequireBorderSwizzleruns next toRequireFilterMinmax, for each sampled image and its paired samplers.XWYZ,WZYX,WXYZ,YXWZ) and a paired sampler clamps to an opaque black border.DecodeSamplerResource.XYZWorZYXWthe sampled values are exactly those of the unswizzled case.agc_driver_graphics(GuestTextureResource): values 0-5 decode and keep their value; 6 and 7 are rejected.agc_driver_graphics(GuestSamplerResource):ReadsOpaqueBlackBorderis true only for clamp-to-border with opaque black. Every swizzle passes with transparent black, opaque white, or no border addressing. The four alpha-moving swizzles throw with opaque black, andXYZW/ZYXWpass. An unbound sampler element throws.Tested
Windows 11 Pro (26200), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, NVIDIA GeForce RTX 5070 Ti.
CTestTestfile.cmakecommands because antivirus blocksctest.exeon this machine.Not tested on AMD, Intel or Linux.
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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by johnmaia on 2026-10-08T18:59:12Z.
Linux run, since the description lists AMD and Linux as not tested: Ubuntu 24.04.5 (kernel 6.8), GCC 13.3, Release, AMD Radeon RX 7600 (RADV NAVI33, Mesa 25.2.8). This PR's head
933bfe1d, merged onto main6b56175a.Full ctest: 479/479 pass, with the GPU tests running on the RX 7600 (none skipped). That includes
agc_driver_graphicswith the newGuestTextureResourceandGuestSamplerResourcecases.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T03:18:51Z.
This conflicts with main after today's merges; could you rebase? It passed testing and is otherwise ready.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T07:23:10Z.
Rebased head checked on top of current main: builds, ctest green (incl.
agc_driver_graphics), no conflicts. Merging.