mesa: merge glapidispatch.h into dispatch.h

glapidispatch.h was located in glapi and shared with mesa core.  Because
the way it was shared, mesa core must include it indirectly via
main/dispatch.h.

Now that it is no longer needed by glapi and is located in core mesa,
merging it with main/dispatch.h to avoid wrong uses.
This commit is contained in:
Chia-I Wu 2011-06-08 22:24:32 +08:00
parent 0dc45374f2
commit 4bb748b609
8 changed files with 12257 additions and 12298 deletions

View File

@ -40,7 +40,7 @@
#include "glapi.h"
#include "glapitable.h"
#include "glapidispatch.h"
#include "main/dispatch.h"
#include "apple_glx.h"
#include "apple_xgl_api.h"
@ -83,7 +83,7 @@ void apple_xgl_init_direct(void) {
assert(__ogl_framework_api);
/* to update:
* for f in $(grep SET_ ../../mesa/main/glapidispatch.h | grep INLINE | sed 's:^.*\(SET_[^(]*\)(.*$:\1:' | sort -u); do grep -q "$f(" apple_glapi.c || echo $f ; done | sed 's:SET_\(.*\)$: SET_\1(__ogl_framework_api, dlsym(handle, "gl\1"))\;:'
* for f in $(grep SET_ ../../mesa/main/dispatch.h | grep INLINE | sed 's:^.*\(SET_[^(]*\)(.*$:\1:' | sort -u); do grep -q "$f(" apple_glapi.c || echo $f ; done | sed 's:SET_\(.*\)$: SET_\1(__ogl_framework_api, dlsym(handle, "gl\1"))\;:'
*/
SET_Accum(__ogl_framework_api, dlsym(handle, "glAccum"));

View File

@ -5,7 +5,7 @@ include $(TOP)/configs/current
OUTPUTS := \
glapi_mapi_tmp.h \
main/glapidispatch.h \
main/dispatch.h \
main/remap_helper.h
COMMON = gl_and_es_API.xml gl_XML.py glX_XML.py license.py typeexpr.py
@ -57,7 +57,7 @@ endef
$(PYTHON2) $(PYTHON_FLAGS) $< \
--printer $(PRINTER) --mode lib $(GLAPI)/gl_and_es_API.xml > $@
%/main/glapidispatch.h: $(GLAPI)/gl_table.py $(COMMON)
%/main/dispatch.h: $(GLAPI)/gl_table.py $(COMMON)
$(call gen-glapi,-c -m remap_table)
%/main/remap_helper.h: $(GLAPI)/remap_helper.py $(COMMON)

View File

@ -27,7 +27,7 @@ MESA_OUTPUTS = \
$(MESA_GLAPI_OUTPUTS) \
$(MESA_GLAPI_ASM_OUTPUTS) \
$(MESA_DIR)/main/enums.c \
$(MESA_DIR)/main/glapidispatch.h \
$(MESA_DIR)/main/dispatch.h \
$(MESA_DIR)/main/remap_helper.h \
$(MESA_GLX_DIR)/indirect.c \
$(MESA_GLX_DIR)/indirect.h \
@ -180,7 +180,7 @@ $(MESA_DIR)/main/enums.c: gl_enums.py $(COMMON) $(ES_API)
-f $(MESA_GLAPI_DIR)/gen-es/es1_API.xml \
-f $(MESA_GLAPI_DIR)/gen-es/es2_API.xml > $@
$(MESA_DIR)/main/glapidispatch.h: gl_table.py $(COMMON)
$(MESA_DIR)/main/dispatch.h: gl_table.py $(COMMON)
$(PYTHON2) $(PYTHON_FLAGS) $< -m remap_table > $@
$(MESA_DIR)/main/remap_helper.h: remap_helper.py $(COMMON)

View File

@ -73,7 +73,7 @@ class PrintRemapTable(gl_XML.gl_print_base):
gl_XML.gl_print_base.__init__(self)
self.es = es
self.header_tag = '_GLAPI_DISPATCH_H_'
self.header_tag = '_DISPATCH_H_'
self.name = "gl_table.py (from Mesa)"
self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM")
return
@ -81,10 +81,8 @@ class PrintRemapTable(gl_XML.gl_print_base):
def printRealHeader(self):
print """
/* this file should not be included directly in mesa */
/**
* \\file glapidispatch.h
* \\file main/dispatch.h
* Macros for handling GL dispatch tables.
*
* For each known GL function, there are 3 macros in this file. The first
@ -93,8 +91,9 @@ class PrintRemapTable(gl_XML.gl_print_base):
* can SET_FuncName, are used to get and set the dispatch pointer for the
* named function in the specified dispatch table.
*/
#include "main/mfeatures.h"
"""
return
def printBody(self, api):
@ -139,14 +138,14 @@ class PrintRemapTable(gl_XML.gl_print_base):
print '#define _gloffset_%s %d' % (f.name, f.offset)
print ''
print '#if !defined(_GLAPI_USE_REMAP_TABLE)'
print '#if !FEATURE_remap_table'
print ''
for f, index in functions:
print '#define _gloffset_%s %d' % (f.name, f.offset)
print ''
print '#else /* !_GLAPI_USE_REMAP_TABLE */'
print '#else /* !FEATURE_remap_table */'
print ''
if self.es:
@ -171,7 +170,7 @@ class PrintRemapTable(gl_XML.gl_print_base):
print '#define _gloffset_%s %s[%s_remap_index]' % (f.name, remap_table, f.name)
print ''
print '#endif /* _GLAPI_USE_REMAP_TABLE */'
print '#endif /* !FEATURE_remap_table */'
print ''
for f, index in abi_functions + functions:
@ -200,12 +199,12 @@ class PrintRemapTable(gl_XML.gl_print_base):
print '#define SET_%s(disp, fn) SET_%s(disp, fn)' % (name, f.name)
print ''
print '#if defined(_GLAPI_USE_REMAP_TABLE)'
print '#if FEATURE_remap_table'
for f in alias_functions:
for name in f.entry_points:
if name != f.name:
print '#define %s_remap_index %s_remap_index' % (name, f.name)
print '#endif /* defined(_GLAPI_USE_REMAP_TABLE) */'
print '#endif /* FEATURE_remap_table */'
print ''
return

View File

@ -346,7 +346,7 @@ if env['gles']:
GLAPI = '#src/mapi/glapi/'
gles_headers = []
gles_headers += env.CodeGenerate(
target = 'es1api/main/glapidispatch.h',
target = 'es1api/main/dispatch.h',
script = GLAPI + 'gen/gl_table.py',
source = GLAPI + 'gen-es/es1_API.xml',
command = python_cmd + ' $SCRIPT -c -m remap_table -f $SOURCE > $TARGET',
@ -358,7 +358,7 @@ if env['gles']:
command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET',
)
gles_headers += env.CodeGenerate(
target = 'es2api/main/glapidispatch.h',
target = 'es2api/main/dispatch.h',
script = GLAPI + 'gen/gl_table.py',
source = GLAPI + 'gen-es/es2_API.xml',
command = python_cmd + ' $SCRIPT -c -m remap_table -f $SOURCE > $TARGET',

File diff suppressed because it is too large Load Diff

View File

@ -681,9 +681,7 @@ print """
#if FEATURE_remap_table
/* define esLocalRemapTable */
/* cannot include main/dispatch.h here */
#define _GLAPI_USE_REMAP_TABLE
#include "%sapi/main/glapidispatch.h"
#include "%sapi/main/dispatch.h"
#define need_MESA_remap_table
#include "%sapi/main/remap_helper.h"
@ -719,8 +717,7 @@ init_remap_table(void)
#else /* FEATURE_remap_table */
/* cannot include main/dispatch.h here */
#include "%sapi/main/glapidispatch.h"
#include "%sapi/main/dispatch.h"
static INLINE void
init_remap_table(void)

File diff suppressed because it is too large Load Diff