nir: Add barrier intrinsic function
authorJordan Justen <jordan.l.justen@intel.com>
Fri, 13 Mar 2015 19:03:15 +0000 (12:03 -0700)
committerJordan Justen <jordan.l.justen@intel.com>
Fri, 12 Jun 2015 22:12:40 +0000 (15:12 -0700)
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
src/glsl/nir/glsl_to_nir.cpp
src/glsl/nir/nir_intrinsics.h

index 3c7284e8ca5f6adb37d19656c46b95478e50fca5..95531bbcd8fb22ed73cd2a0f6b9cd29bab07494e 100644 (file)
@@ -1894,5 +1894,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);
 }
index b516830be950248eb144aa87c93cbbe12670037d..bc6e6b8f4985cdaba9dba00d5542ebce26bc85ee 100644 (file)
@@ -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)
 
 /*