ARB_sample_shading: Add test to verify new functions and enums

Tests basic functionality of function:
MinSampleShadingARB()
and enums:
SAMPLE_SHADING_ARB
MIN_SAMPLE_SHADING_VALUE_ARB

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
ARB_sample_shading: Add test to verify the functionality of gl_NumSamples

V2: Get rid of redundant projection matrix.
V3: Use piglit_draw_rect() and get rid of redundant code.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
ARB_sample_shading: Add test to verify the functionality of gl_SampleID

V2: Get rid of redundant projection matrix.
V3: Draw to a multisample texture and use it later to verify
    the expected color of each sample.
    Use piglit_draw_rect() and get rid of redundant code.
    Use piglit_vertex in vertex shader.
    Use piglit_link_simple_program().

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
ARB_sample_shading: Add test to verify the functionality of gl_SampleMask[]

V2: Get rid of redundant projection matrix.
V3: Draw to a multisample texture and use it later to verify
    the expected color of each sample.
    Use piglit_draw_rect() and get rid of redundant code.
    Use piglit_vertex in vertex shader.
    Use piglit_link_simple_program().

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
ARB_sample_shading: Add test to verify the functionality of gl_SamplePosition

V2: Use better technique to verify sample positions in fragment shader.
    Get rid of redundant projection matrix.
V3: Define a macro for maximum number of samples supported by the test.
    Use piglit_draw_rect().

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
ARB_sample_shading: Add compiler tests for new builtins

Tests gl_SamplePosition,
      gl_SampleID,
      gl_NumSamples,
      gl_SampleMask[]

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Move multisample blit scaled tests to spec/ext_framebuffer_multisample_blit_scaled

We moved Fbo and TestPattern classes to a global location tests/util in
commit 9c1b2ac. Now, the functions from these classes can be utilized
from spec/ext_framebuffer_multisample_blit_scaled directory.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
clearbuffer-display-lists: GL_BACK_is not allowed as drawbuffer

Only 0 to MAX_DRAW_BUFFERS-1 is allowed. If you want to clear GL_BACK,
call glDrawBuffers(GL_BACK) and then glClearBuffer(GL_COLOR, 0, ..).

Reviewed-by: Brian Paul <brianp@vmware.com>
gl30basic: test glClearBuffer(GL_COLOR), use piglit API

This adds testing of GL_FRONT, GL_BACK, and GL_FRONT_AND_BACK.

Reviewed-by: Brian Paul <brianp@vmware.com>
clearbuffer-mixed-format: actually test with multiple draw buffers

This test was REALLY BAD.

Even though it created a FBO with multiple color attachments, the resulting
framebuffer had only one attachment, so it didn't actually test mixed formats.
You could have just created a separate FBO for each renderbuffer and
the behavior would be exactly the same.

That's not all. If you do e.g. glDrawBuffer(GL_COLOR_ATTACHMENT3), you should
clear it with glClearBuffer(GL_COLOR, 0), because it's GL_DRAW_BUFFER0.
Clearing any other drawbuffer should be a no-op, which proves Mesa is
incorrect too.

Reviewed-by: Brian Paul <brianp@vmware.com>
Fix piglit syle in GL_ARB_sync/sync-initialize.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Fix spurious failures in GL_ARB_sync/sync-initialize.

You can't just fire off some rendering and assert that it won't be
done by the time you get around to executing your query.  Plus the
rendering was broken and throwing INVALID_OPERATION when the test was
executed in core mode, anyway, since there was no shader bound.

Reviewed-by: Matt Turner <mattst88@gmail.com>
glsl-1.20: Negative test redeclaration of gl_TexCoord

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
glsl-1.20: Test sizing an array by initialization after the array has been accessed

The "big-enough" test verifies that the compiler accepts an initializer
used to size an array after an access (to the previously implicitly
sized array) has been seen when the access would have been in-bounds in
the sized array.

The "too-small" test verifies that the compiler rejects an initializer
used to size an array after an access (to the previously implicitly
sized array) has been seen when the access would have been out-of-bounds
in the sized array.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
Use piglit_vertex to properly interface with piglit_draw_rect()

Also, use piglit_link_simple_program(). It ensures that
piglit_vertex gets assigned to the proper attribute slot.
This patch fixes these tests currently failing on mesa.

V2: Use piglit_build_simple_program().
    Also, make similar changes to builtin-sample_id and
    builtin-sample-mask tests.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
texture_rectangle: Whitespace / trivial cleanups.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
texture_rectangle: Also test the other mirror wrap modes

These aren't part of GL 3.3, but they should generate GL_INVALID_ENUM
when used.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Add new concurrency option

This patch adds a new concurrency option that runs all tests out of a
multi-threaded pool, ignoring their request to be threaded or not. This
new option is mutually exclusive with the -1/--no-concurrency option.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
util: Do not define asprintf for MinGW.

MinGW provides asprintf in stdio.h.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72556
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
copyteximage: Don't use fixed-function for array textures

GL_EXT_texture_array does not add support for array textures with fixed
function.  The only reason this ever worked with Mesa is because Mesa
also supported GL_MESA_texture_array... which does add support for array
textures with fixed function.

For the GL_TEXTURE_1D_ARRAY and GL_TEXTURE_2D_ARRAY cases, the test now
uses a fragment shader that interacts with fixed-function vertex
processing.

I can't see how the GL_TEXTURE_1D_ARRAY or GL_TEXTURE_2D_ARRAY cases
could have ever worked on any implementation other than Mesa.  There are
currently patches on the mesa-dev list that remove support for
GL_MESA_texture_array, and these patches cause the unpatched version of
this test to fail.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>