summaryrefslogtreecommitdiffstats
path: root/src/gallium/docs/source/exts/tgsi.py
blob: e92cd5c4d1b8b4b41b9721286af6e68ae4a9fac4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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)