cl: check for cl_khr_fp64 in generated double store tests

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
cl-program-tester: Allow double type

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
cl: Add buffer-flags test

v2: Rework to use subtests
v3: fix printf output
    use piglit_merge_result
    whitespace fixes
    0 as default was added in OpenCL 1.2

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Test some corner cases of loop analysis.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
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>