arb_gpu_shader5: Remove unused vars in tf-wrong-stream-value

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
teximage-colors: Don't try to do exact upload/download on 12-bit formats

Since we can't give a 12-bit input, trying to do an exact test doesn't
really make sense.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
shader_runner: Fix packing matrix data in UBOs

The indices were all confused, and it wasn't obvious which order the
parser expected the data.  The old code worked with square matrices,
it either didn't upload enough data or wrote outside the UBO for non-
square matrices.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
glsl-1.50: Add non-square matrix variations of UBO tests

These tests pass on NVIDIA's closed source driver (version 331.89 on
GTX260)

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
shader_runner: Add missing terminators for string_to_enum arrays

If an unknown enum string were specified, lookup_enum_string would read
past the end of the array.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
shader_runner: static constify all string_to_enum arrays

Otherwise the compiler does shockingly daft things.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
shader_runner: Add "active uniform" command

This enables querying various aspects of a uniform using
glActiveUniformsiv.  Future commits will use this feature to test UBO
layouts.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
arb_uniform_buffer_object: Add test based on extension spec

This comes almost verbatim from the ARB_uniform_buffer_object spec.
It's also mostly redundant with the layout-std140 test... which will be
removed soon.

This test passes on NVIDIA's closed source driver (version 331.89 on
GTX260)

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
arb_uniform_buffer_object: Add test for padding between UBO structs

This test also comes from layout-std140.  Verify that the base alignment
of a structure is that of a vec4, per std140 rule #9.

This test fails on NVIDIA's closed source driver (version 331.89 on
GTX260).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
arb_uniform_buffer_object: Remove now redundant layout-std140 test

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
arb_uniform_buffer_object: Add test for padding after a UBO struct

Similar to struct_base_alignment.shader_test.  Instead of putting a
struct after the small struct, put some fields with less that vec4
alignment after the struct.

NOTE: On Mesa we get the correct locations, but the shader doesn't
generate the correct results.  The test fails.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83533
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
shader_runner: Allow loading hex values for floats

For some cases we want to have shaders where we load an exact bit
pattern into a float (or double) uniform.

NOTE: The double path isn't really tested.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
glsl-1.50: Put a struct after a struct with weird alignment

The trick of this test is putting a structure after a structure that is
larger than 16-bytes but not 16-byte aligned.  In this case the first
structure is 24 bytes.  This should have an array stride of 32-bytes.
There seems to be some problem in Mesa's glsl_type::std140_size() that
causes the total array size to be 48 instead of 64.  The correct values
are, however, reported via the GL API.

NOTE: On Mesa we get the correct locations, but the shader doesn't
generate the correct results.  The test fails.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83639
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
arb_uniform_buffer_object: Add test for row-major matrix inside array of struct

NOTE: On Mesa we get the correct locations, but the shader doesn't
generate the correct results.  The test fails.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83506
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
arb_uniform_buffer_object: Add test for data after a row-major matrix inside array of struct

NOTE: On Mesa we get the correct locations, but the shader doesn't
generate the correct results.  The test fails.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83741
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Add user-specified test name suffix to junit output.

When summarizing piglit results from a set of hardware, it is
necessary to differentiate failures from the various platforms.  Tools
like jenkins are confused when a test name is repeated in test
results, especially when it both passes and fails in separate result
files.

Provide the --junit_suffix parameter to piglit to append a string to
the name of each test in the junit output.  Multiple invocations of
piglit can be summarized together in jenkins with different suffixes.

v2: - Fix 3 unit tests. This is a trivial fix. (Dylan)

Reviewed-by: Dylan Baker <dylanx.c.baker@intel.com>
spec/ARB_copy_image: Exercise different mipmap levels in the formats test

Previously, we only ever worked on level 0.  Now we work on levels 1 and 3
so that cross-level copying gets tested.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
arb_gs5: add nonconst sampler access tests

These test some of the annoying cases of fermi/kepler instruction
encodings.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
teximage-color: Fix un_to_float for 32-bit builds

The un_to_float function was trying to get the maximum value given a
number of bits by shifting ~0ul by the number of bits. For the
GL_UNSIGNED_INT type this function was also being used to get a
maximum value for a 32-bit quantity. However on a 32-bit build this
would mean that it is shifting a 32-bit integer (unsigned long is
32-bit) by 32 bits. The C spec leaves it undefined what happens if you
do a shift that is greater than the number of bits in the type. GCC
takes advantage of that to make the shift a no-op so the maximum was
ending up as zero and the test fails.

This patch makes it shift ~0u in the other direction so that it
doesn't matter what size unsigned int is and it won't try to shift by
32.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83695
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Tested-by: Tapani Pälli <tapani.palli@intel.com>