arb_internalformat_query-minmax: add more version/ext checking

The valid_formats[] list includes formats supported either by
GL 3.0 or GL_EXT_texture_float and GL_EXT_texture_rg.
ext_texture_array/compressed: check for GL_EXT_texture_array

We obviously should require this extension.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
builtin_functions.py: tweak integer constants

This fixes some misleading fs-op-div-* failures when the driver does
integer arithmetic with floating point.  When we compute the reciprocal
of some integers we wind up with inexact floating point results.  So
expressions like X/X result in 0.9999 or such.

This patch tweaks the generator code to use some "nicer" integers
so that X/X comes out as expected.

Note the GLSL 1.10 spec, section 4.1.3:
"However, there is no requirement that integers in the language map to
an integer type in hardware. It is not expected that underlying hardware
has full support for a wide range of integer operations."
texsubimage: use piglit_get_gl_enum_name()
arb_explicit_location: Add tests without the extension enabled

Make sure that the correct error is generated.  The second 1.30 version
and the 1.40 of the test ensure that layout() exists at all by using a
different extension (or GLSL version).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
framework: Fix mis-indentation of the test changes computation.

b66f365f23a5b6b31a1b3f6c5bb13d3983de2443 appears to have accidentally
indented this code, so that we would calculate the changes from the
1st to 2nd result again when looking at the 3rd result.

Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
framework: Make the set of tests per page always be a set.

Starting with appending to the dictionary entry as a list, then making
the entry into a set later is pretty weird.  Just always use a set.

Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
glsl-1.50: Test compilation of interface blocks containing unsized arrays.

Although it's not explicitly stated in the GLSL 1.50 spec, unsized
arrays are allowed in interface blocks.

section 1.2.3 (Changes from revision 5 of version 1.5) of the GLSL
1.50 spec says:

    * Completed full update to grammar section.  Tested spec examples
      against it:

      ...

      * add unsized arrays for block members

And section 7.1 (Vertex and Geometry Shader Special Variables)
includes an unsized array in the built-in gl_PerVertex interface
block:

    out gl_PerVertex {
        vec4 gl_Position;
        float gl_PointSize;
        float gl_ClipDistance[];
    };

Furthermore, GLSL 4.30 contains an example of an unsized array
occurring inside an interface block.  From section 4.3.9 (Interface
Blocks):

    uniform Transform {  // API uses "Transform[2]" to refer to instance 2
        mat4           ModelViewMatrix;
        mat4           ModelViewProjectionMatrix;
        vec4           a[];  // array will get implicitly sized
        float          Deformation;
    } transforms[4];

This patch adds compiler tests to verify that in and out blocks can
contain unsized arrays.

Verified using the NVIDIA proprietary driver for Linux.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
oglconform.tests: Add missing subprocess import.

Not sure when this broke, but it definitely wasn't working.
cl: Move common code from generate-cl-int-builtins.py into its own module
cl-program-test: Add support for parsing float values in scientific notation
cl: Add a python script for generating tests for math builtins

This includes a test for the nextafter builtin.
cl: Add a python script for generating tests for relational builtins

This includes a test for the isnan builtin.
cl: Add a test for the sign() builtin
gs: Test core GS inputs on GLSL 1.50

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
gs: Test corner case for triangle strip ordering with primitive restart.

Verified using the NVIDIA proprietary driver (version 313.18) for linux.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
ARB_texture_gather: add initial execution test

This test exercises combinations of:
- Shader stage vs/fs
- Offsetting
- Component count, up to implementation-defined limit
- Swizzling
- Unsigned normalized, float, int, unsigned int component types
- 2D/2DArray/Cube/CubeArray samplers

The test works by numbering the texels, and ensuring that the four
texels sampled by textureGather*() are those we expect.

Not exercised yet:
- Other interesting internalformats [DEPTH_COMPONENT, etc]
- Addressing modes other than WRAP.
- Use in Geometry Shader. I'd like to pick this up later, as mesa's
  GS support matures.

V2: - Use textureSize rather than hardcoding size in shader;
    - Use piglit_build_simple_program
    - Whitespace tidyups
    - Convert swizzle to enum
    - More component types, for all gsampler2D variants.

V3: - More whitespace
V4: - allow explicit 'unorm' component type; rework usage
    - Support all required sampler types.
    - Refactor setup

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
shader_runner: add ability to specify GL_TEXTURE_BASE_LEVEL

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
shader_runner: add ability to control red swizzle texparameter

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
ARB_texture_gather: add new test for miplevel behavior

textureGather always samples the base level, regardless of what
filtering modes are set.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>