util-cl: Add utilities to support OpenCL tests

piglit-util-cl.* adds functions for faster and easier writing of OpenCL
programs. Most of the functions return NULL or false on errors and print
the error to stderr, others print an error and exit the program.

piglit-util-cl-enum.* files add enum definitions (some of them also by
version) and their string representations.

Signed-off-by: Blaž Tomažič <blaz.tomazic@gmail.com>
util-cl: Add OpenCL testing framework

The framework is composed of 1 main part and 3 different sub-parts. Each
test is linked to this framework and calls the piglit_cl_framework_run
function.

The main part is in piglit-framework-cl.* files. The header contains
definitions to implement each specific test type. The source file's
piglit_cl_framework_run function is called by each test of any type.
This file then parses program and environment variables, and depending
on test configuration, runs the test on selected platforms and devices.

The other 3 sub-parts are tests types implementations: Custom, API and
Program. Each one is used to create tests that benefit from different
functionality. Here each header file contains definitions to implement
an OpenCL test and each source file handles the specific options used in
test configurtation.

Signed-off-by: Blaž Tomažič <blaz.tomazic@gmail.com>
cmake: Build OpenCL utilities and framework

Add BUILD_CL_TESTS option to cmake configuration and build OpenCL
utilities and framework to library piglitutil_cl.

Signed-off-by: Blaž Tomažič <blaz.tomazic@gmail.com>
cl: Add OpenCL tests

All of the tests are located in tests/cl. Each type of tests are located
in their own subfolders. Custom tests in custom folder, API in api and
Program in program.

Program folder has special tests that are run by program-tester.c which
parses .cl or .program_test tests. This type of tests test program
building and kernel execution. These tests are located in program/build
and program/execute.

Signed-off-by: Blaž Tomažič <blaz.tomazic@gmail.com>
cmake: Build OpenCL tests

Build OpenCL tests to binaries with 'cl-' prefix. Each test type adds
another prefix to it, for example Custom test has a 'cl-custom-' prefix.

Signed-off-by: Blaž Tomažič <blaz.tomazic@gmail.com>
cl: Add all_cl.tests test set

This test set includes all the OpenCL tests.

Signed-off-by: Blaž Tomažič <blaz.tomazic@gmail.com>
doc: Add cl tests documentation

Here the OpenCL testing framework is documented in README file and each
test type is documented in respective doc_type and template_type files.

Signed-off-by: Blaž Tomažič <blaz.tomazic@gmail.com>
README: Include OpenCL information

Update README to include information about OpenCL tests.

Signed-off-by: Blaž Tomažič <blaz.tomazic@gmail.com>
max-texture-size: remove unnecessary GL calls
copytexsubimage: print GL enum strings instead of hex values
Merge remote-tracking branch 'blaz/opencl-request-v2'

This introduces OpenCL testing to piglit under tests/all_cl.tests.
Implement lround for MSVC.

Should fix shader_runner build failure.
fbo-blit-stretch: add cast to silence signed/unsigned comparison warning

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
shader_runner: add casts to silence char** vs const GLchar** warnings

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
cmake: Use C++ compiler to link C programs if using Solaris Studio.

Fixes Solaris Studio build.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50802
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
piglit/util: re-order cubemap faces and coords.

This reflects the order they are requires for ARB_texture_cube_map_array,

I've tested that this causes no regressions here.

Signed-off-by: Dave Airlie <airlied@redhat.com>
textureSize: add GL_ARB_texture_cube_map_array support.

This one is wierd since you give glTexImage3D layers * 6, but
textureSize reports back layers on its own.

Tested and passes on nvidia 295.59.

Signed-off-by: Dave Airlie <airlied@redhat.com>
arb_texture_cube_map_array: basic cubemap test (v2)

This creates a cube map array of 2 cubes, and tests the upload via
glTexImage3D and rendering of each layer happens correctly.

note it needs to redefine the common cubemap stuff as they are in the
wrong order for cubemap arrays.

v2: fixup Brian's review

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
arb_texture_cube_map_array: check for teximage3d invalid values.

This tests teximage3d returns invalid values for width != height
and depth not divisible by 6.

Signed-off-by: Dave Airlie <airlied@redhat.com>
arb_texture_cube_map_array: test getting binding.

test the getintegerv addition from the spec.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>