]> git.tdb.fi Git - libs/gl.git/blob - tests/glsl/parameter_composite_access.glsl
Don't try to access parameters with a pointer access instructior
[libs/gl.git] / tests / glsl / parameter_composite_access.glsl
1 uniform Colors
2 {
3         vec4 top_color;
4         vec4 bottom_color;
5 };
6
7 #pragma MSP stage(vertex)
8 layout(location=0) in vec4 position;
9 layout(location=1) in vec3 normal;
10 void main()
11 {
12         gl_Position = position;
13         passthrough;
14 }
15
16 #pragma MSP stage(fragment)
17 layout(location=0) out vec4 frag_color;
18 vec4 get_color(vec3 n)
19 {
20         if(n.z>=0)
21                 return top_color;
22         else
23                 return bottom_color;
24 }
25 void main()
26 {
27         frag_color = get_color(normal);
28 }
29
30 /* Expected output: vertex
31 layout(location=0) in vec4 position;
32 layout(location=1) in vec3 normal;
33 layout(location=0) out vec3 _vs_out_normal;
34 void main()
35 {
36         gl_Position = position;
37         _vs_out_normal = normal;
38 }
39 */
40
41 /* Expected output: fragment
42 layout(binding=23) uniform Colors
43 {
44         vec4 top_color;
45         vec4 bottom_color;
46 };
47 layout(location=0) out vec4 frag_color;
48 vec4 get_color(vec3 n)
49 {
50         if(n.z>=0.0)
51                 return top_color;
52         else
53                 return bottom_color;
54 }
55 layout(location=0) in vec3 _vs_out_normal;
56 void main()
57 {
58         frag_color = get_color(_vs_out_normal);
59 }
60 */