summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/rhi/qrhi/data/storagebuffer_runtime.tesc
blob: 56060285d25cb09eb7a3ee5559a6507b92abf822 (plain)
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
#version 450

layout(vertices = 3) out;


layout (std430, binding = 7) readonly buffer ssbo7
{
    float float7[];
};

layout (std430, binding = 8) readonly buffer ssbo8
{
    float float8[];
};

layout (std430, binding = 9) readonly buffer ssbo9
{
    float float9[];
};

layout (std430, binding = 10) readonly buffer ssbo10
{
    float float10[];
};

void main()
{

    // some OpenGL implementations will optimize out the buffer variables if we don't use them
    // resulting in a .length() of 0
    float a = float7[0] == 0 && float8[0] == 0 && float9[0] == 0 && float10[0] == 0 ? 1 : 1;

    if (gl_InvocationID == 0) {
        gl_TessLevelOuter[0] = float7.length() * a;
        gl_TessLevelOuter[1] = float8.length() * a;
        gl_TessLevelOuter[2] = float9.length() * a;
        gl_TessLevelInner[0] = float10.length() * a;
    }

    gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;

}