shader: link compute calls through function tables, fix call-target crash (PPSA01473) #1849

Open
github-bot wants to merge 2 commits from github-bot/gh-1849 into main AGit
Owner

@⁠MrBigBritches on GitHub · 2026-10-22 22:24 UTC · original
MrBigBritches:rift-apart-shader-calls → main · +864 −120 · 18 files · 2 commits · open

Fixes a fatal assert when preparing S_SWAPPC_B64 call targets in compute shaders (seen at startup in Ratchet & Clank: Rift Apart, PPSA01473). Also adds experimental, off-by-default support for calls whose target is read from a function table at an entry selected by GPU data.

Crash fix

  • FindScalarDefinition asserted when more than one write reached a call-target register. For example, a callee address is loaded before a loop and reloaded on the back edge.
    • CFG::FindScalarDefinitions now returns every reaching definition, sorted and de-duplicated.
    • A target may have several candidates, as long as they all evaluate to the same callee at dispatch.
    • If an operand feeding a target is ambiguous, the shader takes the existing dispatch-skip fallback instead of aborting.
  • MayWriteScalarRegister assumed lane reads and wave32 lane masks write an SGPR pair, which produced false "multiple definitions". These now write one SGPR, and wave32 programs pass wave64 = false.

Function-table calls (experimental)

Some shaders run a waterfall loop that reads the callee from a GPU buffer at readfirstlane(index) * stride and calls it with S_SWAPPC_B64.

  • PrepareCallTargets recognises this pattern (MatchCallTable).
  • At dispatch, RefreshShaderSource reads the table in 1 MB chunks and links each distinct callee once.
    • The call is replaced by a compare chain on the target pair.
    • After each call, the matched target is restored, so the native PC can't flow into later compares.
    • Writes to the table or to callee code trigger a re-link.
  • The caller's own S_GETPC_B64 reads of constants embedded in its code are still allowed (Program::native_bytes). PCs inside linked code are still rejected.
  • Off by default, controlled by the new function_table_calls config option:
    • --function-table-calls on the command line;
    • Function-table shader calls (experimental) under Rendering compatibility in the launcher.
  • Known limitation: in the game this was developed against, the callees select textures through per-entry pointers that also come from GPU data. Resource tracking can't plan that yet, so enabling the option currently stops the game. With it off, these shaders are skipped exactly as before.

Robustness for large linked programs

  • Linked programs make IR dependency chains thousands of values deep. Tracker::CollectScalarRead is now iterative.
  • New Common::RunWithStack runs work on a thread with a large stack:
    • CreateThread on Windows;
    • a pthread with an explicit stack size elsewhere (macOS secondary threads default to 512 KB).
  • pipelineCache translates and compiles linked programs on a 256 MB stack.

Testing

  • New TestFunctionTableLeafCall covers:
    • table recognition;
    • dispatcher layout;
    • translation;
    • relink behaviour when the table or a callee changes.
  • shader_cfg_tests and memory_tracker_tests pass (Windows, clang-cl).
  • Rift Apart (v01.005.003) no longer crashes at startup and reaches the main menu with the option off.
  • RunWithStack's POSIX path was checked on Linux with a standalone deep-recursion test. It has not been built on macOS.
**@⁠MrBigBritches** on GitHub · 2026-10-22 22:24 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1849) `MrBigBritches:rift-apart-shader-calls` → `main` · +864 −120 · 18 files · 2 commits · open Fixes a fatal assert when preparing `S_SWAPPC_B64` call targets in compute shaders (seen at startup in Ratchet & Clank: Rift Apart, PPSA01473). Also adds **experimental, off-by-default** support for calls whose target is read from a function table at an entry selected by GPU data. ### Crash fix - `FindScalarDefinition` asserted when more than one write reached a call-target register. For example, a callee address is loaded before a loop and reloaded on the back edge. - `CFG::FindScalarDefinitions` now returns every reaching definition, sorted and de-duplicated. - A target may have several candidates, as long as they all evaluate to the same callee at dispatch. - If an operand *feeding* a target is ambiguous, the shader takes the existing dispatch-skip fallback instead of aborting. - `MayWriteScalarRegister` assumed lane reads and wave32 lane masks write an SGPR pair, which produced false "multiple definitions". These now write one SGPR, and wave32 programs pass `wave64 = false`. ### Function-table calls (experimental) Some shaders run a waterfall loop that reads the callee from a GPU buffer at `readfirstlane(index) * stride` and calls it with `S_SWAPPC_B64`. - `PrepareCallTargets` recognises this pattern (`MatchCallTable`). - At dispatch, `RefreshShaderSource` reads the table in 1 MB chunks and links each distinct callee once. - The call is replaced by a compare chain on the target pair. - After each call, the matched target is restored, so the native PC can't flow into later compares. - Writes to the table or to callee code trigger a re-link. - The caller's own `S_GETPC_B64` reads of constants embedded in its code are still allowed (`Program::native_bytes`). PCs inside linked code are still rejected. - **Off by default**, controlled by the new `function_table_calls` config option: - `--function-table-calls` on the command line; - **Function-table shader calls (experimental)** under *Rendering compatibility* in the launcher. - **Known limitation:** in the game this was developed against, the callees select textures through per-entry pointers that also come from GPU data. Resource tracking can't plan that yet, so enabling the option currently stops the game. With it off, these shaders are skipped exactly as before. ### Robustness for large linked programs - Linked programs make IR dependency chains thousands of values deep. `Tracker::CollectScalarRead` is now iterative. - New `Common::RunWithStack` runs work on a thread with a large stack: - `CreateThread` on Windows; - a pthread with an explicit stack size elsewhere (macOS secondary threads default to 512 KB). - `pipelineCache` translates and compiles linked programs on a 256 MB stack. ### Testing - New `TestFunctionTableLeafCall` covers: - table recognition; - dispatcher layout; - translation; - relink behaviour when the table or a callee changes. - `shader_cfg_tests` and `memory_tracker_tests` pass (Windows, clang-cl). - Rift Apart (v01.005.003) no longer crashes at startup and reaches the main menu with the option off. - `RunWithStack`'s POSIX path was checked on Linux with a standalone deep-recursion test. It has not been built on macOS.
Ratchet & Clank: Rift Apart (PPSA01473) crashed at startup on a fatal
assert in FindScalarDefinition: a compute shader reloads its callee
address on a loop back edge, so two writes reach the S_SWAPPC_B64.
FindScalarDefinitions now returns every reaching definition. A call
target may have several candidates as long as they all evaluate to the
same callee at dispatch. When an operand feeding a target is ambiguous,
the shader takes the existing dispatch-skip fallback.

