graphics: use static feedback loop pipelines without the dynamic-state extension #1187

Open
github-bot wants to merge 1 commit from github-bot/gh-1187 into main AGit
Owner

@⁠overlordxrz-source on GitHub · 2026-10-08 02:31 UTC · original
overlordxrz-source:graphics/feedback-loop-static-pipelines → main · +72 −26 · 8 files · 1 commits · open

Depth feedback loops (a draw that samples the depth target it is also writing) only work when the device has both VK_EXT_attachment_feedback_loop_layout and VK_EXT_attachment_feedback_loop_dynamic_state. If either one is missing, the emulator enables neither, and the first such draw exits with depth attachment feedback loop is not supported by the host (renderDraw.cpp:536).

Some drivers have the layout extension but not the dynamic-state one. In #904, @⁠joaodiaslobo read the reporter's vulkaninfo for an RX 9070 XT on Windows and found exactly that. As he pointed out there, the layout extension alone is enough if the pipeline carries the feedback loop flag itself instead of setting it per draw. This PR does that.

  • vulkanWindow.cpp: enable VK_EXT_attachment_feedback_loop_layout on its own, and the dynamic-state extension only when the device also has it. Each feature struct is chained only when its extension is enabled. The log line now reads Vulkan depth feedback support: <layout> (dynamic state: <dynamic>).
  • GraphicContext: attachment_feedback_loop_enabled now means the layout feature is on. The new attachment_feedback_loop_dynamic_state_enabled gates eAttachmentFeedbackLoopEnableEXT and vkCmdSetAttachmentFeedbackLoopEnableEXT.
  • pipeline cache: PipelineRenderingState has a new depth_stencil_feedback_loop bit, which is part of the key's equality and hash. When it is set, the pipeline is created with VK_PIPELINE_CREATE_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT. It is only set on hosts without the dynamic-state extension, so hosts with both extensions keep one pipeline per state as before.
  • ExecutePreparedDraw: the render targets are now acquired before the pipeline lookup, so the draw's feedback state is known when the pipeline is chosen. A draw counts as a feedback loop when AcquireRenderTargets reports feedback aspects or puts the depth attachment in ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT. GetGraphicsPipeline only creates pipelines and doesn't record commands, so the barriers that AcquireRenderTargets records end up in the same command buffer as before.

Draws that don't sample their own depth target are unchanged on every host. Nothing changes on a host that has neither extension: the exit stays.

Evidence

  • #904 Demon's Souls (PPSA01342), RX 9070 XT, Windows 11: exits with this error at boot. #943 lets the clear-only case through, and the reporter then hit the same exit later in the opening, where depth really is written. joaodiaslobo's comment on #904 (2026-10-03) says the card has VK_EXT_attachment_feedback_loop_layout but not VK_EXT_attachment_feedback_loop_dynamic_state, and suggests baking the setting into the pipeline as a fallback.
  • #997 Demon's Souls (PPSA01341), RX 9070 XT, Windows: same exit at renderDraw.cpp:536. A second user with the same GPU says they see it too.
  • #1123 GTA V (PPSA04264), Intel Arc B580, Windows: Vulkan depth feedback support: false, then the same exit in cutscenes. I don't know which of the two extensions that driver is missing. If it lacks the layout extension too, this PR won't help there.
  • Overlap: #943 is about clear-only draws and touches different lines, so the two PRs combine cleanly. TheCruZ's fork has a commit (4f2d620, not a PR here) that samples a copy of the depth target on hosts without feedback loops. That covers hosts with neither extension. This PR covers hosts that have the layout extension, without a copy and with exact feedback semantics, so the two could coexist.

