Skip to content

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

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
alfalfa-star:feat/agc-graphics-int64-atomics
Oct 9, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
alfalfa-star:feat/agc-graphics-int64-atomics

Conversation

@alfalfa-star

@alfalfa-star alfalfa-star commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

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 feat(recompiler): implement 64-bit image atomics #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

@oneandonlydean

Copy link
Copy Markdown
Collaborator

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
alfalfa-star force-pushed the feat/agc-graphics-int64-atomics branch from 0560b1e to 573fc79 Compare October 8, 2026 16:52
@alfalfa-star

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (573fc79). 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.

@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Oct 8, 2026
…enables them

The recompiler emits OpCapability Int64Atomics for 64-bit buffer atomics
in any stage, and the device enables shaderBufferInt64Atomics when it
has it, but graphics shader validation only accepted its fixed list of
capabilities, so every draw whose shaders use one was rejected 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 the graphics Context) and ValidateShaders accepts Int64Atomics when
it is enabled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alfalfa-star
alfalfa-star force-pushed the feat/agc-graphics-int64-atomics branch 2 times, most recently from 573fc79 to a2b049d Compare October 8, 2026 18:20
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 8, 2026
@popcoder565

Copy link
Copy Markdown
Contributor

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 8b393b6 in one build with 31 other PRs that had no Windows run.

No title was run.

🤖 Addressed by Claude Code

@adriadam10

Copy link
Copy Markdown
Collaborator

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.

@adriadam10
adriadam10 merged commit fc063cf into boykopovar:main Oct 9, 2026
6 checks passed
@alfalfa-star
alfalfa-star deleted the feat/agc-graphics-int64-atomics branch October 10, 2026 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants