refactor(recompiler): dispatch image atomics through ImageOpcodeInfoOf #1078

Merged
MathiasDevelopes merged 1 commit from upstream-pr/1078 into main 2026-10-07 12:34:15 +00:00
MathiasDevelopes commented 2026-10-07 09:36:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MathiasDevelopes on 2026-10-07T09:36:52Z.


What

EmitImage in SpirvImageEmitter.cpp listed all 27 ImageAtomic* opcodes by hand to reach EmitAtomicOp, although the function already looks up ImageOpcodeInfoOf for the instruction. Every opcode whose access is ImageAccess::Atomic now goes to EmitAtomicOp before the switch (+4 / -29).

The opcodes that reach EmitAtomicOp are unchanged: the hand-written case list and the atomic cases of ImageOpcodeInfoOf contain the same 27 opcodes. A new image atomic opcode now only needs adding to ImageOpcodeInfoOf.

Tested

Linux, clang: SpirvImageEmitter.cpp compiles with the same diagnostics as before the change. No title run.

Checklist

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4770760063 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1078). Originally posted by [MathiasDevelopes](https://github.com/MathiasDevelopes) on 2026-10-07T09:36:52Z. --- ### What `EmitImage` in `SpirvImageEmitter.cpp` listed all 27 `ImageAtomic*` opcodes by hand to reach `EmitAtomicOp`, although the function already looks up `ImageOpcodeInfoOf` for the instruction. Every opcode whose access is `ImageAccess::Atomic` now goes to `EmitAtomicOp` before the switch (+4 / -29). The opcodes that reach `EmitAtomicOp` are unchanged: the hand-written case list and the atomic cases of `ImageOpcodeInfoOf` contain the same 27 opcodes. A new image atomic opcode now only needs adding to `ImageOpcodeInfoOf`. ### Tested Linux, clang: `SpirvImageEmitter.cpp` compiles with the same diagnostics as before the change. No title run. ### 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)](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)](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
copilot-pull-request-reviewer[bot] commented 2026-10-07 09:37:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by copilot-pull-request-reviewer[bot] on 2026-10-07T09:37:02Z.

Review: COMMENTED


Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5440419099 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1078#pullrequestreview-5440419099). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/apps/copilot-pull-request-reviewer) on 2026-10-07T09:37:02Z. **Review:** COMMENTED --- Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
adriadam10 commented 2026-10-07 12:34:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-07T12:34:12Z.


Checked that the ImageAccess::Atomic cases of ImageOpcodeInfoOf are exactly the 27 removed opcodes and that every other opcode still gets ImageAccess::None, so dispatch is unchanged; build + full ctest green on top of current main (395/395). Merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6038002132 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1078#issuecomment-6038002132). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-07T12:34:12Z. --- Checked that the `ImageAccess::Atomic` cases of `ImageOpcodeInfoOf` are exactly the 27 removed opcodes and that every other opcode still gets `ImageAccess::None`, so dispatch is unchanged; build + full ctest green on top of current main (395/395). 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!1078
No description provided.