nir/glsl: Add support for saturate
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 15 Oct 2014 23:19:26 +0000 (16:19 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 15 Jan 2015 15:18:59 +0000 (07:18 -0800)
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/glsl/nir/glsl_to_nir.cpp

index 19f4e29ebdb8443966f2522bf2094613bcabe793..7155a9df08a8c8e7bb44112f35b559c151f01907 100644 (file)
@@ -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);