summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2014-10-15 16:19:26 -0700
committerJason Ekstrand <[email protected]>2015-01-15 07:18:59 -0800
commit458a6ce500998e6f463d29641060a1672e01c620 (patch)
tree151d97f124fd2e1ec8b89b1490f86d393051a7a7 /src
parent4582341ea74a076c981c962f1a01311bfa3bf991 (diff)
nir/glsl: Add support for saturate
Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/glsl/nir/glsl_to_nir.cpp5
1 files changed, 5 insertions, 0 deletions
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);