Skip to content

Declare motion blur and position fetch capabilities for hit object ops - #4503

Merged
arcady-lunarg merged 1 commit into
KhronosGroup:mainfrom
dgkoch:dk/ser-motion-position-fetch-caps
Oct 28, 2026
Merged

arcady-lunarg merged 1 commit into
KhronosGroup:mainfrom
dgkoch:dk/ser-motion-position-fetch-caps

Conversation

@dgkoch

@dgkoch dgkoch commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

The shader invocation reorder motion instructions (OpHitObjectTraceRayMotion{NV,EXT},
OpHitObjectRecordHitMotionNV, OpHitObjectRecordHitWithIndexMotionNV,
OpHitObjectRecordMissMotion{NV,EXT}, OpHitObjectTraceMotionReorderExecuteEXT) and
OpHitObjectGetCurrentTime{NV,EXT} require the RayTracingMotionBlurNV capability, and
OpHitObjectGetIntersectionTriangleVertexPositionsEXT requires RayTracingPositionFetchKHR
(KhronosGroup/SPIRV-Registry#462, clarified in KhronosGroup/SPIRV-Registry#463).
glslang only declared the shader invocation reorder capability for them.

This change declares the extra capability and its SPIR-V extension when emitting these
instructions, the same way OpTraceRayMotionNV is already handled. It updates the
affected spv.{ext,nv}.hitobject-allops results, and adds tests for the current time
and triangle vertex position queries, which weren't covered before.

KhronosGroup/SPIRV-Tools#7007 adds spirv-val checks for these requirements. Without
this change, the hitobject-allops tests fail validation against it, which is why that
PR's shaderc smoketest currently fails.

Possible follow-up (not in this PR): the GLSL extension specs are loose here.
GLSL_EXT_shader_invocation_reorder and GLSL_NV_shader_invocation_reorder say the motion
functions are allowed only when GLSL_NV_ray_tracing_motion_blur is "present"/"supported",
hitObjectGetCurrentTime{EXT,NV} has no such requirement, and
hitObjectGetIntersectionTriangleVertexPositionsEXT doesn't mention
GLSL_EXT_ray_tracing_position_fetch. glslang currently gates all of these only on the
shader invocation reorder GLSL extension. With this change the generated SPIR-V is
correct either way. Whether the front end should also require the motion blur or
position fetch GLSL extension depends on a GLSL spec clarification.

▎ GenAI disclosure: Draft assisted by Claude (claude-opus-5-5, Anthropic, commercial SaaS — Claude Code CLI).

🤖 Generated with Claude Code

The shader invocation reorder motion instructions and
OpHitObjectGetCurrentTime{NV,EXT} require the RayTracingMotionBlurNV
capability, and OpHitObjectGetIntersectionTriangleVertexPositionsEXT
requires the RayTracingPositionFetchKHR capability, but only the shader
invocation reorder capability was declared for them.

Declare the extra capability and its extension when emitting these
instructions, update the affected hitobject-allops results, and add tests
for the current time and vertex position queries, which were not
previously covered.

See KhronosGroup/SPIRV-Registry#462.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@arcady-lunarg
arcady-lunarg merged commit b71e347 into KhronosGroup:main Oct 28, 2026
34 checks passed
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.

2 participants