Testing

  • My machine is aarch64 Linux with no GPU, so I couldn't run the emulator, a game or the Vulkan test suite.
  • Compiled the changed vulkanWindow.cpp, pipelineCache.cpp, shaders.cpp, renderDraw.cpp, plus image.cpp and tests/ShaderRecompilerComputeTests.cpp, for x86_64-linux-gnu with clang (zig c++). No errors.
  • The test harness context now sets attachment_feedback_loop_dynamic_state_enabled along with attachment_feedback_loop_enabled, because its device enables both extensions. That keeps the existing per-draw feedback test on the dynamic path.
  • Wrote a standalone Vulkan check (not in this PR) that ran on Mesa lavapipe 25.0.7 with the Khronos validation layer 1.4.309. Its device enables only VK_EXT_attachment_feedback_loop_layout. It creates a dynamic-rendering pipeline with VK_PIPELINE_CREATE_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT, with depth usage DEPTH_STENCIL_ATTACHMENT | SAMPLED | ATTACHMENT_FEEDBACK_LOOP, as image.cpp sets it. The draw writes depth while sampling it, with the attachment in ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT. The validation layer reported 0 errors, and the output matches the same draw on a device with both extensions using vkCmdSetAttachmentFeedbackLoopEnableEXT. Caveat: the same layer version also reports nothing when the flag is left out, so this shows the new path is valid, not that the layer enforces the flag. The requirement comes from the spec's feedback loop rules in the render pass chapter.
  • The changed src/ lines are clean under src/.clang-format (clang-format 23.1.3).
  • Not built on Windows or macOS. I couldn't check it on an AMD Windows driver, so a run on the #904 or #997 setup would be the real test.

AI assistance

An AI assistant helped me trace the exit to the extension check, write the change and the Vulkan check, and run the builds above. I reviewed the code and the results.

**@⁠overlordxrz-source** on GitHub · 2026-10-08 02:31 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1187) `overlordxrz-source:graphics/feedback-loop-static-pipelines` → `main` · +72 −26 · 8 files · 1 commits · open Depth feedback loops (a draw that samples the depth target it is also writing) only work when the device has both `VK_EXT_attachment_feedback_loop_layout` and `VK_EXT_attachment_feedback_loop_dynamic_state`. If either one is missing, the emulator enables neither, and the first such draw exits with `depth attachment feedback loop is not supported by the host` (renderDraw.cpp:536). Some drivers have the layout extension but not the dynamic-state one. In #904, @⁠joaodiaslobo read the reporter's vulkaninfo for an RX 9070 XT on Windows and found exactly that. As he pointed out there, the layout extension alone is enough if the pipeline carries the feedback loop flag itself instead of setting it per draw. This PR does that. - `vulkanWindow.cpp`: enable `VK_EXT_attachment_feedback_loop_layout` on its own, and the dynamic-state extension only when the device also has it. Each feature struct is chained only when its extension is enabled. The log line now reads `Vulkan depth feedback support: <layout> (dynamic state: <dynamic>)`. - `GraphicContext`: `attachment_feedback_loop_enabled` now means the layout feature is on. The new `attachment_feedback_loop_dynamic_state_enabled` gates `eAttachmentFeedbackLoopEnableEXT` and `vkCmdSetAttachmentFeedbackLoopEnableEXT`. - pipeline cache: `PipelineRenderingState` has a new `depth_stencil_feedback_loop` bit, which is part of the key's equality and hash. When it is set, the pipeline is created with `VK_PIPELINE_CREATE_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT`. It is only set on hosts without the dynamic-state extension, so hosts with both extensions keep one pipeline per state as before. - `ExecutePreparedDraw`: the render targets are now acquired before the pipeline lookup, so the draw's feedback state is known when the pipeline is chosen. A draw counts as a feedback loop when `AcquireRenderTargets` reports feedback aspects or puts the depth attachment in `ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT`. `GetGraphicsPipeline` only creates pipelines and doesn't record commands, so the barriers that `AcquireRenderTargets` records end up in the same command buffer as before. Draws that don't sample their own depth target are unchanged on every host. Nothing changes on a host that has neither extension: the exit stays. ## Evidence - #904 Demon's Souls (PPSA01342), RX 9070 XT, Windows 11: exits with this error at boot. #943 lets the clear-only case through, and the reporter then hit the same exit later in the opening, where depth really is written. joaodiaslobo's comment on #904 (2026-10-03) says the card has `VK_EXT_attachment_feedback_loop_layout` but not `VK_EXT_attachment_feedback_loop_dynamic_state`, and suggests baking the setting into the pipeline as a fallback. - #997 Demon's Souls (PPSA01341), RX 9070 XT, Windows: same exit at renderDraw.cpp:536. A second user with the same GPU says they see it too. - #1123 GTA V (PPSA04264), Intel Arc B580, Windows: `Vulkan depth feedback support: false`, then the same exit in cutscenes. I don't know which of the two extensions that driver is missing. If it lacks the layout extension too, this PR won't help there. - Overlap: #943 is about clear-only draws and touches different lines, so the two PRs combine cleanly. TheCruZ's fork has a commit (4f2d620, not a PR here) that samples a copy of the depth target on hosts without feedback loops. That covers hosts with neither extension. This PR covers hosts that have the layout extension, without a copy and with exact feedback semantics, so the two could coexist. ## Testing - My machine is aarch64 Linux with no GPU, so I couldn't run the emulator, a game or the Vulkan test suite. - Compiled the changed `vulkanWindow.cpp`, `pipelineCache.cpp`, `shaders.cpp`, `renderDraw.cpp`, plus `image.cpp` and `tests/ShaderRecompilerComputeTests.cpp`, for `x86_64-linux-gnu` with clang (zig c++). No errors. - The test harness context now sets `attachment_feedback_loop_dynamic_state_enabled` along with `attachment_feedback_loop_enabled`, because its device enables both extensions. That keeps the existing per-draw feedback test on the dynamic path. - Wrote a standalone Vulkan check (not in this PR) that ran on Mesa lavapipe 25.0.7 with the Khronos validation layer 1.4.309. Its device enables only `VK_EXT_attachment_feedback_loop_layout`. It creates a dynamic-rendering pipeline with `VK_PIPELINE_CREATE_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT`, with depth usage `DEPTH_STENCIL_ATTACHMENT | SAMPLED | ATTACHMENT_FEEDBACK_LOOP`, as `image.cpp` sets it. The draw writes depth while sampling it, with the attachment in `ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT`. The validation layer reported 0 errors, and the output matches the same draw on a device with both extensions using `vkCmdSetAttachmentFeedbackLoopEnableEXT`. Caveat: the same layer version also reports nothing when the flag is left out, so this shows the new path is valid, not that the layer enforces the flag. The requirement comes from the spec's feedback loop rules in the render pass chapter. - The changed `src/` lines are clean under `src/.clang-format` (clang-format 23.1.3). - Not built on Windows or macOS. I couldn't check it on an AMD Windows driver, so a run on the #904 or #997 setup would be the real test. ## AI assistance An AI assistant helped me trace the exit to the extension check, write the change and the Vulkan check, and run the builds above. I reviewed the code and the results.
Depth feedback loops (a draw that samples the depth target it also
writes) were only enabled when the device exposed both
VK_EXT_attachment_feedback_loop_layout and
VK_EXT_attachment_feedback_loop_dynamic_state. Drivers that have the
layout extension but not the dynamic-state one, such as the Radeon
RX 9070 XT driver on Windows reported in #904, got neither, so the first
such draw exited with "depth attachment feedback loop is not supported
by the host" (Demon's Souls on that card).

