[Mesa-dev] [PATCH v2 2/7] glsl: Don't optimize min/max into saturate when EmitNoSat is set

Abdiel Janulgue abdiel.janulgue at linux.intel.com
Mon Dec 1 05:47:42 PST 2014


Signed-off-by: Abdiel Janulgue <abdiel.janulgue at linux.intel.com>
---
 src/glsl/opt_algebraic.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/glsl/opt_algebraic.cpp b/src/glsl/opt_algebraic.cpp
index 430f5cb..89fc0de 100644
--- a/src/glsl/opt_algebraic.cpp
+++ b/src/glsl/opt_algebraic.cpp
@@ -679,7 +679,8 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
 
    case ir_binop_min:
    case ir_binop_max:
-      if (ir->type->base_type != GLSL_TYPE_FLOAT)
+      if (ir->type->base_type != GLSL_TYPE_FLOAT ||
+          options->EmitNoSat)
          break;
 
       /* Replace min(max) operations and its commutative combinations with
-- 
1.9.1



More information about the mesa-dev mailing list