File: spv.memoryQualifier.frag

package info (click to toggle)
glslang 16.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 51,720 kB
  • sloc: cpp: 92,305; yacc: 4,320; sh: 603; python: 305; ansic: 94; javascript: 74; makefile: 17
file content (38 lines) | stat: -rw-r--r-- 884 bytes parent folder | download | duplicates (19)
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
#version 450

layout(binding = 0, r32f) uniform coherent image1D      i1D;
layout(binding = 1, r32f) uniform volatile image2D      i2D;
layout(binding = 2, r32f) uniform restrict image2DRect  i2DRect;
layout(binding = 3, r32f) uniform readonly image3D      i3D;
layout(binding = 3, r32f) uniform writeonly imageCube   iCube;

struct Data
{
    float f1;
    vec2  f2;
};

coherent buffer Buffer
{
    volatile float f1;
    restrict vec2  f2;
    readonly vec3  f3;
    writeonly vec4 f4;
    int i1;
    Data data;
};

void main()
{
    vec4 texel = imageLoad(i1D, 1);
    texel += imageLoad(i2D, ivec2(1));
    texel += imageLoad(i2DRect, ivec2(1));
    texel += imageLoad(i3D, ivec3(1));
    imageStore(iCube, ivec3(1), texel);

    texel[i1] = f1;
    texel.xy += f2;
    texel.xyz -= f3;
    texel.w += data.f1 + data.f2[1];
    f4 = texel;
}