feat(agc): run mesh-path draws through a compute pass on devices without mesh shaders #9356

Open
billythemenace2 wants to merge 3 commits from upstream-pr/9356 into main
billythemenace2 commented 2026-10-21 19:17:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by billythemenace2 on 2026-10-21T19:17:53Z.


Requested by billy

What

A mesh-path draw (the NGG primitive-shader path) needed VK_EXT_mesh_shader. Devices without it stop at device does not support mesh shaders: RDNA1, RDNA2 iGPUs on AMD's Windows driver, Intel Gen9, and Apple through MoltenVK. This runs such a draw through a compute pass instead, as designed in #6528.

  • Compute pass: the mesh program is compiled as GLCompute (SpirvTarget::meshAsCompute). It writes the draw's primitive indices and vertex records to a device buffer behind a 16-byte VkDrawIndirectCommand header. The buffer address travels in the mesh argument dwords.
  • Readback: a generated vertex shader (BuildMeshReadbackVertexShader) reads the records back for a triangle or line list drawn with vkCmdDrawIndirect. It carries position, parameters, clip and cull distances, and the layer from the provoking vertex. MeshRecordLayout describes the record (clip and cull counts, layer, provoking vertex, primitive size) and is stored with the compiled program.
  • Pipeline layout: the compute pass has its own pipeline layout, with the draw's set layouts and a compute push range. With the draw's independent-sets layout, even an empty compute shader lost the device on RDNA1.
  • Subgroups: the pass pins the program's subgroup size where subgroup size control allows. It refuses compute subgroups narrower than the wave, which drew wrong primitives on lavapipe, except the 32-lane subgroups that run a wave-64 program in paired lanes (Apple).
  • Per-draw choice: MeshDrawRunsAsCompute decides per draw. Without mesh shaders the fallback is always used. On a device with them, it's used when MeshDrawLayers (the bound targets' largest layer, slice or depth-slice count) exceeds maxMeshOutputLayers, which is 8 on RADV. The draw stage then requests the mesh program with meshAsCompute set, and a program compiled for the mesh stage that reaches the compute pass is refused.
  • Switch: APS5_NO_MESH_SHADER=1 leaves VK_EXT_mesh_shader off, so every mesh-path draw takes the fallback.
  • Output buffer: sized per draw from the groups and instances it resolves to (an indirect draw's record is read on the CPU, IndirectDrawPath::MeshCompute). A draw that needs more than min(256 MiB, maxStorageBufferRange) throws.
  • Points: a mesh program with point output that runs as compute throws, since the record carries no point size. This is listed in the debt file.
  • Docs: docs/dev/ARCHITECTURE.md describes the pass.
  • Versions: serialization version 45 stores meshAsCompute. The shader disk cache format is 46, for the record layout field.

Not covered here, as follow-ups on top: emulated barycentrics behind the fallback. @root-over's geometry-stage route (eff3479e9) and @Alexius0815's tessellation route for MoltenVK cover it. Until then, a mesh-path pixel shader that reads barycentrics on a device without VK_KHR_fragment_shader_barycentric still stops with its existing message.

Tested

  • RX 5700 XT (RDNA1), AMD 32.0.21045.5002, Windows 11, on main f57e4ef72: agc_driver_graphics (with a unit test for the per-draw choice and the subgroup refusal), agc_driver_mesh through the fallback, agc_driver_layered_volume_draw/_submit/_vertex/_vertex_no_gpl, agc_driver_prepared_graphics (and the three prebuild variants), agc_shader_memory, the agc_shader_disk_cache tests and request_serializer pass. The tests that need the native mesh stage skip.
  • Titles on the RX 5700 XT:
    • Sackboy: A Big Adventure (PPSA01289) runs its layered 32-layer pass through the fallback.
    • The Smurfs – Dreams (PPSA21607) reaches its village, level select and first level. That run also used the geometry-stage barycentric route, which isn't in this PR.
  • @tezzgod74 on this PR's head (6861beb61), Windows: RDNA2 iGPU (fallback only) and RX 9060 XT (RDNA4), natively and with APS5_NO_MESH_SHADER=1. 891 tests (agc_* and request_serializer), with the same failures as the base in each configuration.
  • Testers' runs of the prototype on #6528 (commits 5e9032eae, 168eaf3e9 and 08346eb8f):
    • @tezzgod74, Windows: RDNA2 iGPU, mesh=0, fallback only. RX 9060 XT (RDNA4), native and with APS5_NO_MESH_SHADER=1. 718 agc_* tests, with the same failures as the base.
    • @DavidSamir, Windows, Radeon 680M with mesh=0: 15 of 20 homebrew catalog titles run for 60 s that stopped within 9 s on main.
    • @Pacuka, RADV: RX 6650 XT, where 32-slice LayeredVolumeDraw passes only through the fallback.
    • @root-over, RADV: Vega iGPU, the unit tests and 7 titles with the geometry-stage route.
    • @Alexius0815, MoltenVK: Apple M4, agc_driver_mesh with the paired-lane case allowed.
    • @odntht and @hashaam1217: Intel Gen9.
    • The Intel ANV subgroup and SPIR-V version fixes came from those runs.

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: #6528
  • Unblocks: PPSA01289 #6803, PPSA21607 #8158, and the homebrew catalog titles on devices without mesh shaders
  • GPUs tested: AMD Radeon RX 5700 XT, AMD 32.0.21045.5002, Windows 11 26200 (others listed above, on the prototype)
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4957052557 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9356). Originally posted by [billythemenace2](https://github.com/billythemenace2) on 2026-10-21T19:17:53Z. --- <!-- claude-projects-attribution --> _Requested by **billy**_ ### What A mesh-path draw (the NGG primitive-shader path) needed `VK_EXT_mesh_shader`. Devices without it stop at `device does not support mesh shaders`: RDNA1, RDNA2 iGPUs on AMD's Windows driver, Intel Gen9, and Apple through MoltenVK. This runs such a draw through a compute pass instead, as designed in #6528. - **Compute pass:** the mesh program is compiled as `GLCompute` (`SpirvTarget::meshAsCompute`). It writes the draw's primitive indices and vertex records to a device buffer behind a 16-byte `VkDrawIndirectCommand` header. The buffer address travels in the mesh argument dwords. - **Readback:** a generated vertex shader (`BuildMeshReadbackVertexShader`) reads the records back for a triangle or line list drawn with `vkCmdDrawIndirect`. It carries position, parameters, clip and cull distances, and the layer from the provoking vertex. `MeshRecordLayout` describes the record (clip and cull counts, layer, provoking vertex, primitive size) and is stored with the compiled program. - **Pipeline layout:** the compute pass has its own pipeline layout, with the draw's set layouts and a compute push range. With the draw's independent-sets layout, even an empty compute shader lost the device on RDNA1. - **Subgroups:** the pass pins the program's subgroup size where subgroup size control allows. It refuses compute subgroups narrower than the wave, which drew wrong primitives on lavapipe, except the 32-lane subgroups that run a wave-64 program in paired lanes (Apple). - **Per-draw choice:** `MeshDrawRunsAsCompute` decides per draw. Without mesh shaders the fallback is always used. On a device with them, it's used when `MeshDrawLayers` (the bound targets' largest layer, slice or depth-slice count) exceeds `maxMeshOutputLayers`, which is 8 on RADV. The draw stage then requests the mesh program with `meshAsCompute` set, and a program compiled for the mesh stage that reaches the compute pass is refused. - **Switch:** `APS5_NO_MESH_SHADER=1` leaves `VK_EXT_mesh_shader` off, so every mesh-path draw takes the fallback. - **Output buffer:** sized per draw from the groups and instances it resolves to (an indirect draw's record is read on the CPU, `IndirectDrawPath::MeshCompute`). A draw that needs more than `min(256 MiB, maxStorageBufferRange)` throws. - **Points:** a mesh program with point output that runs as compute throws, since the record carries no point size. This is listed in the debt file. - **Docs:** `docs/dev/ARCHITECTURE.md` describes the pass. - **Versions:** serialization version 45 stores `meshAsCompute`. The shader disk cache format is 46, for the record layout field. Not covered here, as follow-ups on top: emulated barycentrics behind the fallback. @root-over's geometry-stage route (`eff3479e9`) and @Alexius0815's tessellation route for MoltenVK cover it. Until then, a mesh-path pixel shader that reads barycentrics on a device without `VK_KHR_fragment_shader_barycentric` still stops with its existing message. ### Tested - **RX 5700 XT (RDNA1), AMD 32.0.21045.5002, Windows 11**, on `main` `f57e4ef72`: `agc_driver_graphics` (with a unit test for the per-draw choice and the subgroup refusal), `agc_driver_mesh` through the fallback, `agc_driver_layered_volume_draw`/`_submit`/`_vertex`/`_vertex_no_gpl`, `agc_driver_prepared_graphics` (and the three prebuild variants), `agc_shader_memory`, the `agc_shader_disk_cache` tests and `request_serializer` pass. The tests that need the native mesh stage skip. - **Titles on the RX 5700 XT:** - Sackboy: A Big Adventure (PPSA01289) runs its layered 32-layer pass through the fallback. - The Smurfs – Dreams (PPSA21607) reaches its village, level select and first level. That run also used the geometry-stage barycentric route, which isn't in this PR. - **@tezzgod74 on this PR's head (`6861beb61`)**, Windows: RDNA2 iGPU (fallback only) and RX 9060 XT (RDNA4), natively and with `APS5_NO_MESH_SHADER=1`. 891 tests (`agc_*` and `request_serializer`), with the same failures as the base in each configuration. - **Testers' runs of the prototype on #6528** (commits `5e9032eae`, `168eaf3e9` and `08346eb8f`): - @tezzgod74, Windows: RDNA2 iGPU, `mesh=0`, fallback only. RX 9060 XT (RDNA4), native and with `APS5_NO_MESH_SHADER=1`. 718 `agc_*` tests, with the same failures as the base. - @DavidSamir, Windows, Radeon 680M with `mesh=0`: 15 of 20 homebrew catalog titles run for 60 s that stopped within 9 s on `main`. - @Pacuka, RADV: RX 6650 XT, where 32-slice `LayeredVolumeDraw` passes only through the fallback. - @root-over, RADV: Vega iGPU, the unit tests and 7 titles with the geometry-stage route. - @Alexius0815, MoltenVK: Apple M4, `agc_driver_mesh` with the paired-lane case allowed. - @odntht and @hashaam1217: Intel Gen9. - The Intel ANV subgroup and SPIR-V version fixes came from those runs. ### 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 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: #6528 - [x] Unblocks: PPSA01289 #6803, PPSA21607 #8158, and the homebrew catalog titles on devices without mesh shaders - [x] GPUs tested: AMD Radeon RX 5700 XT, AMD 32.0.21045.5002, Windows 11 26200 (others listed above, on the prototype) - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tezzgod74 commented 2026-10-22 05:41:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by tezzgod74 on 2026-10-22T05:41:27Z.


Re-run on this PR's head, since the Tested section lists my earlier runs as the prototype's. 6861beb61 against its base 1698d1ea6, Windows 11 Pro 10.0.26300, MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON, all agc_* tests plus request_serializer (891):

base 1698d1ea6 6861beb61
Ryzen 9 7950X iGPU (RDNA 2, 1002:164e, 32.0.21045.5002, mesh=0), agc_driver_mesh skipped passes through the fallback
RX 9060 XT (RDNA 4, 1002:7590, 32.0.32015.2008), all six agc_driver_mesh* pass pass
RX 9060 XT + APS5_NO_MESH_SHADER=1, agc_driver_mesh passes (native, the switch isn't on the base) passes through the fallback
failed tests, each of the three configurations same set as the base

With the PR, all three configurations pass:

  • agc_driver_graphics
  • agc_driver_layered_volume_draw, _submit, _vertex and _vertex_no_gpl
  • agc_driver_prepared_graphics
  • agc_shader_memory
  • the four agc_shader_disk_cache* tests
  • request_serializer

No test reports module version exceeds requested SPIR-V target on the iGPU's SPIR-V 1.3 target. The other five agc_driver_mesh_* tests skip whenever the fallback runs, on the iGPU and with APS5_NO_MESH_SHADER=1.

The failures shared with the base are agc_compute_pipeline_capture_run and the three agc_driver_sample_order* tests on both devices, plus the four f64 and division tests from #7451 on the RX 9060 XT. ImageArrayWindowPastLayerLimit.cpp doesn't compile with MinGW on the base (alignas(65536), the case #9150 checks for), so that test isn't built on either side.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6333660716 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9356#issuecomment-6333660716). Originally posted by [tezzgod74](https://github.com/tezzgod74) on 2026-10-22T05:41:27Z. --- Re-run on this PR's head, since the Tested section lists my earlier runs as the prototype's. 6861beb61 against its base 1698d1ea6, Windows 11 Pro 10.0.26300, MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, `-DANYPS5_ENABLE_SPIRV_TOOLS=ON`, all `agc_*` tests plus `request_serializer` (891): | | base 1698d1ea6 | 6861beb61 | |---|---|---| | Ryzen 9 7950X iGPU (RDNA 2, `1002:164e`, 32.0.21045.5002, `mesh=0`), `agc_driver_mesh` | skipped | **passes through the fallback** | | RX 9060 XT (RDNA 4, `1002:7590`, 32.0.32015.2008), all six `agc_driver_mesh*` | pass | pass | | RX 9060 XT + `APS5_NO_MESH_SHADER=1`, `agc_driver_mesh` | passes (native, the switch isn't on the base) | **passes through the fallback** | | failed tests, each of the three configurations | | **same set as the base** | With the PR, all three configurations pass: - `agc_driver_graphics` - `agc_driver_layered_volume_draw`, `_submit`, `_vertex` and `_vertex_no_gpl` - `agc_driver_prepared_graphics` - `agc_shader_memory` - the four `agc_shader_disk_cache*` tests - `request_serializer` No test reports `module version exceeds requested SPIR-V target` on the iGPU's SPIR-V 1.3 target. The other five `agc_driver_mesh_*` tests skip whenever the fallback runs, on the iGPU and with `APS5_NO_MESH_SHADER=1`. The failures shared with the base are `agc_compute_pipeline_capture_run` and the three `agc_driver_sample_order*` tests on both devices, plus the four f64 and division tests from #7451 on the RX 9060 XT. `ImageArrayWindowPastLayerLimit.cpp` doesn't compile with MinGW on the base (`alignas(65536)`, the case #9150 checks for), so that test isn't built on either side. AI-assisted: yes
billythemenace2 commented 2026-10-22 14:08:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by billythemenace2 on 2026-10-22T14:08:18Z.


@tezzgod74 thank you for re-running on the PR head itself: the same results on the RDNA2 iGPU and the RX 9060 XT, natively and with APS5_NO_MESH_SHADER=1, and no SPIR-V target warnings. I'll cite this run in the description.

Rebased onto main 8b3e39832, now at 950a12b6b. main split Draw into prepareDraw and recordPreparedDraw, so the stage swap from MeshComputeStages now sits at the top of Draw, before both. On the RX 5700 XT, agc_driver_graphics, agc_driver_mesh, the four layered volume tests, agc_driver_prepared_graphics and its prebuild variants, agc_shader_memory, the agc_shader_disk_cache tests and request_serializer pass.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6342799500 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9356#issuecomment-6342799500). Originally posted by [billythemenace2](https://github.com/billythemenace2) on 2026-10-22T14:08:18Z. --- @tezzgod74 thank you for re-running on the PR head itself: the same results on the RDNA2 iGPU and the RX 9060 XT, natively and with `APS5_NO_MESH_SHADER=1`, and no SPIR-V target warnings. I'll cite this run in the description. Rebased onto `main` `8b3e39832`, now at `950a12b6b`. `main` split `Draw` into `prepareDraw` and `recordPreparedDraw`, so the stage swap from `MeshComputeStages` now sits at the top of `Draw`, before both. On the RX 5700 XT, `agc_driver_graphics`, `agc_driver_mesh`, the four layered volume tests, `agc_driver_prepared_graphics` and its prebuild variants, `agc_shader_memory`, the `agc_shader_disk_cache` tests and `request_serializer` pass. AI-assisted (Claude Code).
adriadam10 commented 2026-10-22 18:26:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-22T18:26:38Z.

Review: CHANGES_REQUESTED


Read the whole diff. The design is sound and the third-party runs are useful evidence. Three things to address, plus a rebase:

  • Silent drop of indirect draws with more than 4 instances. MeshArgumentRulesFor(..., asCompute=true) sets maxTotal = indexGroups * MeshComputeIndirectInstances (Draw.cpp:856, MeshComputeIndirectInstances = 4). ResolveMeshArguments then returns zero groups when groups > maxTotal / instances (Draw.cpp:888), so an indirect mesh draw with 5+ instances draws nothing and nothing is thrown. On main the same clamp is a real device limit; here it is a number chosen to size the output buffer. Either size the buffer from the instance count that is actually read, or throw when the draw exceeds what the buffer holds. Add a test with 5+ instances.
  • Unbounded output buffer. recordMeshCompute allocates MeshOutputHeaderBytes + groups * groupBytes per draw (Draw.cpp:1864), with groups = meshGroups * instanceCount and no upper bound (direct case) and groupBytes including recordBytes * maxVertices. A draw with a large instance or index count allocates that in device-local memory and holds it until the batch retires. State the bound (or Require a maximum and throw above it) and give peak RSS/VRAM before/after on a big mesh workload, as in the memory rules (docs/rules/memory.md).
  • docs/dev/ARCHITECTURE.md: a new compute pass and generated readback vertex stage in the draw path changes the pipeline; add the section under the draw diagram.
  • Conflict with main in ShaderValidation.cpp (stage count / barycentric patches line, :668): main now accepts triangle strip there ("require a triangle list or strip"). Keep that condition and message together with your meshCompute stage count.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5618956320 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9356#pullrequestreview-5618956320). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-22T18:26:38Z. **Review:** CHANGES_REQUESTED --- Read the whole diff. The design is sound and the third-party runs are useful evidence. Three things to address, plus a rebase: - **Silent drop of indirect draws with more than 4 instances.** `MeshArgumentRulesFor(..., asCompute=true)` sets `maxTotal = indexGroups * MeshComputeIndirectInstances` (`Draw.cpp:856`, `MeshComputeIndirectInstances = 4`). `ResolveMeshArguments` then returns zero groups when `groups > maxTotal / instances` (`Draw.cpp:888`), so an indirect mesh draw with 5+ instances draws nothing and nothing is thrown. On `main` the same clamp is a real device limit; here it is a number chosen to size the output buffer. Either size the buffer from the instance count that is actually read, or throw when the draw exceeds what the buffer holds. Add a test with 5+ instances. - **Unbounded output buffer.** `recordMeshCompute` allocates `MeshOutputHeaderBytes + groups * groupBytes` per draw (`Draw.cpp:1864`), with `groups = meshGroups * instanceCount` and no upper bound (direct case) and `groupBytes` including `recordBytes * maxVertices`. A draw with a large instance or index count allocates that in device-local memory and holds it until the batch retires. State the bound (or `Require` a maximum and throw above it) and give peak RSS/VRAM before/after on a big mesh workload, as in the memory rules (`docs/rules/memory.md`). - **`docs/dev/ARCHITECTURE.md`**: a new compute pass and generated readback vertex stage in the draw path changes the pipeline; add the section under the draw diagram. - **Conflict with `main`** in `ShaderValidation.cpp` (stage count / barycentric patches line, `:668`): `main` now accepts triangle strip there ("require a triangle list or strip"). Keep that condition and message together with your `meshCompute` stage count.
adriadam10 commented 2026-10-23 20:57:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-23T20:57:54Z.

Review: CHANGES_REQUESTED


The three points from the last review are addressed (indirect record read on the CPU with the output sized from groups × instances and a 6-instance test, the 256 MiB / maxStorageBufferRange bound with a throw, the ARCHITECTURE.md section). Two things left:

  • Conflicts with main in 8 files: Draw.cpp, tests/ShaderMemory.cpp, CacheKey.hpp, ControlFlow/src/RequestSerializer.cpp, Recompiler.hpp, SpirvEmitter.hpp, SpirvEmitter.cpp, tests/RequestSerializerTests.cpp. The one in Draw.cpp needs a decision: main now also binds the pixel-function LDS buffer right after the descriptor sets (BindPixelFunctionLds) and passes PixelFunctionLdsSubgroup(shaders) != 0u to StartDrawPass; both must survive inside your bindResources lambda and the meshCompute condition. Please rebase and re-run the touched tests, including serialization/disk-cache versions after whatever main bumped.
  • Conventions fails: the new debt line links core/shader/recompiler/Recompiler.cpp, so the check wants it in docs/dev/debt/shader.md. Either move it there or link a libSceAgcDriver file like the neighbouring lines.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5634373163 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9356#pullrequestreview-5634373163). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-23T20:57:54Z. **Review:** CHANGES_REQUESTED --- The three points from the last review are addressed (indirect record read on the CPU with the output sized from groups × instances and a 6-instance test, the 256 MiB / `maxStorageBufferRange` bound with a throw, the ARCHITECTURE.md section). Two things left: - **Conflicts with `main`** in 8 files: `Draw.cpp`, `tests/ShaderMemory.cpp`, `CacheKey.hpp`, `ControlFlow/src/RequestSerializer.cpp`, `Recompiler.hpp`, `SpirvEmitter.hpp`, `SpirvEmitter.cpp`, `tests/RequestSerializerTests.cpp`. The one in `Draw.cpp` needs a decision: `main` now also binds the pixel-function LDS buffer right after the descriptor sets (`BindPixelFunctionLds`) and passes `PixelFunctionLdsSubgroup(shaders) != 0u` to `StartDrawPass`; both must survive inside your `bindResources` lambda and the `meshCompute` condition. Please rebase and re-run the touched tests, including serialization/disk-cache versions after whatever `main` bumped. - **Conventions fails**: the new debt line links `core/shader/recompiler/Recompiler.cpp`, so the check wants it in `docs/dev/debt/shader.md`. Either move it there or link a `libSceAgcDriver` file like the neighbouring lines.
XairRrR commented 2026-11-03 18:37:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T18:37:37Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

This pull request does not merge cleanly into main (1e658521a0): head f49a25ae9f conflicts in

  • core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp
  • core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
  • core/libs/prx/libSceAgcDriver/Graphics/include/Draw.hpp
  • core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
  • core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
  • core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp
  • core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
  • core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
  • core/libs/prx/libSceAgcDriver/tests/execution/LayeredVolumeDraw.cpp
  • core/shader/recompiler/CMakeLists.txt
  • core/shader/recompiler/CacheKey.hpp
  • core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
  • core/shader/recompiler/Recompiler.cpp
  • core/shader/recompiler/Recompiler.hpp
  • core/shader/recompiler/ShaderDiskCache.cpp
  • core/shader/recompiler/ShaderDiskCache.hpp
  • core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitter.hpp
  • core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
  • core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
  • core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cpp
  • core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
  • core/shader/recompiler/tests/RequestSerializerTests.cpp
  • docs/dev/ENVIRONMENT.md
  • docs/dev/debt/libSceAgcDriver.md

Please rebase it onto current main. I will review the change once it merges cleanly.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5757612622 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9356#pullrequestreview-5757612622). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T18:37:37Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested This pull request does not merge cleanly into `main` (1e658521a0a599872612bb91949311e2956b5283): head f49a25ae9f036a1d27e6418faeac7c812be5773e conflicts in - `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp` - `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` - `core/libs/prx/libSceAgcDriver/Graphics/include/Draw.hpp` - `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` - `core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp` - `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp` - `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` - `core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp` - `core/libs/prx/libSceAgcDriver/tests/execution/LayeredVolumeDraw.cpp` - `core/shader/recompiler/CMakeLists.txt` - `core/shader/recompiler/CacheKey.hpp` - `core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp` - `core/shader/recompiler/Recompiler.cpp` - `core/shader/recompiler/Recompiler.hpp` - `core/shader/recompiler/ShaderDiskCache.cpp` - `core/shader/recompiler/ShaderDiskCache.hpp` - `core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitter.hpp` - `core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp` - `core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp` - `core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cpp` - `core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp` - `core/shader/recompiler/tests/RequestSerializerTests.cpp` - `docs/dev/ENVIRONMENT.md` - `docs/dev/debt/libSceAgcDriver.md` Please rebase it onto current `main`. I will review the change once it merges cleanly. <!-- anyps5-bots job=3516 head=f49a25ae9f036a1d27e6418faeac7c812be5773e -->
MarcZX10 commented 2026-11-17 05:21:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T05:21:42Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

Head f49a25ae9f036a1d27e6418faeac7c812be5773e, base main. No merged-preview check. No build, no tests, no GPU run. The checks were a read of the diff and of the head code through the repository reader:

python3 repo_read.py search "meshArguments" core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
python3 repo_read.py search "specializations" core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
python3 repo_read.py search "MeshArgumentAddressDword" core/shader
python3 repo_read.py search "computeWave32" core/libs/prx/libSceAgcDriver
python3 repo_read.py search "ControlBarrier" core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp
python3 repo_read.py cat core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp 1762 1782
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp 446 490
python3 repo_read.py cat core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cpp 170 212
python3 repo_read.py cat core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvInputOutput.cpp 204 222

Results

Check Result Note
Build not run No build in this review
Tests named in the description not run Author-reported runs only
Description claims against code passed Switch, serialization and disk-cache versions, debt entry and docs match
Changed hunks in the diff passed Every hunk read; callers checked only where noted

Findings

Blocking

None.

Non-blocking

  • core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp:885 — indexGroups is computed in the asCompute branch of MeshArgumentRulesFor and never used. It is dead code, and an unused-variable warning fails the build if warnings are errors. Removing the line fixes it.
  • core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp:469 — stages.erase shifts the entries of stages, but the stencil-replay check after it (lines 474 to 478) still indexes stages with the shaders index. For a mesh-as-compute pipeline, that check now looks at the fragment stage instead of the readback vertex stage. Nothing fails today, because the readback vertex stage never gets a subgroup size, but the check no longer covers the stage it names. Running the check before the erase, or finding the stage by its stage value, fixes it.

Not verified

  • Nothing was built or run. The author's runs (RX 5700 XT, RX 9060 XT, RDNA2 iGPU, RX 6650 XT, Vega iGPU, Apple M4, Radeon 680M, Intel Gen9) are reported in the description and were not reproduced.
  • Files read: the diff hunks of all 36 files in the reviewed list. I did not open the full text of any changed file in the review folder. Callers were read only for the functions named in the findings and for the mesh argument, pipeline stage and barrier paths.
  • tests/Graphics.cpp and tests/ShaderMemory.cpp are too large for the review folder. I read only their diff hunks.
  • The message a barycentric mesh pixel shader gets on the fallback was not traced. The description says it keeps its existing message.
  • That variantId is non-zero for programs loaded from the disk cache (MeshComputeStages requires it) was not traced.
  • Whether LocalInvocationIndex is always declared when the mesh program is emitted as compute was not traced. DefineInputs declares it only for some lane and wave cases.
  • GPU behaviour was not checked: the barriers, the push-constant ranges with compute stage flags, the 256 MiB output limit, and RADV's maxMeshOutputLayers of 8, which the description states.

To get this to a good state

Nothing is required. The two non-blocking points above are optional.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5933362812 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9356#pullrequestreview-5933362812). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-17T05:21:42Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this; the points below are optional. ## What I ran Head `f49a25ae9f036a1d27e6418faeac7c812be5773e`, base `main`. No merged-preview check. No build, no tests, no GPU run. The checks were a read of the diff and of the head code through the repository reader: ``` python3 repo_read.py search "meshArguments" core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp python3 repo_read.py search "specializations" core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp python3 repo_read.py search "MeshArgumentAddressDword" core/shader python3 repo_read.py search "computeWave32" core/libs/prx/libSceAgcDriver python3 repo_read.py search "ControlBarrier" core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp python3 repo_read.py cat core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp 1762 1782 python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp 446 490 python3 repo_read.py cat core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cpp 170 212 python3 repo_read.py cat core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvInputOutput.cpp 204 222 ``` ## Results | Check | Result | Note | |---|---|---| | Build | not run | No build in this review | | Tests named in the description | not run | Author-reported runs only | | Description claims against code | passed | Switch, serialization and disk-cache versions, debt entry and docs match | | Changed hunks in the diff | passed | Every hunk read; callers checked only where noted | ## Findings ### Blocking None. ### Non-blocking - `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp:885` — `indexGroups` is computed in the `asCompute` branch of `MeshArgumentRulesFor` and never used. It is dead code, and an unused-variable warning fails the build if warnings are errors. Removing the line fixes it. - `core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp:469` — `stages.erase` shifts the entries of `stages`, but the stencil-replay check after it (lines 474 to 478) still indexes `stages` with the `shaders` index. For a mesh-as-compute pipeline, that check now looks at the fragment stage instead of the readback vertex stage. Nothing fails today, because the readback vertex stage never gets a subgroup size, but the check no longer covers the stage it names. Running the check before the erase, or finding the stage by its `stage` value, fixes it. ## Not verified - Nothing was built or run. The author's runs (RX 5700 XT, RX 9060 XT, RDNA2 iGPU, RX 6650 XT, Vega iGPU, Apple M4, Radeon 680M, Intel Gen9) are reported in the description and were not reproduced. - Files read: the diff hunks of all 36 files in the reviewed list. I did not open the full text of any changed file in the review folder. Callers were read only for the functions named in the findings and for the mesh argument, pipeline stage and barrier paths. - `tests/Graphics.cpp` and `tests/ShaderMemory.cpp` are too large for the review folder. I read only their diff hunks. - The message a barycentric mesh pixel shader gets on the fallback was not traced. The description says it keeps its existing message. - That `variantId` is non-zero for programs loaded from the disk cache (`MeshComputeStages` requires it) was not traced. - Whether `LocalInvocationIndex` is always declared when the mesh program is emitted as compute was not traced. `DefineInputs` declares it only for some lane and wave cases. - GPU behaviour was not checked: the barriers, the push-constant ranges with compute stage flags, the 256 MiB output limit, and RADV's `maxMeshOutputLayers` of 8, which the description states. ## To get this to a good state Nothing is required. The two non-blocking points above are optional.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/9356:upstream-pr/9356'
git switch 'upstream-pr/9356'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/9356'
git switch 'upstream-pr/9356'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/9356'
git switch 'upstream-pr/9356'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/9356'
git switch 'main'
git merge --squash 'upstream-pr/9356'
git switch 'main'
git merge --ff-only 'upstream-pr/9356'
git switch 'main'
git merge 'upstream-pr/9356'
git push origin 'main'
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!9356
No description provided.