Skip to content

Wire AABB/procedural geometry through the Pipeline-level AS builder#1289

Open
MarijnS95 wants to merge 1 commit into
llvm:mainfrom
Traverse-Research:inlinert-aabb-procedural
Open

Wire AABB/procedural geometry through the Pipeline-level AS builder#1289
MarijnS95 wants to merge 1 commit into
llvm:mainfrom
Traverse-Research:inlinert-aabb-procedural

Conversation

@MarijnS95

@MarijnS95 MarijnS95 commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Depends on #1245

Summary

Routes BLASDesc.AABBs through the Pipeline → API conversion in buildPipelineAccelerationStructures, picking the appropriate BLASBuildRequest variant (SmallVector<AABBGeometryDesc> or SmallVector<TriangleGeometryDesc> in Geometry) based on which geometry list is populated (mixed and empty cases now error explicitly). The DX/VK/MTL AABB build paths were already in place from the bring-up; this PR just hooks them up to YAML.

The covering test (Feature/InlineRT/aabb-procedural.test) defines a single AABB, fires a ray through it, and in the candidate loop calls CommitProceduralPrimitiveHit(); CommittedStatus() must return COMMITTED_PROCEDURAL_PRIMITIVE_HIT.

Part of the inline-RT test coverage epic (#1258).

Test plan

Local on an NVIDIA RTX 3060:

  • 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):

  • windows-nvidia D3D12 (RaytracingTier 1.2)
  • windows-intel VK (VK_KHR_ray_tracing_pipeline)
  • macOS Metal (supportsRaytracing)

@MarijnS95 MarijnS95 force-pushed the inlinert-aabb-procedural branch from ab718cf to 98956e7 Compare June 4, 2026 15:44
@MarijnS95 MarijnS95 marked this pull request as draft June 4, 2026 16:11
@MarijnS95 MarijnS95 force-pushed the inlinert-aabb-procedural branch 2 times, most recently from 1347eb9 to a3c3822 Compare June 11, 2026 13:49
Routes BLASDesc.AABBs through the Pipeline → API conversion in
buildPipelineAccelerationStructures, picking createAABBBLAS-
BuildRequest vs createTriangleBLASBuildRequest based on which geometry
list is populated (mixed and empty cases now error explicitly). The
DX/VK/MTL AABB build paths were already in place. The covering test
defines a single AABB, fires a ray through it, and in the candidate
loop calls CommitProceduralPrimitiveHit(); CommittedStatus() must
return COMMITTED_PROCEDURAL_PRIMITIVE_HIT.

Part of the inline-RT test coverage epic
(llvm#1258).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@MarijnS95 MarijnS95 marked this pull request as ready for review June 11, 2026 16:57
@MarijnS95 MarijnS95 force-pushed the inlinert-aabb-procedural branch from a3c3822 to 1a860dd Compare June 11, 2026 16:57
Comment thread lib/API/Device.cpp
if (!BD.Triangles.empty() && !BD.AABBs.empty())
return llvm::createStringError(
std::errc::invalid_argument,
"BLAS '%s' mixes triangle and AABB geometry; pick one.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"BLAS '%s' mixes triangle and AABB geometry; pick one.",
"BLAS '%s' mixes triangle and AABB geometry; must be either not both.",

Comment on lines +19 to +23
while (Q.Proceed()) {
if (Q.CandidateType() == CANDIDATE_PROCEDURAL_PRIMITIVE)
Q.CommitProceduralPrimitiveHit(1.5);
}
Output[0] = (uint)Q.CommittedStatus();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not quite sure about this one.
The RT API doesn't require the ray to actually hit the AABB to register it as a hit (due to AABB quantization).
I suppose for this specific example it's fine since we only need a ray to hit the box, but it might be better if we have multiple rays where some hit and some miss so that the AABB data is uploaded as expected.
This means we will also need to do a manual AABB test after we register an intersection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants