shader: append an unused acceleration-structure binding to ray-query layouts (#2339) #2403

Closed
github-bot wants to merge 1 commit from gh-pr/2403/head into gh-pr/2403/base
Owner

@⁠mitsa-ng on GitHub · 2026-11-19 01:35 UTC · original
ray-query-as-binding → main · +22 −2 · 3 files · 1 commits · closed without merging

Fixes #2339.

Problem

With --native-rt, AMD's Windows driver (RX 6900 XT, driver 0x800161, Vulkan 1.4.315) rejects any ray-query pipeline whose layout has descriptor sets but no VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR binding, with VK_ERROR_UNKNOWN from vkCreateComputePipelines. That includes an empty set, sets of any other descriptor type, and push-descriptor sets; the SPIR-V module itself is not the trigger. The emulator always creates set 0 and reaches the TLAS by device address (OpConvertUToAccelerationStructureKHR), so it never had such a binding.

Change

Append one unused acceleration-structure binding (count 1, binding number past all native binding groups) to the layout of every shader with info.ray_query, and give the descriptor pool acceleration-structure capacity for layouts that do not use push descriptors. This is exactly the workaround the issue reporter validated on their hardware.

Evidence

Per #2339, with this workaround the reporter's RayQueryTraversal test and its wave64 variant pass on the RX 6900 XT, results included. macOS x86_64 and Windows builds with this change are green on my fork's CI; I have no AMD Windows machine to re-run the test myself, hence the direct implementation of the reporter's validated recipe.

Written with AI assistance (ZCode); the change was built and tested by the author on macOS hardware.

**@⁠mitsa-ng** on GitHub · 2026-11-19 01:35 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2403) `ray-query-as-binding` → `main` · +22 −2 · 3 files · 1 commits · closed without merging Fixes #2339. ## Problem With `--native-rt`, AMD's Windows driver (RX 6900 XT, driver 0x800161, Vulkan 1.4.315) rejects any ray-query pipeline whose layout has descriptor sets but no `VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR` binding, with `VK_ERROR_UNKNOWN` from `vkCreateComputePipelines`. That includes an empty set, sets of any other descriptor type, and push-descriptor sets; the SPIR-V module itself is not the trigger. The emulator always creates set 0 and reaches the TLAS by device address (`OpConvertUToAccelerationStructureKHR`), so it never had such a binding. ## Change Append one unused acceleration-structure binding (count 1, binding number past all native binding groups) to the layout of every shader with `info.ray_query`, and give the descriptor pool acceleration-structure capacity for layouts that do not use push descriptors. This is exactly the workaround the issue reporter validated on their hardware. ## Evidence Per #2339, with this workaround the reporter's `RayQueryTraversal` test and its wave64 variant pass on the RX 6900 XT, results included. macOS x86_64 and Windows builds with this change are green on my fork's CI; I have no AMD Windows machine to re-run the test myself, hence the direct implementation of the reporter's validated recipe. Written with AI assistance (ZCode); the change was built and tested by the author on macOS hardware.
AMD's Windows driver rejects any ray-query pipeline whose layout has
descriptor sets but no acceleration-structure binding, including empty
sets, sets of other descriptor types, and push-descriptor sets
(VK_ERROR_UNKNOWN from vkCreateComputePipelines). The TLAS is reached by
device address, so the layout never had one. Append one unused
acceleration-structure binding to layouts of shaders with ray_query and
give the descriptor pool matching capacity for layouts that do not use
push descriptors.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:19:55 +00:00
github-bot closed this pull request 2026-11-26 10:19:55 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-19 01:40 UTC · original

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Ray-query shader layouts now include one unused acceleration-structure descriptor binding. When ray queries are enabled, descriptor pool creation adds capacity for 256 acceleration-structure descriptors. The new binding constant is four times DescriptorBindingKind::Count.

Suggested reviewers: nmzik, senaxx

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: Minimal · up to 9b91e

