summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/3rdparty/glslang/Test/400.tesc
blob: d01bd3ea1bfb68e37705fe8290e2fc02ef9598a8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#version 400 core

layout(vertices = 4) out;
int outa[gl_out.length()];

layout(quads) in;                   // ERROR
layout(ccw) out;                    // ERROR
layout(fractional_even_spacing) in; // ERROR

patch in vec4 patchIn;              // ERROR
patch out vec4 patchOut;

void main()
{
    barrier();

    int a = gl_MaxTessControlInputComponents +
            gl_MaxTessControlOutputComponents +
            gl_MaxTessControlTextureImageUnits +
            gl_MaxTessControlUniformComponents +
            gl_MaxTessControlTotalOutputComponents;

    vec4 p = gl_in[1].gl_Position;
    float ps = gl_in[1].gl_PointSize;
    float cd = gl_in[1].gl_ClipDistance[2];

    int pvi = gl_PatchVerticesIn;
    int pid = gl_PrimitiveID;
    int iid = gl_InvocationID;

    gl_out[gl_InvocationID].gl_Position = p;
    gl_out[gl_InvocationID].gl_PointSize = ps;
    gl_out[gl_InvocationID].gl_ClipDistance[1] = cd;

    gl_TessLevelOuter[3] = 3.2;
    gl_TessLevelInner[1] = 1.3;

    if (a > 10)
        barrier();           // ERROR
    else
        barrier();           // ERROR

    barrier();

    do {
        barrier();           // ERROR
    } while (a > 10);

    switch (a) {
    default:
        barrier();           // ERROR
        break;
    }
    a < 12 ? a : (barrier(), a); // ERROR
    {
        barrier();
    }

    return;

    barrier();               // ERROR
}

layout(vertices = 4) in;    // ERROR
layout(vertices = 5) out;   // ERROR

void foo()
{
    gl_out[4].gl_PointSize;  // ERROR

    barrier();                // ERROR
}

in vec2 ina;   // ERROR, not array
in vec2 inb[];
in vec2 inc[18];  // ERROR, wrong size
in vec2 ind[gl_MaxPatchVertices];

#extension GL_ARB_separate_shader_objects : enable

layout(location = 3) in vec4 ivla[];
layout(location = 4) in vec4 ivlb[];
layout(location = 4) in vec4 ivlc[];  // ERROR, overlapping

layout(location = 3) out vec4 ovla[];
layout(location = 4) out vec4 ovlb[];
layout(location = 4) out vec4 ovlc[];  // ERROR, overlapping

precise vec3 pv3;

void foop()
{
    precise double d;

    pv3 *= pv3;
    pv3 = fma(pv3, pv3, pv3);
    d = fma(d, d, d);
}

patch out pinbn {
    int a;
} pinbi;

invariant precise out vec4 badOrder[]; // ERROR, precise must appear first
void badp(out precise float f);        // ERROR, precise must appear first