feat(agc): accept 64-bit atomics in graphics shaders when the device enables them #1074

Merged
alfalfa-star merged 1 commit from upstream-pr/1074 into main 2026-10-09 22:14:56 +00:00
alfalfa-star commented 2026-10-07 08:38:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by alfalfa-star on 2026-10-07T08:38:46Z.


What

Graphics shader validation accepts OpCapability Int64Atomics when the device enabled shaderBufferInt64Atomics. The recompiler emits that capability for 64-bit buffer atomics in any stage, and the device setup enables the feature when it is available. But ValidateShaders only accepted its fixed list, so every draw whose shaders use one was dropped with SPIR-V requires unsupported device capability 12. Compute dispatches are not validated this way and already ran them.

The device records the feature (bufferInt64Atomics in the device state and in the graphics Context) and passes it to ValidateShaders.

A note for #896, which adds 64-bit image atomics: its second commit does the same for Int64ImageEXT with an imageInt64Atomics flag. Both PRs change the same ValidateShaders signature, so whichever lands second needs a rebase. The combined form is ..., descriptorIndexing, bufferInt64Atomics, imageInt64Atomics, with Int64Atomics accepted when either flag is set.

Tested

Linux 7.2.9 (Arch), Mesa 26.2.4 RADV, RX 9070 XT.

  • PPSA14632 (LEGO Horizon Adventures): a draw rejected for capability 12 passes validation. In that title it then needs #896's image capability too, since the draw uses a 64-bit image atomic. With both, it records.
  • agc_driver_graphics: a module declaring Int64Atomics is refused without the feature and accepted with it.
  • ctest: 463 of 463 pass on current main.

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:4770120840 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1074). Originally posted by [alfalfa-star](https://github.com/alfalfa-star) on 2026-10-07T08:38:46Z. --- ### What Graphics shader validation accepts `OpCapability Int64Atomics` when the device enabled `shaderBufferInt64Atomics`. The recompiler emits that capability for 64-bit buffer atomics in any stage, and the device setup enables the feature when it is available. But `ValidateShaders` only accepted its fixed list, so every draw whose shaders use one was dropped with `SPIR-V requires unsupported device capability 12`. Compute dispatches are not validated this way and already ran them. The device records the feature (`bufferInt64Atomics` in the device state and in the graphics `Context`) and passes it to `ValidateShaders`. A note for #896, which adds 64-bit image atomics: its second commit does the same for `Int64ImageEXT` with an `imageInt64Atomics` flag. Both PRs change the same `ValidateShaders` signature, so whichever lands second needs a rebase. The combined form is `..., descriptorIndexing, bufferInt64Atomics, imageInt64Atomics`, with `Int64Atomics` accepted when either flag is set. ### Tested Linux 7.2.9 (Arch), Mesa 26.2.4 RADV, RX 9070 XT. - PPSA14632 (LEGO Horizon Adventures): a draw rejected for capability 12 passes validation. In that title it then needs #896's image capability too, since the draw uses a 64-bit image atomic. With both, it records. - `agc_driver_graphics`: a module declaring `Int64Atomics` is refused without the feature and accepted with it. - `ctest`: 463 of 463 pass on current `main`. ### 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)
oneandonlydean commented 2026-10-08 03:25:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-08T03:25:30Z.


Conflicts with main in ShaderValidation.cpp, Pipeline.hpp, Draw.cpp, Context.hpp and VulkanDevice.cpp: #375 added geometryShader and sampleRateShading to ValidateShaders. Please rebase.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6051536816 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1074#issuecomment-6051536816). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-08T03:25:30Z. --- Conflicts with main in `ShaderValidation.cpp`, `Pipeline.hpp`, `Draw.cpp`, `Context.hpp` and `VulkanDevice.cpp`: #375 added `geometryShader` and `sampleRateShading` to `ValidateShaders`. Please rebase.
alfalfa-star commented 2026-10-08 16:53:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by alfalfa-star on 2026-10-08T16:53:58Z.


Rebased onto current main (573fc793). The flag now comes after #375's geometryShader/sampleRateShading in ValidateShaders/Inspect, and the positional test call has the two extra falses. ctest: 463/463.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6064833655 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1074#issuecomment-6064833655). Originally posted by [alfalfa-star](https://github.com/alfalfa-star) on 2026-10-08T16:53:58Z. --- Rebased onto current `main` (573fc793). The flag now comes after #375's `geometryShader`/`sampleRateShading` in `ValidateShaders`/`Inspect`, and the positional test call has the two extra `false`s. `ctest`: 463/463.
popcoder565 commented 2026-10-09 19:42:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T19:42:39Z.


Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head a2b049d4, merged onto main 8b393b6e in one build with 31 other PRs that had no Windows run.

  • This PR's tests pass: agc_driver_graphics.
  • Full ctest in that build: 520 of 521. The one failure is guest_offline_imports, broken by #2359 (reported there).

No title was run.

🤖 Addressed by Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6088021622 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1074#issuecomment-6088021622). Originally posted by [popcoder565](https://github.com/popcoder565) on 2026-10-09T19:42:39Z. --- Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head `a2b049d4`, merged onto `main` 8b393b6e in one build with 31 other PRs that had no Windows run. - This PR's tests pass: `agc_driver_graphics`. - Full ctest in that build: 520 of 521. The one failure is `guest_offline_imports`, broken by #2359 (reported there). No title was run. _🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
adriadam10 commented 2026-10-09 22:14:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-09T22:14:53Z.


Checked on current main: build and full ctest green (546/546), agc_driver_graphics covers refusal without the feature and acceptance with it, and the test fails to build without the change. The flag follows the same condition that enables shaderBufferInt64Atomics on the device, and Int64ImageEXT stays gated by the image flag. Windows run by @popcoder565 passes too; merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6090144739 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1074#issuecomment-6090144739). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-09T22:14:53Z. --- Checked on current main: build and full ctest green (546/546), `agc_driver_graphics` covers refusal without the feature and acceptance with it, and the test fails to build without the change. The flag follows the same condition that enables `shaderBufferInt64Atomics` on the device, and `Int64ImageEXT` stays gated by the image flag. Windows run by @popcoder565 passes too; merging.
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!1074
No description provided.