diff options
author | Mathieu Bridon <[email protected]> | 2018-07-06 12:22:18 +0200 |
---|---|---|
committer | Dylan Baker <[email protected]> | 2018-07-24 11:07:04 -0700 |
commit | 9ebd8372b9d98b1ffa7e80666ee367c59e128af5 (patch) | |
tree | 13adc1d5c528c6f6a6ce6ca63acbad63ebce3bb1 /src/compiler | |
parent | 022d2a381d32d24aabe2c54704a5a5e2440a75e9 (diff) |
python: Use range() instead of xrange()
Python 2 has a range() function which returns a list, and an xrange()
one which returns an iterator.
Python 3 lost the function returning a list, and renamed the function
returning an iterator as range().
As a result, using range() makes the scripts compatible with both Python
versions 2 and 3.
Signed-off-by: Mathieu Bridon <[email protected]>
Reviewed-by: Eric Engestrom <[email protected]>
Reviewed-by: Dylan Baker <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/glsl/ir_expression_operation.py | 2 | ||||
-rw-r--r-- | src/compiler/nir/nir_opcodes.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler/glsl/ir_expression_operation.py b/src/compiler/glsl/ir_expression_operation.py index b3dac3da3f7..16b98690a6d 100644 --- a/src/compiler/glsl/ir_expression_operation.py +++ b/src/compiler/glsl/ir_expression_operation.py @@ -116,7 +116,7 @@ constant_template_common = mako.template.Template("""\ constant_template_vector_scalar = mako.template.Template("""\ case ${op.get_enum_name()}: % if "mixed" in op.flags: - % for i in xrange(op.num_operands): + % for i in range(op.num_operands): assert(op[${i}]->type->base_type == ${op.source_types[0].glsl_type} || % for src_type in op.source_types[1:-1]: op[${i}]->type->base_type == ${src_type.glsl_type} || diff --git a/src/compiler/nir/nir_opcodes.py b/src/compiler/nir/nir_opcodes.py index 3c3316dcaa8..b03c5da2eae 100644 --- a/src/compiler/nir/nir_opcodes.py +++ b/src/compiler/nir/nir_opcodes.py @@ -367,8 +367,8 @@ for (unsigned bit = 0; bit < bit_size; bit++) { """) -for i in xrange(1, 5): - for j in xrange(1, 5): +for i in range(1, 5): + for j in range(1, 5): unop_horiz("fnoise{0}_{1}".format(i, j), i, tfloat, j, tfloat, "0.0f") |