def printBody(self, api):
for func in api.functionIterateAll():
if not func.ignore and not func.vectorequiv:
- if func.glx_rop != 0:
+ if func.glx_rop:
print 'extern HIDDEN void __glXDisp_%s(GLbyte * pc);' % (func.name)
print 'extern HIDDEN void __glXDispSwap_%s(GLbyte * pc);' % (func.name)
- elif func.glx_sop != 0 or func.glx_vendorpriv != 0:
+ elif func.glx_sop or func.glx_vendorpriv:
print 'extern HIDDEN int __glXDisp_%s(struct __GLXclientStateRec *, GLbyte *);' % (func.name)
print 'extern HIDDEN int __glXDispSwap_%s(struct __GLXclientStateRec *, GLbyte *);' % (func.name)
+ if func.glx_sop and func.glx_vendorpriv:
+ n = func.glx_vendorpriv_names[0]
+ print 'extern HIDDEN int __glXDisp_%s(struct __GLXclientStateRec *, GLbyte *);' % (n)
+ print 'extern HIDDEN int __glXDispSwap_%s(struct __GLXclientStateRec *, GLbyte *);' % (n)
+
return
print '#include <GL/gl.h>'
print '#include <GL/glxproto.h>'
-
- # FIXME: Since this block will require changes as other
- # FIXME: platforms are added, it should probably be in a
- # FIXME: header file that is not generated by a script.
-
- if self.do_swap:
- print '#ifdef __linux__'
- print '#include <byteswap.h>'
- print '#elif defined(__OpenBSD__)'
- print '#include <sys/endian.h>'
- print '#define bswap_16 __swap16'
- print '#define bswap_32 __swap32'
- print '#define bswap_64 __swap64'
- print '#else'
- print '#include <sys/endian.h>'
- print '#define bswap_16 bswap16'
- print '#define bswap_32 bswap32'
- print '#define bswap_64 bswap64'
- print '#endif'
-
print '#include <inttypes.h>'
print '#include "indirect_size.h"'
print '#include "indirect_size_get.h"'
print '#include "indirect_dispatch.h"'
print '#include "glxserver.h"'
+ print '#include "glxbyteorder.h"'
print '#include "indirect_util.h"'
print '#include "singlesize.h"'
- print '#include "glapitable.h"'
print '#include "glapi.h"'
+ print '#include "glapitable.h"'
print '#include "glthread.h"'
print '#include "dispatch.h"'
print ''
for func in api.functionIterateByOffset():
if not func.ignore and not func.server_handcode and not func.vectorequiv and (func.glx_rop or func.glx_sop or func.glx_vendorpriv):
- self.printFunction(func)
+ self.printFunction(func, func.name)
+ if func.glx_sop and func.glx_vendorpriv:
+ self.printFunction(func, func.glx_vendorpriv_names[0])
+
return
- def printFunction(self, f):
+ def printFunction(self, f, name):
if (f.glx_sop or f.glx_vendorpriv) and (len(f.get_images()) != 0):
return
base = '__glXDispSwap'
if f.glx_rop:
- print 'void %s_%s(GLbyte * pc)' % (base, f.name)
+ print 'void %s_%s(GLbyte * pc)' % (base, name)
else:
- print 'int %s_%s(__GLXclientState *cl, GLbyte *pc)' % (base, f.name)
+ print 'int %s_%s(__GLXclientState *cl, GLbyte *pc)' % (base, name)
print '{'
self.printRenderFunction(f)
elif f.glx_sop or f.glx_vendorpriv:
if len(f.get_images()) == 0:
- self.printSingleFunction(f)
+ self.printSingleFunction(f, name)
else:
- print "/* Missing GLX protocol for %s. */" % (f.name)
+ print "/* Missing GLX protocol for %s. */" % (name)
print '}'
print ''
list = []
for param in f.parameterIterator():
+ if param.is_padding:
+ continue
if param.is_counter or param.is_image() or param.is_output or param.name in f.count_parameter_list or len(param.count_parameter_list):
location = param.name
if param.is_image():
offset = f.offset_of( param.name )
- print '%s %s const %s = (%s) %s(pc + %s);' % (indent, type_string, param.name, type_string, cond, offset)
+ print '%s %s const %s = (%s) (%s(pc + %s));' % (indent, type_string, param.name, type_string, cond, offset)
if param.depth:
print '%s __GLXpixel3DHeader * const hdr = (__GLXpixel3DHeader *)(pc);' % (indent)
return
- def printSingleFunction(self, f):
- if f.glx_sop:
+ def printSingleFunction(self, f, name):
+ if name not in f.glx_vendorpriv_names:
print ' xGLXSingleReq * const req = (xGLXSingleReq *) pc;'
else:
print ' xGLXVendorPrivateReq * const req = (xGLXVendorPrivateReq *) pc;'
print ' __GLXcontext * const cx = __glXForceCurrent(cl, req->contextTag, &error);'
print ''
- if f.glx_sop:
+ if name not in f.glx_vendorpriv_names:
print ' pc += __GLX_SINGLE_HDR_SIZE;'
else:
print ' pc += __GLX_VENDPRIV_HDR_SIZE;'