fbo: Add the first in a series of negative FBO completeness tests

This test will eventually contain a number of subtests that verify
certain framebuffer incompleteness scenarios.

The first test tries a 0x0 color texture (and renderbuffer).  This
should result in GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT, but in Mesa it
results in a segfault instead.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
fbo: Verify attaching an invalid slice of a 3D texture

Create a texture with slices [0, N-1].  Try attaching slice N, N+1, and
N-1 to an FBO.  The first two cases should result in
GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT.  Do the same test with the layers
of an array texture.  The i965 driver results in:

intel_mipmap_tree.h:554: intel_miptree_check_level_layer: Assertion `layer < mt->level[level].depth' failed.

v2: Also try attaching levels N and N-1 instead of just N+1.  This
catches a bug in the first proposed fix for this issue.

v3: Also try 1D_ARRAY textures.  There were still some problems there in
Mesa.

v4: Also try CUBE_MAP_ARRAY textures.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> [v1]
fbo: Verify deleting the texture bound to the current FBO

Also verify deleting the renderbuffer bound to the current FBO.  Both of
these should result in GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT.
This currently passes on Mesa.

v2: Fix a compile error typo.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
fbo: Trigger a Mesa segfault with an FBO with invalid texture attached

Attach a really broken texture to an FBO, unbind the FBO, rebind the
FBO: boom!

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
gs: Test rules related to geometry shader input sizes.

Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec
contains some tricky rules for how the sizes of geometry shader input
arrays are related to the input layout specification.  In essence,
those rules boil down to the following:

- If an input array declaration does not specify a size, and it
  follows an input layout declaration, it is sized according to the
  input layout.

- If an input layout declaration follows an input array declaration
  that didn't specify a size, the input array declaration is given a
  size at the time the input layout declaration appears.

- All input layout declarations and input array sizes must ultimately
  match.  Inconsistencies are reported as soon as they are detected,
  at compile time if the inconsistency is within one compilation unit,
  otherwise at link time.

- At least one compilation unit must contain an input layout
  declaration.

This patch includes tests for verifying all of these behaviours,
modelled as closely as possible from the text and examples in the GLSL
1.50 spec.  Both interface block style and and non-interface block
style declarations are tested.

v2: Test layout vs explicit size more thoroughly: don't just test the
case where one compilation unit specifies a layout with N vertices and
another compilation unit specifies an input with size >N.  Also test
the case where the second compilation unit specifies an input with
size <N.
!UPSTREAM: gs: Make texelFetch and textureSize tests use GLSL 1.50 for geometry shaders.

Previously, these tests used ARB_geometry_shader4.  However, the
initial implementation of geometry shaders in Mesa isn't going to
support ARB_geometry_shader4.  So test this functionality using GLSL
1.50 geometry shaders instead.

TODO:
- Get rid of references to gl_PositionIn
!UPSTREAM: Performance micro-benchmark for fast color clears.
util: Create generic piglit_draw_rect() functions.  TODO: rework.

This patch adds the following functions to piglit-util-gl-common:
- piglit_draw_rect_generic
- piglit_draw_rect_back_generic
- piglit_draw_rect_z_generic
- piglit_draw_rect_tex_generic

These functions are similar to corresponding functions without the
"_generic" suffix, except that instead of delivering vertex position
and texture coordinates to the vertex shader using glVertexPointer()
and glTexCoordPointer(), they deliver to the generic attributes
PIGLIT_ATTRIB_POS and PIGLIT_ATTRIB_TEX.  These functions use VBO's
and VAO's when available, so they may be used when testing core
contexts.

These functions also work with compatibility contexts and with all
GLES versions.  Since GLES1 doesn't support generic vertex attributes,
we fall back to using glVertexPointer() and glTexCoordPointer() in the
GLES1 case.

When building GLES tests, the behaviour of the new _generic functions
is for all intents and purposes the same as that of the pre-existing
non-generic functions.  So to avoid code duplication, the non-generic
functions simply call their generic equivalents in GLES builds.
WIP: start testing GS in/out types
WIP: fix shader_runner error reporting when vertex data included.
WIP: Basic test of GS input varyings
Geometry shaders: add a basic EndPrimitive() test.
WIP: large EndPrimitive test
shader_runner: Add missing newlines to error messages.

Certain shader error messages were missing newlines, leading to the
error message being concatenated on the same line with "PIGLIT:
{'result': 'fail' }".
!UPSTREAM: Start working on a function accuracy test
!UPSTREAM: more experimentation with function accuracy
!UPSTREAM: read-after-swap

This works but I'm not convinced it's a good idea yet.

TODO:
- Discuss on mailing list.
!UPSTREAM: hacks
Front buffer rendering sanity test
Hacks