xgl-generate.py: simplify _is_dispatchable()
authorChia-I Wu <olv@lunarg.com>
Sun, 4 Jan 2015 07:38:47 +0000 (15:38 +0800)
committerCourtney Goeltzenleuchter <courtney@LunarG.com>
Thu, 5 Feb 2015 00:58:04 +0000 (17:58 -0700)
Make use of object_in_params().  Remove unused _is_name_dispatchable().

xgl-generate.py

index edd759d..98d43b8 100755 (executable)
@@ -129,22 +129,12 @@ class LoaderEntrypointsSubcommand(Subcommand):
             "CreateCommandBuffer",
             "WsiX11CreatePresentableImage")
 
-    def _is_name_dispatchable(self, name):
-        return name not in (
-            "GetProcAddr",
-            "InitAndEnumerateGpus",
-            "EnumerateLayers",
-            "DbgRegisterMsgCallback",
-            "DbgUnregisterMsgCallback",
-            "DbgSetGlobalOption")
-
     def _is_dispatchable(self, proto):
-        """Return true if the prototype is dispatchable.
+        if proto.name in ["GetProcAddr", "EnumerateLayers"]:
+            return False
 
-        That is, return true when the prototype takes a XGL_PHYSICAL_GPU or
-        XGL_BASE_OBJECT.
-        """
-        return self._is_name_dispatchable(proto.name)
+        in_objs = proto.object_in_params()
+        return in_objs and in_objs[0] == proto.params[0]
 
     def _generate_loader_dispatch_entrypoints(self, qual=""):
         if qual: