[Piglit] [PATCH 8/8] gen_builtin_uniform_tests.py: Remove dead code and update comment.

Eric Anholt eric at anholt.net
Fri Aug 29 14:41:19 PDT 2014


b4274e7581a779b398f0b7588e38f672b2419e6d in 2011 changed things to use
tolerances instead of scaling of colors.
---
 generated_tests/gen_builtin_uniform_tests.py | 29 +++++-----------------------
 1 file changed, 5 insertions(+), 24 deletions(-)

diff --git a/generated_tests/gen_builtin_uniform_tests.py b/generated_tests/gen_builtin_uniform_tests.py
index dc01607..5c6438c 100644
--- a/generated_tests/gen_builtin_uniform_tests.py
+++ b/generated_tests/gen_builtin_uniform_tests.py
@@ -31,11 +31,11 @@
 # uniforms, so that the effectiveness of the test won't be
 # circumvented by constant folding in the GLSL compiler.
 #
-# The tests operate by invoking the built-in function in the
-# appropriate shader, applying a scale and offset so that the expected
-# values are in the range [0.25, 0.75], and then outputting the result
-# as a solid rgba color, which is then checked using shader_runner's
-# "probe rgba" command.
+# The float and int tests invoke the built-in function and test in the
+# shader that the result is within some tolerance of the expected
+# value, then store green for success or red for failure.  The bool
+# tests compute a bvec4, cast that to vec4, then store that as the
+# output color.
 #
 # For built-in functions whose result type is a matrix, the test
 # checks one column at a time.
@@ -53,25 +53,6 @@ import os.path
 import sys
 
 
-def compute_offset_and_scale(test_vectors):
-    """Compute scale and offset values such that for each result in
-    test_vectors, (result - offset) * scale is in the range [0.25,
-    0.75], and scale is less than or equal to 1.0.  These values are
-    used to transform the test vectors so that their outputs can be
-    stored in gl_FragColor without overflow.
-    """
-    low = min(numpy.min(tv.result) for tv in test_vectors)
-    hi = max(numpy.max(tv.result) for tv in test_vectors)
-    span = hi - low
-    center = (hi + low)/2.0
-    span *= 2.0
-    if span < 1.0:
-        span = 1.0
-    offset = center - span/2.0
-    scale = 1.0/span
-    return offset, scale
-
-
 def shader_runner_format(values):
     """Format the given values for use in a shader_runner "uniform" or
     "probe rgba" command.  Bools are converted to 0's and 1's, and
-- 
2.1.0



More information about the Piglit mailing list