1 # Verify that interpolation qualifiers (flat, smooth, noperspective)
2 # declared inside interface blocks are properly respected.
4 # This test operates by comparing varyings declared inside an
5 # interface block with varyings declared outside an interface block.
6 # We assume that interpolation qualifiers work properly when declared
7 # outside interface blocks, because that is tested by other piglit
10 # In this test, we verify proper functioning of interpolation
11 # qualifiers in a named interface block.
17 in vec4 piglit_vertex;
19 flat out float flat_var;
20 smooth out float smooth_var;
21 noperspective out float noperspective_var;
22 out float unqualified_var;
26 smooth float smooth_var;
27 noperspective float noperspective_var;
28 float unqualified_var;
33 gl_Position = piglit_vertex;
34 float var = float(gl_VertexID);
37 noperspective_var = var;
38 unqualified_var = var;
41 ifc.noperspective_var = var;
42 ifc.unqualified_var = var;
46 flat in float flat_var;
47 smooth in float smooth_var;
48 noperspective in float noperspective_var;
49 in float unqualified_var;
53 smooth float smooth_var;
54 noperspective float noperspective_var;
55 float unqualified_var;
61 if (flat_var != ifc.flat_var) ok = false;
62 if (smooth_var != ifc.smooth_var) ok = false;
63 if (noperspective_var != ifc.noperspective_var) ok = false;
64 if (unqualified_var != ifc.unqualified_var) ok = false;
65 gl_FragColor = ok ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
71 0.0 2.0 0.0 2.0 # Note: different W's to ensure that smooth != noperspective
76 # Clear the background to green so that parts of the triangle which
77 # aren't drawn won't cause the test to fail.
78 clear color 0.0 1.0 0.0 1.0
80 draw arrays GL_TRIANGLES 0 3
81 probe all rgba 0.0 1.0 0.0 1.0