The layout extension alone is enough: a pipeline created with
VK_PIPELINE_CREATE_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT may be
used with a depth attachment in ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT
layout. Enable the layout extension on its own, track the dynamic-state
extension separately, and when it is missing make the feedback loop part
of the graphics pipeline key and set the flag at pipeline creation. The
render targets are now acquired before the pipeline is looked up so the
draw's feedback state is known. Hosts with both extensions keep one
pipeline and set the loop per draw as before.

The cached dynamic state now emits vkCmdSetAttachmentFeedbackLoopEnableEXT
only when the dynamic-state extension is present, since the layout
extension alone no longer implies it.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:47:05 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-08 02:33 UTC · original · edited 2026-10-16 02:38 UTC

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 79365744-82c1-49a1-a4dc-5c4ba52e99fc
📥 Commits

Reviewing files that changed from the base of the PR and between ef7251d85989edf46cbc4a5dcf89f8228f464092 and 633696f09f.

📒 Files selected for processing: 7
  • src/graphics/host_gpu/graphicContext.h
  • src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp
  • src/graphics/host_gpu/renderer/pipeline/pipelineCache.h
  • src/graphics/host_gpu/renderer/pipeline/shaders.cpp
  • src/graphics/host_gpu/renderer/renderDraw.cpp
  • src/graphics/presentation/window/vulkanWindow.cpp
  • tests/ShaderRecompilerComputeTests.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.