In wave32, MayWriteScalarRegister treated lane reads and lane-mask
results as writing a register pair, which made s12 appear to have
several definitions. Lane reads and wave32 lane masks now write one
SGPR.

Two of the game's compute shaders (0x7e95bb6f0edf10de and
0x9c90b6661778d105) call through a per-material function table: a
waterfall loop reads the callee from a GPU buffer at
readfirstlane(material) * 16. PrepareCallTargets recognises this
(MatchCallTable). RefreshShaderSource then reads the table in 1 MB
chunks, links each distinct callee once, and replaces the call with a
compare chain on the target pair. The shader's own S_GETPC reads of
embedded constants are still allowed (Program::native_bytes).

The linked callees read their textures through per-material data
pointers chosen by GPU data. Resource tracking cannot plan these yet,
so table linking is off by default and the two shaders are still
skipped. It can be enabled with the new function_table_calls config
option: --function-table-calls on the command line, or "Function-table
shader calls (experimental)" under Rendering compatibility in the
launcher.

Linked programs make IR dependency chains thousands of values deep.
Tracker::CollectScalarRead is now iterative, and pipelineCache
translates and compiles linked programs on a 256 MB stack
(Common::RunWithStack: CreateThread on Windows, a pthread with an
explicit stack size elsewhere, since macOS secondary threads default to
512 KB).

Tests: TestFunctionTableLeafCall covers table recognition, dispatcher
layout, translation and relinking on table or callee changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- A call target that depends on GPU data but is not a single
  ReadConstBuffer no longer aborts on EXIT_IF; it takes the
  dispatch-skip fallback, as other unsupported targets do.
- The table scan assigns each entry to the 1 MiB read chunk where its
  target pair starts. Before, an entry that started before a chunk
  boundary with its pair after it was skipped by both chunks. That
  needs a stride that does not divide the chunk size, a non-zero
  pair offset and a table over 1 MiB; the call then silently fell
  through to the return.

TestFunctionTableChunkBoundary covers both cases: a 48-byte-stride
table with the pair at +16 and an entry straddling the boundary, which
fails with the old start index, and a lane-computed target without a
table.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:07:03 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-22 22:31 UTC · original · edited 2026-10-22 23:59 UTC

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between f1d24de936 and b9d283ca19.

📒 Files selected for processing: 2
  • src/graphics/shader/recompiler/ShaderRecompiler.cpp
  • tests/shaderCfgTests.cpp

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

📝 Walkthrough

The change adds a disabled-by-default option for linking shader calls whose targets come from supported function tables. The recompiler tracks multiple reaching definitions, reads and refreshes table entries, and builds dispatchers for distinct callees. The launcher and command line expose the option. Linked shader translation and compilation use a temporary thread with a larger stack. The change also replaces recursive scalar-read collection with an iterative traversal and adds function-table linking and refresh tests.

Suggested reviewers: nmzik

Priority: ➖ Normal

Change: Bug fix

Merge Risk: ⚪ Minimal · up to b9d28

Unsupported GPU-selected call targets now take the dispatch-skip fallback rather than stopping the emulator. No actionable merge-blocking risk remains after normal checks.

Pre-merge checks: Passed 4 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Docstring Coverage Inconclusive Docstring coverage is 19.44% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 36 functions across 16 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title names the two main changes: function-table call linking for compute shaders and a fix for a call-target crash (PPSA01473). The changeset matches both parts. The title is long at 85 character…
Description check Passed The description is detailed and on-topic. It explains the crash fix in FindScalarDefinition and MayWriteScalarRegister, the experimental function-table call support, the iterative Tracker::CollectScal…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the two main changes: function-table call linking for compute shaders and a fix for a call-target crash (PPSA01473). The changeset matches both parts. The title is long at 85 characters, but it is specific and on-topic, so it passes.

Full details: Description check

Explanation

The description is detailed and on-topic. It explains the crash fix in FindScalarDefinition and MayWriteScalarRegister, the experimental function-table call support, the iterative Tracker::CollectScalarRead, the RunWithStack helper, the new config option and launcher checkbox, and the tests. This matches the file summaries.

