tex3d-maxsize: remove unused NVIDIA hack code

The problem described in the comments no longer seems to be an issue
with a recent driver.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
glsl-vs-deadcode-*: New tests for changes to Mesa's opt_dead_code_local.cpp.

The second test is a slight strip-down of a glean test that regressed.
The first was just what I wrote to first look at the implementation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
GL_ARB_draw_instanced/dlist: Test for error conditions.

Catches a bug in Mesa.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
GL_ARB_draw_elements/dlist-arb_draw_instanced: Test for error conditions.

Catches a bug in Mesa.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
GL_ARB_draw_instanced/negative-*: New tests for remaining error conditions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
GL_ARB_draw_instanced/negative-instanceidarb-write: New error test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
GL_ARB_draw_instanced/instance-array-dereference: Strip copy'n'paste comment.

That was for the test the shader came from, not this one.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
GL_ARB_draw_instanced/elements: Test glDrawElementsInstancedARB() rendering.

We didn't have any tests hitting this path for actual drawing, so make
a derived test from instance-array-dereference.shader_test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Move writing of JSON 'tests' dictionary section out of TestProfile.run.

When resuming an interrupted piglit run, we'll want to output both
existing and new results into the same 'tests' section.  Since
TestProfile.run only handles newly run tests, it can't open/close the
JSON dictionary.

So, move it to the caller in piglit-run.py.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Add the ability to resume an interrupted test run where it left off.

GPUs like to hang, especially when barraged with lots of mean Piglit
tests.  Usually this results in the poor developer having to figure out
what test hung, blacklist it via -x, and start the whole test run over.
This can waste a huge amount of time, especially when many tests hang.

This patch adds the ability to resume a Piglit run where you left off.

The workflow is:
$ piglit-run.py -t foo tests/quick.tests results/foobar-1
<interrupt the test run somehow>
$ piglit-run.py -r -x bad-test results/foobar-1

To accomplish this, piglit-run.py now stores the test profile
(quick.tests) and -t/-x options in the JSON results file so it can tell
what you were originally running.  When run with the --resume option, it
re-reads the results file to obtain this information (repairing broken
JSON if necessary), rewrites the existing results, and runs any
remaining tests.

WARNING:
Results files produced after this commit are incompatible with older
piglit-summary-html.py (due to the extra "option" section.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
don't write generated header to the source directory

It was impossible to have the source directory read-only.

Also add the include_directories() directive for tests/util
in just one place, under tests/, so that all subdirectories
inherit it. A bunch of CMakeLists.txt files duplicate it,
so delete those redundant include flags:

sed -i -e "/^\t\${piglit_SOURCE_DIR}\/tests\/util/ d" \
 `grep piglit_SOURCE_DIR -rl tests/ | grep "CMakeLists\.gl"`
cmake: workaround cmake bug when GLUT is not found

Silences thousands of lines of spam.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42700
tests/glx: fix Xrender detection

Use the variables CMake provides so that compilation won't
break if Xrender is in a different include directory.

v2: Just don't build the one test that needs it if it's not found.
cmake: check for glproto headers

And error out when they're not found, rather than failing to
compile later when GL/glxproto.h can't be found.
Stop using GLEW_VERSION_* macros

Several tests were checking the GL version using GLEW's GLEW_VERSION_*
macros.  This patch changes the tests to use piglit_get_gl_version(),
which provides the same functionality in a way that is not dependent
on GLEW.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Stop using GLEW extension macros

Several tests were checking for the presence of GL extensions using
GLEW macros.  This patch changes the tests to use
piglit_is_extension_supported(), which provides the same functionality
in a way that is not dependent on GLEW.

v2: Follow piglit convention of including "GL_" in the string passed
to piglit_is_extension_supported().

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Stop using glewIsSupported

Several tests were using the function glewIsSupported() to check for
extensions and GL versions.  This patch changes the tests to use
piglit_get_gl_version() and piglit_is_extension_supported(), which
provide the same functionality in a way that is not dependent on GLEW.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

v2: Follow piglit convention of including "GL_" in the string passed
to piglit_is_extension_supported().
Stop using GLEW_GET_FUN

Some tests were using the GLEW_GET_FUN macro to retrieve GL function
pointers from GLEW.  This was necessary using old versions of GLEW,
but it is not necessary anymore; now we can just refer to the GLEW
function pointers directly.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Stop referring to nonstandard enums GL_CLIP_PLANE{6,7}.

GL_GLIP_PLANE6 and GL_CLIP_PLANE7 are defined by glew.h, but not by
the standard OpenGL headers.  The standard OpenGL headers name these
constants GL_CLIP_DISTANCE6 and GL_CLIP_DISTANCE7.  Unfortunately, we
can't use those names either, because glew.h uses #defines to prevent
the standard OpenGL headers from having any effect.

To work around this madness, just use GL_CLIP_PLANE0+6 and
GL_CLIP_PLANE_0+7, which work whether or not GLEW is in use.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Convert more older tests to use piglit-framework.c.

This patch converts the following tests to use the main() function in
piglit-framework.c rather than define their own main() function.

- crash-cubemap-order
- crash-texparameter-before-teximage
- fdo10370
- fdo23489
- fdo9833
- copytexsubimage

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>