fix(agc): pass the tile mode of a mismatched depth plane copy as an int #7504
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7504"
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 milescoviello on 2026-10-18T09:56:59Z.
What
The error for a depth plane copy whose geometry doesn't match its layers (
DepthSurface.cpp) passedresource.tileMode, aTextureTileModeenum class, straight to a%uconversion. A scoped enumeration isn't promoted in a variadic call, so the conversion doesn't match its argument. GCC 13 warns about it in every build:It is now cast to
intand printed with%d, as the replaced-view error in the same file already prints it. (The storage image access error casts tounsignedand prints%u; either cast fixes the mismatch.) On currentmainthe message is atDepthSurface.cpp:1561.Tested
Ubuntu 24.04 (Linux 6.8), GCC 13.3, NVIDIA RTX 4070 Ti, driver 595.99.02.
cmake --build build: the warning above is gone, andDepthSurface.cppbuilds without warnings.ctest -R "agc_driver_depth|native_depth|depth_plane|depth_storage": 19/19 pass. No test reaches this error (it fires only on a geometry mismatch), so there's no red/green test. The change only touches the message's arguments.tools/check_conventions.py --base upstream/mainpasses.tools/pr_overlap.pylists only conflicting PRs that it could not compare onDepthSurface.cpp, and none of their diffs touch this message.@wachi35676 tested 352f6236c. On WSL Ubuntu 24.04 with GCC 13.3,
mainprints the-Wformatwarning atDepthSurface.cpp:868and this PR builds the object without warnings. MinGW GCC 15.2 gives no warning either way. The 19agc_driver_depth|native_depth|depth_plane|depth_storagetests pass on an RTX 5070 Ti (617.42) and an AMD Radeon iGPU (32.0.21042.62).Windows, Intel and AMD: @savvaniss ran the full CTest (1,526 tests, Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Intel UHD 770 and AMD RX 9070 XT) with head
352f6236cmerged intomain07377573f, alone and together with 13 other open AGC and shader PRs. Neither GPU fails anything beyondmain's own failures on that machine.Khronos validation layer (LunarG SDK 1.4.363), NVIDIA RTX 4070 Ti (595.99.02), Ubuntu 24.04:
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest -R '^agc_' -Vonmaine2a2914aa1and onmain+ this PR (352f6236cc, a local merge).main: 815 of 815 pass; with this PR: 815 of 815 pass. Neither log reports the layer missing. VUIDs onmain:VUID-VkImageViewCreateInfo-usage-02275×6,VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605×18,VUID-vkCmdCopyBuffer-srcBuffer-00118×2,VUID-vkCmdDraw-multisampledRenderToSingleSampled-07285×2,VUID-vkCmdWaitEvents-srcStageMask-01158×2,VUID-vkSetEvent-event-09543×2; with this PR:VUID-VkImageViewCreateInfo-usage-02275×6,VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605×18,VUID-vkCmdCopyBuffer-srcBuffer-00118×2,VUID-vkCmdDraw-multisampledRenderToSingleSampled-07285×2,VUID-vkCmdWaitEvents-srcStageMask-01158×2,VUID-vkSetEvent-event-09543×2. None is new with this PR.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by wachi35676 on 2026-10-19T00:13:22Z.
Tested at
352f6236c.main9f25d0bf5: buildingDepthSurface.cpp.oprintsDepthSurface.cpp:868:214: warning: format '%u' expects argument of type 'unsigned int', but argument 12 has type 'const AgcDriver::Graphics::TextureTileMode' [-Wformat=]. With this PR merged, the object builds with no warnings.agc_driver_depth|native_depth|depth_plane|depth_storagetests pass on an RTX 5070 Ti (617.42) and an AMD Radeon iGPU (32.0.21042.62).AI-assisted: yes (Claude Code); results above were run on this machine.
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T01:06:14Z.
Thanks @wachi35676 for checking the warning on both toolchains and running the depth tests on two GPUs. Added to the description.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-19T06:35:46Z.
Windows regression check on an Intel UHD 770 and an AMD RX 9070 XT: no change in the full CTest results.
Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built,
ANYPS5_NO_SHADER_CACHE=1, serial CTest. Intel UHD Graphics 770 (8086:a780), driver 32.0.101.7088. AMD Radeon RX 9070 XT (1002:7550), driver 32.0.31041.1004, withVkCacheemptied first. This head352f6236cmerged intomain07377573f.This PR adds no test. Full CTest (
--parallel 4, 1526 tests) with this head merged fails the same tests asmainalone on this machine: the five image-table tests (#6647) andagc_driver_sample_multisample_target(#6957) on the UHD 770, andagc_driver_layered_volume_vertex_no_gpl(#4768) on the RX 9070 XT.I also ran full CTest with this PR and the 13 other open AGC and shader PRs I tested in the same batch merged together (#7668, #7659, #7432, #7426, #7413, #7480, #7465, #7466, #7464, #7449, #7489, #7673, #7560). Neither GPU showed a failure beyond
main's own: the five image-table tests (#6647) andagc_driver_sample_multisample_target(#6957) on the UHD 770, andagc_driver_layered_volume_vertex_no_gpl(#4768) on the RX 9070 XT.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T06:54:03Z.
@savvaniss thanks for the full CTest on both GPUs, alone and in the 14-PR batch. It's in the description now.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-03T04:52:14Z.
Review: APPROVED
Still needed on current
mainf6232fcfda: the message moved tocore/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp:1561, and it still passesresource.tileMode(aTextureTileModescoped enum) to%u. The PR merges cleanly.Windows 11, WinLibs GCC 15.2.0: the merged
DepthSurface.cppcompiles with no warnings. This build passes no-Wflags for that file (ninja -t commandsfor its object). In a separate two-line file, GCC 15.2 with-Wallreportsformat '%u' expects argument of type 'unsigned int', but argument 4 has type 'E' [-Wformat=]for a scoped enum passed to%u, the same diagnostic you saw with GCC 13.A wording nit for the description: on current
mainonly the replaced-view message (:869) prints the tile mode asstatic_cast<int>with%d. The storage-access one (:612) usesstatic_cast<unsigned>with%u. Either cast fixes the mismatch.