teximage-errors: remove config.window_width/height lines

So the test isn't skipped (with "warn" result) on Windows.
Fix test macro-definitions.cl

The original version defined BUILD_OPT, but used BUILD_OPT1.  Clover
wasn't capable of passing the test either way.  Now, the test should
pass on conforming implementations.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Fix MacOS build for OpenCL tests

1) Fix creation of libpiglitutil_cl.dylib
2) Fix includes of OpenCL.h to finish fixing MacOS build

Previous error message when linking dylib was:

Linking C shared library ../../../../lib/libpiglitutil_cl.dylib
Undefined symbols for architecture x86_64:
  "_piglit_cl_get_test_config", referenced from:
      _piglit_cl_framework_run in piglit-framework-cl.c.o
ld: symbol(s) not found for architecture x86_64

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Fix discovery of OpenCL framework on MacOS.

Tested on Mac OS 10.7

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
glx: Sanity check the various GLX extension strings that an app can query

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56057
shader_runner: Refactor version comparisons

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
shader_runner: Use integers for GL and GLSL versions

In floating point, 3.1 is actually 3.0999999999, and that's just
awsome for comparing GL versions.

v2: Use 3-digit GLSL versions as suggested by Eric.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
shader_runner: Set a VAO in a GL 3.1 context

There's no default VAO (without GL_ARB_compatibility), so we have to
create and bind one.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
shader_runner: Partially process the requirements section before creating the context

A test script can require a specific GLSL version or a specific GL
version.  To satisfy this requirement, the piglit framework code needs
to know about the requirement before creating the context.  However,
the requirements section can contain other requirements, such as
minimum number of uniforms.

The requirements section can't be fully processed until after the
context is created, but the context can't be created until after the
requirements section is processed.  Do a quick can over the
requirements section to find the GL and GLSL version requirements.
Use these to guide context creation.

v2: Use 3-digit GLSL versions as suggested by Eric.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
glslparsertest: Use specified GLSL version to select API version

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
all.tests: Remove glean/rgbTriStrip.

It doesn't actually test anything, and thus can never fail.

Reviewed-by: Eric Anholt <eric@anholt.net>
glx-multithread: use XInitThreads

To use multithreading with xlib, you're supposed to call XInitThreads
before any other xlib call.  Without this, xlib and GLX calls won't be
thread safe.

(Based on a patch by Ian Romanick <ian.d.romanick@intel.com>)
glx-multithread: Replace glFlush calls with glFinish

Currently, in Mesa with the i965 driver, calling glFlush() forces all
pending drawing operations to be sent to the kernel; this ensures that
any subsequent drawing operations will be performed after those
pending drawing operations, even if they come from other contexts.
The glx-multithread test was relying on this behaviour, however, the
GL and GLX specs do not garantee this.

This patch modifies the glx-multithread test to use glFinish() instead
of glFlush().

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
egl-create-context-verify-gl-flavor: Test GLES3

- Request a config with the es3 bit, EGL_OPENGL_ES3_BIT_KHR.
- Try to create a GLES 3.0 context with the config.
- Verify that the context version is >= 3.0.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
egl_khr_create_context: Check eglChooseConfig's errors

If eglChooseConfig fails with EGL_BAD_ATTRIBUTE, then fail the test.
Piglit only requests valid attributes, therefore the error is incorrect.

Regresses test egl-create-context-verify-gl-flavor:gles3.0 on
mesa-5cf853669. Mesa fails to recoginize EGL_OPENGL_ES3_BIT_KHR despite
exposing the EGL_KHR_create_context extension.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
egl-create-context-verify-gl-flavor: Test bogus versions

Attempt to create contexts with bogus versions.

Tests Mesa commit 243cf7a924eaef78ce0d5150747fae6c3c4e6974. Before that
commit, the Intel driver failed to validate requested OpenGL ES context
versions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
texture-integer-glsl130: Expect 1 for alpha in R, RG, RGB cases.

Table 3.23 (on page 221) of the OpenGL 3.0 specification is:

+----------------------------------------+
| Texture Base    | Texture source color |
| Internal Format |    C_s          A_s  |
+-----------------+----------------------+
| ALPHA           | (0, 0, 0)    |   A   |
| LUMINANCE       | (L, L, L)    |   1   |
| LUMINANCE_ALPHA | (L, L, L)    |   A   |
| INTENSITY       | (I, I, I)    |   I   |
| RED             | (R, 0, 0)    |   1   |
| RG              | (R, G, 0)    |   1   |
| RGB             | (R, G, B)    |   1   |
| RGBA            | (R, G, B)    |   A   |
+-----------------+----------------------+

From this, we see when sampling from RED, RG, and RGB textures, alpha
is supposed to be one.

v2: Change commit message to quote the right part of the spec.

Reviewed-by: Eric Anholt <eric@anholt.net>
util: Do not use setrlimit/getrlimit if RLIMIT_AS is not defined.

OpenBSD is one platform that does not define the symbol RLIMIT_AS.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Revert "texture-integer-glsl130: Expect 1 for alpha in R, RG, RGB cases."

This reverts commit cf47699087f74a6fd94c59a74837fc6c3c6422a8.

While I still believe the test is wrong, apparently this change made it
worse; the test doesn't quite work like I thought.  More investigation
is needed.  In the meantime, restore the old behavior.
time-elapsed: Spend time in the FS rather than do a lot of draws.

The time-elapsed test needs to consume a lot of GPU time so that it
can validate GPU time queries against elapsed wall-clock time.
Previously we did this by painting the window thousands of times.
That sometimes caused false failures due to the CPU time consumed in
preparing the draw calls.

This patch changes the test so that it consumes time by using a slow
fragment shader rather than by painting the window over and over.