microsoft / microsoft/DirectXShaderCompiler

[Feature Request] [SPIRV] Support `SPV_EXT_shader_invocation_reorder`

Open
#8,226 7 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C++
Stars
3.7k
Forks
900
Avg merge
2d 11h
Merged PRs (30d)
44

Description

Is your feature request related to a problem? Please describe.

https://github.com/microsoft/DirectXShaderCompiler/issues/6994 for the older SPV_NV_shader_invocation_reorder was previously closed as blocking on https://github.com/microsoft/hlsl-specs/pull/277 to add a SER proposal to HLSL first. Now that that's in, and the SPIR-V extension was promoted to EXT, would it be possible to target SPV_EXT_shader_invocation_reorder in SPIR-V?

Describe the solution you'd like
When dx::HitObject is used in code that is compiled to SPIR-V with dxc -spirv, the SPV_EXT_shader_invocation_reorder extension is used.

Describe alternatives you've considered
The Vulkan VK_NV_ray_tracing_invocation_reorder extension mentions how to use SPIR-V intrinsics to achieve this, which should trivially translate to SPV_EXT_shader_invocation_reorder even if a manual conditional implementation needs to be added next to existing dx::HitObject usage.

Additional context
Add any other context or screenshots about the feature request here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how dx::HitObject is lowered when dxc -spirv is used, then compare that path with the Vulkan HLSL mapping and the SPV_EXT_shader_invocation_reorder specification linked in the issue. Done means code using dx::HitObject emits the EXT extension rather than relying on the older NV behavior, with compiler coverage for the generated SPIR-V.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.