summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/rhi/qrhi/data/storagebuffer_runtime.frag
blob: 2e45a5f62a063fcf44ceb24963e2100d52126355 (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
#version 450

layout (location = 0) out vec4 fragColor;

layout (std430, binding = 1) readonly buffer ssboG
{
    float g[];
};

layout (std430, binding = 2) readonly buffer ssboB
{
    float b[];
};

layout (std430, binding = 6) readonly buffer ssboR
{
    float r[];
};

layout (std430, binding = 3) readonly buffer ssbo3
{
    vec4 _vec4;
};

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 = (r[0]+g[0]+b[0])>0?1:1;

    fragColor = a * vec4(r.length(), g.length(), b.length(), 255)/vec4(255);
}