glapi: Fix a comment about category names.

Looking at gl.spec and the regexps, that's not what this function did.

v2: Fix incorrect "GL_" prefix, noted by Paul.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
piglit: Make callers of piglit_dispatch_default_init() specify the API.

To automatically detect the current API, we'd need to make calls to
piglit_is_gles() and piglit_get_gl_version(), while bypassing the
dispatch mechanism we're trying to initialize.  That seems tricky,
while the context type is probably going to be known by the caller
when we extend dispatch to GLES tests.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
util: Remove PIGLIT_DISPATCH_GL_FWD.

Since I'm making the first actual use of this api parameter, and I
don't know what it would have done, just remove it.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
piglit: Prefer waffle's getprocaddress/dlsym() support to our own.

Notably, waffle has EGL bits which this stuff doesn't.  We can't
globally enable this and remove the old platform-specific
dlsym/getprocaddress code, because waffle isn't always built against
yet, and even when we're building against it, it's not used in some of
the EGL/GLX tests (yet, at least).

v2: Note that the non-waffle functions are ignored in the waffle
    build.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
gen_dispatch: Convert tabs to spaces here, too.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
glapi: Factor out adding a function to the API.

This will be shared with GLES code, and modified to support multiple
categories (GL versions or extensions) defining the same function
name.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
glapi: Allow one function name to be in multiple categories.

The gl.spec file doesn't list the same function name in multiple
categories even when it should (such as glGenQueries between core nad
GL_EXT_timer_query), so it hasn't been handled, even though it is a
bug in piglit_dispatch.  With the gl2ext.h parsing for GLES2 our data
source will be giving us instances of this that we need to handle
successfully, so add support for it now.

This also means we'll be able to add annotation of gl.spec for
additional categories for functions if we find we need to.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
glapi: Add dispatch generation support for GLES APIs.

There's no incoming data yet to trigger this code, though.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
glapi: Fix some missing prototype parameter names in gl2ext.h.

The file is almost consistent in providing parameter names, except for
a few functions.  Instead of parsing the typedefs below and trying to
match them up for generating our own function implementations, just
fix up the header file.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
glapi: Parse the GLES3 core header for piglit-dispatch.

This gets us piglit-dispatch support for all the core functions of
GLES2/3.

v2: Improve the python-style-ness of the argument parsing code (thanks
    Paul!)

Reviewed-by: Paul Berry <stereotype441@gmail.com>
glapi: Add parsing of GLES2/gl2ext.h.

Weirdly, the gl3ext.h has no entries currently, and to access
extensions from GLES3 you need to include this GLES2 header.

We now have code-generated piglit-dispatch support for all of desktop,
GLES2, and GLES3.

v2: Express the corename substitution as a regexp. (suggestion by Paul)

Reviewed-by: Paul Berry <stereotype441@gmail.com>
gl2ext.h: Add a "const" annotation that was missing in the GLES variant.

Desktop GL added the extra const annotation, and missing it was
producing compile warnings in piglit dispatch once it's enabled.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Add a local definition of GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS.

This is the only GLES2 enum we were using in our source code that
isn't in enum.spec or enumext.spec (though 3 synonyms were).

Reviewed-by: Paul Berry <stereotype441@gmail.com>
glapi: Build and use piglit-dispatch for GLES2.

We still build separate binaries because we aren't dynamically loading
the GL for multi-API test sources, but we can almost completely use
the same source file for the two builds, relying on piglit-dispatch to
make up most of the difference.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
all.tests: Run ES3 conformance tests if the symlink (bin/GTF3) is present.

This is just like how we did the ES2 conformance tests if bin/GTF was
present.  We can't just link an ES3 conformance build as bin/GTF,
because piglit will then try to run a bunch of desktop GL tests that
emit an error.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
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.

v2: removed ifdefs as suggested by Eric Anholt.

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>