llvm / llvm/llvm-project

[HLSL][SPIRV] WaveSize attribute doesn't work for SPIRV

Open
#187,188 0 comments 0 reactions 0 assignees View on GitHub
clang:HLSL:SPIRV HLSL
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

https://godbolt.org/z/PqPxh6z9T

When using the WaveSize attribute with clang-dxc and `-spirv` an unhelpful error message is shown:

```
> type t.hlsl
[WaveSize(32)]
[numthreads(1, 1, 1)]
void main() {
}
> ./clang-dxc -spirv -T cs_6_8 t.hlsl
t.hlsl:1:2: error: attribute 'WaveSize' requires shader model 6.6 or greater
1 | [WaveSize(32)]
| ^
1 error generated.
```

Note that DXC says: ":1:2: warning: Wave size is not supported by Vulkan SPIR-V. Consider using VK_EXT_subgroup_size_control."

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the linked Godbolt example and the shown clang-dxc -spirv -T cs_6_8 command using t.hlsl. Compare the diagnostic with DXC's warning about Vulkan SPIR-V and trace the WaveSize attribute handling; done means SPIR-V reports the limitation clearly instead of the misleading shader-model error.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.