fix(agc): build agc_shader_replay with SPIRV-Tools again #6125

Closed
milescoviello wants to merge 1 commit from upstream-pr/6125 into main
milescoviello commented 2026-10-14 22:51:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-14T22:51:05Z.


What

agc_shader_replay no longer compiles with ANYPS5_ENABLE_SPIRV_TOOLS=ON:

core/libs/prx/libSceAgcDriver/tools/ShaderReplay.cpp:150:34: error: no matching function for call to 'spvtools::SpirvTools::Disassemble(const ShaderRecompiler::SharedSpirv&, std::string*, spv_binary_to_text_options_t)'

--dis passed result.spirv straight to spvtools::SpirvTools::Disassemble, which takes either a std::vector<uint32_t> or a pointer and a word count. That relied on SharedSpirv's implicit conversion to const std::vector<std::uint32_t>&. 895002149 (#4806) removed that conversion when SharedSpirv started viewing mapped cache files as a span.

CI configures with -DANYPS5_ENABLE_SPIRV_TOOLS=ON, but the tool target is EXCLUDE_FROM_ALL, so CI never builds it.

This change passes the words as result.spirv.data() and result.spirv.size(). Nothing else changes.

Tested

Ubuntu 24.04, GCC 13.3, Release, ANYPS5_ENABLE_SPIRV_TOOLS=ON, on main eea428ca8:

  • cmake --build build --target agc_shader_replay: fails with the error above on main, builds with this change.
  • agc_shader_replay --dis <request> prints the whole module for a dumped graphics request (348 instructions) and a dumped compute request (12,722 instructions).
  • tools/check_conventions.py --base upstream/main passes.

#5959 also edits ShaderReplay.cpp but leaves this call as it is. The two don't overlap.

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 in TechnicalDebt
  • 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
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4865637535 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6125). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-14T22:51:05Z. --- ### What `agc_shader_replay` no longer compiles with `ANYPS5_ENABLE_SPIRV_TOOLS=ON`: ``` core/libs/prx/libSceAgcDriver/tools/ShaderReplay.cpp:150:34: error: no matching function for call to 'spvtools::SpirvTools::Disassemble(const ShaderRecompiler::SharedSpirv&, std::string*, spv_binary_to_text_options_t)' ``` `--dis` passed `result.spirv` straight to `spvtools::SpirvTools::Disassemble`, which takes either a `std::vector<uint32_t>` or a pointer and a word count. That relied on `SharedSpirv`'s implicit conversion to `const std::vector<std::uint32_t>&`. 895002149 (#4806) removed that conversion when `SharedSpirv` started viewing mapped cache files as a span. CI configures with `-DANYPS5_ENABLE_SPIRV_TOOLS=ON`, but the tool target is `EXCLUDE_FROM_ALL`, so CI never builds it. This change passes the words as `result.spirv.data()` and `result.spirv.size()`. Nothing else changes. ### Tested Ubuntu 24.04, GCC 13.3, Release, `ANYPS5_ENABLE_SPIRV_TOOLS=ON`, on `main` eea428ca8: - `cmake --build build --target agc_shader_replay`: fails with the error above on `main`, builds with this change. - `agc_shader_replay --dis <request>` prints the whole module for a dumped graphics request (348 instructions) and a dumped compute request (12,722 instructions). - `tools/check_conventions.py --base upstream/main` passes. #5959 also edits `ShaderReplay.cpp` but leaves this call as it is. The two don't overlap. ### Checklist - [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 in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [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] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
adriadam10 commented 2026-10-16 23:32:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-16T23:32:23Z.


Closing: the same one-line fix (result.spirv.data(), result.spirv.size() in the --dis call of ShaderReplay.cpp) landed on main with #5959 yesterday, so this PR no longer changes anything against main. Thanks for finding the build break. Feel free to reopen if you see another difference.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6226647651 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6125#issuecomment-6226647651). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-16T23:32:23Z. --- Closing: the same one-line fix (`result.spirv.data(), result.spirv.size()` in the `--dis` call of `ShaderReplay.cpp`) landed on `main` with #5959 yesterday, so this PR no longer changes anything against `main`. Thanks for finding the build break. Feel free to reopen if you see another difference.

Pull request closed

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!6125
No description provided.