Skip to content

pipeline-when-inline-better

Status: stub. The full-length analysis is queued for a v1.0.x patch release per ADR 0018, section 5, criterion #6. The companion rule page at docs/rules/pipeline-when-inline-better.md contains the canonical detection logic + GPU reasoning.

TL;DR

DXR exposes two traversal styles. Pipeline ray tracing uses TraceRay and a state-object full of hit-group and miss shaders; the runtime's scheduler dispatches the right shader through the shader-binding-table indirection on every hit, and SER (SM 6.9) layers on top to coalesce the divergent dispatches. Inline ray tracing uses RayQuery and runs the traversal as a method call inside the caller — no shader table, no hit-group dispatch, no payload spill across the trace. Both NVIDIA Ada Lovelace and AMD RDNA 3 expose the same RT-core hardware to both modes; the difference is entirely in the surrounding scheduling.

What the rule fires on

A full DXR pipeline-TraceRay call from a stage that would do better with an inline RayQuery. The rule fires on TraceRay invocations whose payload is empty or single-scalar, whose MissShaderIndex and RayContributionToHitGroupIndex resolve to "shadow-ray" hit groups (any-hit / closest-hit shaders that only set a single bool), and whose call-site stage already runs in compute or pixel — both stages where a RayQuery<RAY_FLAG_*> inline traversal pays no shader-table indirection. The companion rule inline-rayquery-when-pipeline-better detects the opposite direction.

See the What it detects section of the rule page for the full pattern definition.

Why it matters

The full GPU-mechanism analysis lives in the Why it matters on a GPU section of the companion rule page.

Examples

The bad / good code snippets are kept canonical on the rule page; see pipeline-when-inline-better.md -> Examples.

See also


This is a v1.0-ship stub. Full analysis pending; track issue link TBD.

© 2026 NelCit — Apache-2.0 (code), CC-BY-4.0 (docs).