generated_tests: Fix geometry shader tests to use gl_VerticesIn

Commit ff315ae (Add geometry testing to code-generated tests)
erroneously omitted the parentheses when calling
glPositionIn.length().  It also failed to account for the fact that
the .length() method is unavailable in GLSL 1.10.

This patch modifies the code to use gl_VerticesIn instead, since this
is provided by ARB_geometry_shader4, and hence is available regardless
of the GLSL version being tested.

Thanks to Ken Phillis Jr for discovering this bug.

Cc: Ken Phillis Jr <kphillisjr@gmail.com>
glslparsertest: Fix parsing of GL_SHADING_LANGUAGE_VERSION in GLES.

In desktop GL, glGetString(GL_SHADING_LANGUAGE_VERSION) returns a
string that begins with the supported version number.  But in GLES,
the version number is preceded by the text "OpenGL ES GLSL ES ".  This
was causing glslparsertest to fail to parse the implementation's
supported GLSL version, and that in turn caused parse_glsl_version()
function to access uninitialized memory.

This patch splits parse_glsl_version() into two functions:
parse_glsl_version_number(), which parses the bare version number, and
parse_glsl_version_string(), which expects the prefix "OpenGL ES GLSL
ES " when compiled for GLES testing.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Tom Gall <tom.gall@linaro.org>

v2: Use runtime detection of GLES vs desktop GL.
glslparsertest: Don't require ES compatibility extensions when testing GLES.

glslparsertest should only check for the presence of
GL_ARB_ES{2,3}_compatibility when the test is running under desktop
GL.  GLES never exposes these extensions.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Tom Gall <tom.gall@linaro.org>

v2: Use runtime detection of GLES vs desktop GL.
glslparsertest: Avoid uninitialized vars in parse_glsl_version_number.

Previously, if the user specified an ill-formed GLSL version number
(or the implementation supplied an ill-formed number in its response
to glGetString(GL_SHADING_LANGUAGE_VERSION)), glslparsertest would
access uninitialized variables, resulting in unpredictable (and often
confusing) behaviour.

With this patch, glslparser test accepts version numbers either of the
form "<int>" or "<int>.<int>".  Ill-formed version numbers lead to a
test failure.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Tom Gall <tom.gall@linaro.org>

v2: Add comment explaining the use of sscanf(...) == 0.
framework: Fix issue with generating a report on a Windows system.

Was getting error about an unknown keyword 'wglinfo'.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
glx-query-drawable: Require GLX 1.3

... since that's when it was added.

Signed-off-by: Adam Jackson <ajax@redhat.com>
glx-query-drawable: Add cases for all drawable types

Default is still the GLX 1.2 thing of using a raw Window not a
GLXWindow.

Signed-off-by: Adam Jackson <ajax@redhat.com>
glx: Add GLX 1.3 variants of glx-query-drawable to all.tests

Keep the 1.2-style test name in place to make results before and after
easy to compare.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Change expected behavior for #if with undefined macros.

The GLSL 1.30 specification deviated from the standard behavior of C
preprocessors everywhere by making an undefined macro an error rather
than treating it as a value of 0. This was not actually useful, and
this exception to the standard behavior is dropped in GLSL 4.30.

In the meantime, popular implementations have been ignoring the
specified behavior and implementing the standard behavior anyway. So
expect that.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51631

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
glsl-1.50: add test for interface block member qualifier mismatch

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
glsl-1.10: add uniform type mismatch link test

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
glsl-es-3.00: add uniform block type mismatch link test

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
glsl-1.50: attribute keyword is not allowed within an interface block

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
glsl-1.50: varying keyword is not allowed within an interface block

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
glsl-1.50: add simple test for varying interface block

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
glsl-1.50: move interface-blocks-simple-varying to execution dir

This is not a linker test, but rather tests the execution
of a simple shader utilizing interface blocks.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
arb_texture_multisample: add cmake plumbing

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
arb_texture_multisample: new minmax test

Verifies new minimum maximums in ARB_texture_multisample:

GL_MAX_COLOR_TEXTURE_SAMPLES >= 1
GL_MAX_DEPTH_TEXTURE_SAMPLES >= 1
GL_MAX_INTEGER_SAMPLES >= 1
GL_MAX_SAMPLE_MASK_WORDS >= 1

V2: - Don't specify the window size; we don't render anything
      so we don't care.
    - Use piglit_minmax_pass so we actually fail the test if things
      are broken.

V4: - Add missing copyright notice.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
arb_texture_multisample: new test for fb configs

This tests FBO setup with various combinations of multisample textures
and `classic` multisample renderbuffers, and for each, checks:

- That the renderbuffers or textures can be created
- Completeness status

If the configuration is expected to work, additionally:
- Actual sample count >= requested sample count
- Sample positions meet spec requirements (all obtainable, and in [0,1]

Covers the fixedsamplelocations and sample count consistency
requirements in the spec.

V2: - Don't specify window size, we don't care.
    - Add comment about internalformat defaulting.
    - Don't specify dims, sample count per attachment; attachment
      is either multisampled or not, dims are always the same.
    - Report each config result using subtests
    - Support testing different sample counts, and test 2/4/6/8/16
        samples in all.tests. Unsupported sample counts are skipped.
    - Fixup for signature change of piglit_report_subtest_result.
    - Test some multisample array scenarios too.
    - Lookup enum names for some of the output, to make it easier to
        read.
    - Remove the bogus stencil texture case, it's not valid.
    - Skip subtests which can't work with the sample limits exposed
        by the driver, rather than just failing.

V2: - Add missing copyright notice.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
arb_texture_multisample: new test for teximage state

This tests that the new teximage state added in ARB_texture_multisample
exists and has correct defaults for non-multisample textures:

    - GL_TEXTURE_SAMPLES = 0
    - GL_TEXTURE_FIXED_SAMPLE_LOCATIONS = true

V2: - Don't specify window size, we don't care.
V4: - Add missing copyright notice.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>