aboutsummaryrefslogtreecommitdiff
path: root/Test/iomap.crossStage.frag
blob: 16247032e312fc901a068a10c98937799db29a2c (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
#version 460


layout(location = 5) in outBlock {
    vec4 o3;
};

in vec2 o2; // declaration order different than vertex shader
in vec4 o1; // declaration order different than vertex shader

out vec4 outColor;

uniform vec2 u1;
uniform vec3 u2;    // initializer present in vertex stage
uniform vec4 u3 = vec4(0); // initializer matches initializer in vertex stage

uniform mat2 um2 = mat2(4.0);

layout (location = 0, binding = 0) uniform sampler2D glass;

uniform crossStageBlock1 {
    uniform vec4 a;
    vec4 b;
};

buffer fragOnlyBlock {
    vec2 fb1;
};

uniform crossStageBlock2 {
    uniform vec4 a;
    vec2 b;
} blockName2 [2]; // instance name different from vert


void main()
{
    vec4 color = o1 * u1.rgrg * u2.rgbr * u3.rgba;        // o1 is statically used
    outColor = color;
}