summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2013-02-23 19:31:43 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2013-02-23 19:31:43 +0100
commit1634b9003c4702840a2faa9e67c07336eff1b659 (patch)
treecd0ae3a283952983624203224f4778169e757766 /tools
parentf07aa6ed6f85bec0adcc97267d69a6e3106ab4b8 (diff)
etna_pipe: add displacement mapping demo
Diffstat (limited to 'tools')
-rwxr-xr-xtools/asm.py5
-rw-r--r--tools/data/viv_gallium_state.txt14
-rwxr-xr-xtools/disasm.py5
-rwxr-xr-xtools/dump_separate_cmdbuf.py3
-rw-r--r--tools/etnaviv/util.py33
-rwxr-xr-xtools/gen_weave_state.py3
-rwxr-xr-xtools/make_feature_comparison.py3
7 files changed, 52 insertions, 14 deletions
diff --git a/tools/asm.py b/tools/asm.py
index df613d7..df42a85 100755
--- a/tools/asm.py
+++ b/tools/asm.py
@@ -2,7 +2,7 @@
'''
Shader assembler.
-Usage: asm.py ../rnndb/isa.xml in.asm out.bin
+Usage: asm.py --isa-file ../rnndb/isa.xml in.asm out.bin
'''
# Copyright (c) 2012-2013 Wladimir J. van der Laan
#
@@ -30,6 +30,7 @@ import sys
from binascii import b2a_hex
import re
+from etnaviv.util import rnndb_path
from etnaviv.parse_rng import parse_rng_file, format_path, BitSet, Domain
from etnaviv.asm_common import DstOperand, DstOperandAReg, SrcOperand, TexOperand, AddrOperand, Instruction, AMODES, COMPS, RGROUPS
from etnaviv.asm_common import disassemble, format_instruction
@@ -285,7 +286,7 @@ def parse_arguments():
parser = argparse.ArgumentParser(description='Disassemble shader')
parser.add_argument('--isa-file', metavar='ISAFILE', type=str,
help='Shader ISA definition file (rules-ng-ng)',
- default='../rnndb/isa.xml')
+ default=rnndb_path('isa.xml'))
parser.add_argument('input', metavar='INFILE', type=str,
help='Shader assembly file')
#parser.add_argument('output', metavar='OUTFILE', type=str,
diff --git a/tools/data/viv_gallium_state.txt b/tools/data/viv_gallium_state.txt
index 0576cc8..c93797c 100644
--- a/tools/data/viv_gallium_state.txt
+++ b/tools/data/viv_gallium_state.txt
@@ -59,15 +59,15 @@ sample_mask sample_mask. ETNA_STATE_SAMPLE_MASK
GL.MULTI_SAMPLE_CONFIG
sampler_state sampler[{0}]-> ETNA_STATE_SAMPLERS
- TE.SAMPLER.CONFIG0
- TE.SAMPLER.LOD_CONFIG
+ TE.SAMPLER.CONFIG0 Set to 0 for inactive samplers
+ TE.SAMPLER.LOD_CONFIG Only set for active samplers
sampler_view sampler_view[{0}]. ETNA_STATE_SAMPLER_VIEWS
- TE.SAMPLER.CONFIG0
- TE.SAMPLER.LOD_CONFIG
- TE.SAMPLER.SIZE
- TE.SAMPLER.LOG_SIZE
- TE.SAMPLER.LOD_ADDR
+ TE.SAMPLER.CONFIG0 Only set for active samplers
+ TE.SAMPLER.LOD_CONFIG Only set for active samplers
+ TE.SAMPLER.SIZE Only set for active samplers
+ TE.SAMPLER.LOG_SIZE Only set for active samplers
+ TE.SAMPLER.LOD_ADDR Only set for active samplers
framebuffer_state framebuffer. ETNA_STATE_FRAMEBUFFER
GL.MULTI_SAMPLE_CONFIG
diff --git a/tools/disasm.py b/tools/disasm.py
index 25e7866..dc9b107 100755
--- a/tools/disasm.py
+++ b/tools/disasm.py
@@ -2,7 +2,7 @@
'''
Shader disassembler.
-Usage: disasm.py ../rnndb/isa.xml (vs|ps)_x.bin
+Usage: disasm.py --isa-file ../rnndb/isa.xml (vs|ps)_x.bin
'''
# Copyright (c) 2012-2013 Wladimir J. van der Laan
#
@@ -30,6 +30,7 @@ import sys
from binascii import b2a_hex
from collections import namedtuple
+from etnaviv.util import rnndb_path
from etnaviv.parse_rng import parse_rng_file, format_path, BitSet, Domain
from etnaviv.asm_common import format_instruction, disassemble
@@ -37,7 +38,7 @@ def parse_arguments():
parser = argparse.ArgumentParser(description='Disassemble shader')
parser.add_argument('--isa-file', metavar='ISAFILE', type=str,
help='Shader ISA definition file (rules-ng-ng)',
- default='../rnndb/isa.xml')
+ default=rnndb_path('isa.xml'))
parser.add_argument('input', metavar='INFILE', type=str,
help='Binary shader file')
parser.add_argument('-a', dest='addr',
diff --git a/tools/dump_separate_cmdbuf.py b/tools/dump_separate_cmdbuf.py
index e577e98..b4608da 100755
--- a/tools/dump_separate_cmdbuf.py
+++ b/tools/dump_separate_cmdbuf.py
@@ -31,6 +31,7 @@ from collections import defaultdict
from binascii import b2a_hex
# Parse rules-ng-ng format for state space
+from etnaviv.util import rnndb_path
from etnaviv.parse_rng import parse_rng_file, format_path, BitSet, Domain
DEBUG = False
@@ -158,7 +159,7 @@ def parse_arguments():
help='FDR file')
parser.add_argument('--rules-file', metavar='RULESFILE', type=str,
help='State map definition file (rules-ng-ng)',
- default='../rnndb/state.xml')
+ default=rnndb_path('state.xml'))
parser.add_argument('-l', '--hide-load-state', dest='hide_load_state',
default=False, action='store_const', const=True,
help='Hide "LOAD_STATE" entries, this can make command stream a bit easier to read')
diff --git a/tools/etnaviv/util.py b/tools/etnaviv/util.py
new file mode 100644
index 0000000..925058d
--- /dev/null
+++ b/tools/etnaviv/util.py
@@ -0,0 +1,33 @@
+'''
+Basic utilities.
+'''
+# Copyright (c) 2012-2013 Wladimir J. van der Laan
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sub license,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the
+# next paragraph) shall be included in all copies or substantial portions
+# of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+from __future__ import print_function, division, unicode_literals
+from os import path
+import os,sys
+
+FILE = path.dirname(sys.modules[__name__].__file__)
+BASEPATH = os.path.join(FILE, '../..')
+
+def rnndb_path(filename):
+ return path.join(BASEPATH, 'rnndb', filename)
+
diff --git a/tools/gen_weave_state.py b/tools/gen_weave_state.py
index b79d812..0207c04 100755
--- a/tools/gen_weave_state.py
+++ b/tools/gen_weave_state.py
@@ -27,6 +27,7 @@ import argparse
from collections import defaultdict
import sys
# Parse rules-ng-ng format for state space
+from etnaviv.util import rnndb_path
from etnaviv.parse_rng import parse_rng_file, format_path, BitSet, Domain, Stripe, Register, Array, BaseType
SRC_SPEC = 'e->'
@@ -39,7 +40,7 @@ def parse_args():
default='data/viv_gallium_state.txt')
parser.add_argument('--rules-file', metavar='RULESFILE', type=str,
help='State map definition file (rules-ng-ng)',
- default='../rnndb/state.xml')
+ default=rnndb_path('state.xml'))
return parser.parse_args()
diff --git a/tools/make_feature_comparison.py b/tools/make_feature_comparison.py
index 073ecac..28add01 100755
--- a/tools/make_feature_comparison.py
+++ b/tools/make_feature_comparison.py
@@ -27,11 +27,12 @@ The input data is specified in JSON format, the output is in HTML.
from __future__ import print_function, division, unicode_literals
import argparse
import json, cgi
+from etnaviv.util import rnndb_path
from etnaviv.parse_rng import parse_rng_file, format_path, BitSet, Domain
import sys
GPUS_FILE = 'data/gpus.json'
-STATE_MAP = '../rnndb/state.xml'
+STATE_MAP = rnndb_path('state.xml')
class Cell(object):
def __init__(self, row, column, value, rowspan=1, colspan=1, cls=None):