fbo-framework: check for ARB_framebuffer_object

If we just blindly call glBindFramebuffer, that will cause the piglit
test to skip. Make sure that ARB_framebuffer_object is supported first.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
framework: flush out screen prints explicitly

Without the flush, updates only happen whenever the buffer overfills,
which can be tens of tests.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
framework: there are 0 completed tests at the beginning

This fixes a minor annoyance, that the test id displayed was lower than
the completed count in single-threaded runs.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
framework: keep track of running stats and display them

This will display a line that looks like:
[00076/11064] fail: 1, pass: 55, skip: 19 Running Test(s): 00075

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
arb_vertex_array_bgra: Test that the valid usage is accepted

This is mostly copied from vertex-array-bgra.c.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
arb_vertex_array_bgra: Test all the invalid types

Inspired by by code in vertex-array-bgra.c.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
arb_vertex_array_bgra: Remove vertex-array-bgra.c

It was redundant with arb_vertex_array_bgra-api-errors, and it had some
bugs that were already fixed in arb_vertex_array_bgra-api-errors.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
glean: Remove VertArrayBGRATest::testAPI

It was redundant with arb_vertex_array_bgra-api-errors, and it had some
bugs that were already fixed in arb_vertex_array_bgra-api-errors.  I'm
keeping the glean rendering test because I believe that it's the only
rendering test in piglit for BGRA arrays.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
texturing/s3tc-errors: double check GL_TEXTURE parameters and alloc

If the GL does not actually support one of the compression formats in
s3tc_formats, it may silently choose a different actual internalformat.

In such a case, the resulting compressed image size may be larger,
leading to memory corruption when the bigger-than-expected image is read
back with glGetCompressedTexImage() into a buffer that was allocated to
the expected, smaller, size.

Instead, first confirm the texture has really been compressed, that the
format is as expected, and that the size matches our pre-computed
expected size.  If any of these fail, set pass to false and spit an
error, but keep going, using the actual format and size returned by the
GL.

Ian Romanick pointed out that "if we're going to all this effort, we
should probably go all the way. A follow-on patch should check that
glGetCompressedTexImage doesn't over-run the buffer."

v2:
 * Fixed parameter check block format per Ian Romanick review
 * Updated commit message title per Brian Paul review
 * Function call continuation lines align with open '(' (like in rest of
   file).

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Make the generated constant array size tests respect extensions.

In 89603add5ad0bf02fcfcb7fdc0149c09f5aa2988, I neglected to update the
constant array size test generator.  In the following commit, I added a
bunch of AMD_shader_trinary_minmax tests which then got generated
without the #extension directive and put in the wrong place.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Add multisample scaled blit tests to all.py.

These were accidentally forgotten, so the actual rendering tests never
got run---only the negative/error checking test.
glx_oml_sync_control: report FAIL if glXGetMscRateOML returns an error

The glx_oml_sync_control does not parse parameters.  In particular, it
does not parse the "-auto" flag to set piglit_automatic.

So, when we return FAIL from draw(), it returns to the
piglit_glx_event_loop, which just continues to spin waiting for events.
Instead, just report the FAIL result, which quits the program.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
util: Mark piglit_report_result with noreturn attribute.

This silences several false compiler warnings with Clang.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
util: Move NORETURN attribute from end to start of function prototype.

This patch fixes the MSVC build failure introduced with commit
88d03d90b75efaae02f6d768997d825e664d1151.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Add a rendering test for GL_ARB_stencil_texturing.

The GL_ARB_stencil_texturing extension allows sampling from either the
depth or stencil components of combined GL_DEPTH_STENCIL textures.  To
select which component to sample, applications can call TexParameter
with a pname of GL_DEPTH_STENCIL_TEXTURE_MODE and value of either
GL_DEPTH_COMPONENT or GL_STENCIL_INDEX.

This test verifies that both depth and stencil texturing works as
expected.  In particular, it verifies that the shader samples the
correct locations.

I chose a 256x256 texture since it's larger than i965's Y-tiling format
(64) and W-tiling-interpreted-as-Y (128).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Add ARB_stencil_texturing test to all.py.

I made this change and did 'git commit --amend', but forgot '-a', so
nothing happened.
glsl-1.10: Expect __ tests to pass

From page 14 (page 20 of the PDF) of the GLSL 1.10 spec:

    "In addition, all identifiers containing two consecutive underscores
     (__) are reserved as possible future keywords."

The intention is that names containing __ are reserved for internal use
by the implementation, and names prefixed with GL_ are reserved for use
by Khronos.  Names simply containing __ are dangerous to use, but should
be allowed.

Per the Khronos bug mentioned below, a future version of the GLSL
specification will clarify this.

NOTE: This test will fail on stable Mesa branches until changes to Mesa
are picked back.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Tapani Pälli <lemody@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71870
Bugzilla: Khronos #11702
glsl-1.30: Expect __ tests to pass

Section 3.3 (Preprocessor) of the GLSL 1.30 spec (and later) and the
GLSL ES spec (all versions) say:

    "All macro names containing two consecutive underscores ( __ ) are
    reserved for future use as predefined macro names. All macro names
    prefixed with "GL_" ("GL" followed by a single underscore) are also
    reserved."

The intention is that names containing __ are reserved for internal use
by the implementation, and names prefixed with GL_ are reserved for use
by Khronos.  Since every extension adds a name prefixed with GL_ (i.e.,
the name of the extension), that should be an error.  Names simply
containing __ are dangerous to use, but should be allowed.  In similar
cases, the C++ preprocessor specification says, "no diagnostic is
required."

Per the Khronos bug mentioned below, a future version of the GLSL
specification will clarify this.

NOTE: This test will fail on stable Mesa branches until changes to Mesa
are picked back.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Tapani Pälli <lemody@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71870
Bugzilla: Khronos #11702
glsl-es-3.00: Verify that predefined macros cannot be undefined

Section 3.4 (Preprocessor) of the OpenGL ES Shading Language 3.00 spec
says:

    "It is an error to undefine or to redefine a built-in (pre-defined)
    macro name."

NOTE: These tests currently fail on Mesa.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
glean/texswizzle: Fix GCC return-type warning.

This patch fixes this GCC return-type warning.

ttexswizzle.cpp: In member function 'GLubyte GLEAN::TexSwizzleTest::Swizzle(const GLubyte*, GLenum)':
ttexswizzle.cpp:119:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>