📝 Walkthrough

The change separates attachment feedback-loop layout support from dynamic-state support. Device setup queries and enables each capability according to extension and feature availability. Graphics pipeline creation uses static depth/stencil feedback-loop state when dynamic state is unavailable. Draw execution passes depth feedback-loop information to pipeline creation and updates per-draw feedback-loop state only when dynamic state is supported.

Suggested reviewers: nmzik

Priority: ➖ Normal

Change: Bug fix

Merge Risk: 🔵 Low · up to 63369

The change remains mergeable with awareness that the layout-only fallback has not been covered by the test harness; hardware retesting would improve confidence.

Pre-merge checks: Passed 4 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Docstring Coverage Inconclusive Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 7 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 clearly and concisely describes the main change: using static feedback-loop pipelines when the dynamic-state extension is unavailable.
Description check Passed The description is directly related to the changeset and explains the extension handling, pipeline fallback, affected code paths, evidence, and testing limitations.
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: Docstring Coverage

Explanation

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

  • Autopilot · 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-08 02:33 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1187#issuecomment-6050991814) · edited 2026-10-16 02:38 UTC <!-- 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/1187?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> - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `79365744-82c1-49a1-a4dc-5c4ba52e99fc` </dd> </dl> </details> <details> <summary><strong>📥 Commits</strong></summary> <dl> <dd> Reviewing files that changed from the base of the PR and between ef7251d85989edf46cbc4a5dcf89f8228f464092 and 633696f09f7f9757ec70d67213281c4b44840e01. </dd> </dl> </details> <details> <summary><strong>📒 Files selected for processing: 7</strong></summary> <dl> <dd> * `src/graphics/host_gpu/graphicContext.h` * `src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp` * `src/graphics/host_gpu/renderer/pipeline/pipelineCache.h` * `src/graphics/host_gpu/renderer/pipeline/shaders.cpp` * `src/graphics/host_gpu/renderer/renderDraw.cpp` * `src/graphics/presentation/window/vulkanWindow.cpp` * `tests/ShaderRecompilerComputeTests.cpp` </dd> </dl> </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. </dd> </dl> </details> <!-- recent_review_end --> <!-- walkthrough_start --> <details> <summary><strong>📝 Walkthrough</strong></summary> <dl> <dd> The change separates attachment feedback-loop layout support from dynamic-state support. Device setup queries and enables each capability according to extension and feature availability. Graphics pipeline creation uses static depth/stencil feedback-loop state when dynamic state is unavailable. Draw execution passes depth feedback-loop information to pipeline creation and updates per-draw feedback-loop state only when dynamic state is supported. **Suggested reviewers:** `nmzik` </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> **Priority:** ➖ Normal <!-- change_assessment_commit:"633696f09f7f9757ec70d67213281c4b44840e01" --> **Change:** Bug fix <!-- change_assessment_end --> <details> <summary><strong>Merge Risk:</strong> <strong>🔵 Low</strong> · up to <code>63369</code></summary> <dl> <dd> <!-- final_review_risk_start --> <!-- final_review_risk_label **Merge Risk:** **🔵 Low** · up to `63369` --> <!-- final_review_risk_coverage:{"sourceCommitId":"633696f09f7f9757ec70d67213281c4b44840e01","coveredCommitId":"633696f09f7f9757ec70d67213281c4b44840e01","kind":"reviewed"} --> The change remains mergeable with awareness that the layout-only fallback has not been covered by the test harness; hardware retesting would improve confidence. <!-- 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 30.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 7 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 clearly and concisely describes the main change: using static feedback-loop pipelines when the dynamic-state extension is unavailable. | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The description is directly related to the changeset and explains the extension handling, pipeline fallback, affected code paths, evidence, and testing limitations. | | 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. | </dd> </dl> </details> <details> <summary><strong>Full details: Docstring Coverage</strong></summary> <dl> <dd> **Explanation** Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 7 files. (1 skipped: 1 too large.) </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">Autopilot</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=1187)! 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 -->
Author
Owner

@⁠RobertBruno454 on GitHub · 2026-10-09 16:35 UTC · original

