[Mesa-dev] merging glapi-reorg branch

Chia-I Wu olvaffe at gmail.com
Tue Oct 26 21:06:50 PDT 2010


Hi all,

I've pushed a new branch, glapi-reorg

  http://cgit.freedesktop.org/mesa/mesa/log/?h=glapi-reorg

to reorganize glapi headers.

It turns out that glapidispatch.h and glapioffsets.h are core mesa
headers.  The branch drops the use of both headers in glapi and glx
(which is considered an extension to glapi when it comes to defining
public GL entries).   The headers are then moved to core mesa and
merged.

A terse example of what are in the headers is

  #if !defined(_GLAPI_USE_REMAP_TABLE)
  #  define _gloffset_AttachShader 408
  #  define GET_AttachShader(disp) ((disp)->AttachShader)
  #else
  #  define _gloffset_AttachShader \
        driDispatchRemapTable[AttachShader_remap_index]
  #  define GET_AttachShader(disp) \
        GET_by_offset(disp, driDispatchRemapTable[AttachShader_remap_index])
  #endif

These defines allow core mesa to be compiled for DRI drivers or
non-DRI drivers depending on whether _GLAPI_USE_REMAP_TABLE is
defined.  They are not needed in glapi.  Actually, glapi will not
compile when _GLAPI_USE_REMAP_TABLE is defined.

Other than moving the headers to core mesa, the branch also turns the
above example into

  #if !defined(_GLAPI_USE_REMAP_TABLE)
  #  define _gloffset_AttachShader 408
  #else
  #  define _gloffset_AttachShader \
        driDispatchRemapTable[AttachShader_remap_index]
  #endif
  #define GET_AttachShader(disp) \
        GET_by_offset(disp, _gloffset_AttachShader)

and drops glapitable.h includes from core mesa.  So other than
dropping glapidispatch.h and glapioffsets.h from glapi, the branch
also identifies that glapitable.h is a private header of glapi.

I am working on making libGL.so support multiple APIs (or profiles in
light of GLX_EXT_create_context_es2_profile).  This reorganization is
not a prerequisite to that, but it makes the fact that _glapi_table is
opaque to core mesa more clear.

If there is no objection, I'd like to merge it this week.

-- 
olv at LunarG.com


More information about the mesa-dev mailing list