Always print what is being probed

Reviewed-by: Paul Berry <stereotype441@gmail.com>
read-front: modify the test to reproduce an MSAA front buffer bug in st/dri

v2: move the clearing code to piglit_display
Add -samples=n command-line argument forcing MSAA visuals

v2: combining -fbo and -samples should report FAIL

Reviewed-by: Paul Berry <stereotype441@gmail.com>
glx-copy-sub-buffer: accept -samples=n

Reviewed-by: Paul Berry <stereotype441@gmail.com>
all.tests: enable testing of MSAA visuals for a few selected tests

These tests have proved to be useful for implementing and fixing MSAA
visuals.

I also recommend the mesa/demos tests "reflect" and "copypixrate" to test front
buffer MSAA rendering.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
glslparsertest: Fix handling of GL_GEOMETRY_VERTICES_OUT_ARB.

When testing geometry shaders, glslparsertest must set
GL_GEOMETRY_VERTICES_OUT_ARB before linking, since the default value
of this setting (0) is fairly useless.

Previously, we were accidentally passing the shader name to
glProgramParameteri() instead of the program name, causing spurious
errors.

Reviewed-by: Eric Anholt <eric@anholt.net>
shader_runner: Use piglit_height for framebuffer height.

It used to be piglit_width which works, too, as the framebuffer is hardcoded
to 250x250 pixels.

Signed-off-by: Fabian Bieler <fabianbieler@fastmail.fm>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
shader_runner: Allow new drawing modes.

Add primitives with adjacency and (for extreme future-proofness) patches to
recognized drawing modes.

Signed-off-by: Fabian Bieler <fabianbieler@fastmail.fm>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
util: Draw rectangles using triangle strips instead of quads.

This is useful for core profile OpenGL contexts and geometry shaders.

Signed-off-by: Fabian Bieler <fabianbieler@fastmail.fm>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
shader_runner: Draw instanced rectangles using triangle strips instead of quads.

This is useful for core profile OpenGL contexts and geometry shaders.

Signed-off-by: Fabian Bieler <fabianbieler@fastmail.fm>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
arb_geometry_shader4: Test valid input primitives.

Test that glProgramParameter() triggers the required errors.

The geometry shader input primitive type is limited to a subset
of OpenGL primitive types.

From the ARB_geometry_shader4 spec (section Errors):
"The error INVALID_VALUE is generated by ProgramParameteriARB if <pname> is
GEOMETRY_INPUT_TYPE_ARB and <value> is not one of POINTS, LINES,
LINES_ADJACENCY_ARB, TRIANGLES or TRIANGLES_ADJACENCY_ARB."

Signed-off-by: Fabian Bieler <fabianbieler@fastmail.fm>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
arb_geometry_shader4: Test valid output primitives.

Test that glProgramParameter() triggers the required errors.

The geometry shader output primitive type is limited to a subset
of OpenGL primitive types.

From the ARB_geometry_shader4 spec (section Errors):
"The error INVALID_VALUE is generated by ProgramParameteriARB if <pname> is
GEOMETRY_OUTPUT_TYPE_ARB and <value> is not one of POINTS, LINE_STRIP or
TRIANGLE_STRIP."

Signed-off-by: Fabian Bieler <fabianbieler@fastmail.fm>
arb_geometry_shader4: Test valid vertices out count.

Test that glProgramParameter() triggers the required errors.

The value of GEOMETRY_VERTICES_OUT is limited by the implementation
dependend constants MAX_GEOMETRY_OUTPUT_VERTICES and
MAX_VERTEX_VARYING_COMPONENTS.

From the ARB_geometry_shader4 spec (section Errors):
"The error INVALID_VALUE is generated by ProgramParameteriARB if <pname> is
GEOMETRY_VERTICES_OUT_ARB and <value> is negative.

The error INVALID_VALUE is generated by ProgramParameteriARB if <pname> is
GEOMETRY_VERTICES_OUT_ARB and <value> exceeds
MAX_GEOMETRY_OUTPUT_VERTICES_ARB.

The error INVALID_VALUE is generated by ProgramParameteriARB if <pname> is
set to GEOMETRY_VERTICES_OUT_ARB and the product of <value> and the sum of
all components of all active varying variables exceeds
MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB."
squash! arb_geometry_shader4: Test valid vertices out count.

Don't count gl_Position against MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS.
arb_geometry_shader4: Test valid drawing modes.

Test that glDrawArrays() triggers the required errors.

The geometry shader input type limits the valid primitive types of glBegin()
(including implicit glBegin()).

From the ARB_geometry_shader4 spec (section Errors):
"The error INVALID_OPERATION is generated if Begin, or any command that
implicitly calls Begin, is called when a geometry shader is active and:

    * the input primitive type of the current geometry shader is
      POINTS and <mode> is not POINTS,

    * the input primitive type of the current geometry shader is
      LINES and <mode> is not LINES, LINE_STRIP, or LINE_LOOP,

    * the input primitive type of the current geometry shader is
      TRIANGLES and <mode> is not TRIANGLES, TRIANGLE_STRIP or
      TRIANGLE_FAN,

    * the input primitive type of the current geometry shader is
      LINES_ADJACENCY_ARB and <mode> is not LINES_ADJACENCY_ARB or
      LINE_STRIP_ADJACENCY_ARB, or

    * the input primitive type of the current geometry shader is
      TRIANGLES_ADJACENCY_ARB and <mode> is not
      TRIANGLES_ADJACENCY_ARB or TRIANGLE_STRIP_ADJACENCY_ARB."

Signed-off-by: Fabian Bieler <fabianbieler@fastmail.fm>
arb_geometry_shader4: Link without vertex shader.

Test that linking fails without vertex shader present.

ARB_geometry_shader4 spec 2.15.2:
"Linking will also fail if the program object contains objects to form a
geometry shader (see section 2.16), but no objects to form a vertex shader"

Signed-off-by: Fabian Bieler <fabianbieler@fastmail.fm>
arb_geometry_shader4: Test input overrun.

Test that linking fails if the geometry shader accesses more components than
are available for every input primitive type.

ARB_geometry_shader4 spec 2.16.1:
"However, a program object, containing a shader object that access more input
vertices than are available for the input primitive type of the program
object, will not link."

Signed-off-by: Fabian Bieler <fabianbieler@fastmail.fm>
arb_geometry_shader4: Test indexing geometry shader input arrays.

All geometry shader input varyings are arrays.
Array varyings are two-dimensional arrays.

Test indexing of scalar, vector and matrix varyings.

Signed-off-by: Fabian Bieler <fabianbieler@fastmail.fm>
arb_geometry_shader4: Test that adjacent vertices are ignored when no geometry shader is active.

Draw the adjacency version of a primitive in red and blend the normal version
of that primitive in green on top of it. Check that the entire framebuffer is
yellow or black.

Test this with and without indexed drawing (glDrawElements and glDrawArrays).

ARB_geometry_shader4 spec 2.6.1:
"If a geometry shader is not active, the "adjacent" vertices are ignored."

Signed-off-by: Fabian Bieler <fabianbieler@fastmail.fm>
Reviewed-by: Brian Paul <brianp@vmware.com>
arb_geometry_shader4: Test geometry shader that doesn't generate any primitives.

Signed-off-by: Fabian Bieler <fabianbieler@fastmail.fm>