[Mesa-dev] [v2 PATCH 06/16] i965/fs: Add support for ir_unop_saturate
Abdiel Janulgue
abdiel.janulgue at linux.intel.com
Mon Jul 7 06:57:03 PDT 2014
Reviewed-by: Matt Turner <mattst88 at gmail.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue at linux.intel.com>
---
src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp | 1 +
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp b/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp
index 9fe0ffc..b0cba64 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp
@@ -220,6 +220,7 @@ ir_channel_expressions_visitor::visit_leave(ir_assignment *ir)
case ir_unop_bit_count:
case ir_unop_find_msb:
case ir_unop_find_lsb:
+ case ir_unop_saturate:
for (i = 0; i < vector_elements; i++) {
ir_rvalue *op0 = get_element(op_var[0], i);
diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index 8e8affa..01750bc 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -702,6 +702,10 @@ fs_visitor::visit(ir_expression *ir)
case ir_unop_find_lsb:
emit(FBL(this->result, op[0]));
break;
+ case ir_unop_saturate:
+ inst = emit(MOV(this->result, op[0]));
+ inst->saturate = true;
+ break;
case ir_triop_bitfield_extract:
/* Note that the instruction's argument order is reversed from GLSL
* and the IR.
--
1.9.1
More information about the mesa-dev
mailing list