shader: append an unused acceleration-structure binding to ray-query layouts (#2339) #2403
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!2403
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2403/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@mitsa-ng on GitHub · 2026-11-19 01:35 UTC · original
ray-query-as-binding→main· +22 −2 · 3 files · 1 commits · closed without mergingFixes #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 noVK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHRbinding, withVK_ERROR_UNKNOWNfromvkCreateComputePipelines. 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
RayQueryTraversaltest 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.
@coderabbitai[bot] on GitHub · 2026-11-19 01:40 UTC · original
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,senaxxChange: Bug fix · Severity of issue fixed: Medium
Merge Risk:
Minimal · up to
9b91eThis 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:
4
#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 …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#2339and 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
#2339requests. 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
4d58ec7a-c69a-403a-9389-3edc73c7fd2dReviewing files that changed from the base of the PR and between
a90be8dd73and9b91ecc834.src/graphics/host_gpu/renderer/pipeline/descriptorHeap.cppsrc/graphics/host_gpu/renderer/pipeline/shaders.cppsrc/graphics/shader/recompiler/ir/ShaderIR.hIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
@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.
Pull request closed