diff options
-rw-r--r-- | src/glsl/nir/nir_opcodes.py | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/glsl/nir/nir_opcodes.py b/src/glsl/nir/nir_opcodes.py index 6f3c5bac36..b9af7f14bb 100644 --- a/src/glsl/nir/nir_opcodes.py +++ b/src/glsl/nir/nir_opcodes.py @@ -36,19 +36,19 @@ class Opcode: # where nir_op_is_ is prepended before each entry def __init__(self, name, output_size, output_type, input_sizes, input_types, algebraic_properties, const_expr): - assert(isinstance(name, str)) - assert(isinstance(output_size, int)) - assert(isinstance(output_type, str)) - assert(isinstance(input_sizes, list)) - assert(isinstance(input_sizes[0], int)) - assert(isinstance(input_types, list)) - assert(isinstance(input_types[0], str)) - assert(isinstance(algebraic_properties, str)) - assert(isinstance(const_expr, str)) - assert(len(input_sizes) == len(input_types)) - assert(0 <= output_size <= 4) + assert isinstance(name, str) + assert isinstance(output_size, int) + assert isinstance(output_type, str) + assert isinstance(input_sizes, list) + assert isinstance(input_sizes[0], int) + assert isinstance(input_types, list) + assert isinstance(input_types[0], str) + assert isinstance(algebraic_properties, str) + assert isinstance(const_expr, str) + assert len(input_sizes) == len(input_types) + assert 0 <= output_size <= 4 for size in input_sizes: - assert(0 <= size <= 4) + assert 0 <= size <= 4 if output_size != 0: assert size != 0 self.name = name @@ -74,7 +74,7 @@ opcodes = {} def opcode(name, output_size, output_type, input_sizes, input_types, algebraic_properties, const_expr): - assert(name not in opcodes) + assert name not in opcodes opcodes[name] = Opcode(name, output_size, output_type, input_sizes, input_types, algebraic_properties, const_expr) @@ -285,9 +285,9 @@ for (unsigned bit = 0; bit < 32; bit++) {{ """) -for i in range(1, 5): - for j in range(1, 5): - unop_horiz("fnoise" + str(i) + "_" + str(j), i, tfloat, j, tfloat, +for i in xrange(1, 5): + for j in xrange(1, 5): + unop_horiz("fnoise{0}_{1}".format(i, j), i, tfloat, j, tfloat, "0.0f") def binop_convert(name, out_type, in_type, alg_props, const_expr): |