uniform-initializer: Don't rely on Python 2.7

zero-length formats "{}{}" not supported on Python 2.6

Trivial.
cmake: Give an early error message when the required make.template module is not available.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
util: fix broken depth/stencil FBO setup

The call to glTexImage2D(internalFormat=GL_DEPTH_STENCIL, format=GL_RGBA,
type=GL_UNSIGNED_BYTE) generated in invalid operation error since the
formats disagreed.  The subsquent glFramebufferTexture2D() calls failed
too.  And Mesa hit a failed assertion (ex: piglit drawpix-z -fbo).

Fixed by passing the correct format/type values to glTexImage2D.

Also, GL_DEPTH_STENCIL and GL_DEPTH_STENCIL_OES have the same value so
remove the compile-time #if/#else.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Add test to verify glBlitFramebuffer with non-matching sample count

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Add test to verify glBlitFramebuffer with non-matching buffer sizes

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Add test to verify glBlitFramebuffer with non-matching buffer formats

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
msaa: Refactor all.tests so that sample counts to test are specified once.
msaa: Test that msaa blits are clipped and scissored correctly.

There are three reasons why the set of rectangles passed to
glBlitFramebuffer() might need to be clipped before performing the
blit:

1. If the destination rectangle falls (partly or completely) outside
the bounds of the draw framebuffer.

2. If the destination rectangle falls (partly or completely) outside
the scissor rectangle.

3. If the source rectangle falls (party or completely) outside the
bounds of the read framebuffer.

In cases 1 and 2, it is clear from the GL spec that the blit should be
clipped.  In case 3, the spec is less clear, however Ian Romanick and
I have received clarification from the ARB that clipping is the
intended behaviour.

This test verifies that blits are properly clipped in cases 1-3.  It
only tests blits in which the source and destination rectangles are
the same size (i.e. no scaling is occurring), since scaling blits are
not allowed for MSAA.
glsl-1.30: Verify proper conversion of large floats to uints.

This patch adds two new tests that exercise a bug in Mesa/i965:
conversion from float to uint was being done in a two step process:
convert first to int and then to uint.  Since i965 uses saturating
arithmetic in float->int conversion, this caused conversion to give
the wrong result for values greater than 0x7fffffff.

I'll be submitting a Mesa fix shortly.
util: Make a separate function to compare in-memory images.

This patch splits off a new piglit-util function,
piglit_compare_images_color(), from the existing
piglit_probe_image_color() function.  The new function compares two
images in memory, so that the caller can take responsibility for
calling glReadPixels().

In addition, this patch creates a function
piglit_compute_probe_tolerance(), which detemines the correct
tolerance thresholds to use when comparing images.

These functions will be needed in order to test proper behaviour of
MSAA with different buffer formats, since the MSAA format test needs
to be able to read the rendered image using glReadPixels, make
adjustments to it in memory, and then compare the results.
msaa: Make it possible to change output type when drawing sunbursts.

In order to test that MSAA works properly for integer framebuffers, we
will need to be able to output ivec4 and uvec4 types when rendering
the test image.  This patch makes that possible by adapting the
Sunburst GLSL program so that it can be compiled to output ivec4's,
uvec4's, or vec4's.
msaa: Make it possible to scale and offset ColorGradientSunburst.

In order to test that MSAA works properly for integer framebuffers, we
will need to be able to adjust the outputs of the
ColorGradientSunburst program to cover the range of signed or unsigned
integers, rather than the range [0, 1] that is appropriate for testing
normalized color framebuffers.

This patch makes that possible by adding "scale" and "offset"
parameters to the ColorGradientSunburst program.
msaa/formats: Adapt test pattern drawing to handle integer formats.

This patch adapts the MSAA "formats" test so that it can draw to
integer framebuffers, by creating 3 instantiations of the
ColorGradientSunburst class, one for testing vec4's (for floating
point and normalized formats), one for testing ivec4's (for signed
integer formats), and one for testing uvec4's (for unsigned integer
formats).

The test determines which ColorGradientSunburst to use by querying
GL_FRAMEBUFFERATTACHMENT_COMPONENT_TYPE.
msaa/formats: Adapt glReadPixels() call to handle integer formats.

This patch adapts the MSAA "formats" test to pass the proper
parameters to glReadPixels() when checking that the proper image has
been rendered.  Since glReadPixels() requires an integral type when
reading pixels from an integer framebuffer, we read the pixels into a
temporary integer buffer and then copy them (using the CPU) into a
floating point buffer for comparison to the reference image.
msaa/formats: Compare integer formats properly.

This patch adapts the MSAA "formats" test to use
piglit_compare_images_color() to check pass/fail instead of
piglit_probe_image_color().  This will allow integer formats to be
tested.
msaa/formats: Use a scale and offset for testing integer formats.

This patch adapts the MSAA "formats" test so that when drawing into
integer framebuffers, it applies the necessary scale and offset to
cover the entire range of possible integer values.  When reading
pixels back from the framebuffer, the test applies the inverse scale
and offset, so that the result can be compared to the reference RGBA
image.
msaa/formats: Make it possible to specify a test set on the command line.
msaa/formats: Add EXT_texture_integer tests.

The MSAA "formats" test now properly tests integer framebuffer
formats.  This patch updates all.tests to cause integer framebuffer
formats to be tested.
msaa/formats: Adjust tolerance appropriately for floating-point formats.

When setting up a floating-point format, the GL implementation
responds to queries GL_ATTACHMENT_{RED,GREEN,BLUE,ALPHA}_SIZE with the
total number of bits in the floating-point value, regardless of
whether those bits are used for sign, exponent, or mantissa.  However,
for the purpose of setting a reasonable tolerance for pass/fail
comparisons, we really should only account for mantissa bits.

This patch modifies the MSAA "formats" test to detect when the buffer
format is GL_FLOAT, and if so, convert the channel size into the
number of mantissa bits, so that we don't test floating-point formats
to an unreasonably tight tolerance.
msaa/formats: Add floating point format tests.

The MSAA "formats" test now properly tests floating point formats.
This patch updates all.tests to cause those formats to be tested.