[Mesa-dev] [RFC] Extract API-dependent code from utilities

Blaž Tomažič blaz.tomazic at gmail.com
Sun Jun 17 06:36:40 PDT 2012


I am working on an OpenCL testing framework for Piglit (XOrg EVoC) and I
want to reorganize Piglit utilities to share more code between different
APIs. I would like some feedback on the matter. Here is a summary of
changes in the included patch [1]:

        Build files were modified to include/link files in targat_api
        files. Piglit utilities for gl are now built into piglitutil_gl
        shared library, while the old piglitutil shared library now
        contains only API-independent code.
        
        Code depending on gl/gles/glut from piglit-util.* was moved to
        piglit-util-gl-common.*. File piglit-util-enum.c was also
        renamed to piglit-util-gl-enum.c and shader-load.c was merged to
        piglit-util.c.
        
        piglit-util-gl-common.h header includes piglit-util.h header so
        including it resolves in same functionality as before when
        including piglit-util.h. All piglit-util.h includes were
        therefore replaced with piglit-util-gl-common.h.
        
The patch is quite big because of the renaming and moving of code. The
only new code is in CMake files in tests/util/CMakeLists.*:

 tests/util/CMakeLists.gl.txt                       |   32 +-
 tests/util/CMakeLists.gles1.txt                    |   15 +-
 tests/util/CMakeLists.gles2.txt                    |   15 +-
 tests/util/CMakeLists.no_api.txt                   |   13 +
 tests/util/CMakeLists.txt                          |   50 +-

Code was moved between next files (the other files can be ignored as
they are only header include renames):

 tests/util/piglit-util-enum.c                      | 2986 --------------------
 tests/util/piglit-util-gl-common.c                 |  359 +++
 tests/util/piglit-util-gl-common.h                 |  206 ++
 tests/util/piglit-util-gl-enum.c                   | 2986 ++++++++++++++++++++
 tests/util/piglit-util.c                           |  483 +---
 tests/util/piglit-util.h                           |  168 +-
 tests/util/shader-load.c                           |  146 -


Any feedback would be appreciated.

[1]
https://raw.github.com/gist/2944540/388882c96edf06f99bdf576e1e87bfeef1072e1a/0001-util-Extract-API-dependent-code-from-utilities.patch



More information about the mesa-dev mailing list