fix(agc): lower a fragment Layer input through the viewport index layer extension #6164

Merged
011010 merged 2 commits from upstream-pr/6164 into main 2026-10-18 22:15:02 +00:00
011010 commented 2026-10-15 00:01:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by 011010 on 2026-10-15T00:01:17Z.


What

When a fragment shader reads the Layer input, DefineModule emitted CapabilityGeometry unconditionally. On a device without geometry shaders (MoltenVK on macOS) the module then names a capability the device does not advertise, and validation fails.

Emit SPV_EXT_shader_viewport_index_layer and CapabilityShaderViewportIndexLayerEXT instead when the device supports that capability and does not support Geometry. The previous behaviour is kept everywhere else, so NVIDIA and lavapipe (which advertise Geometry) emit exactly what they did before.

Asked about the placement in #1; @mugurc confirmed it should go against main now, independently of the macOS series, since none of those branches touch SpirvModuleSetup.cpp.

Tested

  • Linux (Ubuntu 24.04, x86-64), at this head: ctest -R agc → 566/566 passed, including the new agc_layer_input.
  • macOS (Apple M4, MoltenVK), at the pre-rebase head: the AGC suite is green including agc_layer_input. The rebase onto current main was clean, and the Linux run above is on the rebased head.

The new agc_layer_input test forces supportedCapabilities to the no-geometry case, so it covers the fallback without a GPU.

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
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none (macOS bring-up, #1)
  • GPUs tested: n/a for the tests above, they are CPU unit tests. The path this fixes is the macOS/MoltenVK one, where the device has no geometry shaders.
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4866184391 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6164). Originally posted by [011010](https://github.com/011010) on 2026-10-15T00:01:17Z. --- ### What When a fragment shader reads the `Layer` input, `DefineModule` emitted `CapabilityGeometry` unconditionally. On a device without geometry shaders (MoltenVK on macOS) the module then names a capability the device does not advertise, and validation fails. Emit `SPV_EXT_shader_viewport_index_layer` and `CapabilityShaderViewportIndexLayerEXT` instead when the device supports that capability and does not support `Geometry`. The previous behaviour is kept everywhere else, so NVIDIA and lavapipe (which advertise `Geometry`) emit exactly what they did before. Asked about the placement in #1; @mugurc confirmed it should go against `main` now, independently of the macOS series, since none of those branches touch `SpirvModuleSetup.cpp`. ### Tested - Linux (Ubuntu 24.04, x86-64), at this head: `ctest -R agc` → **566/566 passed**, including the new `agc_layer_input`. - macOS (Apple M4, MoltenVK), at the pre-rebase head: the AGC suite is green including `agc_layer_input`. The rebase onto current `main` was clean, and the Linux run above is on the rebased head. The new `agc_layer_input` test forces `supportedCapabilities` to the no-geometry case, so it covers the fallback without a GPU. ### 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 - [x] New third-party code is a submodule built from source (none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none (macOS bring-up, #1) - [x] GPUs tested: n/a for the tests above, they are CPU unit tests. The path this fixes is the macOS/MoltenVK one, where the device has no geometry shaders. - [x] AI-assisted: yes
Dextroid17 commented 2026-10-15 01:02:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-15T01:02:48Z.


Ran this on PR head b7948261a (merge base ab9a47684, which is current main).

Setup: PR head checked out as-is, default CMake build (CMAKE_BUILD_TYPE empty, unoptimized), Linux.

  • agc_layer_input_tests on the PR: 3 of 3 passed ("layer input capability tests passed").
  • Mutation check: kept the PR's test, put back main's SpirvBackend/src/SpirvMemory/SpirvModuleSetup.cpp, rebuilt, ran 3 times: 3 of 3 failed: "a Layer input without geometry shaders must declare the viewport index layer capability".

The test checks the emitted SPIR-V capability and extension. Its no-geometry device reports ShaderViewportIndexLayerEXT as available, so it covers only a device that has the extension. I did not check a device without it, and did not run a title.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6181960122 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6164#issuecomment-6181960122). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-15T01:02:48Z. --- Ran this on PR head b7948261a (merge base ab9a47684, which is current main). Setup: PR head checked out as-is, default CMake build (CMAKE_BUILD_TYPE empty, unoptimized), Linux. - agc_layer_input_tests on the PR: 3 of 3 passed ("layer input capability tests passed"). - Mutation check: kept the PR's test, put back main's SpirvBackend/src/SpirvMemory/SpirvModuleSetup.cpp, rebuilt, ran 3 times: 3 of 3 failed: "a Layer input without geometry shaders must declare the viewport index layer capability". The test checks the emitted SPIR-V capability and extension. Its no-geometry device reports ShaderViewportIndexLayerEXT as available, so it covers only a device that has the extension. I did not check a device without it, and did not run a title. AI-assisted: yes
jotitadev commented 2026-10-15 01:21:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-15T01:21:21Z.

Review: COMMENTED


Ran this on Apple silicon at head b7948261a, as an end-to-end GPU check of the fallback (the runs so far cover the CPU unit test).

Setup: Apple M2 Max, macOS 27.2, x86-64 Release build under Rosetta, SDK MoltenVK 1.4.2. Base is macos-port @ b7eb6b6b + ImportWatched + PR diff, not main. MoltenVK on this device reports geometryShader = false, VK_EXT_shader_viewport_index_layer and shaderOutputLayer = true, so it is the no-geometry case this PR targets.

The port predates 105561775, so its device setup never enabled VK_EXT_shader_viewport_index_layer and the new branch could not fire. For this run I added a minimal stand-in for the part of 105561775 that the PR relies on (+8/-2 lines): VulkanDevice enables the extension and adds ShaderViewportIndexLayerEXT and SPV_EXT_shader_viewport_index_layer to the target, and ShaderValidation accepts that capability and extension. Current main already has the real version of this.

agc_driver_relative_ancillary (the fragment shader reads the ancillary word, which carries the render target index, and the test checks the pixels it writes):

tree result
base fails: SPIR-V requires unsupported device capability 2 (Geometry)
base + stand-in same failure
base + stand-in + this PR passes, pixels match

With stand-in + PR it also passes on MoltenVK main + SPIRV-Cross #2704.

  • Full AGC suite (-R ^agc, flip/display/lds_atomics64 excluded, -j1 --timeout 30): 13 failures on base, 12 with the stand-in + PR. The only change is agc_driver_relative_ancillary, which now passes. No new failures.
  • agc_layer_input passes. With only the test applied on base it fails with a Layer input without geometry shaders must declare the viewport index layer capability.

GPUs tested: Apple M2 Max (MoltenVK 1.4.2 / Vulkan SDK 1.4.363), macOS 27.2.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5526874440 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6164#pullrequestreview-5526874440). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-15T01:21:21Z. **Review:** COMMENTED --- Ran this on Apple silicon at head b7948261a, as an end-to-end GPU check of the fallback (the runs so far cover the CPU unit test). **Setup:** Apple M2 Max, macOS 27.2, x86-64 Release build under Rosetta, SDK MoltenVK 1.4.2. Base is macos-port @ b7eb6b6b + ImportWatched + PR diff, not main. MoltenVK on this device reports `geometryShader = false`, `VK_EXT_shader_viewport_index_layer` and `shaderOutputLayer = true`, so it is the no-geometry case this PR targets. The port predates 105561775, so its device setup never enabled `VK_EXT_shader_viewport_index_layer` and the new branch could not fire. For this run I added a minimal stand-in for the part of 105561775 that the PR relies on (+8/-2 lines): `VulkanDevice` enables the extension and adds `ShaderViewportIndexLayerEXT` and `SPV_EXT_shader_viewport_index_layer` to the target, and `ShaderValidation` accepts that capability and extension. Current `main` already has the real version of this. **`agc_driver_relative_ancillary`** (the fragment shader reads the ancillary word, which carries the render target index, and the test checks the pixels it writes): | tree | result | |---|---| | base | fails: `SPIR-V requires unsupported device capability 2` (Geometry) | | base + stand-in | same failure | | base + stand-in + this PR | passes, pixels match | With stand-in + PR it also passes on MoltenVK main + SPIRV-Cross #2704. - Full AGC suite (`-R ^agc`, flip/display/lds_atomics64 excluded, `-j1 --timeout 30`): 13 failures on base, 12 with the stand-in + PR. The only change is `agc_driver_relative_ancillary`, which now passes. No new failures. - `agc_layer_input` passes. With only the test applied on base it fails with `a Layer input without geometry shaders must declare the viewport index layer capability`. GPUs tested: Apple M2 Max (MoltenVK 1.4.2 / Vulkan SDK 1.4.363), macOS 27.2. Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
github-actions[bot] commented 2026-10-15 12:15:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:15:51Z.


Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1341 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 2434 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4650 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4891 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5426 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5499 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6044 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6185 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6186 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6192 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6234 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6280 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6300 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6320 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6360 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6412 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6454 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6481 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6486 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6501 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6503 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvModuleSetup.cpp
PR 6535 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6683 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6701 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6747 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6763 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6788 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6856 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6868 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6937 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6941 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6946 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6947 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6963 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6973 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6987 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6989 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6995 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7002 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7201 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7223 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7615 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7642 core/libs/prx/libSceAgcDriver/CMakeLists.txt
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6191817105 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6164#issuecomment-6191817105). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T12:15:51Z. --- <!-- pr-overlap --> Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 1341](https://www.github.com/boykopovar/AnyPS5/pull/1341) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 1368](https://www.github.com/boykopovar/AnyPS5/pull/1368) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 1395](https://www.github.com/boykopovar/AnyPS5/pull/1395) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 2434](https://www.github.com/boykopovar/AnyPS5/pull/2434) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 4650](https://www.github.com/boykopovar/AnyPS5/pull/4650) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 4891](https://www.github.com/boykopovar/AnyPS5/pull/4891) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5371](https://www.github.com/boykopovar/AnyPS5/pull/5371) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5426](https://www.github.com/boykopovar/AnyPS5/pull/5426) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5499](https://www.github.com/boykopovar/AnyPS5/pull/5499) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5925](https://www.github.com/boykopovar/AnyPS5/pull/5925) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6185](https://www.github.com/boykopovar/AnyPS5/pull/6185) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6186](https://www.github.com/boykopovar/AnyPS5/pull/6186) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6192](https://www.github.com/boykopovar/AnyPS5/pull/6192) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6234](https://www.github.com/boykopovar/AnyPS5/pull/6234) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6280](https://www.github.com/boykopovar/AnyPS5/pull/6280) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6300](https://www.github.com/boykopovar/AnyPS5/pull/6300) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6320](https://www.github.com/boykopovar/AnyPS5/pull/6320) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6360](https://www.github.com/boykopovar/AnyPS5/pull/6360) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6412](https://www.github.com/boykopovar/AnyPS5/pull/6412) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6454](https://www.github.com/boykopovar/AnyPS5/pull/6454) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6481](https://www.github.com/boykopovar/AnyPS5/pull/6481) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6486](https://www.github.com/boykopovar/AnyPS5/pull/6486) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6501](https://www.github.com/boykopovar/AnyPS5/pull/6501) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6503](https://www.github.com/boykopovar/AnyPS5/pull/6503) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvModuleSetup.cpp` | | [PR 6535](https://www.github.com/boykopovar/AnyPS5/pull/6535) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6683](https://www.github.com/boykopovar/AnyPS5/pull/6683) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6701](https://www.github.com/boykopovar/AnyPS5/pull/6701) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6747](https://www.github.com/boykopovar/AnyPS5/pull/6747) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6763](https://www.github.com/boykopovar/AnyPS5/pull/6763) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6788](https://www.github.com/boykopovar/AnyPS5/pull/6788) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6808](https://www.github.com/boykopovar/AnyPS5/pull/6808) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6856](https://www.github.com/boykopovar/AnyPS5/pull/6856) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6868](https://www.github.com/boykopovar/AnyPS5/pull/6868) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6937](https://www.github.com/boykopovar/AnyPS5/pull/6937) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6941](https://www.github.com/boykopovar/AnyPS5/pull/6941) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6963](https://www.github.com/boykopovar/AnyPS5/pull/6963) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6973](https://www.github.com/boykopovar/AnyPS5/pull/6973) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6987](https://www.github.com/boykopovar/AnyPS5/pull/6987) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6989](https://www.github.com/boykopovar/AnyPS5/pull/6989) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6995](https://www.github.com/boykopovar/AnyPS5/pull/6995) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7002](https://www.github.com/boykopovar/AnyPS5/pull/7002) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7223](https://www.github.com/boykopovar/AnyPS5/pull/7223) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7615](https://www.github.com/boykopovar/AnyPS5/pull/7615) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7642](https://www.github.com/boykopovar/AnyPS5/pull/7642) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` |
011010 commented 2026-10-15 16:03:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by 011010 on 2026-10-15T16:03:19Z.


Thanks to both of you, this is more than I could produce on my own.

@Dextroid17 the mutation check is the part that matters: putting SpirvModuleSetup.cpp back to main while keeping the test fails 3/3, so the test is not passing by accident. On the coverage caveat, you are right. The branch is now:

  • Geometry supported → CapabilityGeometry, unchanged, so NVIDIA and lavapipe emit exactly what they did before.
  • Geometry not supported, ShaderViewportIndexLayerEXT supported → the extension plus CapabilityShaderViewportIndexLayerEXT.
  • neither → CapabilityGeometry, the previous behaviour.

The third case is deliberate: with neither capability there is nothing to declare a fragment Layer input with, so the module fails validation exactly as it did before this PR. It adds a path, it does not remove one. There is one candidate this PR does not take: the output-layer branch a few lines above falls back to ShaderLayer with SPIR-V 1.5 when the extension is missing, and the input could mirror it. I left it out because neither of us has a device that reports neither, so it would be an untested path — say the word and I will add it as a follow-up.

@jotitadev thank you for the GPU run, it is the evidence I could not produce myself. You read the base correctly: main already carries the real device setup from 105561775 (VulkanDevice.cpp pushes CapabilityShaderViewportIndexLayerEXT and the extension), so the +8/-2 stand-in was the right call for the port branch and nothing else is needed on main. The two numbers I care about are the ones you measured: agc_driver_relative_ancillary goes from SPIR-V requires unsupported device capability 2 to passing with matching pixels, and the suite goes from 13 to 12 failures with no new ones.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6196503122 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6164#issuecomment-6196503122). Originally posted by [011010](https://github.com/011010) on 2026-10-15T16:03:19Z. --- Thanks to both of you, this is more than I could produce on my own. @Dextroid17 the mutation check is the part that matters: putting `SpirvModuleSetup.cpp` back to `main` while keeping the test fails 3/3, so the test is not passing by accident. On the coverage caveat, you are right. The branch is now: - `Geometry` supported → `CapabilityGeometry`, unchanged, so NVIDIA and lavapipe emit exactly what they did before. - `Geometry` not supported, `ShaderViewportIndexLayerEXT` supported → the extension plus `CapabilityShaderViewportIndexLayerEXT`. - neither → `CapabilityGeometry`, the previous behaviour. The third case is deliberate: with neither capability there is nothing to declare a fragment `Layer` input with, so the module fails validation exactly as it did before this PR. It adds a path, it does not remove one. There is one candidate this PR does not take: the output-layer branch a few lines above falls back to `ShaderLayer` with SPIR-V 1.5 when the extension is missing, and the input could mirror it. I left it out because neither of us has a device that reports neither, so it would be an untested path — say the word and I will add it as a follow-up. @jotitadev thank you for the GPU run, it is the evidence I could not produce myself. You read the base correctly: `main` already carries the real device setup from `105561775` (`VulkanDevice.cpp` pushes `CapabilityShaderViewportIndexLayerEXT` and the extension), so the +8/-2 stand-in was the right call for the port branch and nothing else is needed on `main`. The two numbers I care about are the ones you measured: `agc_driver_relative_ancillary` goes from `SPIR-V requires unsupported device capability 2` to passing with matching pixels, and the suite goes from 13 to 12 failures with no new ones.
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!6164
No description provided.