mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-18 14:36:46 +00:00

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
25 lines
931 B
HLSL
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() {
|
|
}
|