From 458a6ce500998e6f463d29641060a1672e01c620 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 15 Oct 2014 16:19:26 -0700 Subject: [PATCH] nir/glsl: Add support for saturate Reviewed-by: Connor Abbott --- src/glsl/nir/glsl_to_nir.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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); -- 2.30.2