X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=gltrace.py;h=af5714242e5a7a148a1befc4d928bd929000405b;hb=a26cf3eea71454aa5cc466a2abbe01537c95c31c;hp=32e77a75034b84f05a3e0317752a17c2a90944eb;hpb=1b3d3752685cd15531c45e190c8ed55d31271127;p=apitrace diff --git a/gltrace.py b/gltrace.py index 32e77a7..af57142 100644 --- a/gltrace.py +++ b/gltrace.py @@ -494,13 +494,30 @@ class GlTracer(Tracer): Tracer.trace_function_impl_body(self, function) + gremedy_functions = [ + 'glStringMarkerGREMEDY', + 'glFrameTerminatorGREMEDY', + ] + def dispatch_function(self, function): if function.name in ('glLinkProgram', 'glLinkProgramARB'): # These functions have been dispatched already return # We implement the GREMEDY extensions, not the driver - if function.name in ('glStringMarkerGREMEDY', 'glFrameTerminatorGREMEDY'): + if function.name in self.gremedy_functions: + return + + if function.name in ('glXGetProcAddress', 'glXGetProcAddressARB', 'wglGetProcAddress'): + if_ = 'if' + for gremedy_function in self.gremedy_functions: + print ' %s (strcmp("%s", (const char *)%s) == 0) {' % (if_, gremedy_function, function.args[0].name) + print ' __result = (%s)&%s;' % (function.type, gremedy_function) + print ' }' + if_ = 'else if' + print ' else {' + Tracer.dispatch_function(self, function) + print ' }' return Tracer.dispatch_function(self, function)