From: Dave Airlie Date: Wed, 21 Aug 2019 00:19:16 +0000 (+1000) Subject: gallivm: add memory barrier support X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b9bf236c712a4cb3ea85304c425149919b0258cb;p=mesa.git gallivm: add memory barrier support Reviewed-by: Roland Scheidegger --- diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c index d6625c42276..ef27b547b79 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c @@ -3858,6 +3858,16 @@ atomic_emit( } } +static void +membar_emit( + const struct lp_build_tgsi_action * action, + struct lp_build_tgsi_context * bld_base, + struct lp_build_emit_data * emit_data) +{ + LLVMBuilderRef builder = bld_base->base.gallivm->builder; + LLVMBuildFence(builder, LLVMAtomicOrderingSequentiallyConsistent, false, ""); +} + static void increment_vec_ptr_by_mask(struct lp_build_tgsi_context * bld_base, LLVMValueRef ptr, @@ -4464,6 +4474,7 @@ lp_build_tgsi_soa(struct gallivm_state *gallivm, bld.bld_base.op_actions[TGSI_OPCODE_ATOMIMIN].emit = atomic_emit; bld.bld_base.op_actions[TGSI_OPCODE_ATOMIMAX].emit = atomic_emit; + bld.bld_base.op_actions[TGSI_OPCODE_MEMBAR].emit = membar_emit; if (params->gs_iface) { /* There's no specific value for this because it should always * be set, but apps using ext_geometry_shader4 quite often