Basic tests of fast color clear functionality on i965/gen7+.

Fast color clears are a hardware feature in i965/gen7+ which allows
the memory writes associated with clearing a color buffer to be
deferred until the buffer is later written to or read from; in most
cases this allows the clear writes to be write-combined with later
rendering operations.

For fast color clears to work correctly, the driver must maintain a
state machine for each buffer to indicate whether there are deferred
clears pending, and if so what the clear value was.  This patch
introduces simple shader_runner tests to validate corner cases of that
state machine.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Test reading from a buffer after fast clearing it.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Test that fast color clears work properly after a blit.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Test that ReadPixels into a PBO properly resolves fast clears.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
cl: Test get_work_dim function

Tests get_work_dim for 1/2/3 dimensional kernels.
copyteximage: Enable test vector printfs even when running in -auto mode.

Each invocation of the copyteximage test exercises a large number of
test vectors; a failure in a single test vector causes the entire test
to fail.

This patch modifies the printfs that show which test vector is being
tested, so that they execute regardless of whether the test is being
run automatically or manually (previously, they only executed when the
test was run manually).  This makes it much easier to troubleshoot
failures when looking at the output of an automated piglit run.

Reviewed-by: Eric Anholt <eric@anholt.net>
piglit: Switch a bunch of tests over to piglit_build_simple_program.

Since I was about to clean up some piglit_compile_shader_text calls, I
was looking at all these anyway.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
piglit: Always request GNU C extensions.

GNU C has a bunch of useful extensions making C a useful language.
Most of those extensions are also available on the BSDs, but MSVC
loses out.  The solution for MSVC is to write the same wrapper we'd
end up writing per test if we were limiting ourselves to non-GNU C.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
util: Print shader source and exit in the compile failure case.

This util function was printing to stderr anyway (so it's going to be
a piglit failure according to the summary), and we always want to stop
and look at the source producing the error.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
fbo-integer: Reuse piglit_require_GLSL_version().

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
util: Fix rgb9e5's big-endian test

__BIG_ENDIAN__ is predefined by gcc at least, MESA_BIG_ENDIAN isn't
defined anywhere in piglit though.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Apply the same local fix to enum.spec that we did for enumext.spec.
Include enum.spec along with enumext.spec for piglit-dispatch.

There are three differences between the two (as verified by sort, sed,
uniq, and diff):

- enum.spec includes GLES extension enums (since it's used for
  maintaining uniqueness of enums in the registry), which we want to
  include for cross-API compatibility.
- enum.spec includes some entries for known GL versions and GL extensions.
- enumext.spec has a few more synonyms for enums (since it's the
  file used for generating the official glext.h for desktop).

This change only introduces new #define lines to generated-dispatch.h.

v2: Make the statement about "only introduces new #define lines"
    actually true by continuing to emit based on the categories we
    collected during parsing, except with them defined to '1' instead
    of '', to match actual glext definitions and what gets
    autogenerated from enum.ext.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
core.py: Fix sporadic loss of tests in summary

The checking in TestrunResult to determine if a file was proper json or
not is very fragile: it assumes that the last line of the file will be
}. Sometimes this triggers and rebuilds a valid json file, dropping the
last test and resulting in python overhead.

This patch replaces that check with a try/except block. This block
attempts to load the json file with json.load, and on failure attempts
to fix the json.

V2: - replaces json.loads with json.load: this was causing an error but
	  being caught by the except block.
	- Corrects issue created by the try block changing file.tell() so
	  that file.seek would fail in self.__repairFile()
V3: - refactor to remove duplicate code

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
oes_fixed_point: Add ES1 test for fixed-point attribute arrays (v2)

Test GL_FIXED with glColorPointer and glVertexPointer. Verifies Mesa
commit 7a9f4d3e.

v2: Remove glViewport and piglit_ortho_projection.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
glean: Don't link X11 on MacOSX.
glean: Disable on MacOSX.

Simply impossible to get it working these days.
Set config.requires_displayed_window in tests that use front buffers.

When running tests with a non-composited window manager, it isn't safe
to access the front buffer until after the window is shown.  This
patch sets config.requires_displayed_window in tests that access front
buffers, to make sure that the piglit framework exposes the window,
even when testing in "-auto" mode.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
util/x11: Wait for expose event in manual mode or with front buffer tests.

When running piglit in manual mode (no "-auto" command-line option is
given), there's no point in calling piglit_display() before the window
is exposed.  This just leads to confusion because it will be called
again once the window appears, leading to duplicate test output in the
console window.

When running piglit in "-auto" mode, if the test accesses the front
buffer, then we need to wait until the window is exposed before
calling piglit_display(), since a front buffer is not guaranteed to be
available before then (in practice, this only happens with
non-compositing window managers).  However, if the test doesn't access
the front buffer, then it is still safe to call piglit_display()
before the expose event; doing so avoids wasting time.

Note: there are two known bugs that cause sporadic failures in certain
piglit tests with Mesa/Intel hardware (and possibly other Mesa
drivers).  See bugs #1 and #2 in
http://lists.freedesktop.org/archives/mesa-dev/2013-May/039985.html.
This change seems to exacerbate those sporadic failures.  As far
as I'm aware, the tests that are affected are:

- spec/!OpenGL 1.1/drawbuffer-modes
- spec/EXT_framebuffer_blit/fbo-sys-blit
- spec/EXT_framebuffer_blit/fbo-sys-sub-blit

I have patches on the list to fix bug #1 from that email (see
http://lists.freedesktop.org/archives/mesa-dev/2013-May/040010.html),
and Eric Anholt is working on bug #2.  I believe that once those fixes
land, the above tests should pass consistently.

Based on work by Chad Versace.

Cc: Chad Versace <chad.versace@linux.intel.com>
Cc: Eric Anholt <eric@anholt.net>

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Add a parser test for "#version 110 es".

This should fail as there aren't profiles in GLSL 1.10.  It currently
causes assertion failures in Mesa.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>