Test that loop unrolling properly infers loop bounds.

This patch introduces new vs and fs tests to provoke a bug in Mesa
which caused loop bounds to be inferred incorrectly when the loop
condition was expressed in an unusual way (e.g. "4 > i" instead of "i
< 4").

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
util: Add functions that provide glOrtho-like functionality.

This patch adds functions piglit_gen_ortho_uniform() and
piglit_ortho_uniform(), which can be used to set up an orthographic
projection when the legacy function glOrtho() is not available.

The functions work exactly like piglit_gen_ortho_projection() and
piglit_ortho_projection(), except that instead of programming the
legacy projection matrix, they program an arbitrary uniform matrix.

Reviewed-by: Brian Paul <brianp@vmware.com>
util: Add compressed representations of grayscale images.

This patch adds compressed representations of uniform grayscale blocks
to piglit, in the ETC1 and FXT1 compression formats.  Although they
don't exercise the full capabilities of these compression formats,
they should be sufficient to create basic tests of compression
functionality without having to rely on the GL implementation to do
compression on the fly.

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Eric Anholt <eric@anholt.net>

v2: Add S3TC.
Add tests for glCompressedTex{Image,SubImage}3D().

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

v2: Switch the desktop GL test to use S3TC so that the test can run on
a greater variety of hardware.  Use piglit_probe_rgba to be compatible
with GLES3's glReadPixels restrictions.
arb_uniform_buffer_object: Add new tests for GL_MAX_UNIFORM_BLOCK_SIZE.
depth-cube-map: Fix for airlied's reordering of cube_face_texcoords.

While I'm here, also change which faces are expected where on the
screen.  Before it was expecting:

-Y +Z -Z
+X -X +Y

But I think this makes more sense:

-X -Y -Z
+X +Y +Z
bindfragdata-link-error: Fix WARN report for a PIGLIT_PASS result.

By using the complain-loadly-if-link-error util function in the cases
where we expect a link error, we ensured that this test could never
report a pass in the summary.
gles2: add invalid-es3-queries_gles2 to all.tests

Also changes invalid-es3-quesies to follow conventions and be
built as invalid-es3-queries_gles2

Signed-off-by: Tom Gall <tom.gall@linaro.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
gles2: add minmax testcase

Add minmax test based on values that can be queried as specified
in chapter 6.2 of the OpenGL ES 2.0.25 spec.

Small modification to tests/util/minmax-test.* so that functions
which use GLint64 and GLuint64 types aren't compiled when
building for OpenGL ES 2.

Signed-off-by: Tom Gall <tom.gall@linaro.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
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>
arb_texture_multisample: add cmake plumbing

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
arb_texture_multisample: new minmax test

Verifies new minimum maximums in ARB_texture_multisample:

GL_MAX_COLOR_TEXTURE_SAMPLES >= 1
GL_MAX_DEPTH_TEXTURE_SAMPLES >= 1
GL_MAX_INTEGER_SAMPLES >= 1
GL_MAX_SAMPLE_MASK_WORDS >= 1

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
arb_texture_multisample: new test for fb configs

This tests FBO setup with various combinations of multisample textures
and `classic` multisample renderbuffers, and for each, checks:

- That the renderbuffers or textures can be created
- Completeness status

If the configuration is expected to work, additionally:
- Actual sample count >= requested sample count
- Sample positions meet spec requirements (all obtainable, and in [0,1]

Covers the fixedsamplelocations and sample count consistency
requirements in the spec.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
arb_texture_multisample: new test for teximage state

This tests that the new teximage state added in ARB_texture_multisample
exists and has correct defaults for non-multisample textures:

    - GL_TEXTURE_SAMPLES = 0
    - GL_TEXTURE_FIXED_SAMPLE_LOCATIONS = false

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
arb_texture_multisample: new tests for sample mask

Adds tests for sample mask:

- Initial state
- Fetching of each sample mask word
- Execution test via rendering with various masks to a multisample FBO,
  then downsampling via glBlitFramebuffer and checking the result.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
arb_texture_multisample: add new sampler targets to textureSize

Covers use of the textureSize() glsl builtin with multisample samplers

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>