[Mesa-dev] [PATCH v2 03/11] nir: Add barrier intrinsic function

Jordan Justen jordan.l.justen at intel.com
Sat Apr 25 21:45:52 PDT 2015


Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
Reviewed-by: Chris Forbes <chrisf at ijw.co.nz>
Reviewed-by: Connor Abbott <cwabbott0 at gmail.com>
Reviewed-by: Ben Widawsky <ben at bwidawsk.net>
---
 src/glsl/nir/glsl_to_nir.cpp  | 4 +++-
 src/glsl/nir/nir_intrinsics.h | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp
index 7e37e28..8baa8fd 100644
--- a/src/glsl/nir/glsl_to_nir.cpp
+++ b/src/glsl/nir/glsl_to_nir.cpp
@@ -1790,5 +1790,7 @@ nir_visitor::visit(ir_dereference_array *ir)
 void
 nir_visitor::visit(ir_barrier *ir)
 {
-   unreachable("Not implemented!");
+   nir_intrinsic_instr *instr =
+      nir_intrinsic_instr_create(this->shader, nir_intrinsic_barrier);
+   nir_instr_insert_after_cf_list(this->cf_node_list, &instr->instr);
 }
diff --git a/src/glsl/nir/nir_intrinsics.h b/src/glsl/nir/nir_intrinsics.h
index b48f173..89cbf7f 100644
--- a/src/glsl/nir/nir_intrinsics.h
+++ b/src/glsl/nir/nir_intrinsics.h
@@ -67,6 +67,7 @@ INTRINSIC(interp_var_at_offset, 1, ARR(2), true, 0, 1, 0,
  */
 #define BARRIER(name) INTRINSIC(name, 0, ARR(), false, 0, 0, 0, 0)
 
+BARRIER(barrier)
 BARRIER(discard)
 /** A conditional discard, with a single boolean source. */
 INTRINSIC(discard_if, 1, ARR(1), false, 0, 0, 0, 0)
-- 
2.1.4



More information about the mesa-dev mailing list