summaryrefslogtreecommitdiffstats
path: root/tests/diagnostics/constant-buffer-unsized.slang
blob: 25644e8037fa55ffdca6affb1b1fddb53c419931 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//TEST:SIMPLE(filecheck=CHECK): -target spirv

struct T2 {
    float4 _m0;
};

[[vk::binding(0)]]
cbuffer ubo : register(b0)
{
    int in_val;
    // CHECK: ([[# @LINE+1]]): error 31215
    T2 _z0[]; // error 31215: cannot use unsized type 'T2[]' in a constant buffer.
}

[shader("fragment")]
float4 main() : SV_TARGET
{
    uint x = in_val;
    float4 data = _z0[x]._m0;
    return data;
}