nir: Fix printing execution scope of a scoped barrier
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Fri, 5 Jun 2020 22:26:47 +0000 (15:26 -0700)
committerMarge Bot <eric+marge@anholt.net>
Mon, 8 Jun 2020 15:49:24 +0000 (15:49 +0000)
Fixes: 345b5847b42 ("nir: Replace the scoped_memory barrier by a scoped_barrier")
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
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_print.c

index a7d1a9d7fef5f4dc1a955c8fd97bd2e85d181663..c3efec8a692fd663ad98545284b8572ac8c775b6 100644 (file)
@@ -900,7 +900,10 @@ print_intrinsic_instr(nir_intrinsic_instr *instr, print_state *state)
       case NIR_INTRINSIC_EXECUTION_SCOPE:
       case NIR_INTRINSIC_MEMORY_SCOPE: {
          fprintf(fp, " %s=", index_name[idx]);
-         switch (nir_intrinsic_memory_scope(instr)) {
+         nir_scope scope =
+            idx == NIR_INTRINSIC_MEMORY_SCOPE ? nir_intrinsic_memory_scope(instr)
+                                              : nir_intrinsic_execution_scope(instr);
+         switch (scope) {
          case NIR_SCOPE_NONE:         fprintf(fp, "NONE");         break;
          case NIR_SCOPE_DEVICE:       fprintf(fp, "DEVICE");       break;
          case NIR_SCOPE_QUEUE_FAMILY: fprintf(fp, "QUEUE_FAMILY"); break;