summaryrefslogtreecommitdiff
path: root/tests/spec/glsl-1.50/execution/interface-block-copy-vs-gs-fs.shader_test
blob: 1ce537ece97692700c4eefe5f6dec10658764224 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Test the direct copy of an entire named block

[require]
GLSL >= 1.50

[vertex shader]
#version 150

out Data
{
    vec3 a;
    float b;
} outData;

out vec4 vertex_to_gs;

in vec4 piglit_vertex;

void main()
{
  outData.a = vec3(0.0, 0.75, 1.0);
  outData.b = 0.5;

  vertex_to_gs = piglit_vertex;
}

[geometry shader]
#version 150

layout(triangles) in;
layout(triangle_strip, max_vertices = 3) out;

in vec4 vertex_to_gs[3];

in Data
{
    vec3 a;
    float b;
} inData[];

out Data
{
    vec3 a;
    float b;
} outData;

void main()
{
  for (int i = 0; i < 3; i++) {
    gl_Position = vertex_to_gs[i];
    outData = inData[i];
    EmitVertex();
  }
}

[fragment shader]
#version 150

out vec4 color;

in Data
{
    vec3 a;
    float b;
} inData;

void main()
{
  color = vec4(inData.b, inData.a);
}

[test]
clear color 0.1 0.1 0.1 0.1
clear

draw rect -1 -1 2 2
probe all rgb 0.5 0 0.75