We can use the intersection function to reduce the range even further if the operand has bounds between 0.0 and 1.0. --- src/glsl/opt_minmax.cpp | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/src/glsl/opt_minmax.cpp b/src/glsl/opt_minmax.cpp index 341006e..b925aaa 100644 --- a/src/glsl/opt_minmax.cpp +++ b/src/glsl/opt_minmax.cpp @@ -292,6 +292,13 @@ get_range(ir_rvalue *rval) low = new(mem_ctx) ir_constant(-1.0f); return minmax_range(low, high); + case ir_unop_saturate: + high = new(mem_ctx) ir_constant(1.0f); + low = new(mem_ctx) ir_constant(0.0f); + r0 = get_range(expr->operands[0]); + // We can get the intersection here to limit the range even more + return range_intersection(r0, minmax_range(low, high)); + default: break; } -- 2.0.3 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev