[Piglit] [PATCH 2/2] Add generated tests for AMD_shader_trinary_minmax.

Kenneth Graunke kenneth at whitecape.org
Fri Jan 24 13:59:41 PST 2014


---
 generated_tests/builtin_function.py | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/generated_tests/builtin_function.py b/generated_tests/builtin_function.py
index d2fdf41..30f5897 100644
--- a/generated_tests/builtin_function.py
+++ b/generated_tests/builtin_function.py
@@ -444,6 +444,8 @@ def _clamp(x, minVal, maxVal):
         return None
     return min(max(x, minVal), maxVal)
 
+def _mid3(x, y, z):
+    return max(min(x, y), max(min(x, z), min(y, z)))
 
 def _smoothstep(edge0, edge1, x):
     if edge0 >= edge1:
@@ -860,6 +862,30 @@ def _make_componentwise_test_vectors(test_suite_dict):
       [np.linspace(-2.0, 2.0, 4), np.linspace(-2.0, 2.0, 4)])
     f('max', 2, 130, max, [1], [ints, ints])
     f('max', 2, 130, max, [1], [uints, uints])
+    f('min3', 2, 110, min, None,
+      [np.linspace(-2.0, 2.0, 4), np.linspace(-2.0, 2.0, 4),
+       np.linspace(-2.0, 2.0, 4)],
+      extension="AMD_shader_trinary_minmax")
+    f('min3', 2, 130, min, None, [ints, ints, ints],
+      extension="AMD_shader_trinary_minmax")
+    f('min3', 2, 130, min, None, [uints, uints, uints],
+      extension="AMD_shader_trinary_minmax")
+    f('max3', 2, 110, max, None,
+      [np.linspace(-2.0, 2.0, 4), np.linspace(-2.0, 2.0, 4),
+       np.linspace(-2.0, 2.0, 4)],
+      extension="AMD_shader_trinary_minmax")
+    f('max3', 2, 130, max, None, [ints, ints, ints],
+      extension="AMD_shader_trinary_minmax")
+    f('max3', 2, 130, max, None, [uints, uints, uints],
+      extension="AMD_shader_trinary_minmax")
+    f('mid3', 2, 110, _mid3, None,
+      [np.linspace(-2.0, 2.0, 4), np.linspace(-2.0, 2.0, 4),
+       np.linspace(-2.0, 2.0, 4)],
+      extension="AMD_shader_trinary_minmax")
+    f('mid3', 2, 130, _mid3, None, [ints, ints, ints],
+      extension="AMD_shader_trinary_minmax")
+    f('mid3', 2, 130, _mid3, None, [uints, uints, uints],
+      extension="AMD_shader_trinary_minmax")
     f('clamp', 3, 110, _clamp, [1, 2], [np.linspace(-2.0, 2.0, 4),
       np.linspace(-1.5, 1.5, 3), np.linspace(-1.5, 1.5, 3)])
     f('clamp', 3, 130, _clamp, [1, 2], [ints, ints, ints])
-- 
1.8.5.2



More information about the Piglit mailing list