aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-12-11 22:04:04 -0800
committerJason Ekstrand <[email protected]>2018-01-08 14:57:44 -0800
commit0bb18858fb67558ed8f9173de33c0ea31edf6530 (patch)
tree834731bf29a280df29c1538f0d6eb97994da0e6d /src/compiler
parentab85fd02d56c66d25dfdd2d999884a7dfb83da36 (diff)
spirv/info: Add spirv_op_to_string
Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/spirv/spirv_info.h1
-rw-r--r--src/compiler/spirv/spirv_info_c.py10
2 files changed, 11 insertions, 0 deletions
diff --git a/src/compiler/spirv/spirv_info.h b/src/compiler/spirv/spirv_info.h
index 81d43ec925a..121ffd2febb 100644
--- a/src/compiler/spirv/spirv_info.h
+++ b/src/compiler/spirv/spirv_info.h
@@ -28,5 +28,6 @@
const char *spirv_capability_to_string(SpvCapability cap);
const char *spirv_decoration_to_string(SpvDecoration dec);
+const char *spirv_op_to_string(SpvOp op);
#endif /* SPIRV_INFO_H */
diff --git a/src/compiler/spirv/spirv_info_c.py b/src/compiler/spirv/spirv_info_c.py
index 4a6a81524b3..ff7942bcd3a 100644
--- a/src/compiler/spirv/spirv_info_c.py
+++ b/src/compiler/spirv/spirv_info_c.py
@@ -45,6 +45,15 @@ def collect_data(spirv, kind):
return (kind, values)
+def collect_opcodes(spirv):
+ values = []
+ for x in spirv["instructions"]:
+ name = x["opname"]
+ assert name.startswith("Op")
+ values.append(name[2:])
+
+ return ("Op", values)
+
def parse_args():
p = argparse.ArgumentParser()
p.add_argument("json")
@@ -81,6 +90,7 @@ if __name__ == "__main__":
info = [
collect_data(spirv_info, "Capability"),
collect_data(spirv_info, "Decoration"),
+ collect_opcodes(spirv_info),
]
with open(pargs.out, 'w') as f: