fix(libSceAgcDriver): pad level 0 rows of a POW2_PAD PS4 mip chain #9842
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9842"
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 ntamas94 on 2026-10-22T17:27:15Z.
What
A GCN T# with
POW2_PADset and more than one level has every level padded to power-of-two dimensions, level 0 included. Level 0's pitch already is a power of two; its rows are padded too.ComputeGcnMipLayoutpadded only levels 1 and up, so level 1 started after the micro-tile-aligned height of level 0 instead of its padded height.Knowledge is Power: Decades (CUSA12435, Unity) hits it with the 68x68, seven-level,
Thin_1dThinicon of its PlayLink notifications ("a player joined / left") and of the AWAY badge. The title's CPU tiler writes the chain the way its DMA copies place it: level 0 is 128x128 texels (0x10000 bytes), level 1 starts at +0x10000, level 2 at +0x14000. The driver read level 1 at +0x9000 (128 * 72 texels), which is in level 0's padding rows. The notification shows the icon downscaled, so it sampled level 1 and showed the stale texture data left there as coloured noise. shadPS4 pads every level, level 0 included, and shows the icon clean.Level 0's rows are now padded too when the chain has more than one level. Level 0's width stays the T# pitch. A single
POW2_PADlevel keeps its micro-tile-aligned rows.#9674 (tile mode 19,
Thick_1dThick) adds a volume layout that pads its levels the same way; once both are in, its level 0 rows and depth need the same change, which I will make there.Tested
Windows 11 Pro (10.0.26200), WinLibs GCC, NVIDIA GeForce RTX 2080 (driver 617.14), Release build with
BUILD_TESTING=ON, on this branch (mainf7e84c4cfplus this commit, merge340e579a3):TextureTilingcase lays out the 68x68 chain (pitch 128, seven levels): level 0 is 0x10000 bytes, level 1 starts at 0x10000 and level 2 at 0x14000; a single level of the same texture stays 128 * 72 texels.agc_driver_graphicspasses; withTextureTiling.cppreverted to the base it fails (a POW2_PAD PS4 mip chain pads the rows of level 0).agc_driver_graphics,agc_driver_gcn_detile,agc_driver_ds_swizzle,agc_driver_image_volume_address_planar_texture,agc_driver_image_xor_swizzle_volume,agc_driver_packed_mip_tail_target,agc_driver_view_past_last_mip,agc_driver_resource_cache_replaced_texture,texture_format_lookup.main; the change itself is unchanged):tools/check_conventions.pyfrommain,--base f7e84c4cfwith this title and description: no findings.main(f7e84c4cf) and this branch (all nine), 100% passed on both, withVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_REQUIRE_VULKAN=1andVK_LOADER_DEBUG=warn,error,ctest -V, on the NVIDIA GeForce RTX 2080, driver 617.14, Windows 11 (10.0.26200): both logs carry the loader'sadding layers "VK_LAYER_KHRONOS_validation"line (14 times each) and neither reportswas not found but was requested by env var VK_INSTANCE_LAYERS;VUID-ids onmain: 0, on this branch: 0, new on this branch: 0.Checklist
main; no other open PR implements the same functions (searched open and closed boykopovar/AnyPS5 PRs for pow2,POW2_PAD, pow2pad, mip padding andTextureTilingon 2026-10-22)NotImplemented_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-10-29T09:57:31Z.
Review: CHANGES_REQUESTED
Review — changes requested
The title/texture report and the old-base GPU results are useful, but the integration point this PR was stacked on has moved: dependency #9431 merged into current
mainateefa50841267. Headefeba42f30665ae59c29ab1eeae36f0a5ff77e95does not contain that merge and conflicts with currentmaininState.hpp,DepthSurface.cpp,State.cpp,TextureTiling.cpp, andTextureTiling.cpp's test.The latest
mainchange toDepthSurface.cppremoved the layered-depth pitch restriction that this PR modifies. The resulting combined PS4 mip-layout path and its tests need a deliberate resolution; preserving the old patch mechanically could restore a restriction that main removed. The PR’s reported runs are on the older #9431 stack (26d651d3e), so they do not validate the post-merge integration.Please merge the current #9431 result/current
main, retain the intended POW2_PAD level-0 row layout without reintroducing the removed layered-depth restriction, reconcile the overlapping layout tests, and rerun the focused GPU/tiling tests with validation on the resulting head. I checked the current merge preview andgit diff --check; the preview has those five conflicts and the whitespace check passes. I did not run the GPU tests locally.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T11:12:30Z.
Review: CHANGES_REQUESTED
Re-checked — changes requested
The update explains that the extra depth fields and
DepthSurface.cpppitch line came from the old #9431 stack, not this PR, and reports three focused runs plus a paired validation-layer comparison. The branch remains based onf7e84c4cf1; currentmainisba5b5330b3. Please update the branch to current main and provide a clean merge preview plus conventions on the resulting tree before merge. The current-main diff does not touch the PR's two implementation/test files, so the reported focused runs remain relevant if the refreshed diff confirms they are unchanged.