summaryrefslogtreecommitdiffstats
path: root/src/gallium/docs/source/exts
diff options
context:
space:
mode:
authorCorbin Simpson <[email protected]>2010-02-02 16:20:12 -0800
committerCorbin Simpson <[email protected]>2010-02-02 17:03:41 -0800
commit8580522b14b19e5087a6b72fb694630b962e29ba (patch)
tree19b4eca8cddf59d1e002cf615ef8f3d1776ebbd6 /src/gallium/docs/source/exts
parent3e572eb25e20db0ba4a4bdf554185e1da88af671 (diff)
gallium/docs: Add opcode formatting.
Diffstat (limited to 'src/gallium/docs/source/exts')
-rw-r--r--src/gallium/docs/source/exts/tgsi.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gallium/docs/source/exts/tgsi.py b/src/gallium/docs/source/exts/tgsi.py
new file mode 100644
index 00000000000..e92cd5c4d1b
--- /dev/null
+++ b/src/gallium/docs/source/exts/tgsi.py
@@ -0,0 +1,17 @@
+# tgsi.py
+# Sphinx extension providing formatting for TGSI opcodes
+# (c) Corbin Simpson 2010
+
+import docutils.nodes
+import sphinx.addnodes
+
+def parse_opcode(env, sig, signode):
+ opcode, desc = sig.split("-", 1)
+ opcode = opcode.strip().upper()
+ desc = " (%s)" % desc.strip()
+ signode += sphinx.addnodes.desc_name(opcode, opcode)
+ signode += sphinx.addnodes.desc_annotation(desc, desc)
+ return opcode
+
+def setup(app):
+ app.add_description_unit("opcode", "opcode", "%s (TGSI opcode)", parse_opcode)