[Mesa-dev] [PATCH v2 54/78] i965/nir/vec4: Implement conditional select

Eduardo Lima Mitev elima at igalia.com
Thu Jul 23 03:17:34 PDT 2015


From: Antia Puentes <apuentes at igalia.com>

Adds NIR ALU operations:
   * nir_op_bcsel
---
 src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
index 9823d8e..16e4e64 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
@@ -1210,6 +1210,12 @@ vec4_visitor::nir_emit_alu(nir_alu_instr *instr)
       inst->saturate = instr->dest.saturate;
       break;
 
+   case nir_op_bcsel:
+      emit(CMP(dst_null_d(), op[0], src_reg(0), BRW_CONDITIONAL_NZ));
+      inst = emit(BRW_OPCODE_SEL, dst, op[1], op[2]);
+      inst->predicate = BRW_PREDICATE_NORMAL;
+      break;
+
    default:
       unreachable("Unimplemented ALU operation");
    }
-- 
2.1.4



More information about the mesa-dev mailing list