]> git.notmuchmail.org Git - apitrace/commitdiff
Fix the *GREMEDY proc address return.
authorJosé Fonseca <jfonseca@vmware.com>
Fri, 15 Jul 2011 19:16:40 +0000 (20:16 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Fri, 15 Jul 2011 19:16:40 +0000 (20:16 +0100)
gltrace.py
glxtrace.py

index 32e77a75034b84f05a3e0317752a17c2a90944eb..af5714242e5a7a148a1befc4d928bd929000405b 100644 (file)
@@ -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)
index 7511f0a392ac7afc53acaa6a758c5cbc63b72c62..6b5d786b6d91ff16f1562ceb9790f544481d51ed 100644 (file)
@@ -101,7 +101,7 @@ if __name__ == '__main__':
     for f in api.functions:
         ptype = function_pointer_type(f)
         pvalue = function_pointer_value(f)
-        print '    if (!strcmp("%s", (const char *)procName)) {' % f.name
+        print '    if (strcmp("%s", (const char *)procName) == 0) {' % f.name
         print '        %s = (%s)procPtr;' % (pvalue, ptype)
         print '        return (__GLXextFuncPtr)&%s;' % (f.name,)
         print '    }'