nir/lower_io: assert that offsets are used for shader_in
authorKarol Herbst <kherbst@redhat.com>
Fri, 24 Jul 2020 14:34:43 +0000 (16:34 +0200)
committerMarge Bot <eric+marge@anholt.net>
Sat, 25 Jul 2020 08:51:48 +0000 (08:51 +0000)
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6059>

src/compiler/nir/nir_lower_io.c
src/gallium/frontends/clover/nir/invocation.cpp

index 7e328e7ae552e8592ce2e1ee2bb32a3586f39a42..b004c62b81e25fc121011f2ef51fcb71f6bdbf90 100644 (file)
@@ -845,7 +845,7 @@ build_explicit_io_load(nir_builder *b, nir_intrinsic_instr *intrin,
       op = nir_intrinsic_load_global;
       break;
    case nir_var_shader_in:
-      assert(addr_format_is_global(addr_format));
+      assert(addr_format_is_offset(addr_format));
       op = nir_intrinsic_load_kernel_input;
       break;
    case nir_var_mem_shared:
index 730011b7885ae5abd7c708bcaf527022678f714b..8b52379314c0e9142d36de63c5c4fb7e0259c16f 100644 (file)
@@ -134,8 +134,8 @@ module clover::nir::spirv_to_nir(const module &mod, const device &dev,
       NIR_PASS_V(nir, nir_lower_vars_to_ssa);
       NIR_PASS_V(nir, nir_opt_dce);
 
+      NIR_PASS_V(nir, nir_lower_explicit_io, nir_var_shader_in, nir_address_format_32bit_offset);
       nir_variable_mode modes = (nir_variable_mode)(
-         nir_var_shader_in |
          nir_var_mem_global |
          nir_var_mem_shared);
       nir_address_format format = nir->info.cs.ptr_size == 64 ?