This adds an unused acceleration-structure binding to ray-query shader layouts, plus matching descriptor pool capacity, to work around an AMD Windows driver failure. No concrete merge-blocking risk was found. The fix has not been confirmed on AMD Windows hardware by this review, so the reporter's confirmation is still worth waiting for.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: appending an unused acceleration-structure binding to ray-query layouts. It also references the linked issue number. The changeset matches this description, which cove…
Description check Passed The description explains the AMD Windows driver failure, the workaround, and the affected code paths. It maps to the changes in the descriptor pool and the shader layout bindings. It also states the t…
Linked Issues check Passed [#2339] The requirement is a coding workaround: for shaders with info.ray_query, append one unused acceleration-structure binding (count 1) after the shader's bindings, and add acceleration-structure …
Out of Scope Changes check Passed The changed areas are descriptorHeap.cpp (pool size array and acceleration-structure capacity), shaders.cpp (layout binding for info.ray_query), and ShaderIR.h (the UnusedAccelerationStructureBinding …
Full details: Title check

Explanation

The title names the main change: appending an unused acceleration-structure binding to ray-query layouts. It also references the linked issue number. The changeset matches this description, which covers the layout binding in shaders.cpp, the pool capacity in descriptorHeap.cpp, and the constant in ShaderIR.h.

Full details: Description check

Explanation

The description explains the AMD Windows driver failure, the workaround, and the affected code paths. It maps to the changes in the descriptor pool and the shader layout bindings. It also states the test evidence and its limits, so it is clearly related to the changeset.

Full details: Linked Issues check

Explanation

[#2339] The requirement is a coding workaround: for shaders with info.ray_query, append one unused acceleration-structure binding (count 1) after the shader's bindings, and add acceleration-structure pool capacity for non-push-descriptor layouts. The PR summary states that AddLayoutBindings adds an eAccelerationStructureKHR binding with count 1 when program.info.ray_query is true, using UnusedAccelerationStructureBinding (4 * DescriptorBindingKind::Count). It also states that CreateDescriptorPool adds capacity for 256 acceleration-structure descriptors when ray queries are enabled. Both requirements are covered. The summary does not show the diff for the binding-number ordering, so the claim that 4 * Count lies past all native binding groups is taken from the summary. The PR adds no automated test. The reporter's RayQueryTraversal result on AMD hardware is reported in #2339 and in the PR description, and the author states that they could not rerun it. No other coding requirement is present in #2339.

Full details: Out of Scope Changes check

Explanation

The changed areas are descriptorHeap.cpp (pool size array and acceleration-structure capacity), shaders.cpp (layout binding for info.ray_query), and ShaderIR.h (the UnusedAccelerationStructureBinding constant with a comment). Each change serves the workaround that #2339 requests. No unrelated change appears in the summary. The diff content could not be read in this review, so this verdict relies on the PR summary.

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between a90be8dd73 and 9b91ecc834.

Files selected for processing: 3

  • src/graphics/host_gpu/renderer/pipeline/descriptorHeap.cpp
  • src/graphics/host_gpu/renderer/pipeline/shaders.cpp
  • src/graphics/shader/recompiler/ir/ShaderIR.h

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

**@⁠coderabbitai[bot]** on GitHub · 2026-11-19 01:40 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2403#issuecomment-6997037320) <!-- 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/2403?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-buttons-v1/explain-change-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg" alt="Explain Change →" height="32"></picture></a> <!-- review_stack_entry_end --> <!-- recent_review_status_start --> No actionable comments were generated in the recent review. <!-- recent_review_status_end --> <!-- walkthrough_start --> <details> <summary><strong>Walkthrough</strong></summary> <dl> <dd> <br> Ray-query shader layouts now include one unused acceleration-structure descriptor binding. When ray queries are enabled, descriptor pool creation adds capacity for 256 acceleration-structure descriptors. The new binding constant is four times `DescriptorBindingKind::Count`. **Suggested reviewers:** `nmzik`, `senaxx` </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> <!-- change_assessment_commit:"9b91ecc8348eff159732f57a953922e8a95d14f0" --> <!-- change_assessment_priority:{"version":1,"urgency":"p2","manual":false} --> **Change:** Bug fix · **Severity of issue fixed:** Medium <!-- change_assessment_end --> <details> <summary><strong>Merge Risk:</strong> <strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/risk-unassessed-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Minimal</strong> · up to <code>9b91e</code></summary> <dl> <dd> <br> <!-- final_review_risk_start --> <!-- final_review_risk_label **Merge Risk:** **⚪ Minimal** · up to `9b91e` --> <!-- final_review_risk_coverage:{"sourceCommitId":"9b91ecc8348eff159732f57a953922e8a95d14f0","coveredCommitId":"9b91ecc8348eff159732f57a953922e8a95d14f0","kind":"reviewed"} --> This adds an unused acceleration-structure binding to ray-query shader layouts, plus matching descriptor pool capacity, to work around an AMD Windows driver failure. No concrete merge-blocking risk was found. The fix has not been confirmed on AMD Windows hardware by this review, so the reporter's confirmation is still worth waiting for. <!-- 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</strong></summary> <dl> <dd> <br> | Check name | Status | Explanation | | :------------------------ | :--------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Title check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The title names the main change: appending an unused acceleration-structure binding to ray-query layouts. It also references the linked issue number. The changeset matches this description, which cove… | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The description explains the AMD Windows driver failure, the workaround, and the affected code paths. It maps to the changes in the descriptor pool and the shader layout bindings. It also states the t… | | Linked Issues check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | [`#2339`] The requirement is a coding workaround: for shaders with info.ray_query, append one unused acceleration-structure binding (count 1) after the shader's bindings, and add acceleration-structure … | | Out of Scope Changes check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The changed areas are descriptorHeap.cpp (pool size array and acceleration-structure capacity), shaders.cpp (layout binding for info.ray_query), and ShaderIR.h (the UnusedAccelerationStructureBinding … | <details> <summary><strong>Full details: Title check</strong></summary> <dl> <dd> <br> **Explanation** The title names the main change: appending an unused acceleration-structure binding to ray-query layouts. It also references the linked issue number. The changeset matches this description, which covers the layout binding in shaders.cpp, the pool capacity in descriptorHeap.cpp, and the constant in ShaderIR.h. </dd> </dl> </details> <details> <summary><strong>Full details: Description check</strong></summary> <dl> <dd> <br> **Explanation** The description explains the AMD Windows driver failure, the workaround, and the affected code paths. It maps to the changes in the descriptor pool and the shader layout bindings. It also states the test evidence and its limits, so it is clearly related to the changeset. </dd> </dl> </details> <details> <summary><strong>Full details: Linked Issues check</strong></summary> <dl> <dd> <br> **Explanation** [`#2339`] The requirement is a coding workaround: for shaders with info.ray_query, append one unused acceleration-structure binding (count 1) after the shader's bindings, and add acceleration-structure pool capacity for non-push-descriptor layouts. The PR summary states that AddLayoutBindings adds an eAccelerationStructureKHR binding with count 1 when program.info.ray_query is true, using UnusedAccelerationStructureBinding (4 * DescriptorBindingKind::Count). It also states that CreateDescriptorPool adds capacity for 256 acceleration-structure descriptors when ray queries are enabled. Both requirements are covered. The summary does not show the diff for the binding-number ordering, so the claim that 4 * Count lies past all native binding groups is taken from the summary. The PR adds no automated test. The reporter's RayQueryTraversal result on AMD hardware is reported in `#2339` and in the PR description, and the author states that they could not rerun it. No other coding requirement is present in `#2339`. </dd> </dl> </details> <details> <summary><strong>Full details: Out of Scope Changes check</strong></summary> <dl> <dd> <br> **Explanation** The changed areas are descriptorHeap.cpp (pool size array and acceleration-structure capacity), shaders.cpp (layout binding for info.ray_query), and ShaderIR.h (the UnusedAccelerationStructureBinding constant with a comment). Each change serves the workaround that `#2339` requests. No unrelated change appears in the summary. The diff content could not be read in this review, so this verdict relies on the PR summary. </dd> </dl> </details> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- tips_start --> Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=2403)! 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> <br> - [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> <!-- tips_end --> <!-- recent_review_start --> <h6> <details> <summary><strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="12" height="12" align="absmiddle" alt=""></picture> Recent review info</strong></summary> <dl> <dd> <br> <!-- review_info_content --> <details> <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</strong></summary> <dl> <dd> <br> - **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/a90be8dd7304640cf4176a975871d51443710292/.coderabbit.yaml>) - **Commit**: [a90be8d](<https://github.com/KytyPS5/KytyPS5/commit/a90be8dd7304640cf4176a975871d51443710292>) - **Layers**: Repository YAML - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `4d58ec7a-c69a-403a-9389-3edc73c7fd2d` </dd> </dl> </details> <details> <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</strong></summary> <dl> <dd> <br> Reviewing files that changed from the base of the PR and between a90be8dd7304640cf4176a975871d51443710292 and 9b91ecc8348eff159732f57a953922e8a95d14f0. </dd> </dl> </details> <details> <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 3</strong></summary> <dl> <dd> <br> * `src/graphics/host_gpu/renderer/pipeline/descriptorHeap.cpp` * `src/graphics/host_gpu/renderer/pipeline/shaders.cpp` * `src/graphics/shader/recompiler/ir/ShaderIR.h` </dd> </dl> </details> **Included review availability:** This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. </dd> </dl> </details> </h6> <!-- recent_review_end -->
Author
Owner

@⁠mitsa-ng on GitHub · 2026-11-19 09:08 UTC · original

CI evidence: this exact branch is green on all three platforms on my fork (same workflow): run 44490160632 — Windows, Linux, macOS all success.

**@⁠mitsa-ng** on GitHub · 2026-11-19 09:08 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2403#issuecomment-7004690484) CI evidence: this exact branch is green on all three platforms on my fork (same workflow): [run 44490160632](https://github.com/mitsa-ng/KytyPS5/actions/runs/44490160632) — Windows, Linux, macOS all success.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.