Full details: Docstring Coverage

Explanation

Docstring coverage is 19.44% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 36 functions across 16 files. (1 skipped: 1 too large.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-22 22:31 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1849#issuecomment-6352742584) · edited 2026-10-22 23:59 UTC <!-- coderabbit-ai-generated:v1 --> <!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- review_stack_entry_start --> <a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/1849?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg?v=3"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3" alt="Review in Change Stack →" height="32"></picture></a> <!-- review_stack_entry_end --> <!-- recent_review_start --> No actionable comments were generated in the recent review. 🎉 <details> <summary><strong>ℹ️ Recent review info</strong></summary> <dl> <dd> <details> <summary><strong>⚙️ Run configuration</strong></summary> <dl> <dd> - **Source mode**: Auto - **Repository**: [KytyPS5/KytyPS5](<https://github.com/KytyPS5/KytyPS5>) - **Branch**: [main](<https://github.com/KytyPS5/KytyPS5/tree/main>) - **File**: [.coderabbit.yaml](<https://github.com/KytyPS5/KytyPS5/blob/79837b423dd035b34b2dc476e1d2dce8ae0d18bf/.coderabbit.yaml>) - **Commit**: [79837b4](<https://github.com/KytyPS5/KytyPS5/commit/79837b423dd035b34b2dc476e1d2dce8ae0d18bf>) - **Layers**: Repository YAML - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `39a60125-e6f7-4920-8b0d-8bc201f3bbe9` </dd> </dl> </details> <details> <summary><strong>📥 Commits</strong></summary> <dl> <dd> Reviewing files that changed from the base of the PR and between f1d24de936ba812accaf659a8745cec1be86e292 and b9d283ca19bd6c3b78bd51612245976246677a2d. </dd> </dl> </details> <details> <summary><strong>📒 Files selected for processing: 2</strong></summary> <dl> <dd> * `src/graphics/shader/recompiler/ShaderRecompiler.cpp` * `tests/shaderCfgTests.cpp` </dd> </dl> </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review. </dd> </dl> </details> <!-- recent_review_end --> <!-- walkthrough_start --> <details> <summary><strong>📝 Walkthrough</strong></summary> <dl> <dd> The change adds a disabled-by-default option for linking shader calls whose targets come from supported function tables. The recompiler tracks multiple reaching definitions, reads and refreshes table entries, and builds dispatchers for distinct callees. The launcher and command line expose the option. Linked shader translation and compilation use a temporary thread with a larger stack. The change also replaces recursive scalar-read collection with an iterative traversal and adds function-table linking and refresh tests. **Suggested reviewers:** `nmzik` </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> **Priority:** ➖ Normal <!-- change_assessment_commit:"b9d283ca19bd6c3b78bd51612245976246677a2d" --> **Change:** Bug fix <!-- change_assessment_end --> <details> <summary><strong>Merge Risk:</strong> <strong>⚪ Minimal</strong> · up to <code>b9d28</code></summary> <dl> <dd> <!-- final_review_risk_start --> <!-- final_review_risk_label **Merge Risk:** **⚪ Minimal** · up to `b9d28` --> <!-- final_review_risk_coverage:{"sourceCommitId":"b9d283ca19bd6c3b78bd51612245976246677a2d","coveredCommitId":"b9d283ca19bd6c3b78bd51612245976246677a2d","kind":"reviewed"} --> Unsupported GPU-selected call targets now take the dispatch-skip fallback rather than stopping the emulator. No actionable merge-blocking risk remains after normal checks. <!-- final_review_risk_end --> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_start --> <details> <summary><strong>Pre-merge checks: <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> 4 · <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-inconclusive-14-v2.svg" width="14" height="14" align="middle" alt="Inconclusive" title="Inconclusive"></picture></sup> 1</strong></summary> <dl> <dd> <strong><sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-failed-14-v2.svg" width="14" height="14" align="middle" alt="Failed" title="Failed"></picture></sup> Failed checks: 1 inconclusive</strong> | Check name | Status | Explanation | Resolution | | :---------------- | :--------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- | | Docstring Coverage | ![Inconclusive](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-inconclusive.svg) | Docstring coverage is 19.44% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 36 functions across 16 files. (1 skipped:… | Write docstrings for the functions missing them to satisfy the coverage threshold. | <details> <summary><strong><sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> Passed checks: 4 passed</strong></summary> <dl> <dd> | Check name | Status | Explanation | | :------------------------ | :--------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Title check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The title names the two main changes: function-table call linking for compute shaders and a fix for a call-target crash (PPSA01473). The changeset matches both parts. The title is long at 85 character… | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The description is detailed and on-topic. It explains the crash fix in FindScalarDefinition and MayWriteScalarRegister, the experimental function-table call support, the iterative Tracker::CollectScal… | | Linked Issues check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | <details> <summary><strong>Full details: Title check</strong></summary> <dl> <dd> **Explanation** The title names the two main changes: function-table call linking for compute shaders and a fix for a call-target crash (PPSA01473). The changeset matches both parts. The title is long at 85 characters, but it is specific and on-topic, so it passes. </dd> </dl> </details> <details> <summary><strong>Full details: Description check</strong></summary> <dl> <dd> **Explanation** The description is detailed and on-topic. It explains the crash fix in FindScalarDefinition and MayWriteScalarRegister, the experimental function-table call support, the iterative Tracker::CollectScalarRead, the RunWithStack helper, the new config option and launcher checkbox, and the tests. This matches the file summaries. </dd> </dl> </details> </dd> </dl> </details> <details> <summary><strong>Full details: Docstring Coverage</strong></summary> <dl> <dd> **Explanation** Docstring coverage is 19.44% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 36 functions across 16 files. (1 skipped: 1 too large.) **Resolution** Write docstrings for the functions missing them to satisfy the coverage threshold. </dd> </dl> </details> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- autopilot:start --> - [ ] <!-- {"checkboxId":"2708ad07-9f24-4260-9c11-7dc76a49f2e3"} --> <strong title="Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts">Autofix</strong> · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts <!-- autopilot:end --> <!-- tips_start --> Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=1849)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary><strong>❤️ Share</strong></summary> <dl> <dd> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </dd> </dl> </details> <sub>Comment `@coderabbitai help` to get the list of available commands.</sub> <!-- tips_end -->
@ -568,0 +694,4 @@
source.unsupported_call_pc = call.pc;
source.calls.clear();
return;
}
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-22 22:31 UTC · original

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

