summaryrefslogtreecommitdiff
path: root/src/mesa/glapi/glX_proto_recv.py
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2006-10-11 22:37:14 +0000
committerIan Romanick <idr@us.ibm.com>2006-10-11 22:37:14 +0000
commitf3f51bc844c8749250724d164722402cb9a07dc7 (patch)
tree68ccc40931c2d10f7a521d531609aeeb5b1637f9 /src/mesa/glapi/glX_proto_recv.py
parent8a5871a98c23ce1a1d893b681f59dc8c42228dd1 (diff)
Fix bug #4681.
glDeleteTextures and glDeleteTexturesEXT were erroneously listed as aliases of each other. For anything /except/ GLX protocol they are aliases. This set of changes allows functions that are functionally identical but have different GLX protocol to be listed as aliases. When building with GLX_INDIRECT_RENDERING set, different static functions are used. These functions determine whether the current context is direct rendering or not. If the context is direct rendering, the aliased function (e.g., glDeleteTextures in the case of glDeleteTexturesEXT) is called. If the context is not direct rendering, the correct GLX protocol is sent. For a deeper explanation of what is changed, please see: http://dri.freedesktop.org/wiki/PartiallyAliasedFunctions
Diffstat (limited to 'src/mesa/glapi/glX_proto_recv.py')
-rw-r--r--src/mesa/glapi/glX_proto_recv.py30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/mesa/glapi/glX_proto_recv.py b/src/mesa/glapi/glX_proto_recv.py
index 86bdd0ec93..527f6f10ee 100644
--- a/src/mesa/glapi/glX_proto_recv.py
+++ b/src/mesa/glapi/glX_proto_recv.py
@@ -50,13 +50,18 @@ class PrintGlxDispatch_h(gl_XML.gl_print_base):
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
@@ -129,12 +134,15 @@ class PrintGlxDispatchFunctions(glX_proto_common.glx_print_proto):
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
@@ -144,9 +152,9 @@ class PrintGlxDispatchFunctions(glX_proto_common.glx_print_proto):
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 '{'
@@ -154,9 +162,9 @@ class PrintGlxDispatchFunctions(glX_proto_common.glx_print_proto):
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 ''
@@ -384,8 +392,8 @@ class PrintGlxDispatchFunctions(glX_proto_common.glx_print_proto):
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;'
@@ -398,7 +406,7 @@ class PrintGlxDispatchFunctions(glX_proto_common.glx_print_proto):
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;'