nir: Fix logic that ends combine barrier sequence
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Sat, 6 Jun 2020 06:05:42 +0000 (23:05 -0700)
committerMarge Bot <eric+marge@anholt.net>
Mon, 8 Jun 2020 15:49:24 +0000 (15:49 +0000)
The combination must stop when we see a scoped barrier that have
execution scope, i.e. it has control barrier behavior.  The code was
mistakenly looking at the wrong scope.

Fixes: 345b5847b42 ("nir: Replace the scoped_memory barrier by a scoped_barrier")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5365>

src/compiler/nir/nir_opt_barriers.c

index 609cbc0afdc8648d049ef70764516bb603466f95..49ab10511f88dd672555b408c9ab96a0ea62828b 100644 (file)
@@ -40,7 +40,7 @@ nir_opt_combine_memory_barriers_impl(
 
          nir_intrinsic_instr *current = nir_instr_as_intrinsic(instr);
          if (current->intrinsic != nir_intrinsic_scoped_barrier ||
-             nir_intrinsic_memory_scope(current) != NIR_SCOPE_NONE) {
+             nir_intrinsic_execution_scope(current) != NIR_SCOPE_NONE) {
             prev = NULL;
             continue;
          }