microsoft/hlsl-specs

[Wave Size Range] Should constant values be allowed?

pow2clk opened this issue · 2 comments

Which proposal does this relate to?
https://github.com/microsoft/hlsl-specs/blob/main/proposals/0014-wave-size-range.md

Describe the issue or outstanding question.
Do the parameters to WaveSize really need to be literals or could they be compile-time constant expressions?

Is there any reason not to support something like:

static const int Val = 2;
[WaveSize(Val, Val * 4, Val * 2)]

We have some bugs in DXC that relate to evaluation of constant expressions, but we could certainly support this use case in Clang.

Additional context
#149 (comment)

Related: microsoft/DirectXShaderCompiler#2188

IMO, if we consider the above to be a bug, we should write our spec to treat it as a bug that DXC can't support these cases.

In group discussion, we decided to formally allow any compile-time constant values for any parameter of WaveSize. This includes the legacy 6.6 version. As Chris pointed out, due to the above-mentioned bug, these compile time constants can't actually be used for such until it is resolved, but as far as the spec is concerned, any compile-time constant value that the language supports is acceptable.