Tested this PR on real hardware: AMD Radeon RX 9070 XT, Windows 11, latest Adrenalin, Intel i7-11700.
Build: fork build of e51027a (built with the repo's own workflow).
Game: EA SPORTS UFC 6 (PPSA23566, v01.004.000).

Result: the fix works.

  • Official build 4c8fc53 logs Vulkan depth feedback support: false and exits with
    depth attachment feedback loop is not supported by the host (renderDraw.cpp:542).
  • With this PR it logs Vulkan depth feedback support: true (dynamic state: false) and the game
    gets past that point (shaders went from VS 4 | PS 3 | CS 11 to VS 9 | PS 7 | CS 30).

New, separate crash further in (deterministic, same address on every run):

--- Guest fault context ---
thread: (host thread)
rcx=0000000000000000 rdx=0000000000000000
Unhandled host exception: type=1 code=3221225477 pc=0x00007ffdabe0ab9c access=2 address=0x0000000000000000
 in src/loader/runtimeLinker.cpp:720
  • Happens right after the 30th compute shader is compiled, on a host thread.
  • The faulting instruction is mov [rcx], rdx with rcx=0 inside a doubly-linked-list unlink
    (mov rcx,[r8+8]; mov rdx,[r8]; mov [rcx],rdx), and all return addresses on the stack are in
    0x7ffd... DLLs, so it looks like a crash inside the AMD Vulkan driver during pipeline handling.
  • Running with Vulkan validation enabled produced zero validation messages and the crash was identical.
  • Same crash at the same point with all three Shader optimization modes (None, Size, Performance), with the pipeline cache cleared.

Happy to test further builds or provide full logs.

**@⁠RobertBruno454** on GitHub · 2026-10-09 16:35 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1187#issuecomment-6085087251) Tested this PR on real hardware: **AMD Radeon RX 9070 XT, Windows 11, latest Adrenalin**, Intel i7-11700. Build: fork build of e51027a (built with the repo's own workflow). Game: EA SPORTS UFC 6 (PPSA23566, v01.004.000). **Result: the fix works.** - Official build `4c8fc53` logs `Vulkan depth feedback support: false` and exits with `depth attachment feedback loop is not supported by the host` (renderDraw.cpp:542). - With this PR it logs `Vulkan depth feedback support: true (dynamic state: false)` and the game gets past that point (shaders went from VS 4 | PS 3 | CS 11 to VS 9 | PS 7 | CS 30). **New, separate crash further in** (deterministic, same address on every run): ``` --- Guest fault context --- thread: (host thread) rcx=0000000000000000 rdx=0000000000000000 Unhandled host exception: type=1 code=3221225477 pc=0x00007ffdabe0ab9c access=2 address=0x0000000000000000 in src/loader/runtimeLinker.cpp:720 ``` - Happens right after the 30th compute shader is compiled, on a host thread. - The faulting instruction is `mov [rcx], rdx` with rcx=0 inside a doubly-linked-list unlink (`mov rcx,[r8+8]; mov rdx,[r8]; mov [rcx],rdx`), and all return addresses on the stack are in 0x7ffd... DLLs, so it looks like a crash inside the AMD Vulkan driver during pipeline handling. - **Running with Vulkan validation enabled produced zero validation messages** and the crash was identical. - Same crash at the same point with all three Shader optimization modes (None, Size, Performance), with the pipeline cache cleared. Happy to test further builds or provide full logs.
Author
Owner

@⁠overlordxrz-source on GitHub · 2026-10-10 02:02 UTC · original

Rebased onto current main. The only conflict was with the new cached dynamic state (93452b24e). I kept main's DynamicState path and changed its gate in dynamicState.cpp: vkCmdSetAttachmentFeedbackLoopEnableEXT is now emitted only when VK_EXT_attachment_feedback_loop_dynamic_state is present. Without that, a driver with only the layout extension (the case this PR fixes) would call a command it doesn't support.

This also covers the GTA V prologue-cutscene exit reported in #829 ("depth attachment feedback loop is not supported by the host" on RX 9070). @⁠TotoWood, could you retest GTA V with this build? It complements #1241, with no file overlap.

AI-assisted: yes.

**@⁠overlordxrz-source** on GitHub · 2026-10-10 02:02 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1187#issuecomment-6092494634) Rebased onto current main. The only conflict was with the new cached dynamic state (93452b24e). I kept main's DynamicState path and changed its gate in dynamicState.cpp: vkCmdSetAttachmentFeedbackLoopEnableEXT is now emitted only when VK_EXT_attachment_feedback_loop_dynamic_state is present. Without that, a driver with only the layout extension (the case this PR fixes) would call a command it doesn't support. This also covers the GTA V prologue-cutscene exit reported in #829 ("depth attachment feedback loop is not supported by the host" on RX 9070). @⁠TotoWood, could you retest GTA V with this build? It complements #1241, with no file overlap. AI-assisted: yes.
Author
Owner

@⁠overlordxrz-source on GitHub · 2026-10-12 02:26 UTC · original

Rebased onto current main (16a7fe689). Still one commit, author unchanged, new head ef7251d85.

The only conflict was in VulkanCreateDevice (vulkanWindow.cpp) with 1029511bb ("add depth to color copy"). Both commits rewrote the lines that set attachment_feedback_loop_enabled and print the device log. I kept all of 1029511bb as it is: the VK_KHR_maintenance8 query, enable and pNext chaining, depth_color_copy_enabled, and its "Vulkan depth/color copy support" log line. Then I put this PR's layout and dynamic-state split back around it. The log now prints both lines:

Vulkan depth/color copy support: <true|false>
Vulkan depth feedback support: <true|false> (dynamic state: <true|false>)

How the two interact: they are separate paths, and neither replaces the other.

  • 1029511bb handles copy_depth_to_color draws. CopyDepthToColor runs first in ExecutePreparedDraw, does a vkCmdCopyImage and returns before a pipeline is looked up. So the static feedback-loop pipeline key added here never affects that path.
  • This PR handles draws that sample the depth target they write. On hosts without VK_EXT_attachment_feedback_loop_dynamic_state, the loop is baked into the pipeline. That part is unchanged from the 10-09 rebase, including the dynamicState.cpp gate on attachment_feedback_loop_dynamic_state_enabled.

Checks: x86_64 cross-compile of the touched files, clang-format clean on the changed lines, and test merges with #1388, #1389, #1421 and #1241 (no conflicts). Nothing was run on a GPU.

@⁠RobertBruno454 @⁠TotoWood: since main now also has the maintenance8 depth-to-color copy, could you retest on the RX 9070 / 9070 XT with this head? Please include the two log lines above, and say whether UFC 6 / GTA V still get past the feedback-loop exit and whether the later driver crash changed.

**@⁠overlordxrz-source** on GitHub · 2026-10-12 02:26 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1187#issuecomment-6116650201) Rebased onto current main (16a7fe689). Still one commit, author unchanged, new head `ef7251d85`. The only conflict was in `VulkanCreateDevice` (vulkanWindow.cpp) with 1029511bb ("add depth to color copy"). Both commits rewrote the lines that set `attachment_feedback_loop_enabled` and print the device log. I kept all of 1029511bb as it is: the `VK_KHR_maintenance8` query, enable and pNext chaining, `depth_color_copy_enabled`, and its "Vulkan depth/color copy support" log line. Then I put this PR's layout and dynamic-state split back around it. The log now prints both lines: ``` Vulkan depth/color copy support: <true|false> Vulkan depth feedback support: <true|false> (dynamic state: <true|false>) ``` How the two interact: they are separate paths, and neither replaces the other. - 1029511bb handles `copy_depth_to_color` draws. `CopyDepthToColor` runs first in `ExecutePreparedDraw`, does a `vkCmdCopyImage` and returns before a pipeline is looked up. So the static feedback-loop pipeline key added here never affects that path. - This PR handles draws that sample the depth target they write. On hosts without `VK_EXT_attachment_feedback_loop_dynamic_state`, the loop is baked into the pipeline. That part is unchanged from the 10-09 rebase, including the `dynamicState.cpp` gate on `attachment_feedback_loop_dynamic_state_enabled`. Checks: x86_64 cross-compile of the touched files, clang-format clean on the changed lines, and test merges with #1388, #1389, #1421 and #1241 (no conflicts). Nothing was run on a GPU. @⁠RobertBruno454 @⁠TotoWood: since main now also has the maintenance8 depth-to-color copy, could you retest on the RX 9070 / 9070 XT with this head? Please include the two log lines above, and say whether UFC 6 / GTA V still get past the feedback-loop exit and whether the later driver crash changed.
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-12 02:30 UTC · original · reviewed

🧹 Nitpick comments (1)
tests/ShaderRecompilerComputeTests.cpp (1)

18456-18456: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Split feedback-loop capabilities and guard the fallback test path.

m_rasterization_supported requires both feedback-loop features. This prevents layout-only devices from enabling the layout extension, entering RunGraphicsCase(), or running CheckRasterization(true).

Split layout and dynamic-state support. Gate the depth-feedback test on layout support. In CheckRasterization, call setAttachmentFeedbackLoopEnableEXT only when dynamic-state support is enabled. Otherwise, the test will call the dynamic command instead of exercising the static pipeline fallback.

This is a coverage improvement, not a current production failure.


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b83fa0f8-e778-4d57-9049-526b01759084
📥 Commits

Reviewing files that changed from the base of the PR and between 4c21706e63bc53d35f76f3e9d16f3fae6447cf87 and ef7251d85989edf46cbc4a5dcf89f8228f464092.

📒 Files selected for processing (4)
  • src/graphics/host_gpu/graphicContext.h
  • src/graphics/host_gpu/renderer/renderDraw.cpp
  • src/graphics/presentation/window/vulkanWindow.cpp
  • tests/ShaderRecompilerComputeTests.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-12 02:30 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1187#pullrequestreview-5486078848) · **reviewed** <details> <summary>🧹 Nitpick comments (1)</summary><blockquote> <details> <summary>tests/ShaderRecompilerComputeTests.cpp (1)</summary><blockquote> `18456-18456`: **📐 Maintainability & Code Quality** | **🔵 Trivial** | **⚡ Quick win** **Split feedback-loop capabilities and guard the fallback test path.** `m_rasterization_supported` requires both feedback-loop features. This prevents layout-only devices from enabling the layout extension, entering `RunGraphicsCase()`, or running `CheckRasterization(true)`. Split layout and dynamic-state support. Gate the depth-feedback test on layout support. In `CheckRasterization`, call `setAttachmentFeedbackLoopEnableEXT` only when dynamic-state support is enabled. Otherwise, the test will call the dynamic command instead of exercising the static pipeline fallback. This is a coverage improvement, not a current production failure. <!-- cr-comment:v1:2910e5c4e84e9fdd77469dd4 --> </blockquote></details> </blockquote></details> --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `b83fa0f8-e778-4d57-9049-526b01759084` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 4c21706e63bc53d35f76f3e9d16f3fae6447cf87 and ef7251d85989edf46cbc4a5dcf89f8228f464092. </details> <details> <summary>📒 Files selected for processing (4)</summary> * `src/graphics/host_gpu/graphicContext.h` * `src/graphics/host_gpu/renderer/renderDraw.cpp` * `src/graphics/presentation/window/vulkanWindow.cpp` * `tests/ShaderRecompilerComputeTests.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=0adab7c6-89a1-45c9-be4d-2edc823371c9 attempt=0abd9542-8076-431d-ab68-5b92a30ce1e6 batch=1/1 -->
Author
Owner

@⁠theantipopau on GitHub · 2026-11-13 20:40 UTC · original

Superseded by #2213, which is the rebased replacement targeting current main with the full Windows/macOS/Linux CI green and the static depth-feedback selector passing locally. This PR should be closed once #2213 merges; leaving it open for now.

**@⁠theantipopau** on GitHub · 2026-11-13 20:40 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1187#issuecomment-6864365847) Superseded by #2213, which is the rebased replacement targeting current `main` with the full Windows/macOS/Linux CI green and the static depth-feedback selector passing locally. This PR should be closed once #2213 merges; leaving it open for now.
This pull request has changes conflicting with the target branch.
  • src/graphics/host_gpu/graphicContext.h
  • src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp
  • src/graphics/host_gpu/renderer/pipeline/pipelineCache.h
  • src/graphics/host_gpu/renderer/pipeline/shaders.cpp
  • src/graphics/host_gpu/renderer/renderDraw.cpp
  • src/graphics/presentation/window/vulkanWindow.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/1187/head:github-bot/gh-1187'
git switch 'github-bot/gh-1187'

Merge

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