[Mesa-dev] [PATCH 00/17] dispatch: code generate _mesa_create_exec_table.

Paul Berry stereotype441 at gmail.com
Thu Nov 1 15:19:06 PDT 2012


This patch series replaces the hand-coded function
_mesa_create_exec_table() with an equivalent function that is
generated at compile-time based on the XML in src/mapi/glapi/gen.
This function is responsible for populating the static entries in the
dispatch table with pointers to Mesa functions.

Note that I had to trim down a few patches to make them fit on the
mailing list, so you can't apply the series with "git am".  If you'd
like to test it out, please check out branch "code-gen-api-exec" from
git://github.com/stereotype441/mesa.git.

In order to code generate _mesa_create_exec_table(), I had to add a
few new properties to the XML, to indicate:

- Which functions are deprecated (and hence shouldn't be populated for
  core contexts).

- Which functions are for ES only (and hence shouldn't be populated
  for desktop GL contexts).

- Differences between the name of the function in OpenGL and the name
  of the corresponding Mesa function.

- Which functions are not implemented in Mesa, or have their dispatch
  table updated dynamically based on GL state (and hence shouldn't be
  set up by _mesa_create_exec_table()).

Patch 1 removes some #if conditionals to allow the GLES1.1 dispatch
sanity test to run even if GLES1.1 support isn't being built--this
allows us to get wider test coverage for these changes.

Patches 2-3 do some minor consistency clean-up of the XML--they aren't
strictly necessary for this patch set, but they allowed me to write
some python scripts that read the XML and check that I haven't messed
it up.

Patches 4-10 annotate the XML with the information that will be
necessary to code generate _mesa_create_exec_table().

Patch 11 makes all the functions that will be needed by
_mesa_create_exec_table() non-static, so that
_mesa_create_exec_table() will be able to refer to them.  (Previously,
these functions were inserted into the dispatch table by smaller
functions that _mesa_create_exec_table() would call.  But if we are
code generating _mesa_create_exec_table(), that doesn't make sense).

Patches 12-15 create the code generation script.

Patch 16 adds code generation as a build step.

Patch 17 deletes some functions that are no longer used.

[PATCH 01/17] dispatch: Remove a few FEATURE_ES1 conditionals.
[PATCH 02/17] glapi: Use GL_ or GLX_ prefix for all category names.
[PATCH 03/17] glapi: Mark GLX extensions as window_system="glX".
[PATCH 04/17] glapi: Annotate XML with deprecated="3.1" for deprecated functions.
[PATCH 05/17] glapi: Annotate XML with exec="skip" for unimplemented functions.
[PATCH 06/17] glapi: Annotate XML with exec="dynamic" for dynamic functions.
[PATCH 07/17] glapi: Annotate XML with exec="loopback" for loopback functions.
[PATCH 08/17] glapi: Annotate XML with exec="{es,check}" for special GLES1 functions.
[PATCH 09/17] glapi: Annotate XML with desktop="false" for GLES-only functions.
[PATCH 10/17] glapi: Annotate XML with function name suffix anomalies.
[PATCH 11/17] dispatch: Make all API functions non-static.
[PATCH 12/17] glapi/gen: Comment fix.
[PATCH 13/17] glapi/gen: Gather API version info across aliased functions.
[PATCH 14/17] glapi/gen: handle new XML attributes.
[PATCH 15/17] glapi/gen: Add code generation script for _mesa_create_exec_table().
[PATCH 16/17] dispatch: Code generate api_exec.c.
[PATCH 17/17] dispatch: Delete unused init_dispatch functions.


More information about the mesa-dev mailing list