msaa: Verify accuracy of sRGB MSAA resolves.

From the GL spec, version 4.2, section 4.1.11 (Additional Multisample
Fragment Operations):

    If a framebuffer object is not bound, after all operations have
    been completed on the multisample buffer, the sample values for
    each color in the multisample buffer are combined to produce a
    single color value, and that value is written into the
    corresponding color buffers selected by DrawBuffer or
    DrawBuffers. An implementation may defer the writing of the color
    buffers until a later time, but the state of the framebuffer must
    behave as if the color buffers were updated as each fragment was
    processed. The method of combination is not specified. If the
    framebuffer contains sRGB values, then it is recommended that the
    an average of sample values is computed in a linearized space, as
    for blending (see section 4.1.7).

This patch adds a new "srgb" mode to the MSAA accuracy test, which
verifies that the formula used by the implementation to blend sRGB
samples matches the GL spec's recommendations.  When an "srgb"
accuracy test is requested, the test is modified to do the following
things:

- Render using a buffer format of SRGB8_ALPHA8 instead of RGBA.

- When manually downsampling the reference image, enable
  FRAMEBUFFER_SRGB, so that the data output by the manual downsampler
  gets converted from linear color space into sRGB color space.  This
  ensures that the reference image is generated according to the
  spec's recommendations.

- Convert pixels from sRGB color space to linear color space before
  comparing the test image and the reference image.  This ensures that
  the RMS error is computed in linear color space, so that the RMS
  error computed for sRGB mode is comparable with the RMS error
  computed for linear RGBA color.

Note: if an implementation fails this test, that does not necessarily
mean that it fails to meet the GL spec (since the spec only recommends
sRGB-correct averaging, it doesn't require it).  For example, the
nVidia closed-source driver for Linux fails this test.
msaa/formats: Fix testing of sRGB formats.

sRGB buffers use a different blending operation to do multisample
resolves from non-sRGB buffers.  Accordingly, when testing sRGB
formats, we need to use an sRGB reference image.  This patch modifies
the MSAA "formats" test so that when testing an sRGB format, it
renders the reference image using SRGB8_ALPHA8 format rather than RGBA
format.

This required rearranging the initialization order used in the test,
so that the framebuffer under test is initialized first, so that we
can query it to see whether it is sRGB before initializing the
reference framebuffer.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
msaa/formats: Add EXT_texture_sRGB tests.

The MSAA "formats" test now properly tests sRGB format framebuffers.
This patch updates all.tests to cause those formats to be tested.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
msaa: Test that the "centroid" interpolation qualifier works correctly.

This patch adds tests to verify that:

- When GL_MULTISAMPLE is disabled, the "centroid" keyword is ignored,
  and interpolation is performed at pixel centers (consistent with the
  GL rules for non-antialiased rendering).

- When GL_MULTISAMPLE is enabled and the "centroid" keyword is used,
  interpolation is performed at a location within the boundary of the
  triangle.  The test also verifies that errors introduced into
  derivatives are kept within reasonable bounds.

- When GL_MULTISAMPLE is enabled and the "centroid" keyword is absent,
  derivatives are accurate.

Verified using nVidia's proprietary binary driver for Linux.