gl-2.0: Verify results of program validation when a conflicting sampler configuration is used.

Section 2.15.4 (Shader Execution), subheading "Validation" of the OpenGL
2.0 spec says:

    "[INVALID_OPERATION] is generated by Begin, RasterPos, or any
    command that performs an implicit Begin if:

        - any two active samplers in the current program object are of
          different types, but refer to the same texture image unit,"

This test verifies this behavior several ways.  First, an invalid
configuration is constructed.  When the program is in the invalid
configuration, glValidateProgram is used to determine the status.

The program is then transitioned to a valid configuration, and
glValidateProgram is called again.

The program is then transitioned back to the invalid configuration.
Without calling glValidateProgram, glBegin is called.  This should
generate the aforementioned error.  While still in the invalid state
glValidateProgram is called a third time.

Finally, the program is transitioned back to the valid configuration.
Without calling glValidateProgram, glBegin is called.  This should not
generate any error.

All of the state flip-flopping is done in an attempt to catch
implementations that latch state in glValidateProgram and do not
re-validate in glBegin.

NOTE: Mesa fails this test because it does not generate
GL_INVALID_OPERATION the first time glBegin is called.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
sso: Verify results of program pipeline validation when a conflicting sampler configuration is used.

Section 2.11.11 (Shader Execution), subheading "Validation," of the
OpenGL 4.1 spec says:

    "[INVALID_OPERATION] is generated by any command that transfers
    vertices to the GL if:

        ...

        - Any two active samplers in the current program object are of
          different types, but refer to the same texture image unit."

This test verifies this behavior several ways.  First, an invalid
configuration is constructed.  When the pipeline is in the invalid
configuration, glValidateProgramPipeline is used to determine the
status.

The pipeline is then transitioned to a valid configuration, and
glValidateProgramPipeline is called again.

The pipeline is then transitioned back to the invalid configuration.
Without calling glValidateProgramPipeline, glDrawArrays is called.  This
should generate the aforementioned error.  While still in the invalid
state glValidateProgramPipeline is called a third time.

Finally, the pipeline is transitioned back to the valid configuration.
Without calling glValidateProgramPipeline, glDrawArrays is called.  This
should not generate any error.

All of the state flip-flopping is done in an attempt to catch
implementations that latch state in glValidateProgramPipeline and do not
re-validate in glDrawArrays.

NOTE: The work-in-progress GL_ARB_separate_shader_objects implementation
for Mesa currently fails this test because glValidateProgramPipeline
always succeeds, and it does not generate GL_INVALID_OPERATION the first
time glDrawArrays is called.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
normal3b3s-invariance: test GLbyte[3] and GLshort[3] normal vec invariance

Test rendering invariance with GLfloat[3] vs. GLbyte[3] vs. GLshort[3]
normal vectors.  See comments in code for more details.
swapbuffers-behavior: check if swapbuffers swaps or copies

Probe front/back buffers after a SwapBuffers() call to see if the
implementation does a true swap or a back-to-front copy.

There is no pass/fail (except for one sanity check).  This is just
to find out what GL does.
fbo-readpixels: use piglit_get_gl_enum_name() for info/error messages

Reviewed-by: Eric Anholt <eric@anholt.net>
implement new texture swizzle test

The original one didn't test the GL_ONE and GL_ZERO terms and was
pretty compilicated.  This tests all swizzle combinations and is
much simpler.

v2: remove stray '&& pass' per Eric.

Reviewed-by: Eric Anholt <eric@anholt.net>
add new texture swizzle API test

Test for API errors and glGet for GL_EXT_texture_swizzle.

v2: minor re-org, per Eric

Reviewed-by: Eric Anholt <eric@anholt.net>
remove old tex-swizzle test

It didn't test the GL_ONE and GL_ZERO terms and was needlessly
complicated.  Replaced by ext_texture_swizzle-swizzle test.

Reviewed-by: Eric Anholt <eric@anholt.net>
remove glean texSwizzle test

Replaced by spec/ext_texture_swizzle/api.c and swizzle.c tests.

Reviewed-by: Eric Anholt <eric@anholt.net>
glsl-1.20: Add more tests for various 'invariant' scenarios

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
glsl-1.50: Add more tests for various 'invariant' scenarios

These highlight a few cases where we were doing the wrong thing.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
framework: add support for a "timeout" status

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
tests/igt.py: stop tests after 10 minutes

Stop tests if they run for longer than 10 minutes by first sending the
terminate signal and if that fails, send the kill signal to all
processes in the test's process group.

Based on a patch by Tim Gore.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Cc: Tim Gore <tim.gore@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Dylan Baker <baker.dylan.c@gmail.com>
gl-3.1: Add test for attributeless rendering with gl_VertexID

This tests that rendering with no vertex attributes bound works, in the
core profile. The vertex positions are determined using gl_VertexID.

This currently provokes some bad behavior in the i965 backend --
the whole array of constant data gets spilled to scratch to support the
nonconstant index.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
textureGather: Avoid variable length arrays.

Not supported by MSVC.

Reviewed-by: Brian Paul <brianp@vmware.com>
framework: use formatted time values in the HTML report

v2: update for the changes to the test result template and check for None
    in the summary index time value
v3: make some style changes suggested by Dylan Baker and remove explicit
    string conversion

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
cl: Add complex real world test: Pyrit

Pyrit computes pairwise master keys (PMKs) to attack WPA/WPA2-PSK. This
test verifies two aspects:

 - Computation of the second round of a HMAC (using SHA-1).
 - A calculation of the PMK key.

Both tests use test vectors from IEEE 802.11-2012, pre-processed to fit
in the model used by Pyrit (one part is pre-calculated before passing it
to the kernel).

The results have been verified with POCL and r600g (mesa master+llvm
trunk).

Signed-off-by: Peter Wu <lekensteyn at gmail.com>
fbo: use default window size for fbo tests

No regressions with NVIDIA's driver or llvmpipe.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
early-z: use default window size

Reviewed-by: José Fonseca <jfonseca@vmware.com>
framebuffer-srgb: use default window size

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