microsoft / microsoft/DirectXShaderCompiler

[DXIL] Decorating CS float argument with SV_DispatchThreadID semantic crashes the compiler (float2, float3 and float4 works)

Open
#3,444 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug diagnostic tech-debt
Dominant language
C++
Stars
3.7k
Forks
900
Avg merge
2d 11h
Merged PRs (30d)
44

Description

Title

[DXIL] Decorating CS float argument with SV_DispatchThreadID semantic crashes the compiler (float2, float3 and float4 works)

Functional impact

Compiler crashes

Minimal repro steps
  1. Compile the following shader with dxc.exe -T cs_6_0 -E CSMain issue_shader.txt:
RWStructuredBuffer<float4> rwTexture;

[numthreads(1, 1, 1)]
void CSMain(float id : SV_DispatchThreadID)
{
	rwTexture[3] = id.xxxx;
}
Expected result

Shader compiles correctly, as it does for vector float arguments: float2, float3, float4

Actual result

Compiler crashes

Further technical details

Ran test on shader playground with DXC from 2020 12 16
The SPIR-V backend produces validation errors (reported here https://github.com/microsoft/DirectXShaderCompiler/issues/3443 )

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 reproducing the crash with dxc.exe using the inline issue_shader.txt shader and compare the scalar float argument with the working float2, float3, and float4 cases. Trace the compiler path for the SV_DispatchThreadID semantic and verify that the shader compiles without crashing, while checking the noted SPIR-V backend validation behavior separately.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.