fix(agc): pass the tile mode of a mismatched depth plane copy as an int #7504

Merged
milescoviello merged 1 commit from upstream-pr/7504 into main 2026-11-08 08:17:25 +00:00
milescoviello commented 2026-10-18 09:56:59 +00:00 (Migrated from github.com)

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) passed resource.tileMode, a TextureTileMode enum class, straight to a %u conversion. 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:

core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp:868:214: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 12 has type ‘const AgcDriver::Graphics::TextureTileMode’ [-Wformat=]

It is now cast to int and printed with %d, as the replaced-view error in the same file already prints it. (The storage image access error casts to unsigned and prints %u; either cast fixes the mismatch.) On current main the message is at DepthSurface.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, and DepthSurface.cpp builds 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/main passes. tools/pr_overlap.py lists only conflicting PRs that it could not compare on DepthSurface.cpp, and none of their diffs touch this message.

  • @wachi35676 tested 352f6236c. On WSL Ubuntu 24.04 with GCC 13.3, main prints the -Wformat warning at DepthSurface.cpp:868 and this PR builds the object without warnings. MinGW GCC 15.2 gives no warning either way. The 19 agc_driver_depth|native_depth|depth_plane|depth_storage tests 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 352f6236c merged into main 07377573f, alone and together with 13 other open AGC and shader PRs. Neither GPU fails anything beyond main'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_' -V on main e2a2914aa1 and on main + 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 on main: 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

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 4070 Ti, driver 595.99.02, Ubuntu 24.04 (Linux 6.8); NVIDIA RTX 5070 Ti, 617.42, and an AMD Radeon iGPU, 32.0.21042.62, Windows (by @wachi35676); Intel UHD 770 and AMD RX 9070 XT, Windows (by @savvaniss)
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4908133641 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7504). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-18T09:56:59Z. --- ### What The error for a depth plane copy whose geometry doesn't match its layers (`DepthSurface.cpp`) passed `resource.tileMode`, a `TextureTileMode` enum class, straight to a `%u` conversion. 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: ``` core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp:868:214: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 12 has type ‘const AgcDriver::Graphics::TextureTileMode’ [-Wformat=] ``` It is now cast to `int` and printed with `%d`, as the replaced-view error in the same file already prints it. (The storage image access error casts to `unsigned` and prints `%u`; either cast fixes the mismatch.) On current `main` the message is at `DepthSurface.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, and `DepthSurface.cpp` builds 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/main` passes. `tools/pr_overlap.py` lists only conflicting PRs that it could not compare on `DepthSurface.cpp`, and none of their diffs touch this message. - @wachi35676 [tested 352f6236c](https://github.com/boykopovar/AnyPS5/pull/7504#issuecomment-6256920958). On WSL Ubuntu 24.04 with GCC 13.3, `main` prints the `-Wformat` warning at `DepthSurface.cpp:868` and this PR builds the object without warnings. MinGW GCC 15.2 gives no warning either way. The 19 `agc_driver_depth|native_depth|depth_plane|depth_storage` tests 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](https://github.com/boykopovar/AnyPS5/pull/7504#issuecomment-6261242001) (1,526 tests, Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Intel UHD 770 and AMD RX 9070 XT) with head 352f6236c merged into `main` 07377573f, alone and together with 13 other open AGC and shader PRs. Neither GPU fails anything beyond `main`'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_' -V` on `main` e2a2914aa1 and on `main` + 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 on `main`: `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 <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA GeForce RTX 4070 Ti, driver 595.99.02, Ubuntu 24.04 (Linux 6.8); NVIDIA RTX 5070 Ti, 617.42, and an AMD Radeon iGPU, 32.0.21042.62, Windows (by @wachi35676); Intel UHD 770 and AMD RX 9070 XT, Windows (by @savvaniss) - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
wachi35676 commented 2026-10-19 00:13:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by wachi35676 on 2026-10-19T00:13:22Z.


