summaryrefslogtreecommitdiffstats
path: root/tests/spirv/spec-constant-int-val-float-to-int-cast.slang
blob: 9f9f96178579c8fcfe8e53b613e8cfb23826cf58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -entry computeMain -stage compute -target spirv

// CHECK: error 38041: cannot cast non-integer specialization
// CHECK-NEXT: const float X

[[SpecializationConstant]]
const float X = 10.0;

[shader("compute")]
[numthreads(32, 1, 1)]
void computeMain() : SV_Target
{
    float arr[int(X)];
    float a = arr[0];
}