================
@@ -0,0 +1,20 @@
+// 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@+10 {{attribute 'WaveSize' is unsupported in 'pixel' 
shaders, requires one of the following: compute, amplification, mesh}}
+#elif __SHADER_TARGET_STAGE == __SHADER_STAGE_VERTEX
+// expected-error@+8 {{attribute 'WaveSize' is unsupported in 'vertex' 
shaders, requires one of the following: compute, amplification, mesh}}
+#elif __SHADER_TARGET_STAGE == __SHADER_STAGE_GEOMETRY
+// expected-error@+6 {{attribute 'WaveSize' is unsupported in 'geometry' 
shaders, requires one of the following: compute, amplification, mesh}}
+#elif __SHADER_TARGET_STAGE == __SHADER_STAGE_HULL
+// expected-error@+4 {{attribute 'WaveSize' is unsupported in 'hull' shaders, 
requires one of the following: compute, amplification, mesh}}
+#elif __SHADER_TARGET_STAGE == __SHADER_STAGE_DOMAIN
+// expected-error@+2 {{attribute 'WaveSize' is unsupported in 'domain' 
shaders, requires one of the following: compute, amplification, mesh}}
+#endif
+[WaveSize(16)]
----------------
llvm-beanz wrote:

If you put something like `// #WaveSize` at the end of the line here, the 
checks above can all be `@#WaveSize` instead of line offsets.

https://github.com/llvm/llvm-project/pull/101240
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to