Tested at 352f6236c.

  • WSL Ubuntu 24.04, GCC 13.3.0, main 9f25d0bf5: building DepthSurface.cpp.o prints DepthSurface.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.
  • Windows, MinGW GCC 15.2.0: no warning either way.
  • The 19 agc_driver_depth|native_depth|depth_plane|depth_storage tests 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.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6256920958 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7504#issuecomment-6256920958). Originally posted by [wachi35676](https://github.com/wachi35676) on 2026-10-19T00:13:22Z. --- Tested at `352f6236c`. - **WSL Ubuntu 24.04, GCC 13.3.0, `main` `9f25d0bf5`:** building `DepthSurface.cpp.o` prints `DepthSurface.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. - **Windows, MinGW GCC 15.2.0:** no warning either way. - The 19 `agc_driver_depth|native_depth|depth_plane|depth_storage` tests 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.
milescoviello commented 2026-10-19 01:06:14 +00:00 (Migrated from github.com)

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)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6257475259 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7504#issuecomment-6257475259). Originally posted by [milescoviello](https://github.com/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)
savvaniss commented 2026-10-19 06:35:46 +00:00 (Migrated from github.com)

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, with VkCache emptied first. This head 352f6236c merged into main 07377573f.

This PR adds no test. Full CTest (--parallel 4, 1526 tests) with this head merged fails the same tests as main alone on this machine: the five image-table tests (#6647) and agc_driver_sample_multisample_target (#6957) on the UHD 770, and agc_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) and agc_driver_sample_multisample_target (#6957) on the UHD 770, and agc_driver_layered_volume_vertex_no_gpl (#4768) on the RX 9070 XT.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6261242001 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7504#issuecomment-6261242001). Originally posted by [savvaniss](https://github.com/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, with `VkCache` emptied first. This head `352f6236c` merged into `main` `07377573f`. This PR adds no test. Full CTest (`--parallel 4`, 1526 tests) with this head merged fails the same tests as `main` alone on this machine: the five image-table tests (#6647) and `agc_driver_sample_multisample_target` (#6957) on the UHD 770, and `agc_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) and `agc_driver_sample_multisample_target` (#6957) on the UHD 770, and `agc_driver_layered_volume_vertex_no_gpl` (#4768) on the RX 9070 XT. AI-assisted: yes (Claude Code)
milescoviello commented 2026-10-19 06:54:03 +00:00 (Migrated from github.com)

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)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6261504436 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7504#issuecomment-6261504436). Originally posted by [milescoviello](https://github.com/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)
BunnyFl commented 2026-11-03 04:52:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-03T04:52:14Z.

Review: APPROVED


Still needed on current main f6232fcfda: the message moved to core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp:1561, and it still passes resource.tileMode (a TextureTileMode scoped enum) to %u. The PR merges cleanly.

Windows 11, WinLibs GCC 15.2.0: the merged DepthSurface.cpp compiles with no warnings. This build passes no -W flags for that file (ninja -t commands for its object). In a separate two-line file, GCC 15.2 with -Wall reports format '%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 main only the replaced-view message (:869) prints the tile mode as static_cast<int> with %d. The storage-access one (:612) uses static_cast<unsigned> with %u. Either cast fixes the mismatch.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5747411832 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7504#pullrequestreview-5747411832). Originally posted by [BunnyFl](https://github.com/BunnyFl) on 2026-11-03T04:52:14Z. **Review:** APPROVED --- Still needed on current `main` `f6232fcfda`: the message moved to `core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp:1561`, and it still passes `resource.tileMode` (a `TextureTileMode` scoped enum) to `%u`. The PR merges cleanly. Windows 11, WinLibs GCC 15.2.0: the merged `DepthSurface.cpp` compiles with no warnings. This build passes no `-W` flags for that file (`ninja -t commands` for its object). In a separate two-line file, GCC 15.2 with `-Wall` reports `format '%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 `main` only the replaced-view message (`:869`) prints the tile mode as `static_cast<int>` with `%d`. The storage-access one (`:612`) uses `static_cast<unsigned>` with `%u`. Either cast fixes the mismatch.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!7504
No description provided.