From: Caio Marcelo de Oliveira Filho Date: Thu, 9 Jan 2020 18:01:53 +0000 (-0800) Subject: nir/builder: Add nir_scoped_memory_barrier() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=424737da3e25d9fc3dd33a4b8bdb9ad914e7a5f8;p=mesa.git nir/builder: Add nir_scoped_memory_barrier() Reviewed-by: Jason Ekstrand Part-of: --- diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h index eabc6a59cfa..69c7d312b84 100644 --- a/src/compiler/nir/nir_builder.h +++ b/src/compiler/nir/nir_builder.h @@ -1290,4 +1290,18 @@ nir_compare_func(nir_builder *b, enum compare_func func, unreachable("bad compare func"); } +static inline void +nir_scoped_memory_barrier(nir_builder *b, + nir_scope scope, + nir_memory_semantics semantics, + nir_variable_mode modes) +{ + nir_intrinsic_instr *intrin = + nir_intrinsic_instr_create(b->shader, nir_intrinsic_scoped_memory_barrier); + nir_intrinsic_set_memory_scope(intrin, scope); + nir_intrinsic_set_memory_semantics(intrin, semantics); + nir_intrinsic_set_memory_modes(intrin, modes); + nir_builder_instr_insert(b, &intrin->instr); +} + #endif /* NIR_BUILDER_H */