Skip to content

spirv-val: Require motion blur and position fetch capabilities for SER - #7007

Open
dgkoch wants to merge 1 commit into
KhronosGroup:mainfrom
dgkoch:dk/462-ser-capability-validation
Open

dgkoch wants to merge 1 commit into
KhronosGroup:mainfrom
dgkoch:dk/462-ser-capability-validation

Conversation

@dgkoch

@dgkoch dgkoch commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Enforces the requirements clarified in KhronosGroup/SPIRV-Registry#463
(KhronosGroup/SPIRV-Registry#462):

  • The SER motion instructions and OpHitObjectGetCurrentTime{NV,EXT} require
    the RayTracingMotionBlurNV capability.
  • OpHitObjectGetIntersectionTriangleVertexPositionsEXT requires the
    RayTracingPositionFetchKHR capability.

These were never enforced. The grammar listed some of them as additional
enabling capabilities, but any one enabling capability is sufficient, and
the hit object type already requires the shader invocation reorder
capability.

The check is done up front in the NV and EXT reorder passes, in the same
style as the existing OpHitObjectRecordFromQueryEXT / RayQueryKHR check.
OpHitObjectRecordHitMotionNV, OpHitObjectRecordHitWithIndexMotionNV and
OpHitObjectRecordMissMotionNV weren't otherwise handled in the NV pass.

Tests: the existing tests that use these instructions now declare the
required capability and also check the new error when it's missing. A test
for OpHitObjectGetCurrentTimeNV is added.

This doesn't depend on the SPIRV-Headers change
(KhronosGroup/SPIRV-Headers#643). test_val_rstuvw passes against the
currently pinned headers, and all validator test suites pass against the
updated grammar.

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

🤖 Generated with Claude Code

The SER motion instructions and the hit object current time and
triangle vertex position queries also require the RayTracingMotionBlurNV
or RayTracingPositionFetchKHR capability. Listing those as additional
enabling capabilities in the grammar did not enforce this, because any
one enabling capability is sufficient and every hit object instruction
already requires the shader invocation reorder capability.

Check the extra capability explicitly, as is already done for
OpHitObjectRecordFromQueryEXT and RayQueryKHR, and update the tests to
declare the capabilities and cover the error.

See KhronosGroup/SPIRV-Registry#462.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dgkoch

dgkoch commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

The CI-shaderc-smoketest failure is a glslang bug that this check exposes: glslang doesn't declare RayTracingMotionBlurNV / RayTracingPositionFetchKHR for these hit object instructions, so its spv.{ext,nv}.hitobject-allops tests fail the new validation. Fix: KhronosGroup/glslang#4503 (all glslang tests pass against this PR with it). This PR should wait until that lands.

CI-dxc-smoketest is also failing on main and other recent PRs, so it's unrelated.

▎ AI-assisted comment drafting: Claude claude-opus-5-5 (Anthropic, commercial SaaS)

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.

1 participant