fix(agc): accept PS4 tile modes on 1D array textures #21944
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/21944"
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 B-Howell on 2026-11-16T22:40:40Z.
What
A PS4 1D array T# with a tiled PS4 tile mode was rejected with
guest 1D array texture descriptor uses a tile mode other than linear, Z or R, which 1D resources cannot use. That rule (#eb30830da3) is the GFX10 addrlib one:Gfx10Rsrc1dSwModeMask = Gfx10LinearSwModeMask | Gfx10RenderSwModeMask | Gfx10ZSwModeMask(gfx10addrlib.h), checked against theresourceTypefield ofADDR2_COMPUTE_SURFACE_INFO_INPUT. It applies to RDNASW_MODEswizzles.A PS4 T# does not carry a
SW_MODE. ItsTILING_INDEXnames an entry of the GCN tile mode table, whichresolveGcnTileModealready maps tokGcnThin1D,kGcnDisplay1D,kGcnThin2Dand the others, so every PS4 tiled index failed the check,ARRAY_1D_TILED_THIN1included. GCN addrlib has no resource dimension at all:ADDR_COMPUTE_SURFACE_INFO_INPUTtakestileMode,width,height,numSlicesand flags, with no 1D/2D type (addrinterface.h), so a 1D array is laid out like a height-1 2D array with the same tile mode. shadPS4 does the same:ImageInfo::UpdateSizecallsComputeImageSize(pitch, size.height, size.depth, resources.levels, resources.layers, ..., tile_mode, array_mode, ...)for every image type, andGetBaseTypefoldsColor1DArrayintoColor1D(image_info.cpp, resource.h).The check now applies only to RDNA descriptors. PS4 1D arrays go through
ComputeGcnMipLayoutlike PS4 2D arrays already do; thick modes stay rejected there for anything but 3D. The RDNA rejection now prints the descriptor, like the other rejections inDecodeTextureResource. No debt change: nothing new is left unimplemented.The test decodes PS4 1D array T#s with tile indices 5, 9, 13 and 14 and checks that each decodes to its PS4 tile mode and has the same layers, layer size, guest size, level size and pitch as the same T# typed as a 2D array. The RDNA cases (0x05 and 0x19 still rejected; Z_X and R_X accepted) are unchanged.
Tested
Windows 11 Pro 10.0.26300, WinLibs GCC 15.2.0 r7, Release, NVIDIA GeForce RTX 4080 SUPER, driver 621.14, Khronos validation layer 1.4.363.1 through
VK_ADD_LAYER_PATH.ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer ctest --test-dir build-win -R "^(agc_graphics_profile_draw|agc_driver_gcn_.*)$" -V.agc_graphics_profile_drawis the ctest entry that runsRunGuestTextureResourceTests.agc_graphics_profile_drawfails withguest 1D array texture descriptor uses a tile mode other than linear, Z or R, which 1D resources cannot useInsert instance layer "VK_LAYER_KHRONOS_validation"was not found but was requested by env var VK_INSTANCE_LAYERSVUID-Both arms were built in one tree,
mainplus the open fixes Bloodborne needs to reach this point (#17105, #17711, #21832, #20156). None of them touchGuestTextureResource.cppor its test, and both files are the same on that base and on this PR's base. The control arm swapped inmain'sGuestTextureResource.cpp.Title: Bloodborne CUSA00900 01.09 (my own copy), on the same combined tree. With
main's decode it stops about 1.5 s in, at its first presentation, with the message above. With this change that presentation succeeds. In one 60 s run it then loadedgxshader,systex,gxgui,gxrenderershader,gxposteffectandgxflvershader, ran two more compute shaders and stopped atcompute shader 0x2d1f00900: buffer specialization has an unsupported format. That is a separate stop for a follow-up PR. In five other runs it stalled soon after the first compute dispatch, before it opened/data/cache.bin, with no error and no GPU queue stall reported (APS5_STALL_WATCHDOG_SECS=10). That stall is not investigated here.theGodspeed1999 (comment): Windows 10 Pro 22H2 (19045), NVIDIA GeForce RTX 3060 Ti, driver 617.42, WinLibs GCC 15.2.0 r7, Release, this head
c3d543e22conmainef7c67b55ftogether with #13147 and #21345.ctest -R "agc|shader|stencil|depth|cmask|texture": 2,007/2,010 passed, texture resource tests included; the 3 failures also fail onmain(agc_driver_stencil_plane_memory, #22427;agc_driver_store_over_untrackedandagc_driver_upload_cache_read_only_flush, #22358). Combined set only; Linux and macOS not run.Colewiz7 (comment): Linux 7.3.4, GCC 16.2.1, Release, Mesa 26.2.6 RADV, AMD Radeon RX 7900 XT (gfx1100) and Ryzen 7800X3D iGPU (gfx1036), this head
c3d543e22conmain2a7f0786d2. Full suite (6,057 tests) and-R '^agc'(1,936 tests) withVK_LAYER_KHRONOS_validation1.4.363.1,ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1: no new failures againstmainon either GPU, layer inserted in every run, 0VUID-and 0SYNC-HAZARDlines.python3 tools/check_conventions.py --base origin/mainpasses.tools/pr_overlap.py --branchreports #21501, which adds tests at the same place at the end oftests/GuestTextureResource.cpp, so the overlap is textual only. It could not compare #9895 and #13796, which conflict withmain. I read their diffs: neither changes the 1D array tile mode check.eaglescoutmaster (comment): Windows 11 Pro build 26300, NVIDIA GeForce RTX 5080, driver 617.14, WinLibs GCC 15.2.0 r7, Release, this head
c3d543e22capplied ontomainafe88d44ad.agc_graphics_profile_draw,agc_driver_graphicsand eightagc_driver_gcn_*tests, 3 runs per side: 30 of 30 onmainand 30 of 30 with this PR; the 51 runnableagc_driver_graphics_testscases have the same pass set on both.agc_graphics_profile_drawalso passes onmainthere, so this shows no regression, not the fix. No validation layer, so noVUID-check;agc_driver_gcn_display_presentand its trigger test were not run.Merge of
main6ee75a3d82(2026-11-19, headb4527c025d):tests/GuestTextureResource.cppconflicted becausemainaddedRunRememberedRejectionTests();at the end of the same function; kept both, this PR's 1D array checks first. Windows 11 Pro 10.0.26300, WinLibs GCC 15.2.0 r7, Release, RTX 4080 SUPER, driver 621.14: rebuiltagc_driver_graphics_tests;agc_graphics_profile_drawpasses 3 of 3 runs (--repeat until-fail:3) withANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1, noVUID-line in the log.python3 tools/check_conventions.py --base origin/mainpasses.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T06:21:36Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this; the points below are optional.
What I ran
c3d543e22c(base main). No merged-preview check was run.repo_read.py, read-only):Results
Findings
Blocking
None.
Non-blocking
None.
Sources
gcn ||bypass on the 1D array tile mode check.ComputeGcnMipLayouttakes the layers and tile mode with no 1D special case.Not verified
gcnPitch == 128) rest on that run.tools/check_conventions.py. Not run here.GuestTextureResource.cppand the full test file were not read in one piece.files.jsonunder reviewed, in the ranges above. Excluded by rule: none.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T15:04:53Z.
Review: APPROVED
Reviewed — looks good
The change is sound at head
b4527c025db29e6319300350fb5455521d6b17c3: it restricts the relaxed 1D-array tile-mode check to PS4 descriptors, and the added tests compare decoding and layout against equivalent height-1 2D arrays.What I ran
Read the prepared diff and manifest, and inspected the decoder, its PS4 tiling mapping, and the added texture resource tests at the pinned head. No tests were run during this review.
Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
No tests were run independently. The author-reported Windows, Linux, and console runs were not independently reproduced.
files.jsonwas not available through the reader; the manifest lists both changed files as included, and both were read.To get this to a good state
Nothing is required.