summaryrefslogtreecommitdiff
path: root/generated_tests/templates
diff options
context:
space:
mode:
authorDylan Baker <baker.dylan.c@gmail.com>2015-02-19 16:09:42 -0800
committerDylan Baker <baker.dylan.c@gmail.com>2015-02-23 15:47:09 -0800
commit680f4e42c93529ac195dc67c930be40add99ec49 (patch)
tree9023d7b021636fd27b0ef73c4eb477cd2ababa6d /generated_tests/templates
parentc97fd5f95ed955dc97fd789bddbb4fb1673898e8 (diff)
gen_shader_precision_tests.py: python2/3 hybridize
This produces no changes in output. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Diffstat (limited to 'generated_tests/templates')
-rw-r--r--generated_tests/templates/gen_shader_precision_tests/fs.mako11
-rw-r--r--generated_tests/templates/gen_shader_precision_tests/gs.mako11
-rw-r--r--generated_tests/templates/gen_shader_precision_tests/vs.mako11
3 files changed, 21 insertions, 12 deletions
diff --git a/generated_tests/templates/gen_shader_precision_tests/fs.mako b/generated_tests/templates/gen_shader_precision_tests/fs.mako
index 4ea5e50cb..19ec737cd 100644
--- a/generated_tests/templates/gen_shader_precision_tests/fs.mako
+++ b/generated_tests/templates/gen_shader_precision_tests/fs.mako
@@ -1,3 +1,6 @@
+<%!
+ from six.moves import range
+%>
[require]
GLSL >= 4.00
@@ -45,13 +48,13 @@ ${', '.join('floatBitsToInt(expected{0})'.format(i) for i in indexers)}\
## check for differences in the sign bit for each result
##
bool signerr = \
-${' || '.join('(resultbits[{0}]>>31 != expectedbits[{0}]>>31)'.format(i) for i in xrange(0, num_elements))}\
+${' || '.join('(resultbits[{0}]>>31 != expectedbits[{0}]>>31)'.format(i) for i in range(0, num_elements))}\
;
##
## calculate the difference between the generated value and the expected value in ulps
##
${signature.rettype} ulps = ${signature.rettype}(\
-${', '.join('abs(resultbits[{0}] - expectedbits[{0}])'.format(i) for i in xrange(0, num_elements))}\
+${', '.join('abs(resultbits[{0}] - expectedbits[{0}])'.format(i) for i in range(0, num_elements))}\
);
##
## find the maximum error in ulps of all the calculations using a nested max() sort
@@ -72,7 +75,7 @@ max(\
% endfor
max(ulps${indexers[len(indexers)-2]}, ulps${indexers[len(indexers)-1]})\
## fill in completing parens
- % for i in xrange(0, num_elements-2):
+ % for i in range(0, num_elements-2):
)\
% endfor
;
@@ -110,7 +113,7 @@ piglit_vertex/float/2
[test]
% for test_num, test_vector in enumerate(test_vectors):
- % for i in xrange(len(test_vector.arguments)):
+ % for i in range(len(test_vector.arguments)):
uniform ${shader_runner_type(signature.argtypes[i])} arg${i} ${shader_runner_format( column_major_values(test_vector.arguments[i]))}
% endfor
uniform ${shader_runner_type(signature.rettype)} expected ${shader_runner_format(column_major_values(test_vector.result))}
diff --git a/generated_tests/templates/gen_shader_precision_tests/gs.mako b/generated_tests/templates/gen_shader_precision_tests/gs.mako
index 2912e5514..de4a3c8cd 100644
--- a/generated_tests/templates/gen_shader_precision_tests/gs.mako
+++ b/generated_tests/templates/gen_shader_precision_tests/gs.mako
@@ -1,3 +1,6 @@
+<%!
+ from six.moves import range
+%>
[require]
GLSL >= 4.00
@@ -51,13 +54,13 @@ ${', '.join('floatBitsToInt(expected{0})'.format(i) for i in indexers)}\
## check for differences in the sign bit for each result
##
bool signerr = \
-${' || '.join('(resultbits[{0}]>>31 != expectedbits[{0}]>>31)'.format(i) for i in xrange(0, num_elements))}\
+${' || '.join('(resultbits[{0}]>>31 != expectedbits[{0}]>>31)'.format(i) for i in range(0, num_elements))}\
;
##
## calculate the difference between the generated value and the expected value in ulps
##
${signature.rettype} ulps = ${signature.rettype}(\
-${', '.join('abs(resultbits[{0}] - expectedbits[{0}])'.format(i) for i in xrange(0, num_elements))}\
+${', '.join('abs(resultbits[{0}] - expectedbits[{0}])'.format(i) for i in range(0, num_elements))}\
);
##
## find the maximum error in ulps of all the calculations using a nested max() sort
@@ -78,7 +81,7 @@ max(\
% endfor
max(ulps${indexers[len(indexers)-2]}, ulps${indexers[len(indexers)-1]})\
## fill in completing parens
- % for i in xrange(0, num_elements-2):
+ % for i in range(0, num_elements-2):
)\
% endfor
;
@@ -129,7 +132,7 @@ piglit_vertex/float/2
[test]
% for test_num, test_vector in enumerate(test_vectors):
- % for i in xrange(len(test_vector.arguments)):
+ % for i in range(len(test_vector.arguments)):
uniform ${shader_runner_type(signature.argtypes[i])} arg${i} ${shader_runner_format( column_major_values(test_vector.arguments[i]))}
% endfor
uniform ${shader_runner_type(signature.rettype)} expected ${shader_runner_format(column_major_values(test_vector.result))}
diff --git a/generated_tests/templates/gen_shader_precision_tests/vs.mako b/generated_tests/templates/gen_shader_precision_tests/vs.mako
index 31b3013a8..8d8fad682 100644
--- a/generated_tests/templates/gen_shader_precision_tests/vs.mako
+++ b/generated_tests/templates/gen_shader_precision_tests/vs.mako
@@ -1,3 +1,6 @@
+<%!
+ from six.moves import range
+%>
[require]
GLSL >= 4.00
@@ -41,13 +44,13 @@ ${', '.join('floatBitsToInt(expected{0})'.format(i) for i in indexers)}\
## check for differences in the sign bit for each result
##
bool signerr = \
-${' || '.join('(resultbits[{0}]>>31 != expectedbits[{0}]>>31)'.format(i) for i in xrange(0, num_elements))}\
+${' || '.join('(resultbits[{0}]>>31 != expectedbits[{0}]>>31)'.format(i) for i in range(0, num_elements))}\
;
##
## calculate the difference between the generated value and the expected value in ulps
##
${signature.rettype} ulps = ${signature.rettype}(\
-${', '.join('abs(resultbits[{0}] - expectedbits[{0}])'.format(i) for i in xrange(0, num_elements))}\
+${', '.join('abs(resultbits[{0}] - expectedbits[{0}])'.format(i) for i in range(0, num_elements))}\
);
##
## find the maximum error in ulps of all the calculations using a nested max() sort
@@ -68,7 +71,7 @@ max(\
% endfor
max(ulps${indexers[len(indexers)-2]}, ulps${indexers[len(indexers)-1]})\
## fill in completing parens
- % for i in xrange(0, num_elements-2):
+ % for i in range(0, num_elements-2):
)\
% endfor
;
@@ -114,7 +117,7 @@ piglit_vertex/float/2
[test]
% for test_num, test_vector in enumerate(test_vectors):
- % for i in xrange(len(test_vector.arguments)):
+ % for i in range(len(test_vector.arguments)):
uniform ${shader_runner_type(signature.argtypes[i])} arg${i} ${shader_runner_format( column_major_values(test_vector.arguments[i]))}
% endfor
uniform ${shader_runner_type(signature.rettype)} expected ${shader_runner_format(column_major_values(test_vector.result))}