arb_texture_storage subtest reporting

Now reports subtest results, previously reported only aggregate result. Also
removed an unused variable.

Reviewed-by: Matt Turner <mattst88@gmail.com>
draw-range-elements-base-vertex: Avoid void * arithmetic.

Should fix MSVC build.
arb_texture_storage: Remove unused variable.
Put braces around nested if-statement.
Add test to verify srgb conformance

Tests accuracy of srgb->linear and linear->srgb conversion,
according to d3d10 rules as I understand them:
1) srgb->linear is permitted a tolerance of 0.5 on the srgb side
   (meaning the result converted back to srgb (but before float->int
   conversion) using perfect formula must not deviate more than 0.5)
2) linear->srgb is permitted a tolerance of 0.6 compared to using
   perfect formula
3) additionally all srgb values must stay the same when doing
   srgb to linear and then linear to srgb conversion.
This test does not actually verify 2) (which would need exhaustive
test of all float values) so if some floats outside these generated
by srgb->linear conversion get mapped to arbitrary values that will
go unnoticed. Likewise, correct behavior for floats outside 0.0-1.0
is not verified (including INFs and NaNs - the former should get clamped
to 0/255 in the end, NaNs should also get mapped to 0).

v2: some cleanup, also use more accurate pow factor for comparison.

Reviewed-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.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.
!UPSTREAM: gs: 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.

This patch should be squashed with "gs: Test rules related to geometry
shader input sizes."
!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