set -eu
printf '%s\n' '--- changed hunk ---'
git diff --unified=40 79837b423dd035b34b2dc476e1d2dce8ae0d18bf f1d24de936ba812accaf659a8745cec1be86e292 -- src/graphics/shader/recompiler/ShaderRecompiler.cpp
printf '%s\n' '--- base lines around target ---'
git show 79837b423dd035b34b2dc476e1d2dce8ae0d18bf:src/graphics/shader/recompiler/ShaderRecompiler.cpp | nl -ba | sed -n '620,715p'
printf '%s\n' '--- head lines around target ---'
git show f1d24de936ba812accaf659a8745cec1be86e292:src/graphics/shader/recompiler/ShaderRecompiler.cpp | nl -ba | sed -n '650,715p'
printf '%s\n' '--- relevant symbols ---'
rg -n -F --glob 'ShaderRecompiler.cpp' -e 'PrepareCallTargets' -e 'unsupported_call_pc' -e 'function_table_calls' -e 'MatchCallTable' src/graphics/shader/recompiler/ShaderRecompiler.cpp || test "$?" -eq 1

Repository: KytyPS5/KytyPS5

Length of output: 42329


🏁 Script executed:

set -eu
file=src/graphics/shader/recompiler/ShaderRecompiler.cpp
printf '%s\n' '--- base PrepareCallTargets ---'
base=$(git show 79837b423dd035b34b2dc476e1d2dce8ae0d18bf:$file)
printf '%s\n' "$base" | rg -n -F -e 'void PrepareCallTargets' -e 'EXIT_IF(value.Instruction()->GetOpcode()' -e 'source.unsupported_call_pc' -e 'PrepareCallTargets(source' || test "$?" -eq 1
printf '%s\n' "$base" | nl -ba | sed -n '450,610p'
printf '%s\n' '--- bound helper definitions ---'
rg -n -F --glob '*.{h,hpp,cpp,cc}' -e 'ValidateRuntimeValue' -e 'TryInstruction()' -e 'Instruction() const' -e '#define EXIT_IF' src common 2>/dev/null || true
printf '%s\n' '--- call preparation and option guard in head ---'
git show f1d24de936ba812accaf659a8745cec1be86e292:$file | nl -ba | sed -n '740,775p'

Repository: KytyPS5/KytyPS5

Length of output: 38203


Replace the ReadConstBuffer assertion with the dispatch-skip fallback.

This assertion existed before the PR, so the PR retains an existing crash path. When a non-runtime target is not a direct ReadConstBuffer, route it to unsupported_call_pc instead of asserting. The function_table_calls option cannot protect this path because the assertion runs first.

