xgl-generate: add is_dispatchable()
Return true for functions that have access to the ICD dispatch table.
diff --git a/xgl-generate.py b/xgl-generate.py
index f4ede37..f4ca410 100755
--- a/xgl-generate.py
+++ b/xgl-generate.py
@@ -82,12 +82,6 @@
};""" % ";\n ".join(entries)
class LoaderSubcommand(Subcommand):
- # functions that the loader implements
- impl = ("InitAndEnumerateGpus",
- "DbgRegisterMsgCallback",
- "DbgUnregisterMsgCallback",
- "DbgSetGlobalOption")
-
def generate_header(self):
return "\n".join([
"#include <xgl.h>",
@@ -96,7 +90,7 @@
def _generate_api(self):
funcs = []
for proto in self.protos:
- if proto.name in self.impl:
+ if not xgl.is_dispatchable(proto):
continue
decl = proto.c_func(prefix="xgl", attr="XGLAPI")
diff --git a/xgl.py b/xgl.py
index 120d48b..ef358ce 100644
--- a/xgl.py
+++ b/xgl.py
@@ -814,3 +814,15 @@
"CmdDbgMarkerBegin",
"CmdDbgMarkerEnd",
)
+
+def is_dispatchable(proto):
+ """Return true if the prototype is dispatchable.
+
+ That is, return true when the prototype takes a XGL_PHYSICAL_GPU or
+ XGL_BASE_OBJECT.
+ """
+ return proto.name not in (
+ "InitAndEnumerateGpus",
+ "DbgRegisterMsgCallback",
+ "DbgUnregisterMsgCallback",
+ "DbgSetGlobalOption")