v2: use mkOp

Signed-off-by: Karol Herbst <kher...@redhat.com>
---
 src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp 
b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
index 4606ffb792e..badb2398abb 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
@@ -143,6 +143,7 @@ private:
    bool visit(nir_jump_instr *);
    bool visit(nir_load_const_instr*);
    bool visit(nir_loop *);
+   bool visit(nir_ssa_undef_instr *);
 
    nir_shader *nir;
 
@@ -1463,6 +1464,8 @@ Converter::visit(nir_instr *insn)
       return visit(nir_instr_as_jump(insn));
    case nir_instr_type_load_const:
       return visit(nir_instr_as_load_const(insn));
+   case nir_instr_type_ssa_undef:
+      return visit(nir_instr_as_ssa_undef(insn));
    default:
       ERROR("unknown nir_instr type %u\n", insn->type);
       return false;
@@ -2160,6 +2163,16 @@ Converter::visit(nir_alu_instr *insn)
 }
 #undef DEFAULT_CHECKS
 
+bool
+Converter::visit(nir_ssa_undef_instr *insn)
+{
+   LValues &newDefs = convert(&insn->def);
+   for (auto i = 0u; i < insn->def.num_components; ++i) {
+      mkOp(OP_NOP, TYPE_NONE, newDefs[i]);
+   }
+   return true;
+}
+
 bool
 Converter::run()
 {
-- 
2.14.3

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to