From: Abdiel Janulgue Date: Mon, 8 Dec 2014 11:31:29 +0000 (+0200) Subject: glsl: Don't optimize min/max into saturate when EmitNoSat is set X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4ea8c8d56ca8d6b4af36e7750186821b4973355a;p=mesa.git glsl: Don't optimize min/max into saturate when EmitNoSat is set v3: Fix multi-line comment format (Ian) Reviewed-by: Matt Turner Signed-off-by: Abdiel Janulgue --- diff --git a/src/glsl/opt_algebraic.cpp b/src/glsl/opt_algebraic.cpp index c4f883b9a8e..c6f4a9c786d 100644 --- a/src/glsl/opt_algebraic.cpp +++ b/src/glsl/opt_algebraic.cpp @@ -689,7 +689,7 @@ 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 diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 7389baa1d02..cee11a39120 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2990,6 +2990,7 @@ struct gl_shader_compiler_options GLboolean EmitNoMainReturn; /**< Emit CONT/RET opcodes? */ GLboolean EmitNoNoise; /**< Emit NOISE opcodes? */ GLboolean EmitNoPow; /**< Emit POW opcodes? */ + GLboolean EmitNoSat; /**< Emit SAT opcodes? */ GLboolean LowerClipDistance; /**< Lower gl_ClipDistance from float[8] to vec4[2]? */ /**