shader_runner.py: fix gles2 support

Fix shader_test.py so it uses shader_runner_gles2 when running
a shader test with GL 2.0 es in the [required] section.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Signed-off-by: Tom Gall <tom.gall@linaro.org>
shader_runner: add gles2 support

Add a number of GLES2 specific workarounds to
shader_runner_gles_workarounds.h.

Add CMakeLists.gles2 into shaders directory so that
shader_runner is build when gles2 is selected.

Add piglit-vbo.cpp to util/CMakeLists.gles2.txt.

In tests/util/piglit-vbo.cpp add one small ifdef
PIGLIT_USE_OPENGL_ES2, vertex_attrib_description::setup
so the data_type GL_INTEGER for attributes is prevented
from use and emits an error message.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Signed-off-by: Tom Gall <tom.gall@linaro.org>
shader_runner: add glsl-es-1.00 sanity test

Add tests/spec/glsl-es-1.00 directory and new
execution/sanity.shader_test in that directory.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Signed-off-by: Tom Gall <tom.gall@linaro.org>
stencil-twoside: Check and use results of all probed pixels.

Fixes dead assignment bugs reported by Clang Static Analyzer.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
stencil-wrap: Check and use results of all probed pixels.

Fixes dead assignment bugs reported by Clang Static Analyzer.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Remove commen-continuation test.

This test was originally designed to verify that a comment line ending
with a backslash would not be considered a line-continuation
character, (since a shader has been seen in the wild with such a
backslash and where interpreting the backslash as a line-continuation
would cause compilation failure).

However, with OpenGL 4.2 and GLES3, backslash as a line continuation
character is now specified to operate globally. So this test is now
invalid, and the correct result is that this shader should cause a
compilation failure.

[Note that Mesa does have support for a quirk that can disable the
line continuation on an app-by-app basis with driconf
configuation. But that's something that piglit itself can't easily
test. Instead, Mesa now includes its own testing for that.]
masked-clear: port of Glean's maskedClear test to piglit

Reviewed-by: José Fonseca <jfonseca@vmware.com>
shader_runner_gles2: Remove unused variable warnings

The function macros in shader_runner_gles_workarounds.h cause many unused
variable warnings. The function macros have form
  #define glMapBuffer(...) UNDEFINED_FUNCTION(glMapBuffer, 0)
and get expanded to the call
  unsupported_function("glMapBuffer", 0)
Observe that the original arguments to glMapBuffer are unused.

This patch fixes the warnings by changing the macro form to
  #define glMapBuffer(...) UNDEFINED_FUNCTION(glMapBuffer, 0, __VA_ARGS__)
which gets expanded to the call
  unsupported_function("glMapBuffer", 0, __VA_ARGS__)

Reviewed-by: Tom Gall <tom.gall@linaro.org>
Tested-by: Tom Gall <tom.gall@linaro.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
shader_runner_gles2: Remove cast warning

Removes the warning:
  shader_runner.c:1078:7: warning: assignment makes pointer from integer
                          without a cast [enabled by default]

Reviewed-by: Tom Gall <tom.gall@linaro.org>
Tested-by: Tom Gall <tom.gall@linaro.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
util/gl: squash "incompatible pointer type" warning

In the newly added piglit_gen_ortho_uniform it introduced a
warning due to float *[4] being passed instead of the expected
const GLfloat * as the type of the 4th param. Change the array
of floats to const GLfloat [4][4] and provide the cast.

Fixes the GCC warning:
  tests/util/piglit-util-gl-common.c:547:2: warning: passing argument 4 of
    ‘glUniformMatrix4fv’ from incompatible pointer type [enabled by default]

Signed-off-by: Tom Gall <tom.gall@linaro.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Make new tests/spec/arb_occlusion_query directory

Moving the existing occlusion_query.c test from tests/general to the new
directory. This creates a natural place to add additional occlusion-query
tests according to the current naming scheme for piglit.
Cleanup occlusion-query test to not require function pointers.

With the current piglit dispatch code, the distinction between things
like glBeginQuery and glBeginQueryARB is taken care of already so the
test can be simplified a bit.

Reviewed-by: Eric Anholt <eric@anholt.net>
Add new test: occlusion_query_lifetime

This checks that glIsQuery returns the expected results throughout the
lifetime of a query object, (not least of which, that glIsQuery returns
false after glGenQueries and before glBeginQuery).

Reviewed-by: Eric Anholt <eric@anholt.net>
Add new test: ext_timer_query-lifetime

This is similar to the recently added occlusion_query_lifetime test,
basically verifying that glQueryCounter (in addition to glBeginQuery)
is also sufficient for transitioning a generated query name into a
query object.

Reviewed-by: Eric Anholt <eric@anholt.net>
Add new test: occlusion_query_order

Verifying that once one occlusion query has results, that all previous
queries also have results available. (In particular, the final query
includes not drawing.)

Reviewed-by: Eric Anholt <eric@anholt.net>
Add occlusion-query tests for various meta operations.

These tests invoke occlusion queries around the several
meta-operations implemented within mesa. They are designed to
demonstrate various bugs in the current implementation of mesa, (where
meta operations either do or do not generate fragments as specified by
the OpenGL specification).

Reviewed-by: Eric Anholt <eric@anholt.net>
test/shaders: remove explicit 100x100 window sizes

Allows tests to run on Windows.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
arb_uniform_buffer_object: remove explicit 100x100 window size

Allows tests to run on Windows.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
arb_debug_output: remove explicit 100x100 window size

Reviewed-by: José Fonseca <jfonseca@vmware.com>
arb_map_buffer_alignment: remove explicit 100x100 window size

Reviewed-by: José Fonseca <jfonseca@vmware.com>