🐛 Suggested fix
--- "a/src/graphics/shader/recompiler/ShaderRecompiler.cpp"
+++ "b/src/graphics/shader/recompiler/ShaderRecompiler.cpp"
@@ -680,13 +680,14 @@
 			for (const auto definition: definitions) {
 				const auto value = Produce(definition, call.src0.reg + i);
 				if (ambiguous_pc != UINT32_MAX) break;
 				if (!ValidateRuntimeValue(query, value, RuntimeValueType::Integer)) {
-					EXIT_IF(value.Instruction()->GetOpcode() != ValueOpcode::ReadConstBuffer);
-					if (definitions.size() == 1u) {
+					const auto* read = value.TryInstruction();
+					if (definitions.size() == 1u && read != nullptr &&
+					    read->GetOpcode() == ValueOpcode::ReadConstBuffer) {
-						table_reads[i] = value.Instruction();
+						table_reads[i] = read;
 						continue;
 					}
 					source.unsupported_call_pc = call.pc;
 					source.calls.clear();
 					return;
 				}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

				if (!ValidateRuntimeValue(query, value, RuntimeValueType::Integer)) {
					const auto* read = value.TryInstruction();
					if (definitions.size() == 1u && read != nullptr &&
					    read->GetOpcode() == ValueOpcode::ReadConstBuffer) {
						table_reads[i] = read;
						continue;
					}
					source.unsupported_call_pc = call.pc;
					source.calls.clear();
					return;
				}
**@⁠coderabbitai[bot]** on GitHub · 2026-10-22 22:31 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1849#discussion_r4354210729) <!-- coderabbit-ai-generated:v1 --> **🩺 Stability & Availability** | **🟠 Major** | **⚡ Quick win** <details> <summary>🔎 Supported by static analysis</summary> 🏁 Script executed: ```bash set -eu printf '%s\n' '--- changed hunk ---' git diff --unified=40 79837b423dd035b34b2dc476e1d2dce8ae0d18bf f1d24de936ba812accaf659a8745cec1be86e292 -- src/graphics/shader/recompiler/ShaderRecompiler.cpp printf '%s\n' '--- base lines around target ---' git show 79837b423dd035b34b2dc476e1d2dce8ae0d18bf:src/graphics/shader/recompiler/ShaderRecompiler.cpp | nl -ba | sed -n '620,715p' printf '%s\n' '--- head lines around target ---' git show f1d24de936ba812accaf659a8745cec1be86e292:src/graphics/shader/recompiler/ShaderRecompiler.cpp | nl -ba | sed -n '650,715p' printf '%s\n' '--- relevant symbols ---' rg -n -F --glob 'ShaderRecompiler.cpp' -e 'PrepareCallTargets' -e 'unsupported_call_pc' -e 'function_table_calls' -e 'MatchCallTable' src/graphics/shader/recompiler/ShaderRecompiler.cpp || test "$?" -eq 1 ``` Repository: KytyPS5/KytyPS5 Length of output: 42329 --- 🏁 Script executed: ```bash set -eu file=src/graphics/shader/recompiler/ShaderRecompiler.cpp printf '%s\n' '--- base PrepareCallTargets ---' base=$(git show 79837b423dd035b34b2dc476e1d2dce8ae0d18bf:$file) printf '%s\n' "$base" | rg -n -F -e 'void PrepareCallTargets' -e 'EXIT_IF(value.Instruction()->GetOpcode()' -e 'source.unsupported_call_pc' -e 'PrepareCallTargets(source' || test "$?" -eq 1 printf '%s\n' "$base" | nl -ba | sed -n '450,610p' printf '%s\n' '--- bound helper definitions ---' rg -n -F --glob '*.{h,hpp,cpp,cc}' -e 'ValidateRuntimeValue' -e 'TryInstruction()' -e 'Instruction() const' -e '#define EXIT_IF' src common 2>/dev/null || true printf '%s\n' '--- call preparation and option guard in head ---' git show f1d24de936ba812accaf659a8745cec1be86e292:$file | nl -ba | sed -n '740,775p' ``` Repository: KytyPS5/KytyPS5 Length of output: 38203 --- </details> **Replace the `ReadConstBuffer` assertion with the dispatch-skip fallback.** This assertion existed before the PR, so the PR retains an existing crash path. When a non-runtime target is not a direct `ReadConstBuffer`, route it to `unsupported_call_pc` instead of asserting. The `function_table_calls` option cannot protect this path because the assertion runs first. <details> <summary>🐛 Suggested fix</summary> ```diff --- "a/src/graphics/shader/recompiler/ShaderRecompiler.cpp" +++ "b/src/graphics/shader/recompiler/ShaderRecompiler.cpp" @@ -680,13 +680,14 @@ for (const auto definition: definitions) { const auto value = Produce(definition, call.src0.reg + i); if (ambiguous_pc != UINT32_MAX) break; if (!ValidateRuntimeValue(query, value, RuntimeValueType::Integer)) { - EXIT_IF(value.Instruction()->GetOpcode() != ValueOpcode::ReadConstBuffer); - if (definitions.size() == 1u) { + const auto* read = value.TryInstruction(); + if (definitions.size() == 1u && read != nullptr && + read->GetOpcode() == ValueOpcode::ReadConstBuffer) { - table_reads[i] = value.Instruction(); + table_reads[i] = read; continue; } source.unsupported_call_pc = call.pc; source.calls.clear(); return; } ``` </details> <!-- suggestion_start --> <details> <summary>📝 Committable suggestion</summary> > ‼️ **IMPORTANT** > Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements. ```suggestion if (!ValidateRuntimeValue(query, value, RuntimeValueType::Integer)) { const auto* read = value.TryInstruction(); if (definitions.size() == 1u && read != nullptr && read->GetOpcode() == ValueOpcode::ReadConstBuffer) { table_reads[i] = read; continue; } source.unsupported_call_pc = call.pc; source.calls.clear(); return; } ``` </details> <!-- suggestion_end --> <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:4e1331b72d8429e4e11c3b3d --> <!-- This is an auto-generated comment by CodeRabbit -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-22 22:31 UTC · original · edited 2026-10-22 23:54 UTC
On src/graphics/shader/recompiler/ShaderRecompiler.cpp line 844 (outdated):

@@ -621,38 +809,123 @@ const Decoder::Program& RefreshShaderSource(ShaderSource& source, const IR::SrtR
 	const auto clean = IR::CleanRuntime(capture.ObservedRuntime());
 	IR::SrtWalker walker(source.call_targets, clean);
 	for (auto& site: source.calls) {
-		uint32_t low = 0, high = 0;
-		if (!walker.Evaluate(site.target[0], low) || !walker.Evaluate(site.target[1], high))
-			EXIT("shader call at pc 0x%08x has an unavailable scalar target",
-			     source.decoded.instructions[site.instruction].pc);
+		const auto pc = source.decoded.instructions[site.instruction].pc;
+		if (site.table) {
+			// Read every entry of the function table; each distinct target becomes a callee.
+			std::array<uint32_t, 4> descriptor {};
+			for (uint32_t i = 0; i < 4u; ++i)
+				if (!walker.Evaluate(site.table->descriptor[i], descriptor[i]))
+					EXIT("shader call at pc 0x%08x has an unavailable function table", pc);
+			// V# layout: base[47:0] in dwords 0-1, stride in dword 1 [29:16], num_records in dword 2.
+			// Scalar buffer loads count records in bytes when the stride is zero.
+			const auto base   = ((uint64_t {descriptor[1] & 0xffffu} << 32u) | descriptor[0]) & ~uint64_t {3};
+			const auto stride = (descriptor[1] >> 16u) & 0x3fffu;
+			const auto size   = stride == 0u ? uint64_t {descriptor[2]} : uint64_t {stride} * descriptor[2];
+			const auto& table = *site.table;
+			site.table_targets.clear();
+			// Tables can be large (megabytes, with most entries empty), so read them in chunks: one
+			// recorded read per chunk instead of one per entry.
+			if (size > MaxTableBytes)
+				EXIT("shader call at pc 0x%08x: function table is 0x%llx bytes", pc, static_cast<unsigned long long>(size));
+			std::vector<uint32_t> chunk;
+			for (uint64_t chunk_start = 0; chunk_start < size; chunk_start += TableChunkBytes) {
+				const auto chunk_bytes = std::min<uint64_t>(TableChunkBytes, size - chunk_start) & ~uint64_t {3};
+				if (chunk_bytes == 0u) break;
+				chunk.resize(chunk_bytes / 4u);
+				if (!clean.read_memory(clean.userdata, base + chunk_start, chunk))
+					EXIT("shader call at pc 0x%08x cannot read its function table at +0x%llx", pc,
+					     static_cast<unsigned long long>(chunk_start));
+				// First entry whose pair starts inside this chunk.
+				// Entries are visited in order across chunks; a pair that straddles the chunk end is
+				// re-read on its own (rare: only when the stride does not divide the chunk size).
+				const auto first_entry = (chunk_start + table.stride - 1u) / table.stride * table.stride;
+				for (uint64_t entry = first_entry; entry + table.low_offset + 8u <= size &&
+				                                   entry + table.low_offset < chunk_start + chunk_bytes;
+				     entry += table.stride) {

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Fix the per-chunk start index so boundary-crossing entries are scanned.

first_entry is the first entry whose start is at or after chunk_start. The comment and the loop bound use the position of the target pair (entry + low_offset). Take an entry E with E < chunk_start <= E + low_offset:

  • The previous chunk stops before E, because E + low_offset >= chunk_start.
  • This chunk starts after E, because first_entry rounds chunk_start up.

E is never read. This needs an IMul32 stride that does not divide TableChunkBytes (for example 48), low_offset > 0, and a table larger than 1 MiB. A lost target makes the dispatcher fall through to return_pc, so the call is skipped without any message. Power-of-two strides are not affected.

🐛 Proposed fix
--- "a/src/graphics/shader/recompiler/ShaderRecompiler.cpp"
+++ "b/src/graphics/shader/recompiler/ShaderRecompiler.cpp"
@@ -838,7 +838,10 @@
 				// First entry whose pair starts inside this chunk.
 				// Entries are visited in order across chunks; a pair that straddles the chunk end is
 				// re-read on its own (rare: only when the stride does not divide the chunk size).
-				const auto first_entry = (chunk_start + table.stride - 1u) / table.stride * table.stride;
+				// First entry whose target pair starts inside this chunk.
+				const auto first_entry = chunk_start <= table.low_offset
+				    ? uint64_t {0}
+				    : (chunk_start - table.low_offset + table.stride - 1u) / table.stride * table.stride;
 				for (uint64_t entry = first_entry; entry + table.low_offset + 8u <= size &&
 				                                   entry + table.low_offset < chunk_start + chunk_bytes;
 				     entry += table.stride) {

at stays non-negative because entry + low_offset >= chunk_start.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

				// First entry whose target pair starts inside this chunk.
				const auto first_entry = chunk_start <= table.low_offset
				    ? uint64_t {0}
				    : (chunk_start - table.low_offset + table.stride - 1u) / table.stride * table.stride;
				for (uint64_t entry = first_entry; entry + table.low_offset + 8u <= size &&
				                                   entry + table.low_offset < chunk_start + chunk_bytes;
				     entry += table.stride) {

✅ Addressed in commit b9d283c

**@⁠coderabbitai[bot]** on GitHub · 2026-10-22 22:31 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1849#discussion_r4354210753) · edited 2026-10-22 23:54 UTC On `src/graphics/shader/recompiler/ShaderRecompiler.cpp` line 844 (outdated): ```diff @@ -621,38 +809,123 @@ const Decoder::Program& RefreshShaderSource(ShaderSource& source, const IR::SrtR const auto clean = IR::CleanRuntime(capture.ObservedRuntime()); IR::SrtWalker walker(source.call_targets, clean); for (auto& site: source.calls) { - uint32_t low = 0, high = 0; - if (!walker.Evaluate(site.target[0], low) || !walker.Evaluate(site.target[1], high)) - EXIT("shader call at pc 0x%08x has an unavailable scalar target", - source.decoded.instructions[site.instruction].pc); + const auto pc = source.decoded.instructions[site.instruction].pc; + if (site.table) { + // Read every entry of the function table; each distinct target becomes a callee. + std::array<uint32_t, 4> descriptor {}; + for (uint32_t i = 0; i < 4u; ++i) + if (!walker.Evaluate(site.table->descriptor[i], descriptor[i])) + EXIT("shader call at pc 0x%08x has an unavailable function table", pc); + // V# layout: base[47:0] in dwords 0-1, stride in dword 1 [29:16], num_records in dword 2. + // Scalar buffer loads count records in bytes when the stride is zero. + const auto base = ((uint64_t {descriptor[1] & 0xffffu} << 32u) | descriptor[0]) & ~uint64_t {3}; + const auto stride = (descriptor[1] >> 16u) & 0x3fffu; + const auto size = stride == 0u ? uint64_t {descriptor[2]} : uint64_t {stride} * descriptor[2]; + const auto& table = *site.table; + site.table_targets.clear(); + // Tables can be large (megabytes, with most entries empty), so read them in chunks: one + // recorded read per chunk instead of one per entry. + if (size > MaxTableBytes) + EXIT("shader call at pc 0x%08x: function table is 0x%llx bytes", pc, static_cast<unsigned long long>(size)); + std::vector<uint32_t> chunk; + for (uint64_t chunk_start = 0; chunk_start < size; chunk_start += TableChunkBytes) { + const auto chunk_bytes = std::min<uint64_t>(TableChunkBytes, size - chunk_start) & ~uint64_t {3}; + if (chunk_bytes == 0u) break; + chunk.resize(chunk_bytes / 4u); + if (!clean.read_memory(clean.userdata, base + chunk_start, chunk)) + EXIT("shader call at pc 0x%08x cannot read its function table at +0x%llx", pc, + static_cast<unsigned long long>(chunk_start)); + // First entry whose pair starts inside this chunk. + // Entries are visited in order across chunks; a pair that straddles the chunk end is + // re-read on its own (rare: only when the stride does not divide the chunk size). + const auto first_entry = (chunk_start + table.stride - 1u) / table.stride * table.stride; + for (uint64_t entry = first_entry; entry + table.low_offset + 8u <= size && + entry + table.low_offset < chunk_start + chunk_bytes; + entry += table.stride) { ``` <!-- coderabbit-ai-generated:v1 --> **🎯 Functional Correctness** | **🟡 Minor** | **⚡ Quick win** **Fix the per-chunk start index so boundary-crossing entries are scanned.** `first_entry` is the first entry whose *start* is at or after `chunk_start`. The comment and the loop bound use the position of the target pair (`entry + low_offset`). Take an entry `E` with `E < chunk_start <= E + low_offset`: - The previous chunk stops before `E`, because `E + low_offset >= chunk_start`. - This chunk starts after `E`, because `first_entry` rounds `chunk_start` up. `E` is never read. This needs an `IMul32` stride that does not divide `TableChunkBytes` (for example 48), `low_offset > 0`, and a table larger than 1 MiB. A lost target makes the dispatcher fall through to `return_pc`, so the call is skipped without any message. Power-of-two strides are not affected. <details> <summary>🐛 Proposed fix</summary> ```diff --- "a/src/graphics/shader/recompiler/ShaderRecompiler.cpp" +++ "b/src/graphics/shader/recompiler/ShaderRecompiler.cpp" @@ -838,7 +838,10 @@ // First entry whose pair starts inside this chunk. // Entries are visited in order across chunks; a pair that straddles the chunk end is // re-read on its own (rare: only when the stride does not divide the chunk size). - const auto first_entry = (chunk_start + table.stride - 1u) / table.stride * table.stride; + // First entry whose target pair starts inside this chunk. + const auto first_entry = chunk_start <= table.low_offset + ? uint64_t {0} + : (chunk_start - table.low_offset + table.stride - 1u) / table.stride * table.stride; for (uint64_t entry = first_entry; entry + table.low_offset + 8u <= size && entry + table.low_offset < chunk_start + chunk_bytes; entry += table.stride) { ``` </details> `at` stays non-negative because `entry + low_offset >= chunk_start`. <!-- suggestion_start --> <details> <summary>📝 Committable suggestion</summary> > ‼️ **IMPORTANT** > Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements. ```suggestion // First entry whose target pair starts inside this chunk. const auto first_entry = chunk_start <= table.low_offset ? uint64_t {0} : (chunk_start - table.low_offset + table.stride - 1u) / table.stride * table.stride; for (uint64_t entry = first_entry; entry + table.low_offset + 8u <= size && entry + table.low_offset < chunk_start + chunk_bytes; entry += table.stride) { ``` </details> <!-- suggestion_end --> <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:97ec4e38b2b99b4ed47acbbb --> <!-- This is an auto-generated comment by CodeRabbit --> ✅ Addressed in commit b9d283c
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-22 22:31 UTC · original · reviewed

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between 79837b423d and f1d24de936.

📒 Files selected for processing: 18
  • src/common/emulatorConfig.cpp
  • src/common/emulatorConfig.h
  • src/common/threads.cpp
  • src/common/threads.h
  • src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp
  • src/graphics/shader/recompiler/ShaderRecompiler.cpp
  • src/graphics/shader/recompiler/ShaderRecompiler.h
  • src/graphics/shader/recompiler/frontend/cfg/ShaderCFG.cpp
  • src/graphics/shader/recompiler/frontend/cfg/ShaderCFG.h
  • src/graphics/shader/recompiler/frontend/decode/ShaderDecoder.h
  • src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp
  • src/launcher/forms/configuration_edit_dialog.ui
  • src/launcher/include/configuration.h
  • src/launcher/src/configuration.cpp
  • src/launcher/src/configurationEditDialog.cpp
  • src/launcher/src/mainDialog.cpp
  • src/main.cpp
  • tests/shaderCfgTests.cpp

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-22 22:31 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1849#pullrequestreview-5621660427) · **reviewed** <!-- coderabbit-ai-generated:v1 --> **Actionable comments posted: 2** --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> - **Source mode**: Auto - **Repository**: [KytyPS5/KytyPS5](<https://github.com/KytyPS5/KytyPS5>) - **Branch**: [main](<https://github.com/KytyPS5/KytyPS5/tree/main>) - **File**: [.coderabbit.yaml](<https://github.com/KytyPS5/KytyPS5/blob/79837b423dd035b34b2dc476e1d2dce8ae0d18bf/.coderabbit.yaml>) - **Commit**: [79837b4](<https://github.com/KytyPS5/KytyPS5/commit/79837b423dd035b34b2dc476e1d2dce8ae0d18bf>) - **Layers**: Repository YAML - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `40a32c66-54ec-4d96-ba93-b3798fc15969` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 79837b423dd035b34b2dc476e1d2dce8ae0d18bf and f1d24de936ba812accaf659a8745cec1be86e292. </details> <details> <summary>📒 Files selected for processing: 18</summary> * `src/common/emulatorConfig.cpp` * `src/common/emulatorConfig.h` * `src/common/threads.cpp` * `src/common/threads.h` * `src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp` * `src/graphics/shader/recompiler/ShaderRecompiler.cpp` * `src/graphics/shader/recompiler/ShaderRecompiler.h` * `src/graphics/shader/recompiler/frontend/cfg/ShaderCFG.cpp` * `src/graphics/shader/recompiler/frontend/cfg/ShaderCFG.h` * `src/graphics/shader/recompiler/frontend/decode/ShaderDecoder.h` * `src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp` * `src/launcher/forms/configuration_edit_dialog.ui` * `src/launcher/include/configuration.h` * `src/launcher/src/configuration.cpp` * `src/launcher/src/configurationEditDialog.cpp` * `src/launcher/src/mainDialog.cpp` * `src/main.cpp` * `tests/shaderCfgTests.cpp` </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. </details> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=47c5a8a7-e748-4072-96f6-d2408094489a attempt=5c50bd23-6d13-4102-96d7-fcf8c6675f8d batch=1/1 -->
Author
Owner

@⁠ZrDaniel07 on GitHub · 2026-10-31 03:36 UTC · original

A note for whoever continues the function-table work. On GT7 (PPSA01317, v01.680), with the call-target part of this PR ported to main 4919fdb6 (current main handles that crash with abd77f57), the drive starts. One call target is still left that neither can resolve, so its dispatch is skipped. It belongs to a compute shader that traces a batch of rays against a BVH. Its S_SWAPPC_B64 targets come from a hit-group table indexed by the instance each ray hits, so the callee is only known on the GPU. The decoded layout is in #1451: #1451.

AI use: Claude Code read the shader and drafted this with me; I ran the game.

**@⁠ZrDaniel07** on GitHub · 2026-10-31 03:36 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1849#issuecomment-6538492642) A note for whoever continues the function-table work. On GT7 (PPSA01317, v01.680), with the call-target part of this PR ported to `main` `4919fdb6` (current `main` handles that crash with `abd77f57`), the drive starts. One call target is still left that neither can resolve, so its dispatch is skipped. It belongs to a compute shader that traces a batch of rays against a BVH. Its `S_SWAPPC_B64` targets come from a hit-group table indexed by the instance each ray hits, so the callee is only known on the GPU. The decoded layout is in #1451: https://git.gtahub.st/github/KytyPS5--KytyPS5/issues/1451. AI use: Claude Code read the shader and drafted this with me; I ran the game.
This pull request has changes conflicting with the target branch.
  • src/common/emulatorConfig.cpp
  • src/common/emulatorConfig.h
  • src/common/threads.cpp
  • src/common/threads.h
  • src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp
  • src/graphics/shader/recompiler/ShaderRecompiler.cpp
  • src/graphics/shader/recompiler/frontend/cfg/ShaderCFG.cpp
  • src/graphics/shader/recompiler/frontend/cfg/ShaderCFG.h
  • src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp
  • src/launcher/include/configuration.h
  • src/launcher/src/configuration.cpp
  • src/launcher/src/configurationEditDialog.cpp
  • src/launcher/src/mainDialog.cpp
  • src/main.cpp
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1849/head:github-bot/gh-1849'
git switch 'github-bot/gh-1849'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1849'
git switch 'github-bot/gh-1849'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1849'
git switch 'github-bot/gh-1849'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1849'
git switch 'main'
git merge --squash 'github-bot/gh-1849'
git switch 'main'
git merge --ff-only 'github-bot/gh-1849'
git switch 'main'
git merge 'github-bot/gh-1849'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.