Skip to content

[EPIC]: Improve inline raytracing test coverage #1258

Description

@MarijnS95

This issue tracks expanding the inline raytracing (RayQuery) test suite. The bring-up PRs introduce a baseline of three scenarios under test/Feature/InlineRT/ — a single-triangle hit, an indexed triangle hit, and instance selection via translated transforms. The list below walks the HLSL inline-RT spec surface — limited to behavior observable from a shader, since that is what this suite tests — and notes what becomes testable after those PRs land versus what still needs further framework / YAML work.

Bring-up PRs (foundation for everything below)

Legend:

  • Not started
  • In progress 🏗️
  • In review 👀
  • Finished (merged in main)
  • 👍 testable on top of the bring-up PRs above
  • 🏗️ requires additional backend or YAML work first

RayQuery API surface (cs_6_5)

TraceRayInline parameters

Template <RayFlags> (compile-time)

  • RAY_FLAG_FORCE_OPAQUE (skips any-hit / non-opaque candidate path) — 👍
  • RAY_FLAG_FORCE_NON_OPAQUE (forces candidate path even for opaque geom) — 👍
  • RAY_FLAG_ACCEPT_FIRST_HIT_AND_END_SEARCH — verify single Proceed() iteration stops on first hit — 👍
  • RAY_FLAG_CULL_BACK_FACING_TRIANGLES — 👍
  • RAY_FLAG_CULL_FRONT_FACING_TRIANGLES — 👍
  • RAY_FLAG_CULL_OPAQUE — 👍
  • RAY_FLAG_CULL_NON_OPAQUE — 👍
  • RAY_FLAG_SKIP_TRIANGLES (mixed BLAS, triangles skipped, AABBs hit) — 👍 (procedural path wired in Wire AABB/procedural geometry through the Pipeline-level AS builder #1289)
  • RAY_FLAG_SKIP_PROCEDURAL_PRIMITIVES — 👍 (procedural path wired in Wire AABB/procedural geometry through the Pipeline-level AS builder #1289)
  • Combined flags (e.g. CULL_BACK_FACING | ACCEPT_FIRST_HIT_AND_END_SEARCH) — 👍

Candidate-path methods (inside Proceed() loop)

  • CandidateType()CANDIDATE_NON_OPAQUE_TRIANGLE vs CANDIDATE_PROCEDURAL_PRIMITIVE — 🏗️ (non-opaque + procedural)
  • CandidateProceduralPrimitiveNonOpaque() — 🏗️
  • CandidateTriangleRayT() — 👍 (needs non-opaque geometry)
  • CandidateInstanceIndex() / CandidateInstanceID() — 👍
  • CandidateInstanceContributionToHitGroupIndex() — 👍 (YAML field added in Add InstanceContributionToHitGroupIndex YAML field and shader query #1286)
  • CandidateGeometryIndex() (multi-geometry BLAS) — 🏗️ (YAML: multi-geom)
  • CandidatePrimitiveIndex() — 👍
  • CandidateObjectRayOrigin() / CandidateObjectRayDirection() — 👍
  • CandidateObjectToWorld3x4() / CandidateObjectToWorld4x3() — 👍
  • CandidateWorldToObject3x4() / CandidateWorldToObject4x3() — 👍
  • CandidateTriangleFrontFace() — 👍
  • CandidateTriangleBarycentrics() (verify u/v at known points) — 👍
  • CommitNonOpaqueTriangleHit() accept/reject patterns — 👍
  • CommitProceduralPrimitiveHit(t) accept/reject — 🏗️

Committed-hit methods

Ray-side methods

BLAS geometry coverage (shader-visible facets)

TLAS instance coverage (shader-visible facets)

Shader control flow

  • Divergent rays per thread (1D dispatch, per-thread direction) 👀
  • RayQuery as a function parameter (inout) — 👍
  • RayQuery as a struct member — 👍
  • Nested RayQuery (second trace inside a Proceed() loop) — 🏗️ (non-opaque)
  • Two independent RayQuery objects with different template flags in the same shader — 👍
  • Conditional TraceRayInline (skip on lane mask) — 👍
  • Loop-driven Proceed() with explicit while (Q.Proceed()) instead of single-shot — 👍
  • Re-using one RayQuery for sequential rays without dynamic state leak — 👍
  • Storing committed-hit results in groupshared and reading from another lane — 👍

Numerical / vendor edge behavior (shader-observable)

  • Ray exactly hitting a vertex / edge — 👍
  • TMin == hit distance (boundary inclusive vs exclusive) — 👍
  • TMax == hit distance (boundary inclusive vs exclusive) — 👍
  • NaN / Inf in ray origin or direction — must miss safely — 👍
  • Very large scene scales (numerical precision) — 👍
  • Very thin/sliver triangles — 👍
  • Backface culling consistency between DX/VK/MTL (combined with *TriangleFrontFace and CULL_* ray flags) — 👍

Stages other than compute

Inline RT is allowed in every shader stage from SM 6.5 onward. Adding coverage needs the AS-binding plumbing on those pipelines, but the framework already supports each stage individually.

  • RayQuery from a pixel shader — 🏗️ (PS-side AS binding)
  • RayQuery from a vertex shader — 🏗️
  • RayQuery from a mesh shader — 🏗️
  • RayQuery from a hull / domain / geometry shader — 🏗️

Framework / YAML follow-ups

Listed inline above where they block tests; aggregated here for the framework worklist. Limited to gaps that block a shader-visible test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions