layers: fix calculation of intercepting functions.
authorMike Stroyan <mike@LunarG.com>
Mon, 11 May 2015 19:44:24 +0000 (13:44 -0600)
committerMike Stroyan <mike@LunarG.com>
Tue, 12 May 2015 22:03:44 +0000 (16:03 -0600)
Assign _gen_layer_get_global_extension_info to intercept.
Remove duplicate calculation of lookups.

vk-layer-generate.py

index cc30a2274b64b9c85f39a1e731a1674439485eeb..ab1122322a5b4c3a243233f07295fa7392d54b28 100755 (executable)
@@ -285,8 +285,7 @@ class Subcommand(object):
                     elif 'DbgUnregisterMsgCallback' == proto.name:
                         intercept = self._gen_layer_dbg_callback_unregister()
                     elif 'GetGlobalExtensionInfo' == proto.name:
-                        funcs.append(self._gen_layer_get_global_extension_info(self.layer_name))
-                        intercepted.append(proto)
+                        intercept = self._gen_layer_get_global_extension_info(self.layer_name)
                 if intercept is not None:
                     funcs.append(intercept)
                     intercepted.append(proto)
@@ -298,13 +297,6 @@ class Subcommand(object):
             lookups.append("    return (void*) %s%s;" %
                     (prefix, proto.name))
 
-        prefix="vk"
-        lookups = []
-        for proto in intercepted:
-            lookups.append("if (!strcmp(name, \"%s\"))" % proto.name)
-            lookups.append("    return (void*) %s%s;" %
-                    (prefix, proto.name))
-
         # add customized layer_intercept_proc
         body = []
         body.append("static inline void* layer_intercept_proc(const char *name)")