Index: src/mesa/glapi/Makefile =================================================================== RCS file: /cvs/mesa/Mesa/src/mesa/glapi/Makefile,v retrieving revision 1.8 diff -u -d -u -d -r1.8 Makefile --- src/mesa/glapi/Makefile 22 Feb 2005 15:39:46 -0000 1.8 +++ src/mesa/glapi/Makefile 13 Apr 2005 18:46:24 -0000 @@ -13,6 +13,19 @@ ../../glx/x11/indirect_size.h \ ../../glx/x11/indirect_size.c + +XORG_BASE = +GLX_DIR = $(XORG_BASE)/programs/Xserver/GL/glx + +SERVER_OUTPUTS = $(GLX_DIR)/indirect_dispatch.c \ + $(GLX_DIR)/indirect_dispatch_swap.c \ + $(GLX_DIR)/indirect_dispatch.h \ + $(GLX_DIR)/indirect_reqsize.c \ + $(GLX_DIR)/indirect_reqsize.h \ + $(GLX_DIR)/indirect_size_get.c \ + $(GLX_DIR)/indirect_size_get.h + + COMMON = gl_XML.pyo license.pyo gl_API.xml COMMON_GLX = $(COMMON) glX_XML.pyo @@ -21,6 +34,8 @@ all: $(OUTPUTS) +server: $(SERVER_OUTPUTS) + gl_XML.pyo: gl_XML.py rm -f gl_XML.pyo > /dev/null $(PYTHON2) $(PYTHON_FLAGS) gl_XML.py @@ -66,6 +81,34 @@ ../../glx/x11/indirect_size.c: $(COMMON_GLX) glX_proto_size.py $(PYTHON2) $(PYTHON_FLAGS) glX_proto_size.py -m size_c --only-set > ../../glx/x11/indirect_size.c +$(GLX_DIR)/indirect_dispatch.c: $(COMMON_GLX) glX_proto_recv.py + @if [ "$(XORG_BASE)" == "" ]; then echo "GLX_DIR must be set in Makefile" ; exit 1 ; fi + $(PYTHON2) $(PYTHON_FLAGS) glX_proto_recv.py -m dispatch_c > $@ + +$(GLX_DIR)/indirect_dispatch_swap.c: $(COMMON_GLX) glX_proto_recv.py + @if [ "$(XORG_BASE)" == "" ]; then echo "GLX_DIR must be set in Makefile" ; exit 1 ; fi + $(PYTHON2) $(PYTHON_FLAGS) glX_proto_recv.py -m dispatch_c -s > $@ + +$(GLX_DIR)/indirect_dispatch.h: $(COMMON_GLX) glX_proto_recv.py + @if [ "$(XORG_BASE)" == "" ]; then echo "GLX_DIR must be set in Makefile" ; exit 1 ; fi + $(PYTHON2) $(PYTHON_FLAGS) glX_proto_recv.py -m dispatch_h -s > $@ + +$(GLX_DIR)/indirect_reqsize.c: $(COMMON_GLX) glX_proto_size.py + @if [ "$(XORG_BASE)" == "" ]; then echo "GLX_DIR must be set in Makefile" ; exit 1 ; fi + $(PYTHON2) $(PYTHON_FLAGS) glX_proto_size.py -m reqsize_c > $@ + +$(GLX_DIR)/indirect_reqsize.h: $(COMMON_GLX) glX_proto_size.py + @if [ "$(XORG_BASE)" == "" ]; then echo "GLX_DIR must be set in Makefile" ; exit 1 ; fi + $(PYTHON2) $(PYTHON_FLAGS) glX_proto_size.py -m reqsize_h > $@ + +$(GLX_DIR)/indirect_size_get.h: $(COMMON_GLX) glX_proto_size.py + @if [ "$(XORG_BASE)" == "" ]; then echo "GLX_DIR must be set in Makefile" ; exit 1 ; fi + $(PYTHON2) $(PYTHON_FLAGS) glX_proto_size.py -m size_h --only-get -h '_INDIRECT_SIZE_GET_H_' > $@ + +$(GLX_DIR)/indirect_size_get.c: $(COMMON_GLX) glX_proto_size.py + @if [ "$(XORG_BASE)" == "" ]; then echo "GLX_DIR must be set in Makefile" ; exit 1 ; fi + $(PYTHON2) $(PYTHON_FLAGS) glX_proto_size.py -m size_c --get-alias-set > $@ + clean: rm -f *~ *.pyo rm -f $(OUTPUTS) Index: src/mesa/glapi/glX_XML.py =================================================================== RCS file: /cvs/mesa/Mesa/src/mesa/glapi/glX_XML.py,v retrieving revision 1.17 diff -u -d -u -d -r1.17 glX_XML.py --- src/mesa/glapi/glX_XML.py 17 Mar 2005 21:48:37 -0000 1.17 +++ src/mesa/glapi/glX_XML.py 13 Apr 2005 18:46:24 -0000 @@ -384,6 +384,11 @@ self.dimensions_in_reply = 1 else: self.dimensions_in_reply = 0 + + if attrs.get('note_unflushed', "false") == "true": + self.note_unflushed = 1 + else: + self.note_unflushed = 0 else: gl_XML.glFunction.startElement(self, name, attrs) Index: src/mesa/glapi/glX_proto_recv.py =================================================================== RCS file: src/mesa/glapi/glX_proto_recv.py diff -N src/mesa/glapi/glX_proto_recv.py --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/mesa/glapi/glX_proto_recv.py 13 Apr 2005 18:46:24 -0000 @@ -0,0 +1,571 @@ +#!/bin/env python + +# (C) Copyright IBM Corporation 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +from xml.sax import saxutils +from xml.sax import make_parser +from xml.sax.handler import feature_namespaces + +import gl_XML +import glX_XML +import license +import sys, getopt + + +class glXDispatch_h_FunctionIterator(gl_XML.glFunctionIterator): + """Class to iterate over a list of glXFunctions""" + + def __init__(self, context): + return + + +class PrintGlxDispatch_h(glX_XML.GlxProto): + def __init__(self): + glX_XML.GlxProto.__init__(self) + self.name = "glX_proto_recv.py (from Mesa)" + self.last_category = "" + self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2005", "IBM") + self.header_tag = "_INDIRECT_DISPATCH_H_" + self.functions_to_iterate = [] + + + def printRealHeader(self): + self.printVisibility( "HIDDEN", "hidden" ) + print 'struct __GLXclientStateRec;' + print '' + + + def printFunction(self, f): + if f.glx_rop != 0: + print 'extern HIDDEN void __glXDisp_%s(GLbyte * pc);' % (f.name) + print 'extern HIDDEN void __glXDispSwap_%s(GLbyte * pc);' % (f.name) + else: + print 'extern HIDDEN int __glXDisp_%s(struct __GLXclientStateRec *, GLbyte *);' % (f.name) + print 'extern HIDDEN int __glXDispSwap_%s(struct __GLXclientStateRec *, GLbyte *);' % (f.name) + + + def endElement(self, name): + if name == "function": + f = self.current_object + if not f.ignore and f.fn_alias == None and f.vectorequiv == None: + if f.glx_rop != 0 or f.glx_sop != 0 or f.glx_vendorpriv != 0: + self.functions_to_iterate.append(f) + + glX_XML.GlxProto.endElement(self, name) + + + def functionIterator(self): + return self.functions_to_iterate.__iter__() + + +class PrintGlxDispatchFunctions(glX_XML.GlxProto): + def __init__(self, do_swap): + glX_XML.GlxProto.__init__(self) + self.name = "glX_proto_recv.py (from Mesa)" + self.last_category = "" + self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2005", "IBM") + + self.real_types = [ '', '', 'uint16_t', '', 'uint32_t', '', '', '', 'uint64_t' ] + self.do_swap = do_swap + return + + + def printRealHeader(self): + print '#include ' + print '#include ' + print '#include ' + print '#include ' + print '#include ' + print '#include "indirect_size.h"' + print '#include "indirect_size_get.h"' + print '#include "indirect_dispatch.h"' + print '#include "glxserver.h"' + print '#include "singlesize.h"' + print '#include "glapitable.h"' + print '#include "glapi.h"' + print '#include "glthread.h"' + print '' + print 'typedef struct {' + print ' __GLX_PIXEL_3D_HDR;' + print '} __GLXpixel3DHeader;' + print '' + print 'extern GLboolean __glXErrorOccured( void );' + print 'extern void __glXClearErrorOccured( void );' + print '' + print 'static const unsigned dummy_answer[2] = {0, 0};' + print '' + + def printFooter(self): + if self.do_swap: + self.emit_swap_wrappers() + + glX_XML.GlxProto.printFooter(self) + + + def printFunction(self, f): + if f.server_handcode or f.vectorequiv: return + + if f.glx_rop != 0 or f.vectorequiv: + if f.image: + self.printPixelFunction(f) + else: + self.printRenderFunction(f) + elif f.glx_sop != 0: + if not f.image: + self.printSingleFunction(f) + elif f.glx_vendorpriv != 0: + if not f.image: + self.printSingleFunction(f) + else: + print "/* Missing GLX protocol for %s. */" % (f.name) + + + def swap_name(self, bytes): + return 'bswap_%u_array' % (8 * bytes) + + + def emit_swap_wrappers(self): + already_done = {} + + for t_name, t in self.types.iteritems(): + if t.size > 1 and t.glx_name != '' and t.glx_name not in already_done: + print 'static %s' % (t_name) + print 'bswap_%s( const void * src )' % (t.glx_name) + print '{' + print ' union { %s dst; %s ret; } x;' % (self.real_types[t.size], t_name) + print ' x.dst = bswap_%u( *(%s *) src );' % (t.size * 8, self.real_types[t.size]) + print ' return x.ret;' + print '}' + print '' + already_done[ t.glx_name ] = 1 + + for bits in [16, 32, 64]: + print 'static void *' + print 'bswap_%u_array( uint%u_t * src, unsigned count )' % (bits, bits) + print '{' + print ' unsigned i;' + print '' + print ' for ( i = 0 ; i < count ; i++ ) {' + print ' uint%u_t temp = bswap_%u( src[i] );' % (bits, bits) + print ' src[i] = temp;' + print ' }' + print '' + print ' return src;' + print '}' + print '' + + + def location_string(self, param, offsets): + o = offsets[param.name] + t = param.p_type_string + + if self.do_swap and param.p_type.size != 1: + if param.is_array(): + if param.p_type.size == 0: + return ' (%-8s)(pc + %2s)' % (t, o) + else: + swap_func = self.swap_name(param.p_type.size) + return ' (%-8s)%s( (%s *) (pc + %2s), %s )' % (t, swap_func, self.real_types[param.p_type.size], o, param.p_count) + else: + return ' (%-8s)bswap_%-7s( pc + %2s )' % (t, param.p_type.glx_name, o) + else: + if param.is_array(): + return ' (%-8s)(pc + %2s)' % (t, o) + else: + return '*(%-8s *)(pc + %2s)' % (t, o) + + + + + def emit_packet_size_calculation(self, f, offsets): + compsize = self.size_call(f) + if compsize: + print ' const GLuint compsize = %s;' % (compsize) + + print ' const GLuint cmdlen = %s - 4;' % (f.command_length()) + print '' + return + + + def common_emit_args(self, f, offsets, indent): + remain = len(f.fn_parameters) + comma = ',' + for p in f.fn_parameters: + remain -= 1 + if remain == 0: + comma = '' + + if p.is_counter or f.count_parameter_list.count(p.name) or p.count_parameter_list or p.width or p.is_output: + print '%s %s%s' % (indent, p.name, comma) + else: + location = self.location_string(p, offsets) + print '%s %s%s' % (indent, location, comma) + return + + + def emit_function_call(self, f, retval_assign, offsets, indent): + if offsets != {}: + print '%s %sGL_CALL(%s)(' % (indent, retval_assign, f.name) + self.common_emit_args(f, offsets, indent) + print '%s );' % (indent) + else: + print '%s %sGL_CALL(%s)();' % (indent, retval_assign, f.name) + return + + + def common_func_print_just_header(self, f): + if not self.do_swap: + base = '__glXDisp' + else: + base = '__glXDispSwap' + + if f.glx_rop: + print 'void %s_%s(GLbyte * pc)' % (base, f.name) + else: + print 'int %s_%s(__GLXclientState *cl, GLbyte *pc)' % (base, f.name) + + print '{' + return + + + def common_func_print_just_start(self, f, indent): + align64 = 0 + offsets = {} + need_blank = 0 + next_offset = f.offset_of_first_parameter() + next_offset_string = '' + for p in f.parameterIterator(1, 2): + + #if f.image and p.name == f.image.name and p.img_null_flag: + if p.img_null_flag: + offsets[""] = '%u%s' % (next_offset, next_offset_string) + next_offset += 4 + + offsets[p.name] = '%u%s' % (next_offset, next_offset_string) + next_offset += p.size() + + cond = '' + if p.img_null_flag: + print '%s const CARD32 ptr_is_null = *(CARD32 *)(pc + %s);' % (indent, offsets[""]) + cond = '(ptr_is_null != 0) ? NULL : ' + + if p.width: + print '%s %s const %s = (%s) %s(pc + %s);' % (indent, p.p_type_string, p.name, p.p_type_string, cond, offsets[p.name]) + + if p.depth: + print '%s __GLXpixel3DHeader * const hdr = (__GLXpixel3DHeader *)(pc);' % (indent) + else: + print '%s __GLXpixelHeader * const hdr = (__GLXpixelHeader *)(pc);' % (indent) + + need_blank = 1 + elif p.is_counter or f.count_parameter_list.count(p.name): + location = self.location_string(p, offsets) + print '%s const %s %s = %s;' % (indent, p.p_type_string, p.name, location) + need_blank = 1 + elif p.count_parameter_list: + if p.p_type.size == 0 and not self.do_swap: + location = self.location_string(p, offsets) + print '%s %s %s = %s%s;' % (indent, p.p_type_string, p.name, cond, location) + else: + print '%s %s %s;' % (indent, p.p_type_string, p.name) + need_blank = 1 + + if p.counter != None: + next_offset_string = '%s+%s*%u' % (next_offset_string, p.counter, p.p_type.size) + + if p.p_type.size == 8: + align64 = 1 + + if f.pad_after(p): + next_offset += 4 + + + if need_blank: + print '' + + if align64: + print '#ifdef __GLX_ALIGN64' + + if f.count_parameter_list: + self.emit_packet_size_calculation(f, offsets) + s = "cmdlen" + else: + size = 0 + for p in f.fn_parameters: + if p.is_output: continue + + size += p.size() + + s = "%s" % (size) + + print ' if ((unsigned long)(pc) & 7) {' + print ' (void) memmove(pc-4, pc, %s);' % (s) + print ' pc -= 4;' + print ' }' + print '#endif' + print '' + + need_blank = 0 + if self.do_swap: + for p in f.parameterIterator(1, 2): + if p.count_parameter_list: + o = offsets[p.name] + + if p.counter: + count_name = p.counter + else: + count_name = p.p_count + + if p.p_type.size == 0: + # This is basically a special-case for glCallLists. + + x = [] + x.append( [1, ['BYTE', 'UNSIGNED_BYTE', '2_BYTES', '3_BYTES', '4_BYTES']] ) + x.append( [2, ['SHORT', 'UNSIGNED_SHORT']] ) + x.append( [4, ['INT', 'UNSIGNED_INT', 'FLOAT']] ) + + print ' switch(%s) {' % (f.count_parameter_list[0]) + for sub in x: + for t_name in sub[1]: + print ' case GL_%s:' % (t_name) + + if sub[0] == 1: + print ' %s = (%s) (pc + %s); break;' % (p.name, p.p_type_string, o) + else: + swap_func = self.swap_name(sub[0]) + print ' %s = (%s) %s( (%s *) (pc + %s), %s ); break;' % (p.name, p.p_type_string, swap_func, self.real_types[sub[0]], o, count_name) + print ' }' + else: + swap_func = self.swap_name(p.p_type.size) + compsize = self.size_call(f) + print ' %s = (%s) %s( (%s *) (pc + %s), %s );' % (p.name, p.p_type_string, swap_func, self.real_types[p.p_type.size], o, compsize) + + need_blank = 1 + + else: + for p in f.parameterIterator(1, 2): + if p.count_parameter_list: + o = offsets[p.name] + print '%s %s = (%s) (pc + %s);' % (indent, p.name, p.p_type_string, o) + need_blank = 1 + + + if need_blank: + print '' + + + return offsets + + + def printPixelFunction(self, f): + self.common_func_print_just_header(f) + offsets = self.common_func_print_just_start(f, "") + + if self.do_swap: + pre = "bswap_CARD32( & " + post = " )" + else: + pre = "" + post = "" + + if not (f.image.img_type == "GL_BITMAP" and f.image.img_format == "GL_COLOR_INDEX"): + print ' GL_CALL(PixelStorei)(GL_UNPACK_SWAP_BYTES, %shdr->swapBytes%s);' % (pre, post) + + print ' GL_CALL(PixelStorei)(GL_UNPACK_LSB_FIRST, %shdr->lsbFirst%s);' % (pre, post) + print ' GL_CALL(PixelStorei)(GL_UNPACK_ROW_LENGTH, (GLint) %shdr->rowLength%s);' % (pre, post) + if f.image.depth: + print ' GL_CALL(PixelStorei)(GL_UNPACK_IMAGE_HEIGHT, (GLint) %shdr->imageHeight%s);' % (pre, post) + print ' GL_CALL(PixelStorei)(GL_UNPACK_SKIP_ROWS, (GLint) %shdr->skipRows%s);' % (pre, post) + if f.image.depth: + print ' GL_CALL(PixelStorei)(GL_UNPACK_SKIP_IMAGES, (GLint) %shdr->skipImages%s);' % (pre, post) + print ' GL_CALL(PixelStorei)(GL_UNPACK_SKIP_PIXELS, (GLint) %shdr->skipPixels%s);' % (pre, post) + print ' GL_CALL(PixelStorei)(GL_UNPACK_ALIGNMENT, (GLint) %shdr->alignment%s);' % (pre, post) + + print '' + + self.emit_function_call(f, "", offsets, "") + + print '}' + return + + + def printSingleFunction(self, f): + self.common_func_print_just_header(f) + + if f.glx_sop: + print ' xGLXSingleReq * const req = (xGLXSingleReq *) pc;' + else: + print ' xGLXVendorPrivateReq * const req = (xGLXVendorPrivateReq *) pc;' + + print ' int error;' + + if self.do_swap: + print ' __GLXcontext * const cx = __glXForceCurrent(cl, bswap_CARD32( &req->contextTag ), &error);' + else: + print ' __GLXcontext * const cx = __glXForceCurrent(cl, req->contextTag, &error);' + + print '' + if f.glx_sop: + print ' pc += __GLX_SINGLE_HDR_SIZE;' + else: + print ' pc += __GLX_VENDPRIV_HDR_SIZE;' + + print ' if ( cx != NULL ) {' + offsets = self.common_func_print_just_start(f, " ") + + output_param = f.output_parameter() + + if f.fn_return_type != 'void': + print ' %s retval;' % (f.fn_return_type) + retval_string = "retval" + retval_assign = "retval = " + else: + retval_string = "0" + retval_assign = "" + + if output_param != None: + if output_param.p_type.name == "GLvoid": + answer_type = "GLubyte" + else: + answer_type = output_param.p_type.name + + if output_param: + if output_param.p_type.size == 0: + type_size = 1 + size_scale = "" + else: + type_size = output_param.p_type.size + size_scale = " * %u" % (type_size) + else: + type_size = 0 + + if f.count_parameter_list: + print ' const GLuint compsize = %s;' % (self.size_call(f)) + print ' %s answerBuffer[200];' % (answer_type) + print ' %s %s = __glXGetAnswerBuffer(cl, compsize%s, answerBuffer, sizeof(answerBuffer), %u);' % (output_param.p_type_string, output_param.name, size_scale, type_size ) + answer_string = output_param.name + answer_count = "compsize" + + print '' + print ' if (%s == NULL) return BadAlloc;' % (output_param.name) + print ' __glXClearErrorOccured();' + print '' + elif output_param and output_param.counter: + print ' %s answerBuffer[200];' % (answer_type) + print ' %s %s = __glXGetAnswerBuffer(cl, %s%s, answerBuffer, sizeof(answerBuffer), %u);' % (output_param.p_type_string, output_param.name, output_param.counter, size_scale, type_size) + answer_string = output_param.name + answer_count = output_param.counter + elif output_param and output_param.p_count: + print ' %s %s[%u];' % (answer_type, output_param.name, output_param.p_count) + answer_string = output_param.name + answer_count = "%u" % (output_param.p_count) + else: + answer_string = "dummy_answer" + answer_count = "0" + + self.emit_function_call(f, retval_assign, offsets, " ") + + if output_param and f.reply_always_array: + is_array_string = "GL_TRUE" + else: + is_array_string = "GL_FALSE" + + if output_param or f.fn_return_type != 'void': + if self.do_swap: + if type_size > 1: + swap_name = self.swap_name( type_size ) + print ' (void) %s( (uint%u_t *) %s, %s );' % (swap_name, 8 * type_size, output_param.name, answer_count) + + reply_func = '__glXSendReplySwap' + else: + reply_func = '__glXSendReply' + + print ' %s(cl->client, %s, %s, %u, %s, %s);' % (reply_func, answer_string, answer_count, type_size, is_array_string, retval_string) + elif f.note_unflushed: + print ' cx->hasUnflushedCommands = GL_TRUE;' + + print ' error = Success;' + print ' }' + print '' + print ' return error;' + print '}' + print '' + return + + + def printRenderFunction(self, f): + self.common_func_print_just_header(f) + + # There are 4 distinct phases in a rendering dispatch function. + # In the first phase we compute the sizes and offsets of each + # element in the command. In the second phase we (optionally) + # re-align 64-bit data elements. In the third phase we + # (optionally) byte-swap array data. Finally, in the fourth + # phase we actually dispatch the function. + + offsets = self.common_func_print_just_start(f, "") + + self.emit_function_call(f, "", offsets, "") + + print '}' + print '' + return + + +if __name__ == '__main__': + file_name = "gl_API.xml" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "f:m:s") + except Exception,e: + show_usage() + + mode = "dispatch_c" + do_swap = 0 + for (arg,val) in args: + if arg == "-f": + file_name = val + elif arg == "-m": + mode = val + elif arg == "-s": + do_swap = 1 + + if mode == "dispatch_c": + dh = PrintGlxDispatchFunctions(do_swap) + elif mode == "dispatch_h": + dh = PrintGlxDispatch_h() + else: + show_usage() + + parser = make_parser() + parser.setFeature(feature_namespaces, 0) + parser.setContentHandler(dh) + + f = open(file_name) + + dh.printHeader() + parser.parse(f) + dh.printFooter() Index: src/mesa/glapi/glX_proto_size.py =================================================================== RCS file: /cvs/mesa/Mesa/src/mesa/glapi/glX_proto_size.py,v retrieving revision 1.9 diff -u -d -u -d -r1.9 glX_proto_size.py --- src/mesa/glapi/glX_proto_size.py 17 Mar 2005 21:48:37 -0000 1.9 +++ src/mesa/glapi/glX_proto_size.py 13 Apr 2005 18:46:24 -0000 @@ -126,7 +126,7 @@ self.context.common_emit_fixups(fixup) print '' - print ' compsize = %s;' % (context.size_call(context, f)) + print ' compsize = %s;' % ( self.context.size_call(f) ) p = f.variable_length_parameter() print ' return __GLX_PAD(%s);' % (p.size_string()) Index: src/mesa/glapi/glapi.c =================================================================== RCS file: /cvs/mesa/Mesa/src/mesa/glapi/glapi.c,v retrieving revision 1.88 diff -u -d -u -d -r1.88 glapi.c --- src/mesa/glapi/glapi.c 15 Dec 2004 23:14:29 -0000 1.88 +++ src/mesa/glapi/glapi.c 13 Apr 2005 18:46:25 -0000 @@ -452,7 +452,7 @@ } -#if !defined( USE_X86_ASM ) +#if !defined( USE_X86_ASM ) && !defined( XFree86Server ) #define NEED_FUNCTION_POINTER #endif @@ -497,6 +497,7 @@ } +#if !defined( XFree86Server ) #ifdef USE_X86_ASM extern const GLubyte gl_dispatch_functions_start[]; @@ -540,6 +541,7 @@ } #endif /* USE_X86_ASM */ +#endif /* !defined( XFree86Server ) */ /** @@ -857,12 +859,14 @@ } } +#if !defined( XFree86Server ) /* search static functions */ { const _glapi_proc func = get_static_proc_address(funcName); if (func) return func; } +#endif /* !defined( XFree86Server ) */ /* generate new entrypoint - use a temporary dispatch offset of * ~0 (i.e. -1). Later, when the driver calls _glapi_add_entrypoint()