[Mesa-dev] [PATCH 16/78] i965/nir/vec4: Implement store_output intrinsic

Eduardo Lima Mitev elima at igalia.com
Fri Jun 26 01:06:32 PDT 2015


The index into the output_reg array where to store the destination register is
fetched from the nir_outputs map built during nir_setup_outputs stage.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89580
---
 src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
index 8a2d335..55d4490 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
@@ -520,10 +520,23 @@ vec4_visitor::nir_emit_intrinsic(nir_intrinsic_instr *instr)
    }
 
    case nir_intrinsic_store_output_indirect:
+      has_indirect = true;
       /* fallthrough */
-   case nir_intrinsic_store_output:
-      /* @TODO: Not yet implemented */
+   case nir_intrinsic_store_output: {
+      int offset = instr->const_index[0];
+      int output = nir_outputs[offset];
+
+      src = get_nir_src(instr->src[0], nir_output_types[offset]);
+      dest = dst_reg(src);
+
+      dest.writemask = brw_writemask_for_size(instr->num_components);
+
+      if (has_indirect)
+         dest.reladdr = new(mem_ctx) src_reg(get_nir_src(instr->src[1]));
+
+      output_reg[output] = dest;
       break;
+   }
 
    case nir_intrinsic_load_vertex_id:
       unreachable("should be lowered by lower_vertex_id()");
-- 
2.1.4



More information about the mesa-dev mailing list