[Mesa-dev] [PATCH 7/9] glsl: Add min and max IR sexp creation functions to test_case_generator.py

Petri Latvala petri.latvala at intel.com
Tue Jul 29 02:36:37 PDT 2014

Signed-off-by: Petri Latvala <petri.latvala at intel.com>
 src/glsl/tests/test_case_generator.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/glsl/tests/test_case_generator.py b/src/glsl/tests/test_case_generator.py
index 6633702..5f550df 100644
--- a/src/glsl/tests/test_case_generator.py
+++ b/src/glsl/tests/test_case_generator.py
@@ -86,6 +86,21 @@ def gt_zero(var_name):
     """Create Construct the expression var_name > 0"""
     return ['expression', 'bool', '>', ['var_ref', var_name], const_float(0)]
+def min_(a, b, type):
+    """Create an expression min(a, b), of type 'type'"""
+    return ['expression', type, 'min', a, b]
+def max_(a, b, type):
+    """Create an expression max(a, b), of type 'type'"""
+    return ['expression', type, 'max', a, b]
+def minf(a, b):
+    """Helper function for min_(a, b, 'float')"""
+    return min_(a, b, 'float')
+def maxf(a, b):
+    """Helper function for max_(a, b, 'float')"""
+    return max_(a, b, 'float')
 # The following functions can be used to build complex control flow
 # statements.  All of these functions return statement lists (even

More information about the mesa-dev mailing list