registry: Import gl.xml from Khronos registry

Import revision 26792 on 2014-05-22 from
(https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/api/gl.xml).

I'm importing the Khronox XML because I want to generate piglit-dispatch
code from it rather than scraping GL headers and unmaintained *.spec
files.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
dispatch: Generate piglit-dispatch from Khronos XML

Khronos now generates its headers from XML and no longer maintains the
old, crufty *.spec files. Piglit should do the same. Otherwise,
piglit-dispatch won't be able to pick up new extension functions.

As a really really big bonus, after Piglit starts generating its GL
dispatch code from gl.xml, it's a small step to start generating EGL and
GLX dispatch from egl.xml and glx.xml.

This patch imports 'gl.xml' into a new toplevel 'registry directory, to
follow the precedent of libepoxy.

I did *not* try to redesign piglit-dispatch in this patch. To the
contrary, I attempted to keep the newly generated dispatch code to be as
similar as possible as the old generated code. I did want to clean up
piglit-dispatch's design , but I refrained because "a patch should do
one thing, and do it well".

I strove to keep separate concerns in separate files. File
registry/gl.py parses registry/gl.xml. File tests/util/gen_dispatch.py
consumes the parsing result to generate the code. This decision kept
gen_dispatch.py small and focused.

I hope everyone finds the rewritten gen_dispatch.py more maintainable
and easy to read.

The generated code has changed as following:

  - It now contains the GLES1 API, because gl.xml contains information
    on all OpenGL APIs.

  - The comment block for each function alias set now contains more
    information. For each function in the set, it now lists the
    complete set of providers.

    For example:
      /* glActiveTexture (GL_VERSION_1_3) (GL_VERSION_ES_CM_1_0) (GL_ES_VERSION_2_0) */
      /* glActiveTextureARB (GL_ARB_multitexture) */
      extern PFNGLACTIVETEXTUREPROC piglit_dispatch_glActiveTexture;
      #define glActiveTexture piglit_dispatch_glActiveTexture
      #define glActiveTextureARB piglit_dispatch_glActiveTexture

  - Enums are sorted by group then by value. Old dispatch sorted only by
    value.

    For example:
      /* Enum Group MapBufferUsageMask */
      #define GL_MAP_READ_BIT 0x0001
      #define GL_MAP_READ_BIT_EXT 0x0001
      #define GL_MAP_WRITE_BIT 0x0002
      #define GL_MAP_WRITE_BIT_EXT 0x0002
      ...

  - After function resolve_glCheeseCake resolved the proc address for
    glCheeseCake, old dispatch assigned the proc address to
    piglit_dispatch_glCheeseCake. Function resolve_glCheeseCake returns
    the proc address in new dispatch, and then function
    stub_glCheeseCake performs the assignment to
    piglit_dispatch_glCheeseCake. This difference resulted in no
    behavioral change, and removed the need for superfluous typecasting.

Tested for regressions with:
    piglit run -p x11_egl -x glx -x glean
    Mesa 10.2.1
    Intel Ivybridge
    Fedora 20

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
util: Generate piglit_get_gl_enum_name() and friends

This patch removes the files piglit-util-gl*-enum.c and instead replaces
them with a single piglit-util-gl-enum-gen.c generated from the Khronos
XML.

The two functions now generated are:
    piglit_get_gl_enum_name(GLenum param)
    piglit_get_prim_name(GLenum prim)

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
glapi: Remove the glapi directory

The directory is no longer used because Piglit now generates
piglit-dispatch from the Khronos XML.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
util: Rename generated dispatch files

Rename
  generated_dispatch.[ch] -> piglit-dispatch-gen.[ch]
to match the filename convention followed by all other files in
tests/util.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
dispatch: Use piglit-dispatch for GLES1

After having migrated piglit-dispatch to the Khronos XML,
moving GLES1 to piglit-dispatch was easy. This patch:

  1. Fixes gl_wrap.h to stop include piglit-dispatch-gen.h instead of
     <GLES/*.h>.
  2. Deletes some ugly macro workarounds for GLES1 that piglit-dispatch
     obsoletes.
  3. Add piglit-dispatch*.c to libpiglitutil_gles1 in the CMake.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>