From 85ef9930f56bf15181f9a0b238f03d55303cf411 Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 22 Nov 2010 19:42:40 +0000 Subject: Updated to mesalib 7.9 --- mesalib/src/mapi/glapi/gen/ARB_draw_instanced.xml | 69 +++ .../src/mapi/glapi/gen/ARB_geometry_shader4.xml | 57 ++ .../src/mapi/glapi/gen/ARB_seamless_cube_map.xml | 2 +- .../src/mapi/glapi/gen/EXT_transform_feedback.xml | 163 ++++++ mesalib/src/mapi/glapi/gen/GL3.xml | 581 +++++++++++++++++++++ mesalib/src/mapi/glapi/gen/Makefile | 208 ++++++++ mesalib/src/mapi/glapi/gen/glX_proto_recv.py | 4 +- mesalib/src/mapi/glapi/gen/glX_proto_send.py | 28 +- mesalib/src/mapi/glapi/gen/glX_proto_size.py | 2 +- mesalib/src/mapi/glapi/gen/gl_API.xml | 14 +- mesalib/src/mapi/glapi/gen/gl_enums.py | 29 +- mesalib/src/mapi/glapi/gen/remap_helper.py | 12 +- 12 files changed, 1125 insertions(+), 44 deletions(-) create mode 100644 mesalib/src/mapi/glapi/gen/ARB_draw_instanced.xml create mode 100644 mesalib/src/mapi/glapi/gen/ARB_geometry_shader4.xml create mode 100644 mesalib/src/mapi/glapi/gen/EXT_transform_feedback.xml create mode 100644 mesalib/src/mapi/glapi/gen/GL3.xml create mode 100644 mesalib/src/mapi/glapi/gen/Makefile (limited to 'mesalib/src/mapi/glapi/gen') diff --git a/mesalib/src/mapi/glapi/gen/ARB_draw_instanced.xml b/mesalib/src/mapi/glapi/gen/ARB_draw_instanced.xml new file mode 100644 index 000000000..5741a588c --- /dev/null +++ b/mesalib/src/mapi/glapi/gen/ARB_draw_instanced.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mesalib/src/mapi/glapi/gen/ARB_geometry_shader4.xml b/mesalib/src/mapi/glapi/gen/ARB_geometry_shader4.xml new file mode 100644 index 000000000..ca9a101a0 --- /dev/null +++ b/mesalib/src/mapi/glapi/gen/ARB_geometry_shader4.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mesalib/src/mapi/glapi/gen/ARB_seamless_cube_map.xml b/mesalib/src/mapi/glapi/gen/ARB_seamless_cube_map.xml index 3cdc84d2b..8dc827c5a 100644 --- a/mesalib/src/mapi/glapi/gen/ARB_seamless_cube_map.xml +++ b/mesalib/src/mapi/glapi/gen/ARB_seamless_cube_map.xml @@ -3,7 +3,7 @@ - + diff --git a/mesalib/src/mapi/glapi/gen/EXT_transform_feedback.xml b/mesalib/src/mapi/glapi/gen/EXT_transform_feedback.xml new file mode 100644 index 000000000..06deafce4 --- /dev/null +++ b/mesalib/src/mapi/glapi/gen/EXT_transform_feedback.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mesalib/src/mapi/glapi/gen/GL3.xml b/mesalib/src/mapi/glapi/gen/GL3.xml new file mode 100644 index 000000000..0d8d935f0 --- /dev/null +++ b/mesalib/src/mapi/glapi/gen/GL3.xml @@ -0,0 +1,581 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mesalib/src/mapi/glapi/gen/Makefile b/mesalib/src/mapi/glapi/gen/Makefile new file mode 100644 index 000000000..41640b3b0 --- /dev/null +++ b/mesalib/src/mapi/glapi/gen/Makefile @@ -0,0 +1,208 @@ +# This file isn't used during a normal compilation since we don't want to +# require Python in order to compile Mesa. +# Instead, when the Mesa developers update/change the API interface it's +# up to him/her to re-run this makefile and check in the newly generated files. + + +TOP = ../../../.. +include $(TOP)/configs/current + +MESA_DIR = $(TOP)/src/mesa +MESA_GLAPI_DIR = $(TOP)/src/mapi/glapi +MESA_GLX_DIR = $(TOP)/src/glx + +MESA_GLAPI_OUTPUTS = \ + $(MESA_GLAPI_DIR)/glprocs.h \ + $(MESA_GLAPI_DIR)/glapitemp.h \ + $(MESA_GLAPI_DIR)/glapioffsets.h \ + $(MESA_GLAPI_DIR)/glapitable.h \ + $(MESA_GLAPI_DIR)/glapidispatch.h + +MESA_GLAPI_ASM_OUTPUTS = \ + $(MESA_GLAPI_DIR)/glapi_x86.S \ + $(MESA_GLAPI_DIR)/glapi_x86-64.S \ + $(MESA_GLAPI_DIR)/glapi_sparc.S + +MESA_OUTPUTS = \ + $(MESA_GLAPI_OUTPUTS) \ + $(MESA_GLAPI_ASM_OUTPUTS) \ + $(MESA_DIR)/main/enums.c \ + $(MESA_DIR)/main/remap_helper.h \ + $(MESA_GLX_DIR)/indirect.c \ + $(MESA_GLX_DIR)/indirect.h \ + $(MESA_GLX_DIR)/indirect_init.c \ + $(MESA_GLX_DIR)/indirect_size.h \ + $(MESA_GLX_DIR)/indirect_size.c + +###################################################################### + +XORG_GLX_DIR = $(XORG_BASE)/glx +XORG_GLAPI_DIR = $(XORG_BASE)/glx + +XORG_GLAPI_FILES = \ + $(XORG_GLAPI_DIR)/glapi.h \ + $(XORG_GLAPI_DIR)/glapi.c \ + $(XORG_GLAPI_DIR)/glapi_getproc.c \ + $(XORG_GLAPI_DIR)/glapi_nop.c \ + $(XORG_GLAPI_DIR)/glthread.c \ + $(XORG_GLAPI_DIR)/glthread.h + +XORG_GLAPI_OUTPUTS = \ + $(XORG_GLAPI_DIR)/glprocs.h \ + $(XORG_GLAPI_DIR)/glapitemp.h \ + $(XORG_GLAPI_DIR)/glapioffsets.h \ + $(XORG_GLAPI_DIR)/glapitable.h \ + $(XORG_GLAPI_DIR)/glapidispatch.h + +XORG_OUTPUTS = \ + $(XORG_GLAPI_FILES) \ + $(XORG_GLAPI_OUTPUTS) \ + $(XORG_GLX_DIR)/indirect_dispatch.c \ + $(XORG_GLX_DIR)/indirect_dispatch_swap.c \ + $(XORG_GLX_DIR)/indirect_dispatch.h \ + $(XORG_GLX_DIR)/indirect_reqsize.c \ + $(XORG_GLX_DIR)/indirect_reqsize.h \ + $(XORG_GLX_DIR)/indirect_size.h \ + $(XORG_GLX_DIR)/indirect_size_get.c \ + $(XORG_GLX_DIR)/indirect_size_get.h \ + $(XORG_GLX_DIR)/indirect_table.c + +###################################################################### + +API_XML = \ + gl_API.xml \ + ARB_copy_buffer.xml \ + ARB_depth_clamp.xml \ + ARB_draw_elements_base_vertex.xml \ + ARB_draw_instanced.xml \ + ARB_framebuffer_object.xml \ + ARB_geometry_shader4.xml \ + ARB_map_buffer_range.xml \ + ARB_seamless_cube_map.xml \ + ARB_sync.xml \ + ARB_vertex_array_object.xml \ + APPLE_object_purgeable.xml \ + APPLE_vertex_array_object.xml \ + EXT_draw_buffers2.xml \ + EXT_framebuffer_object.xml \ + EXT_packed_depth_stencil.xml \ + EXT_provoking_vertex.xml \ + EXT_texture_array.xml \ + EXT_transform_feedback.xml \ + NV_conditional_render.xml \ + OES_EGL_image.xml + +COMMON = $(API_XML) gl_XML.py glX_XML.py license.py typeexpr.py + +COMMON_GLX = $(COMMON) glX_API.xml glX_XML.py glX_proto_common.py + +###################################################################### + +all: mesa xorg + +mesa: $(MESA_OUTPUTS) + +xorg: check-xorg-source $(XORG_OUTPUTS) + +check-xorg-source: + @if ! test -d $(XORG_GLX_DIR); then \ + echo "ERROR: Must specify path to xserver/GL/ checkout; set XORG_BASE env var."; \ + exit 1; \ + fi + +clean: + -rm -f *~ *.pyo + -rm -f $(MESA_OUTPUTS) + +###################################################################### + +$(XORG_GLAPI_DIR)/%.c: $(MESA_GLAPI_DIR)/%.c + cp $< $@ + +$(XORG_GLAPI_DIR)/%.h: $(MESA_GLAPI_DIR)/%.h + cp $< $@ + +###################################################################### + +$(MESA_GLAPI_DIR)/glprocs.h: gl_procs.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + +$(MESA_GLAPI_DIR)/glapitemp.h: gl_apitemp.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + +$(MESA_GLAPI_DIR)/glapioffsets.h: gl_offsets.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + +$(MESA_GLAPI_DIR)/glapitable.h: gl_table.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + +$(MESA_GLAPI_DIR)/glapidispatch.h: gl_table.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< -m remap_table > $@ + +###################################################################### + +$(MESA_GLAPI_DIR)/glapi_x86.S: gl_x86_asm.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + +$(MESA_GLAPI_DIR)/glapi_x86-64.S: gl_x86-64_asm.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + +$(MESA_GLAPI_DIR)/glapi_sparc.S: gl_SPARC_asm.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + +###################################################################### + +$(MESA_DIR)/main/enums.c: gl_enums.py $(COMMON) $(ES_API) + $(PYTHON2) $(PYTHON_FLAGS) $< -f gl_API.xml \ + -f $(MESA_GLAPI_DIR)/gen-es/es1_API.xml \ + -f $(MESA_GLAPI_DIR)/gen-es/es2_API.xml > $@ + +$(MESA_DIR)/main/remap_helper.h: remap_helper.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + +###################################################################### + +$(MESA_GLX_DIR)/indirect.c: glX_proto_send.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m proto | $(INDENT) $(INDENT_FLAGS) > $@ + +$(MESA_GLX_DIR)/indirect.h: glX_proto_send.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m init_h > $@ + +$(MESA_GLX_DIR)/indirect_init.c: glX_proto_send.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m init_c > $@ + +$(MESA_GLX_DIR)/indirect_size.h $(XORG_GLX_DIR)/indirect_size.h: glX_proto_size.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m size_h --only-set -h _INDIRECT_SIZE_H_ \ + | $(INDENT) $(INDENT_FLAGS) > $@ + +$(MESA_GLX_DIR)/indirect_size.c: glX_proto_size.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m size_c --only-set \ + | $(INDENT) $(INDENT_FLAGS) > $@ + +###################################################################### + +$(XORG_GLX_DIR)/indirect_dispatch.c: glX_proto_recv.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_c > $@ + +$(XORG_GLX_DIR)/indirect_dispatch_swap.c: glX_proto_recv.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_c -s > $@ + +$(XORG_GLX_DIR)/indirect_dispatch.h: glX_proto_recv.py gl_and_glX_API.xml $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_h -f gl_and_glX_API.xml -s > $@ + +$(XORG_GLX_DIR)/indirect_size_get.h: glX_proto_size.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m size_h --only-get -h '_INDIRECT_SIZE_GET_H_' \ + | $(INDENT) $(INDENT_FLAGS) > $@ + +$(XORG_GLX_DIR)/indirect_size_get.c: glX_proto_size.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m size_c | $(INDENT) $(INDENT_FLAGS) > $@ + +$(XORG_GLX_DIR)/indirect_reqsize.h: glX_proto_size.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m reqsize_h --only-get -h '_INDIRECT_SIZE_GET_H_' \ + | $(INDENT) $(INDENT_FLAGS) -l200 > $@ + +$(XORG_GLX_DIR)/indirect_reqsize.c: glX_proto_size.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m reqsize_c | $(INDENT) $(INDENT_FLAGS) > $@ + +$(XORG_GLX_DIR)/indirect_table.c: glX_server_table.py gl_and_glX_API.xml $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -f gl_and_glX_API.xml > $@ diff --git a/mesalib/src/mapi/glapi/gen/glX_proto_recv.py b/mesalib/src/mapi/glapi/gen/glX_proto_recv.py index 31745fcef..887f63191 100644 --- a/mesalib/src/mapi/glapi/gen/glX_proto_recv.py +++ b/mesalib/src/mapi/glapi/gen/glX_proto_recv.py @@ -384,9 +384,9 @@ class PrintGlxDispatchFunctions(glX_proto_common.glx_print_proto): print ' int error;' if self.do_swap: - print ' __GLXcontext * const cx = __glXForceCurrent(cl, bswap_CARD32( &req->contextTag ), &error);' + print ' struct glx_context * const cx = __glXForceCurrent(cl, bswap_CARD32( &req->contextTag ), &error);' else: - print ' __GLXcontext * const cx = __glXForceCurrent(cl, req->contextTag, &error);' + print ' struct glx_context * const cx = __glXForceCurrent(cl, req->contextTag, &error);' print '' if name not in f.glx_vendorpriv_names: diff --git a/mesalib/src/mapi/glapi/gen/glX_proto_send.py b/mesalib/src/mapi/glapi/gen/glX_proto_send.py index c52b85bfb..bd41c9e66 100644 --- a/mesalib/src/mapi/glapi/gen/glX_proto_send.py +++ b/mesalib/src/mapi/glapi/gen/glX_proto_send.py @@ -220,7 +220,7 @@ __glXReadReply( Display *dpy, size_t size, void * dest, GLboolean reply_is_alway } NOINLINE void -__glXReadPixelReply( Display *dpy, __GLXcontext * gc, unsigned max_dim, +__glXReadPixelReply( Display *dpy, struct glx_context * gc, unsigned max_dim, GLint width, GLint height, GLint depth, GLenum format, GLenum type, void * dest, GLboolean dimensions_in_reply ) { @@ -264,7 +264,7 @@ __glXReadPixelReply( Display *dpy, __GLXcontext * gc, unsigned max_dim, #define X_GLXSingle 0 NOINLINE FASTCALL GLubyte * -__glXSetupSingleRequest( __GLXcontext * gc, GLint sop, GLint cmdlen ) +__glXSetupSingleRequest( struct glx_context * gc, GLint sop, GLint cmdlen ) { xGLXSingleReq * req; Display * const dpy = gc->currentDpy; @@ -279,7 +279,7 @@ __glXSetupSingleRequest( __GLXcontext * gc, GLint sop, GLint cmdlen ) } NOINLINE FASTCALL GLubyte * -__glXSetupVendorRequest( __GLXcontext * gc, GLint code, GLint vop, GLint cmdlen ) +__glXSetupVendorRequest( struct glx_context * gc, GLint code, GLint vop, GLint cmdlen ) { xGLXVendorPrivateReq * req; Display * const dpy = gc->currentDpy; @@ -371,10 +371,10 @@ const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 }; print '#define %s %d' % (func.opcode_vendor_name(name), func.glx_vendorpriv) print '%s gl%s(%s)' % (func.return_type, func_name, func.get_parameter_string()) print '{' - print ' __GLXcontext * const gc = __glXGetCurrentContext();' + print ' struct glx_context * const gc = __glXGetCurrentContext();' print '' - print '#ifdef GLX_DIRECT_RENDERING' - print ' if (gc->driContext) {' + print '#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)' + print ' if (gc->isDirect) {' print ' %sCALL_%s(GET_DISPATCH(), (%s));' % (ret_string, func.name, func.get_called_parameter_string()) print ' } else' print '#endif' @@ -408,7 +408,7 @@ const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 }; print """static FASTCALL NOINLINE void generic_%u_byte( GLint rop, const void * ptr ) { - __GLXcontext * const gc = __glXGetCurrentContext(); + struct glx_context * const gc = __glXGetCurrentContext(); const GLuint cmdlen = %u; emit_header(gc->pc, rop, cmdlen); @@ -523,7 +523,7 @@ generic_%u_byte( GLint rop, const void * ptr ) def common_func_print_just_start(self, f, name): - print ' __GLXcontext * const gc = __glXGetCurrentContext();' + print ' struct glx_context * const gc = __glXGetCurrentContext();' # The only reason that single and vendor private commands need # a variable called 'dpy' is becuase they use the SyncHandle @@ -895,13 +895,13 @@ static int NoOp(void) * Create and initialize a new GL dispatch table. The table is initialized * with GLX indirect rendering protocol functions. */ -__GLapi * __glXNewIndirectAPI( void ) +struct _glapi_table * __glXNewIndirectAPI( void ) { - __GLapi *glAPI; + struct _glapi_table *glAPI; GLuint entries; entries = _glapi_get_dispatch_table_size(); - glAPI = (__GLapi *) Xmalloc(entries * sizeof(void *)); + glAPI = (struct _glapi_table *) Xmalloc(entries * sizeof(void *)); /* first, set all entries to point to no-op functions */ { @@ -971,15 +971,15 @@ extern HIDDEN NOINLINE CARD32 __glXReadReply( Display *dpy, size_t size, void * dest, GLboolean reply_is_always_array ); extern HIDDEN NOINLINE void __glXReadPixelReply( Display *dpy, - __GLXcontext * gc, unsigned max_dim, GLint width, GLint height, + struct glx_context * gc, unsigned max_dim, GLint width, GLint height, GLint depth, GLenum format, GLenum type, void * dest, GLboolean dimensions_in_reply ); extern HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupSingleRequest( - __GLXcontext * gc, GLint sop, GLint cmdlen ); + struct glx_context * gc, GLint sop, GLint cmdlen ); extern HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupVendorRequest( - __GLXcontext * gc, GLint code, GLint vop, GLint cmdlen ); + struct glx_context * gc, GLint code, GLint vop, GLint cmdlen ); """ diff --git a/mesalib/src/mapi/glapi/gen/glX_proto_size.py b/mesalib/src/mapi/glapi/gen/glX_proto_size.py index 95cb5110c..f16ea4c3b 100644 --- a/mesalib/src/mapi/glapi/gen/glX_proto_size.py +++ b/mesalib/src/mapi/glapi/gen/glX_proto_size.py @@ -329,7 +329,7 @@ class PrintGlxSizeStubs_c(PrintGlxSizeStubs_common): self.printVisibility( "INTERNAL", "internal" ) print '' print '' - print '#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__APPLE__)' + print '#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(GLX_USE_APPLEGL)' print '# undef HAVE_ALIAS' print '#endif' print '#ifdef HAVE_ALIAS' diff --git a/mesalib/src/mapi/glapi/gen/gl_API.xml b/mesalib/src/mapi/glapi/gen/gl_API.xml index 4a4d0d538..5cf216c91 100644 --- a/mesalib/src/mapi/glapi/gen/gl_API.xml +++ b/mesalib/src/mapi/glapi/gen/gl_API.xml @@ -4666,8 +4666,8 @@ - - + + @@ -7967,6 +7967,12 @@ + + + + + + @@ -9788,8 +9794,8 @@ - - + + diff --git a/mesalib/src/mapi/glapi/gen/gl_enums.py b/mesalib/src/mapi/glapi/gen/gl_enums.py index 3a9ea3c86..0caa01030 100644 --- a/mesalib/src/mapi/glapi/gen/gl_enums.py +++ b/mesalib/src/mapi/glapi/gen/gl_enums.py @@ -105,7 +105,8 @@ const char *_mesa_lookup_enum_by_nr( int nr ) } else { /* this is not re-entrant safe, no big deal here */ - sprintf(token_tmp, "0x%x", nr); + _mesa_snprintf(token_tmp, sizeof(token_tmp) - 1, "0x%x", nr); + token_tmp[sizeof(token_tmp) - 1] = '\\0'; return token_tmp; } } @@ -151,8 +152,10 @@ int _mesa_lookup_enum_by_name( const char *symbol ) return - def printBody(self, api): - self.process_enums( api ) + def printBody(self, api_list): + self.enum_table = {} + for api in api_list: + self.process_enums( api ) keys = self.enum_table.keys() keys.sort() @@ -209,16 +212,20 @@ int _mesa_lookup_enum_by_name( const char *symbol ) def process_enums(self, api): - self.enum_table = {} - for obj in api.enumIterateByName(): if obj.value not in self.enum_table: self.enum_table[ obj.value ] = [] + enum = self.enum_table[ obj.value ] name = "GL_" + obj.name priority = obj.priority() - self.enum_table[ obj.value ].append( [name, priority] ) + already_in = False; + for n, p in enum: + if n == name: + already_in = True + if not already_in: + enum.append( [name, priority] ) def show_usage(): @@ -226,18 +233,16 @@ def show_usage(): sys.exit(1) if __name__ == '__main__': - file_name = "gl_API.xml" - try: (args, trail) = getopt.getopt(sys.argv[1:], "f:") except Exception,e: show_usage() + api_list = [] for (arg,val) in args: if arg == "-f": - file_name = val - - api = gl_XML.parse_GL_API( file_name ) + api = gl_XML.parse_GL_API( val ) + api_list.append(api); printer = PrintGlEnums() - printer.Print( api ) + printer.Print( api_list ) diff --git a/mesalib/src/mapi/glapi/gen/remap_helper.py b/mesalib/src/mapi/glapi/gen/remap_helper.py index 8b50526d2..69b8e5e9d 100644 --- a/mesalib/src/mapi/glapi/gen/remap_helper.py +++ b/mesalib/src/mapi/glapi/gen/remap_helper.py @@ -65,17 +65,12 @@ class PrintGlRemap(gl_XML.gl_print_base): def printRealHeader(self): print '#include "main/dispatch.h"' + print '#include "main/remap.h"' print '' return def printBody(self, api): - print 'struct gl_function_remap {' - print ' GLint func_index;' - print ' GLint dispatch_offset; /* for sanity check */' - print '};' - print '' - pool_indices = {} print '/* this is internal to remap.c */' @@ -108,10 +103,7 @@ class PrintGlRemap(gl_XML.gl_print_base): print '' print '/* these functions need to be remapped */' - print 'static const struct {' - print ' GLint pool_index;' - print ' GLint remap_index;' - print '} MESA_remap_table_functions[] = {' + print 'static const struct gl_function_pool_remap MESA_remap_table_functions[] = {' # output all functions that need to be remapped # iterate by offsets so that they are sorted by remap indices for f in api.functionIterateByOffset(): -- cgit v1.2.3