[Piglit] [PATCH v2 07/13] piglit-dispatch: Code generation scripts.

Chad Versace chad.versace at linux.intel.com
Tue Mar 13 11:34:26 PDT 2012


On 03/12/2012 02:41 PM, Paul Berry wrote:
> This patch contains the code generation scripts that convert the files
> gl.spec, gl.tm, and enumext.spec into C code, as well as the CMake
> directives to run the script.
> 
> Code generation occurs in two phases: first the script
> glapi/parse_glspec.py converts the .spec and .tm files into an
> intermediate JSON format, which is stored in glapi/glapi.json.  Then,
> the script tests/util/gen_dispatch.py converts the JSON file into two
> files, tests/util/generated_dispatch.c and
> tests/util/generated_dispatch.h.
> 
> There are two motivations for breaking code generation into two phases:
> (1) there are other code generation tasks we may add in the future
> (e.g. generating the tests/util/piglit-util-enum.c file), and it would
> be nice not to have to rewrite any parsing code when we do so.  (2) if
> the GL consortium ever decides to change the format of gl.spec, gl.tm,
> and enumext.spec, then we only have to change parse_glspec.py.
> 
> These code generation scripts can be run by invoking "make
> piglit_dispatch_gen" from the toplevel source directory.
> ---
>  CMakeLists.txt              |    3 +
>  cmake/piglit_dispatch.cmake |   42 +++
>  cmake/piglit_glapi.cmake    |   37 +++
>  glapi/parse_glspec.py       |  407 ++++++++++++++++++++++++++++
>  tests/util/gen_dispatch.py  |  616 +++++++++++++++++++++++++++++++++++++++++++
>  5 files changed, 1105 insertions(+), 0 deletions(-)
>  create mode 100644 cmake/piglit_dispatch.cmake
>  create mode 100644 cmake/piglit_glapi.cmake
>  create mode 100644 glapi/parse_glspec.py
>  create mode 100644 tests/util/gen_dispatch.py

Could you post v2, which contains the additional comments and typo fixes?

Chad Versace
chad.versace at linux.intel.com


More information about the Piglit mailing list