chore(agc): log texture creation only with APS5_DEBUG_LOG, except the sRGB copy #11423

Merged
Tehshortbus merged 1 commit from upstream-pr/11423 into main 2026-10-27 23:58:05 +00:00
Tehshortbus commented 2026-10-26 12:54:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Tehshortbus on 2026-10-26T12:54:52Z.


What

Put four of the five remaining unconditional texture creation log sites in Texture.cpp behind APS5_DEBUG_LOG, as 81c67e1be did for the storage image and storage-viewed texture lines: the guest-memory texture line and its per-mip lines, and the repacked, block and depth copy-of-storage-image lines.

The sRGB copy-of-storage-image line (APS5_LOG_OUT(... sRGB copy of storage image ...)) stays unconditional. #7085 changes the lines directly above and below it (copyLevels = ... and the CreateExpandImage call), and guarding it here makes a merge of the two heads conflict in Texture.cpp. It can follow once #7085 is merged or closed.

GTA V (PPSA04264 v01.011.001) creates textures throughout gameplay; on main 30be9b428 these lines were 68,694 of the 69,889 lines (98 %) of a 7-minute run's log, about 8 MB.

Tested

CachyOS Linux (kernel 7.3.0-4-cachyos), NVIDIA GeForce RTX 4070 SUPER, driver 615.78.08.

  • Tested on base main 2db37cf1d; since rebased onto 035ac96ed, whose 17 new commits don't touch Texture.cpp.
  • Focused tests on main and on this change, ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build -R <pattern> -V with agc_driver_staged_clear_sampled_read, agc_driver_view_past_last_mip, agc_driver_resource_cache_replaced_texture, agc_driver_packed_mip_tail_target, agc_driver_image_repacked_float, agc_driver_recover_repack_allocation, agc_driver_bc_block_copy, agc_driver_depth_copy_draw, agc_depth_copy_kept_bytes: 9/9 pass on both. Neither log contains was not found but was requested by env var VK_INSTANCE_LAYERS; neither contains VUID-. The main log has 30 Texture address= lines, 36 mip lines and 6 copy-of-storage-image lines; this change's log has none.
  • Texture.cpp also compiles with -DAPS5_DEBUG_LOG.
  • Neither the focused tests nor the GTA V runs below reach the sRGB copy path (no sRGB copy of storage image line on main either); this PR does not change it.
  • GTA V, same save, unattended: both main 2db37cf1d and this change stop about 50 s in with compute shader 0x25b36a200: reads or writes a converted float image with 16-bit data, which is not implemented (shader recompiler, unrelated to this change). Up to that point main logged 1,701 lines, 1,096 of them from Texture.cpp; this change logged 619 and 605 lines in two runs, none from Texture.cpp.

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 SUPER, driver 615.78.08, CachyOS Linux (kernel 7.3.0-4-cachyos)
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5017765440 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11423). Originally posted by [Tehshortbus](https://github.com/Tehshortbus) on 2026-10-26T12:54:52Z. --- ### What Put four of the five remaining unconditional texture creation log sites in `Texture.cpp` behind `APS5_DEBUG_LOG`, as 81c67e1be did for the storage image and storage-viewed texture lines: the guest-memory texture line and its per-mip lines, and the repacked, block and depth copy-of-storage-image lines. The sRGB copy-of-storage-image line (`APS5_LOG_OUT(... sRGB copy of storage image ...)`) stays unconditional. #7085 changes the lines directly above and below it (`copyLevels = ...` and the `CreateExpandImage` call), and guarding it here makes a merge of the two heads conflict in `Texture.cpp`. It can follow once #7085 is merged or closed. GTA V (PPSA04264 v01.011.001) creates textures throughout gameplay; on `main` 30be9b428 these lines were 68,694 of the 69,889 lines (98 %) of a 7-minute run's log, about 8 MB. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> CachyOS Linux (kernel 7.3.0-4-cachyos), NVIDIA GeForce RTX 4070 SUPER, driver 615.78.08. - Tested on base `main` 2db37cf1d; since rebased onto 035ac96ed, whose 17 new commits don't touch `Texture.cpp`. - Focused tests on `main` and on this change, `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build -R <pattern> -V` with `agc_driver_staged_clear_sampled_read`, `agc_driver_view_past_last_mip`, `agc_driver_resource_cache_replaced_texture`, `agc_driver_packed_mip_tail_target`, `agc_driver_image_repacked_float`, `agc_driver_recover_repack_allocation`, `agc_driver_bc_block_copy`, `agc_driver_depth_copy_draw`, `agc_depth_copy_kept_bytes`: 9/9 pass on both. Neither log contains `was not found but was requested by env var VK_INSTANCE_LAYERS`; neither contains `VUID-`. The `main` log has 30 `Texture address=` lines, 36 mip lines and 6 copy-of-storage-image lines; this change's log has none. - `Texture.cpp` also compiles with `-DAPS5_DEBUG_LOG`. - Neither the focused tests nor the GTA V runs below reach the sRGB copy path (no `sRGB copy of storage image` line on `main` either); this PR does not change it. - GTA V, same save, unattended: both `main` 2db37cf1d and this change stop about 50 s in with `compute shader 0x25b36a200: reads or writes a converted float image with 16-bit data, which is not implemented` (shader recompiler, unrelated to this change). Up to that point `main` logged 1,701 lines, 1,096 of them from `Texture.cpp`; this change logged 619 and 605 lines in two runs, none from `Texture.cpp`. ### 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 SUPER, driver 615.78.08, CachyOS Linux (kernel 7.3.0-4-cachyos) - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-26 12:58:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T12:58:37Z.

Review: CHANGES_REQUESTED


The measured log reduction and nine focused Vulkan tests on both base and changed builds are strong evidence for the changed paths; conventions, intake and labels pass, and this head is based on current main 035ac96edd.

One scope gap remains. The sRGB sampled-texture constructor in Texture.cpp still emits an unconditional APS5_LOG_OUT line (sRGB copy of storage image), while the title says sampled texture creation is logged only with APS5_DEBUG_LOG. The PR body identifies this as intentionally omitted because #7085 changes nearby code. I checked the pairwise merge preview of these exact heads: it is clean, including Texture.cpp, so #7085 does not appear to prevent changing this line. Please either guard this line too, or narrow the title and stated scope to make clear that sRGB-copy logging remains unconditional. The reported GTA V run did not exercise this branch, so its none from Texture.cpp result does not validate the exception.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5652330492 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11423#pullrequestreview-5652330492). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T12:58:37Z. **Review:** CHANGES_REQUESTED --- The measured log reduction and nine focused Vulkan tests on both base and changed builds are strong evidence for the changed paths; conventions, intake and labels pass, and this head is based on current `main` `035ac96edd`. One scope gap remains. The sRGB sampled-texture constructor in `Texture.cpp` still emits an unconditional `APS5_LOG_OUT` line (`sRGB copy of storage image`), while the title says sampled texture creation is logged only with `APS5_DEBUG_LOG`. The PR body identifies this as intentionally omitted because #7085 changes nearby code. I checked the pairwise merge preview of these exact heads: it is clean, including `Texture.cpp`, so #7085 does not appear to prevent changing this line. Please either guard this line too, or narrow the title and stated scope to make clear that sRGB-copy logging remains unconditional. The reported GTA V run did not exercise this branch, so its `none from Texture.cpp` result does not validate the exception.
MarcZX10 commented 2026-10-26 13:14:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T13:14:22Z.

Review: APPROVED


Reviewed head ddab03671fa101033d06299516a53ee7c1486701 against current main 035ac96edd. The four in-scope texture creation/copy log sites are consistently guarded by APS5_DEBUG_LOG; the title and body now explicitly leave the sRGB copy line out, addressing my prior scope concern. The reported base/change Vulkan validation runs cover the changed constructors, and the stated limitation that neither run reaches the sRGB path is clear. Conventions and label checks pass. I did not independently run the author-reported GPU tests.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5652527673 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11423#pullrequestreview-5652527673). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T13:14:22Z. **Review:** APPROVED --- Reviewed head `ddab03671fa101033d06299516a53ee7c1486701` against current `main` `035ac96edd`. The four in-scope texture creation/copy log sites are consistently guarded by `APS5_DEBUG_LOG`; the title and body now explicitly leave the sRGB copy line out, addressing my prior scope concern. The reported base/change Vulkan validation runs cover the changed constructors, and the stated limitation that neither run reaches the sRGB path is clear. Conventions and label checks pass. I did not independently run the author-reported GPU tests.
MarcZX10 commented 2026-10-26 13:55:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T13:55:58Z.

Review: APPROVED


Reviewed head ddab03671fa101033d06299516a53ee7c1486701 against current main. The four guarded sites are texture diagnostics only; the values they previously logged remain used outside the guards, and the sRGB-copy line is deliberately unchanged. The path is limited to Texture.cpp, and the PR explains the conflict/ordering with #7085. git diff --check and tools/check_conventions.py --base upstream/main --head upstream/pr-11423 pass.

The Vulkan regression matrix and GTA V log comparison in the description are author-reported; I did not reproduce them. Current hosted checks cover conventions and labels but do not run the AGC tests. I found no correctness issue in this logging-only diff.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5653080725 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11423#pullrequestreview-5653080725). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T13:55:58Z. **Review:** APPROVED --- Reviewed head `ddab03671fa101033d06299516a53ee7c1486701` against current `main`. The four guarded sites are texture diagnostics only; the values they previously logged remain used outside the guards, and the sRGB-copy line is deliberately unchanged. The path is limited to `Texture.cpp`, and the PR explains the conflict/ordering with #7085. `git diff --check` and `tools/check_conventions.py --base upstream/main --head upstream/pr-11423` pass. The Vulkan regression matrix and GTA V log comparison in the description are author-reported; I did not reproduce them. Current hosted checks cover conventions and labels but do not run the AGC tests. I found no correctness issue in this logging-only diff.
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!11423
No description provided.