From 2867f2e8cd54e2cbb38140e2e0f5521973091ace Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Fri, 13 Mar 2015 12:03:15 -0700 Subject: [PATCH] nir: Add barrier intrinsic function Signed-off-by: Jordan Justen Reviewed-by: Chris Forbes Reviewed-by: Connor Abbott Reviewed-by: Ben Widawsky --- 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 3c7284e8ca5..95531bbcd8f 100644 --- a/src/glsl/nir/glsl_to_nir.cpp +++ b/src/glsl/nir/glsl_to_nir.cpp @@ -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); } diff --git a/src/glsl/nir/nir_intrinsics.h b/src/glsl/nir/nir_intrinsics.h index b516830be95..bc6e6b8f498 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) /* -- 2.30.2