microsoft / microsoft/DirectXShaderCompiler
[DXIL] Decorating CS float argument with SV_DispatchThreadID semantic crashes the compiler (float2, float3 and float4 works)
Nobody has claimed this yet.
- 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
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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