Add a test case for all of the modes of RGBA_UNORM BPTC texture

This creates a compressed texture with a block for each of 8 modes of
RGBA_UNORM BPTC compression. The texture is then both rendered and
read back via glGetTexImage and compared with the expected values.
util/gl: Add the BPTC-compressed formats to piglit-util-gl

piglit_rgbw_image has a special override for compressed formats to
ensure that when the size of the image is less than the size of a
block then it picks a solid color instead of using four colors. This
patch adds the BPTC formats to this list.

It also modifies piglit_get_compressed_block_size to handle the
formats.
Add the bptc formats to fbo-formats.h
bptc: Add tests using fbo-generatemipmap-formats

The unsigned half float format needs special handling because the
texture that the test uploads tries to use negative values.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
texwrap: Add the BPTC formats

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
compressedteximage: Add tests for the four BPTC formats

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Add a test for all of the modes of the two half-float formats of BPTC

The test creates a texture with a block for each of the possible modes
of the half-float formats of BPTC and then retrieves it as a
half-float texture via glGetTexImage. This should test that the
decompressor works correctly with all possible code paths. It doesn't
test rendering the texture because that is a bit more tricky to do
accurately as it is not possible to create a half-float render target.

The data is generated randomly with an external program which also
generated the expected results. There are expected results for both
the signed and unsigned formats.
glsl_parser_test_tests.py: Add tests for command

These tests confirm that the value of command is what is expected based
on the value of the config block.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
glsl_parser_test.py: split some code into private method

The constructor for GLSLParserTest is very long, and fairly complex.
This splits the parser section out of the constructor into a private (__
prefixed) method. This makes the code more readable, and better
separates logical blocks.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
framework/glsl_parser_test.py: Split more out of the constructor

This splits the creation of the command to be passed to super() into a
private method. This change results in more readable code, but doesn't
change the operation of the code at all.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
glsl_parser_test.py: Remove redundant StringIO creation

Previously the code read a StringIO, then immediately created a new one
to write the read text into. This is silly, by just setting the tell
back to position 0 the same effect can be had without the need to read
and write the contents.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
if-arg-must-be-defined-01.frag: Fix shader to work with strict parser

This had
// expected:pass

But a space is required after the :
and should be:
// expected: pass

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
move: glsl_parser_test.py: an empty // should be okay

This patch ensures that a blank line '//\n' is valid explicitly rather
than implicitly relying on it working.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
glsl_parser_test.py: Use a regex for finding entries

This replaces string searching with a single regex statement and the use
of a match object to find and write key value pairs into the StringIO
that is ultimately read into the config file.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
glsl_parser_test.py: Replace ConfigParser and StringIO with dict

Because of the convenience of the regex the need to use a ConfigParser
and a StringIO are removed, the processed file is passed right into a
dictionary and processed from there. This is much simpler, and should be
faster.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
arb_shading_language_420pack/compiler/utf8.frag: fix config section

Currently this test has a 'equire_extensions' key, but this isn't
valid, as it should be 'require_extensions'

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
arb_explicit_attrib_location/1.40/compiler/not-enabled.frag: fix config

This removes a stray gl_version key, which was set to 3.1. It was never
parsed, but does work because required_gl_version() (in
piglit-util-gl.c) automatically matches glsl version 140 with gl 3.1

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
tests/glslparsertest/glsl2: Remove illegal comments from glslparsertests

This patch removes comments from the [config] block of these
glslparsertests, these comments were autogenerated by glslparser.tests,
which has since been removed from the source tree.

Of note these comments would be legal if they weren't contained with in
the [config]/[end config] block

This was generated by running the following command:

grep -l -R -m 1 --color=never '// # NOTE:' * | xargs ./purge.py

cat purge.py <<EOF

import sys

for each in sys.argv:
    with open(each, 'r') as f:
        content = f.readlines()

    with open(each, 'w+') as f:
        for line in content:
	    if not line.startswith('// # NOTE:'):
	        f.write(line)
EOF

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
glsl_parser_test.py: Strict key checking for config section

This enforces a set of valid keys, any key that isn't valid will raise
an exception with a message explaining the problem.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
arb_arrays_of_arrays/compiler/subroutine.vert: Fix config section

This currently uses 3 'require_extensions lines', this doesn't actually
work and never has, but with patches later in this series this stops
parsing since the parser raises an error.

The problem is that only that last definition is honored, and the first
two are no, so rather than requiring 3 extensions this test actually
only requires one.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>