Wire AABB/procedural geometry through the Pipeline-level AS builder#1289
Open
MarijnS95 wants to merge 1 commit into
Open
Wire AABB/procedural geometry through the Pipeline-level AS builder#1289MarijnS95 wants to merge 1 commit into
MarijnS95 wants to merge 1 commit into
Conversation
ab718cf to
98956e7
Compare
1347eb9 to
a3c3822
Compare
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>
a3c3822 to
1a860dd
Compare
| if (!BD.Triangles.empty() && !BD.AABBs.empty()) | ||
| return llvm::createStringError( | ||
| std::errc::invalid_argument, | ||
| "BLAS '%s' mixes triangle and AABB geometry; pick one.", |
Contributor
There was a problem hiding this comment.
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(); |
Contributor
There was a problem hiding this comment.
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.
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
Routes
BLASDesc.AABBsthrough the Pipeline → API conversion inbuildPipelineAccelerationStructures, picking the appropriateBLASBuildRequestvariant (SmallVector<AABBGeometryDesc>orSmallVector<TriangleGeometryDesc>inGeometry) 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 callsCommitProceduralPrimitiveHit();CommittedStatus()must returnCOMMITTED_PROCEDURAL_PRIMITIVE_HIT.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)