yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

ArielG-NVdisallow `static const` variables without default-value (#7993)c4dd2eb00

master
711 B27 linesraw
1// TEST:SIMPLE(filecheck=CHECK): -target spirv -stage compute -entry computeMain -emit-spirv-directly
2
3// Test cases for static const variables without initializers producing an error
4
5// CHECK: ([[# @LINE+1]]): error 31225
6static const int globalVar;
7
8// CHECK-NOT: error 31225
9
10// This should NOT cause an error - extern static const
11extern static const int externVar;
12
13interface ITest
14{
15    // This should NOT cause an error - interface member
16    static const int interfaceVar;
17}
18
19// This should NOT cause an error - has initializer
20static const int initializedVar = 42;
21const int nonStaticVar;
22static int nonConstVar;
23
24[numthreads(1,1,1)]
25void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
26{
27}