Cover ClosestHit ray system values: barycentrics, PrimitiveIndex, WorldRay#1278
Merged
EmilioLaiso merged 1 commit intoJun 26, 2026
Merged
Conversation
This was referenced Jun 3, 2026
81848cb to
dd817cc
Compare
7 tasks
dd817cc to
be000eb
Compare
be000eb to
382b5ca
Compare
…ldRay Three small PSO RT tests stacked on llvm#1275, each isolating one shader- observable closest-hit system value from llvm#1268's 👍 list. Same shape as the prior batch in llvm#1277 — one .test file per behavior, single-purpose shader, exact buffer comparison. - `closest-hit-barycentrics.test` — 3-lane dispatch, each lane fires at a clearly-interior point of the single triangle so the closest- hit shader reports a known `BuiltInTriangleIntersectionAttributes ::barycentrics` (u, v). Points are picked from the inside of the triangle to avoid the watertight-traversal edge-rule lottery you hit at edge midpoints / vertices (the first cut of this test used midpoint(v0, v1) and one lane silently missed on both backends). - `closest-hit-primitive-index.test` — three triangles tiled at x = -3, 0, +3 in a single BLAS. 3-lane dispatch fires straight down at each triangle's centroid; the closest-hit reports `PrimitiveIndex()` and must match the lane index 0..2. - `closest-hit-world-ray.test` — 2-lane dispatch with rays from different z heights (1.0 and 2.0). Closest-hit packs `WorldRayOrigin().z`, `WorldRayDirection().z`, and `RayTCurrent()` through the payload; raygen flattens the float3 into a 6-element Float32 buffer. Verifies the system values match the raygen-side `RayDesc` and that t is correctly computed by the traversal. All three are `# REQUIRES: raytracing-pipeline` with `# XFAIL: Clang` — `clang-dxc` doesn't yet lower `[shader(…)]` entry points. With the Metal RT bring-up rebased on top, all three pass natively on Apple Silicon and Metal is dropped from the XFAIL list. Locally verified end-to-end on the user's Linux box: all three pass on Vulkan via the native offloader, and on D3D12 via Wine + vkd3d-proton + the cross-compiled `offloader.exe`, against an NVIDIA RTX 3060. And on macOS 15 / metal-irconverter 3.1.1 via the native offloader: all three PASS. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
382b5ca to
046c7c3
Compare
EmilioLaiso
approved these changes
Jun 26, 2026
manon-traverse
approved these changes
Jun 26, 2026
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 #1281
Summary
Three small PSO raytracing tests stacked on #1275, each isolating one shader-observable closest-hit system value from #1268's 👍 list. Same shape as the prior batch in #1277 — one
.testfile per behavior, single-purpose shader, exact buffer comparison.closest-hit-barycentrics.test— 3-lane dispatch, each lane fires at a clearly-interior point of the single triangle so the closest-hit shader reports a knownBuiltInTriangleIntersectionAttributes::barycentrics(u, v). Points are picked from the inside of the triangle to avoid the watertight-traversal edge-rule lottery you hit at edge midpoints / vertices (the first cut of this test usedmidpoint(v0, v1)and one lane silently missed on both backends).closest-hit-primitive-index.test— three triangles tiled at x = -3, 0, +3 in a single BLAS. 3-lane dispatch fires straight down at each triangle's centroid; the closest-hit reportsPrimitiveIndex()and must match the lane index 0..2.closest-hit-world-ray.test— 2-lane dispatch with rays from different z heights (1.0 and 2.0). Closest-hit packsWorldRayOrigin().z,WorldRayDirection().z, andRayTCurrent()through the payload; raygen flattens the float3 into a 6-element Float32 buffer. Verifies the system values match the raygen-sideRayDescand that t is correctly computed by the traversal.All three are
# REQUIRES: raytracing-pipelinewith# XFAIL: Clang—clang-dxcdoesn't yet lower[shader("…")]entry points. With the Metal RT bring-up in #1281 rebased underneath this branch, all three pass natively on Apple Silicon andMetalis dropped from the XFAIL list.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)