From: Jason Ekstrand Date: Wed, 15 Oct 2014 23:19:26 +0000 (-0700) Subject: nir/glsl: Add support for saturate X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=458a6ce500998e6f463d29641060a1672e01c620;p=mesa.git nir/glsl: Add support for saturate Reviewed-by: Connor Abbott --- diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp index 19f4e29ebdb..7155a9df08a 100644 --- a/src/glsl/nir/glsl_to_nir.cpp +++ b/src/glsl/nir/glsl_to_nir.cpp @@ -1007,6 +1007,11 @@ nir_visitor::visit(ir_expression *ir) dest_size, srcs); instr->src[0].abs = true; break; + case ir_unop_saturate: + assert(types[0] == GLSL_TYPE_FLOAT); + instr = emit(nir_op_fmov, dest_size, srcs); + instr->dest.saturate = true; + break; case ir_unop_sign: emit(types[0] == GLSL_TYPE_FLOAT ? nir_op_fsign : nir_op_isign, dest_size, srcs);