probe.cpp maps the RTAS heap to binding 7, but vkback's set 0 declares bindings 0-6 only #71

Closed
opened 2026-12-01 10:35:40 +00:00 by github-bot · 2 comments
Owner

@⁠NotBalkanus on GitHub · 2026-12-01 10:35 UTC · original

Found while preparing the "Descriptor heap as one array" work (issue #57), on current main.

greenfield/vkback/tools/probe.cpp:18 declares the descriptor-heap bindings as B_RTAS = 7 and maps heap ray-tracing acceleration structures to it (DXIL_SPV_VULKAN_DESCRIPTOR_TYPE_IDENTITY, line 79). vkback's set-0 layout has bindings 0-6 only (layout::desc_counts is [u32; 7]), so a shader that indexes the RTAS heap references a binding the pipeline layout never declares.

Structure views are deliberately not bound (bufview.rs:49-69 nulls them), and no store shader apparently reaches it today - but the declaration mismatch is the kind of silent thing rule 29 is for: the translator's binding table and the runtime's layout disagree by one binding. It also directly matters for the one-array change (probe of issue #57), which rewrites that table.

Options: map heap RTAS to binding 0 with the rest (it is a slot like any other and vkback writes nulls for it), or make dxil-probe fail loudly when a heap RTAS handle appears, if no shader can.

**@⁠NotBalkanus** on GitHub · 2026-12-01 10:35 UTC · [original](https://github.com/vktory6/VKtory/issues/71) Found while preparing the "Descriptor heap as one array" work (issue #57), on current main. `greenfield/vkback/tools/probe.cpp:18` declares the descriptor-heap bindings as `B_RTAS = 7` and maps heap ray-tracing acceleration structures to it (`DXIL_SPV_VULKAN_DESCRIPTOR_TYPE_IDENTITY`, line 79). vkback's set-0 layout has bindings 0-6 only (`layout::desc_counts` is `[u32; 7]`), so a shader that indexes the RTAS heap references a binding the pipeline layout never declares. Structure views are deliberately not bound (bufview.rs:49-69 nulls them), and no store shader apparently reaches it today - but the declaration mismatch is the kind of silent thing rule 29 is for: the translator's binding table and the runtime's layout disagree by one binding. It also directly matters for the one-array change (probe of issue #57), which rewrites that table. Options: map heap RTAS to binding 0 with the rest (it is a slot like any other and vkback writes nulls for it), or make dxil-probe fail loudly when a heap RTAS handle appears, if no shader can.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 10:35:40 +00:00
Author
Owner

@⁠vktory6 on GitHub · 2026-12-01 10:42 UTC · original

Thanks, confirmed on main: B_RTAS = 7 in probe.cpp against a layout with bindings 0-6. I created a task based on your report (github.com/vktory6/VKtory@6a718f8). Of your two options I chose the loud one. The title's ray tracing walks its own BVH as buffers, so a heap acceleration-structure handle shouldn't be possible; dxil-probe should fail on one (rule 32), and B_RTAS goes away. Mapping it to binding 0 would quietly accept a case we don't expect. If the one-array port lands first, this folds into it.

**@⁠vktory6** on GitHub · 2026-12-01 10:42 UTC · [original](https://github.com/vktory6/VKtory/issues/71#issuecomment-7308586139) Thanks, confirmed on main: `B_RTAS = 7` in `probe.cpp` against a layout with bindings 0-6. I created a task based on your report (https://github.com/vktory6/VKtory/commit/6a718f8). Of your two options I chose the loud one. The title's ray tracing walks its own BVH as buffers, so a heap acceleration-structure handle shouldn't be possible; dxil-probe should fail on one (rule 32), and `B_RTAS` goes away. Mapping it to binding 0 would quietly accept a case we don't expect. If the one-array port lands first, this folds into it.
Author
Owner

@⁠vktory6 on GitHub · 2026-12-01 11:09 UTC · original

Fixed by #73 (github.com/vktory6/VKtory@5ac232a): dxil-probe now fails loudly on a heap acceleration-structure handle, and B_RTAS is gone, so the remapper's table matches the layout. The task is done (github.com/vktory6/VKtory@445a596). Closing, thanks for spotting it!

**@⁠vktory6** on GitHub · 2026-12-01 11:09 UTC · [original](https://github.com/vktory6/VKtory/issues/71#issuecomment-7309243908) Fixed by #73 (https://github.com/vktory6/VKtory/commit/5ac232a): dxil-probe now fails loudly on a heap acceleration-structure handle, and `B_RTAS` is gone, so the remapper's table matches the layout. The task is done (https://github.com/vktory6/VKtory/commit/445a596). Closing, thanks for spotting it!
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/vktory6--VKtory#71
No description provided.