cl: Fix a bunch of CL tests on MacOS.

Any kernel without arguments is automatically optimized out by the compiler.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
cl: Add vector conversion tests.

Adds tests for scalar to vector conversions as well as float -> int,
char -> int, and int -> char.

Also adds tests for IEEE rounding modes (user-specified and default).

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
cl: Remove clc_version_min requirement on scalar-load-[float|uchar].cl tests

Nothing in these tests should require CL C 1.1.

If the tests were attempting to WRITE to a global char*/short*,
then cl_khr_byte_addressable_store or CL1.1 (not CLC 1.1) would be required.

Also added a param/constant test case to the uchar file so that it's
consistent with the float tests.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
cl: Remove clc_version_min from gegl-rgb-gamma-u8-to-ragabaf.cl

This is another test that doesn't require CL C version 1.1, but runs
fine on a CL C 1.0 capable device.

Tested on Linux with Nvidia CL 1.1 run-time on a GF9400M (which supports
CL C 1.0).

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
cl: Add a CL test for kernel names which match iso646.h definitions.

Tests that the following C++ keywords which are also defined in iso646.h are
usable as valid kernel names:
and
and_eq
bitand
bitor
compl
not
not_eq
or
or_eq
xor
xor_eq

All tests currently pass on MacOS 10.7, but at least some of them fail on
Nvidia Linux.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
cl: These tests were failing to compile on Nvidia CL runtime on *NIX.

The newly added tests/cl/program/execute/reserved-words.cl checks that the old
kernel names are properly usable.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
cl: Automatically run any tests in the program directory

Just like what is done for the GL shader_runner tests
util/gl: Kill shader wrapper functions

This patch kills the wrapper functions defined in piglit-shader.h for GL.
They are rendered obsolete by piglit-dispatch.

A subset of the wrappers are kept for GLES1 and GLES2.

    - All GLES1 wrappers are kept and are renamed to match the core GL
      names.  That is, piglit_$func is renamed to gl$func. As before, the
      wrappers simply raise an assertion failure because GLES1 does not
      suppport shaders.

    - The subset of GLES2 wrappers that raise an assertion, because the
      function is not supported on GLES2,  are also kept and likewise
      renamed.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
util/gl: Print diagnostic when skipping due to lack of GLSL

In the GLES1 implementations of functions
piglit_require_{GLSL,vertex_shader,fragment_shader}, print an explanation
before skipping.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
util/gl: Add piglit-shader.[ch] into libpiglitutil_gles3

Eventually. gles3 support will be added shader_runner, and shader_runner
requires piglit-shader.[ch].

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
util/gl: Fix off-by-one in piglit_get_glsl_version

This bug broke piglit_get_glsl_version on GLES.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
util: Initialize vbo_data::stride in constructor.

Fixes uninitialized scalar field defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
etc2: Add test to verify texturing with etc2 miptree

Verifies texturing with following etc2 formats:
GL_COMPRESSED_RGB8_ETC2
GL_COMPRESSED_SRGB8_ETC2
GL_COMPRESSED_RGBA8_ETC2_EAC
GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
GL_COMPRESSED_R11_EAC
GL_COMPRESSED_RG11_EAC
GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2
GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2

Each format requires a compressed and decompressed texture data file,
which are added as a part of this commit. Tests for above formats
currently passes on 'gles3' branch using Intel hardware.

Signed formats (GL_COMPRESSED_SIGNED_R11_EAC & GL_COMPRESSED_SIGNED_RG11_EAC)
are excluded from this test case because the decompressed image (.ppm)
generated by ericsson's etcpack tool converts a decoded 16 bit signed data
to 16 bit unsigned data by adding 2 ^ 15. But gles 3.0 specification doesn't
suggest this conversion. This conversion results in a slightly different image
than the decoded image by mesa.

Note: mesa (gles3 branch) currently passes all etc2 tests in gles3 conformance
on intel h/w, including the signed formats.

V3: Made changes to run only with gles3.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
glx-string-sanity: Fix string length miscalculation.

Reported by Coverity Scan.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
triangle-rasterization: Initialize Vector member variables.

Fixes uninitialized scalar field defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
util/gl: Print diagnostic when skipping due to unset config attribs

If piglit skips the test because the test neglected to set one of the
config attributes 'supports_gl_*_version', then print an explanation
before skipping.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
util/gl: Add more functions to test min/max values (v3)

Add the following functions:
    piglit_test_min_uint
    piglit_test_max_uint
    piglit_test_min_int64
    piglit_test_max_int64
    piglit_test_min_uint64
    piglit_test_max_uint64

v2: Use PRId64 for printing GLint64, for Anholt.
v3: Add functions for uint, uint64.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
gles-3.0: Add minmax test (v3)

This is the first GLES3 test.

Tested against Mesa, branch gles3, commit 5612c08 "egl/dri2: Add plumbing
for EGL_OPENGL_ES3_BIT_KHR", with Intel Sandybridge.  All testcases pass
except:

  token                            min          actual
  GL_MAX_ELEMENT_INDEX             16777215     16384
  GL_MAX_FRAGMENT_INPUT_COMONENTS        60      9999
  GL_MIN_PROGRAM_TEXEL_OFFSET            -8      9999
  GL_MAX_PROGRAM_TEXEL_OFFSET             7      9999

Currently, all.tests contains the GL tests, all_es1.tests contains the
GLES1 tests, and all_es2.tests contains the GLES2 tests. This is the first
GLES3 test, so I added the file all_es3.tests. We should really clean that
up and put all tests in all.tests.

v2: Add tests for the following, for Anholt,
  GL_MIN_VIEWPORT_DIMENSIONS
  GL_NUM_*_BINARY_FORMATS
  GL_MAX_SERVER_WAIT_TIMEOUT

v3: If a value is listed as unsigned in the spec, then test it as
    unsigned. Fixes GL_MAX_SERVER_WAIT_TIMEOUT.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
arb_uniform_buffer_object: Fix memory leak.

Fix resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
glsl-fs-clamp-5: New test for a bug in the i965 driver.