summaryrefslogtreecommitdiffstats
path: root/tests/glsl/ssboStructInsideStructMemoryQualifierError.slang
blob: c5376b4a81cacd186d1b8cff863553b1180108cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//TEST:SIMPLE(filecheck=CHECK-GLSL): -stage compute -entry computeMain -allow-glsl -target glsl
//TEST:SIMPLE(filecheck=CHECK-SPV): -stage compute -entry computeMain -allow-glsl -target spirv -emit-spirv-directly

// This code should error since memory qualifiers are only allowed inside:
// Shader storage blocks, variables declared within shader storage blocks 
// and variables declared as image types. Named structs inside a Interface
// block violates these rules
// CHECK-GLSL: error
// CHECK-SPV: error
buffer Block4 {
    struct StructTmp
    {
        readonly int val;
    };
    readonly structTmp myStruct;
    coherent readonly vec4 member1;
    coherent vec4 member2;
}inputBuffer4;

layout(local_size_x = 1) in;
void computeMain()
{
}