summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl
diff options
context:
space:
mode:
authorVinson Lee <[email protected]>2016-09-01 00:20:02 -0700
committerVinson Lee <[email protected]>2016-09-06 12:03:30 -0700
commit215075ae30aa60dd78dd7b3372f422e9e8e6a52b (patch)
treed8cf0df9d3641449394dd03aed9b2bfbb7c3af6a /src/compiler/glsl
parent31a380c8ddbcb9eaba275a000a9d0c5f28cfd379 (diff)
glsl: Add positional argument specifiers.
Fix build with Python < 2.7. File "./glsl/ir_expression_operation.py", line 360, in get_enum_name return "ir_{}op_{}".format(("un", "bin", "tri", "quad")[self.num_operands-1], self.name) ValueError: zero length field name in format Fixes: e31c72a331b1 ("glsl: Convert tuple into a class") Signed-off-by: Vinson Lee <[email protected]>
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r--src/compiler/glsl/ir_expression_operation.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/compiler/glsl/ir_expression_operation.py b/src/compiler/glsl/ir_expression_operation.py
index 43ba46e4086..9aa08d3cabe 100644
--- a/src/compiler/glsl/ir_expression_operation.py
+++ b/src/compiler/glsl/ir_expression_operation.py
@@ -357,7 +357,7 @@ class operation(object):
def get_enum_name(self):
- return "ir_{}op_{}".format(("un", "bin", "tri", "quad")[self.num_operands-1], self.name)
+ return "ir_{0}op_{1}".format(("un", "bin", "tri", "quad")[self.num_operands-1], self.name)
def get_template(self):
@@ -394,10 +394,10 @@ class operation(object):
def get_c_expression(self, types, indices=("c", "c", "c")):
- src0 = "op[0]->value.{}[{}]".format(types[0].union_field, indices[0])
- src1 = "op[1]->value.{}[{}]".format(types[1].union_field, indices[1]) if len(types) >= 2 else "ERROR"
- src2 = "op[2]->value.{}[{}]".format(types[2].union_field, indices[2]) if len(types) >= 3 else "ERROR"
- src3 = "op[3]->value.{}[c]".format(types[3].union_field) if len(types) >= 4 else "ERROR"
+ src0 = "op[0]->value.{0}[{1}]".format(types[0].union_field, indices[0])
+ src1 = "op[1]->value.{0}[{1}]".format(types[1].union_field, indices[1]) if len(types) >= 2 else "ERROR"
+ src2 = "op[2]->value.{0}[{1}]".format(types[2].union_field, indices[2]) if len(types) >= 3 else "ERROR"
+ src3 = "op[3]->value.{0}[c]".format(types[3].union_field) if len(types) >= 4 else "ERROR"
expr = self.c_expression[types[0].union_field] if types[0].union_field in self.c_expression else self.c_expression['default']