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

Submitted by Iago Toral Quiroga on Oct. 1, 2014, 6:35 a.m.

Details

Message ID 1412145345-3974-7-git-send-email-itoral@igalia.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Iago Toral Quiroga Oct. 1, 2014, 6:35 a.m.
From: Petri Latvala <petri.latvala@intel.com>

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

Patch hide | download patch | download mbox

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