llvm-project/clang/test/SemaHLSL/WaveSize-sm6.6-6.5.hlsl
Xiang Li e41579a31f
[HLSL] AST support for WaveSize attribute. (#101240)
First step for support WaveSize attribute in
 https://microsoft.github.io/DirectX-Specs/d3d/HLSL_SM_6_6_WaveSize.html
and
https://microsoft.github.io/hlsl-specs/proposals/0013-wave-size-range.html

A new attribute HLSLWaveSizeAttr was supported in the AST.

Implement both the wave size and the wave size range, rather than
separately which might require more work.

For #70118
2024-08-31 11:23:34 -04:00

25 lines
931 B
HLSL

// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-library -x hlsl %s -verify
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.5-library -x hlsl %s -verify
[shader("compute")]
[numthreads(1,1,1)]
#if __SHADER_TARGET_MAJOR == 6 && __SHADER_TARGET_MINOR == 6
// expected-error@+4 {{attribute 'WaveSize' with 3 arguments requires shader model 6.8 or greater}}
#elif __SHADER_TARGET_MAJOR == 6 && __SHADER_TARGET_MINOR == 5
// expected-error@+2 {{attribute 'WaveSize' requires shader model 6.6 or greater}}
#endif
[WaveSize(4, 16, 8)]
void e0() {
}
[shader("compute")]
[numthreads(1,1,1)]
#if __SHADER_TARGET_MAJOR == 6 && __SHADER_TARGET_MINOR == 6
// expected-error@+4 {{attribute 'WaveSize' with 2 arguments requires shader model 6.8 or greater}}
#elif __SHADER_TARGET_MAJOR == 6 && __SHADER_TARGET_MINOR == 5
// expected-error@+2 {{attribute 'WaveSize' requires shader model 6.6 or greater}}
#endif
[WaveSize(4, 16)]
void e1() {
}