nir/lower_io: Add support for nir_var_mem_global
authorJason Ekstrand <jason.ekstrand@intel.com>
Sun, 20 Jan 2019 00:50:48 +0000 (18:50 -0600)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sat, 26 Jan 2019 19:39:18 +0000 (13:39 -0600)
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
src/compiler/nir/nir_lower_io.c

index 73075523baeb23a26095c9ca3cb85a60c0bd486e..d1f95cfe6ac4d603c9b3929ee1296dd0bca07a54 100644 (file)
@@ -676,6 +676,10 @@ build_explicit_io_load(nir_builder *b, nir_intrinsic_instr *intrin,
       else
          op = nir_intrinsic_load_ssbo;
       break;
+   case nir_var_mem_global:
+      assert(addr_format_is_global(addr_format));
+      op = nir_intrinsic_load_global;
+      break;
    default:
       unreachable("Unsupported explicit IO variable mode");
    }
@@ -722,6 +726,10 @@ build_explicit_io_store(nir_builder *b, nir_intrinsic_instr *intrin,
       else
          op = nir_intrinsic_store_ssbo;
       break;
+   case nir_var_mem_global:
+      assert(addr_format_is_global(addr_format));
+      op = nir_intrinsic_store_global;
+      break;
    default:
       unreachable("Unsupported explicit IO variable mode");
    }
@@ -767,6 +775,10 @@ build_explicit_io_atomic(nir_builder *b, nir_intrinsic_instr *intrin,
       else
          op = ssbo_atomic_for_deref(intrin->intrinsic);
       break;
+   case nir_var_mem_global:
+      assert(addr_format_is_global(addr_format));
+      op = global_atomic_for_deref(intrin->intrinsic);
+      break;
    default:
       unreachable("Unsupported explicit IO variable mode");
    }