Add more structure constructor tests.
[piglit/hramrach.git] / tests / shaders / glsl-fs-functions-2.shader_test
blobd1c4fda946009cf9c0b3b864df45f4d7c8d1aa8c
1 [require]
2 GL >= 2.0
3 GLSL >= 1.10
5 [vertex shader]
6 varying vec4 pos;
7 void main()
9         gl_Position = gl_Vertex;
10         pos = gl_Vertex;
13 [fragment shader]
14 varying vec4 pos;
16 vec4 y_adjust(vec4 pos)
18         vec4 x;
20         if (pos.x > 0.0)
21                 x = vec4(-0.5, 0.0, 0.0, 0.0);
22         else
23                 x = vec4(1.5, 0.0, 0.0, 0.0);
25         if (pos.y > 0.0)
26                 return vec4(0.0, -0.5, 0.5, 0.0) + x;
27         else
28                 return vec4(0.0, 1.5, 0.5, 0.0) + x;
31 void main()
33         gl_FragColor = sign(pos) + y_adjust(pos);
36 [test]
37 draw rect -1 -1 2 2
38 probe all rgb 0.5 0.5 0.5 0.5