cmake: Fix -Wdeclaration-after-statement detection.

Copy'n'paste typo.  Trivial.

Reviewed-by: Brian Paul <brianp@vmware.com>
cmake: Fix stdbool.h for MSVC 2013.

Reviewed-by: Brian Paul <brianp@vmware.com>
piglit-dispatch: Prevent re-definition of APIENTRY.

Reviewed-by: Brian Paul <brianp@vmware.com>
util: Don't redefine math.h functions on MSVC 2013.

MSVC 2013 provides all math.h functions that were missing in previous
versions.

Reviewed-by: Brian Paul <brianp@vmware.com>
glean: Add missing <algorithm> includes.

max/min were being used in several places, without including
algorithm header, and on MSVC 2013 the header is not being included
internally.

Reviewed-by: Brian Paul <brianp@vmware.com>
util: Fix SENTINEL.

It should have been SENTINEL and not -SENTINEL in piglit_test_float,
as that what's checked below.

Also take in consideration that in general `(GLfoo)SENTINEL != SENTINEL`,
specially for GLfloat.

Reviewed-by: Brian Paul <brianp@vmware.com>
gl-1.0-beginend-coverage: Fix prototypes.

For MSVC `foo()` and `foo(void)` are not the same thing.

Reviewed-by: Brian Paul <brianp@vmware.com>
arb_shader_atomic_counters: Ensure all return paths return value.

MSVC does not consider `assert(TRUE)` as never returning.

Reviewed-by: Brian Paul <brianp@vmware.com>
cmake: Tone down the MSVC warning level.

Very few people are building piglit with MSVC, and the current avalanche
of insignificant warnings ends up being a disservice for those who do, as
it only ends up hiding potential problems.

Reviewed-by: Brian Paul <brianp@vmware.com>
arb_draw_indirect: Silence `format not a string literal and no format arguments`.

Trivial.
tex3d: assorted clean-ups

Don't call piglit_report_result() - return result from piglit_display().
Use default window size and fix "row wrapping" to avoid drawing off the
edge of the window.
Use bool instead of int.
Use piglit_get_gl_enum_name().
Use GLubyte instead of unsigned char.
Set texture env mode to replace.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
tex3d-npot: assorted clean-ups

As with the previous patch for the tex3d test.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
util: use piglit_load_text_file() in piglit_compile_shader()

The old code had a problem on MinGW.  If the shader/text file had
DOS-style \r\n line endings, fread() would convert them to Unix-style
\n line endings.  Since the actual number of chars read by fread()
was less than the stat()'d size, we put the terminating '\0' in the
wrong place, possibly after some garbage characters in the buffer.

This sometimes caused the GLSL compiler to generate an error when it
found those garbage chars.

A Heisenbug:  I was seeing failures w/out gdb but success w/ gdb. Ugh!

v2: get rid of stat() call too, per Jamey Sharp.

Reviewed-by: Jamey Sharp <jamey@minilop.net>
util: use binary mode for fopen() calls in ktx code

Reviewed-by: Brian Paul <brianp@vmware.com>
Add basic execution tests for GL_AMD_shader_trinary_minmax.

Tested on Mesa/Haswell, the tests pass.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
teximage-errors: Run all the tests before returning result

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
teximage-errors: Test the combinations of depth and depth-stencil formats

This patch is to verify a bug fix in mesa commit 079bff5. This commit
allowed GL_DEPTH_COMPONENT and GL_DEPTH_STENCIL combinations in
glTexImage{123}D functions.

V2: Add extension check for GL_EXT_texture_array

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
teximage-errors: Make changes to support core profile

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Fix expected behavior of glBlitFramebuffer() with conditional rendering

It is clarified on page 679 of OpenGL 4.4 core profile spec:
   "Added BlitFramebuffer to commands affected by conditional
    rendering in section 10.10 (Bug 9562)."

This addition is also made to OpenGL 4.4 compatibility profile spec.

Tests the bug fix made in mesa commits 1d350b9 and 8ed42dd:
"i965: Add glBlitFramebuffer to commands affected by conditional
rendering"

Previous to this patch, this test fail on NVIDIA 4200M (driver
version 331.49), as reported by Samuel Iglesias.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77702
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
cmake: Install under separate piglit directory

Install paths updated:
* $PREFIX/share/doc => $PREFIX/share/doc/piglit
* $PREFIX/lib => $PREFIX/lib/piglit/lib
* $PREFIX/bin => $PREFIX/lib/piglit/bin
* etc...

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>