• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#version 460
2
3
4layout(location = 5) in outBlock {
5    vec4 o3;
6};
7
8in vec2 o2; // declaration order different than vertex shader
9in vec4 o1; // declaration order different than vertex shader
10
11out vec4 outColor;
12
13uniform vec2 u1;
14uniform vec3 u2;    // initializer present in vertex stage
15uniform vec4 u3 = vec4(0); // initializer matches initializer in vertex stage
16
17uniform mat2 um2 = mat2(4.0);
18
19layout (location = 0, binding = 0) uniform sampler2D glass;
20
21uniform crossStageBlock1 {
22    uniform vec4 a;
23    vec4 b;
24};
25
26buffer fragOnlyBlock {
27    vec2 fb1;
28};
29
30uniform crossStageBlock2 {
31    uniform vec4 a;
32    vec2 b;
33} blockName2 [2]; // instance name different from vert
34
35
36void main()
37{
38    vec4 color = o1 * u1.rgrg * u2.rgbr * u3.rgba;        // o1 is statically used
39    outColor = color;
40}
41
42