arb_geometry_shader4: Add basic 2d array tests.

Test basic indexing operations with 2d arrays.

v2: Rename tests, assigne different values to different members of arrays;

Signed-off-by: Fabian Bieler <fabianbieler@fastmail.fm>
arb_geometry_shader4: Add further 2d array tests.

Add some tests that basically check that the compiler doesn't confuse the two
array dimensions.

v2: Renamed tests

Signed-off-by: Fabian Bieler <fabianbieler@fastmail.fm>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
arb_geometry_shader4: Test gl_TexCoordIn indexing.

From the ARB_geometry_shader4 spec (section ):
"Indices used to subscript gl_TexCoord must either be an integral constant
expressions, or this array must be re-declared by the shader with a size."

And from the GLSL 1.1 spec page 99 (page 105 of the PDF):
"Multiple modules can declare it [gl_TexCoord] with different sizes, the
maximum will be used at link time."

Presumably, this also applies to gl_TexCoordIn.

v2: Rename tests, assigne different values to different members of gl_TexCoord;

Signed-off-by: Fabian Bieler <fabianbieler@fastmail.fm>
arb_geometry_shader4: Test that gl_VerticesIn is const.

Test that gl_VerticesIn can be used as a valid constant expression.

Also test that it evaluates to 3 for triangles.

Signed-off-by: Fabian Bieler <fabianbieler@fastmail.fm>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
arb_geometry_shader4: Don't export position in vertex shader.

Do not write to gl_Position in a glsl 1.1 version vertex shader with the
geometry shader extension enabled.

From the GL_ARB_geometry_shader4 spec (section "Geometry Shader Inputs"):
"Note that writing to gl_Position from either the vertex or [geometry] shader
is optional"
arb_geometry_shader4: Read primitive ID in fragment shader.

Test reading the primitive ID in a glsl 1.1 fragment shader with the
geometry shader extension enabled.

From the ARB_geometry_shader4 spec (section Geometry Shader outputs):
"The built-in gl_PrimitiveID provides a single integer that serves as a
primitive identifier.  This written primitive ID is available to fragment
shaders."
arb_geometry_shader4: Test two sided triangles.

Draw 8 triangles on the screen like so:

    +-+-+
    |/|/|
    +-+-+
    |/|/|
    +-+-+

The left 4 triangles are front facing, the right 4 triangles are backfacing.
Flip the top 4 triangles in the geometry shader (swap the first and last vertex)
and write to both front and back color. The result should be a 2x2 checkerboard.
arb_geometry_shader: Test passing a single float varying from vs to gs.
arb_geometry_shader4: Test primitive assembly.

Test primitive assembly before and after geometry shader execution using
transform feedback. The test uses all valid combinations of geometry shader
input and output primitive type as well as drawn primitive type.

It draws up to 12 vertices (set via command line). The only vertex attribute
is a zero-base vertex id. The vertex shader simple passes through the vertex
attribute. The geometry shader writes zero to two identical primitives (also
set via command line). For each primitive it uses the first n input vertices
and m extra vertices (where n,m can be set via command line options).
arb_geometry_shader: Add 2 more transform feedback tests.

The tests are pretty random and are written to test for specific bugs in llvmpipe.

01: The gs seems to have trouble to dynamically index scalar (non vector) input fields.

02: The gs seems to write out of bounds.
gen_builtin_packing_tests: Introduces geometry shader support.

Also bumped the desktop GL version requirement to 3.0 due to the use of
unsigned uniforms, updated some comments and added a comment in the generated
test with the name of the script that generated the test.
gen_interpolation_tests: Support geometry shader tests.

For every old test, add one test for every possible interpolation qualifier in
the geometry shader. If a geometry shader is present, the interpolation
qualifier in the vertex shader should be ignored.

From the ARB_geometry_shader4 spec section 2.16:
"This new geometry shader pipeline stage is inserted after primitive assembly,
right before color clamping (section 2.14.6), flat shading (section 2.14.7)
and clipping (sections 2.12 and 2.14.8)."

Also add a comment in the generated test with the name of the script that
generated the test.
generated_tests: Add gs input test. WIP.
arb_geometry_shader4: Test primitiveIDIn with GL_POINTS.
generated_tests: Test geometry shader outputs. WIP
arb_geometry_shader4: Compare 2d arrays.

GLSL 1.2 allows using the equality operators (== and !=) to operate on arrays as entire entities.

Test that they work with geometry shader 2d input arrays.
arb_geometry_shader4: Test gl_PointSize.

Draw different sized points from a geometry shader.
arb_geometry_shader4: Flat shading with undefined but ignored colors.

In this test the geometry shader outputs two flat shaded triangles and only
writes the color for the provoking vertex.

From the ARB_geometry_shader4 spec (section 8.10):
"The values of any unwritten output variables are undefined. The values of all
varying output variables and the special built-in output variables are
undefined after a call to EmitVertex()"

However, in this case the undefined values should be ignored and thus should
not affect the fragment stage.
arb_geometry_shader4: Draw more vertices than allowed.

Test a geometry shader that emits more vertices than allowed per
GEOMETRY_VERTICES_OUT.

From the ARB_geometry_shader4 spec (section 8.10):
"If a geometry shader, in one invocation, emits more vertices than the value
GEOMETRY_VERTICES_OUT_ARB, these emits may have no effect."

However the shader should execute without error and the valid vertices should
be drawn.

Test this with a geometry shader that tries to emit 14 and one that tries to
emit 510 vertices.