glsl-max-varyings: Make this a concurrent test.

It's a really slow one, and I'm adding another variant of it.

Reviewed-by: Brian Paul <brianp@vmware.com>
glsl-max-varyings: Add a variant that also tests >MAX_VARYING_COMPONENTS.

Given that piglit hasn't been testing this, I don't want to modify the
existing glsl-max-varyings which has been very useful.  I don't want a
non-rendering test, though, because gl 2.0 allows an implementation to
allow shaders with >MAX_VARYING_COMPONENTS, so we should actually test
the rendering if that does happen.

v2: Make the error/warning message clearer.

Reviewed-by: Brian Paul <brianp@vmware.com>
GL_ARB_framebuffer_object/negative-readpixels-no-rb: Test for Mesa segfault.

v2: Drop the window size setup.

Reviewed-by: Brian Paul <brianp@vmware.com>
Add a test for viewport triangle clipping.

Triangles should be clipped to the clip volume and therefore shouldn't
end up being rasterized outside the viewport.

This was failing on Sandy Bridge with guard band clipping enabled.

v2: new test name, more comments and addition to all.tests.
v3: Eric's comments incorporated, and the explicit window size removed.
v4: minor style tweaks by Eric, and Brian's probe-related review.

Reviewed-by: Eric Anholt <eric@anholt.net>
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>