Add InstanceContributionToHitGroupIndex YAML field and shader query#1286
Merged
EmilioLaiso merged 1 commit intoJun 15, 2026
Merged
Conversation
This was referenced Jun 4, 2026
b7fb53e to
852802f
Compare
Adds a 24-bit per-instance InstanceContributionToHitGroupIndex slot on AccelerationStructureInstance / InstanceDesc, plumbed through DX (D3D12_RAYTRACING_INSTANCE_DESC), VK (instanceShaderBindingTableRecord- Offset), and the Metal IR converter's addressOfInstanceContributions sidecar. The covering test verifies CommittedInstanceContributionToHit- GroupIndex() returns the per-instance value across distinct instances, including the top-of-range 0xFFFFFF. Part of the inline-RT test coverage epic (llvm#1258). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
852802f to
9d292c0
Compare
manon-traverse
approved these changes
Jun 12, 2026
EmilioLaiso
approved these changes
Jun 15, 2026
EmilioLaiso
pushed a commit
that referenced
this pull request
Jun 24, 2026
Depends on #1245, #1286 ## Summary Introduces `AccelerationStructureInstanceFlags` with bit values that intentionally match `D3D12_RAYTRACING_INSTANCE_FLAGS`, `VkGeometryInstanceFlagBitsKHR`, and `MTLAccelerationStructureInstanceOptions` so the value passes straight through each backend's instance fill with a single `static_cast`. YAML exposes the field as a bitset list (e.g. `InstanceFlags: [TriangleCullDisable, ForceOpaque]`). The covering test (`Feature/InlineRT/instance-flags.test`) sets `TriangleFrontCounterclockwise` on one of two instances of the same single-triangle BLAS and verifies `CommittedTriangleFrontFace()` flips — same world-space ray, same vertices, only the per-instance flag changes. Part of the inline-RT test coverage epic (#1258). ## Test plan Local on an NVIDIA RTX 3060: - [x] Linux Vulkan (native `offloader`) - [ ] Linux D3D12 (Wine + vkd3d-proton + cross-compiled `offloader.exe`) - [ ] Windows Vulkan (native `offloader.exe`) - [ ] Windows D3D12 (native `offloader.exe`) CI (RT-capable runners): - [x] windows-nvidia D3D12 (`RaytracingTier 1.2`) - [ ] windows-intel VK (`VK_KHR_ray_tracing_pipeline`) - [x] macOS Metal (`supportsRaytracing`) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #1245
Summary
Adds a 24-bit per-instance
InstanceContributionToHitGroupIndexslot onAccelerationStructureInstance/InstanceDesc, plumbed through:D3D12_RAYTRACING_INSTANCE_DESC.InstanceContributionToHitGroupIndexinstanceShaderBindingTableRecordOffsetaddressOfInstanceContributionssidecar (the existing stub buffer insetupDispatchis now filled from per-instance values instead of being hardcoded to zeros —intersectionFunctionTableOffsetis left at zero because the IRC bypasses it for inline RT)The covering test (
Feature/InlineRT/instance-contribution.test) verifiesCommittedInstanceContributionToHitGroupIndex()returns the per-instance value across three distinct instances, including the top-of-range0xFFFFFF.Part of the inline-RT test coverage epic (#1258).
Test plan
Local on an NVIDIA RTX 3060:
offloader)offloader.exe)offloader.exe)offloader.exe)CI (RT-capable runners):
RaytracingTier 1.2)VK_KHR_ray_tracing_pipeline)supportsRaytracing)