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
21 lines
1.4 KiB
HLSL
21 lines
1.4 KiB
HLSL
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.8-pixel -x hlsl %s -verify
|
|
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.8-vertex -x hlsl %s -verify
|
|
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.8-geometry -x hlsl %s -verify
|
|
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.8-hull -x hlsl %s -verify
|
|
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.8-domain -x hlsl %s -verify
|
|
|
|
#if __SHADER_TARGET_STAGE == __SHADER_STAGE_PIXEL
|
|
// expected-error@#WaveSize {{attribute 'WaveSize' is unsupported in 'pixel' shaders, requires one of the following: compute, amplification, mesh}}
|
|
#elif __SHADER_TARGET_STAGE == __SHADER_STAGE_VERTEX
|
|
// expected-error@#WaveSize {{attribute 'WaveSize' is unsupported in 'vertex' shaders, requires one of the following: compute, amplification, mesh}}
|
|
#elif __SHADER_TARGET_STAGE == __SHADER_STAGE_GEOMETRY
|
|
// expected-error@#WaveSize {{attribute 'WaveSize' is unsupported in 'geometry' shaders, requires one of the following: compute, amplification, mesh}}
|
|
#elif __SHADER_TARGET_STAGE == __SHADER_STAGE_HULL
|
|
// expected-error@#WaveSize {{attribute 'WaveSize' is unsupported in 'hull' shaders, requires one of the following: compute, amplification, mesh}}
|
|
#elif __SHADER_TARGET_STAGE == __SHADER_STAGE_DOMAIN
|
|
// expected-error@#WaveSize {{attribute 'WaveSize' is unsupported in 'domain' shaders, requires one of the following: compute, amplification, mesh}}
|
|
#endif
|
|
[WaveSize(16)] // #WaveSize
|
|
void main() {
|
|
}
|