clover/nir: Use lower_vars_to_explicit for uniform and global
authorJason Ekstrand <jason@jlekstrand.net>
Thu, 27 Aug 2020 20:56:38 +0000 (15:56 -0500)
committerMarge Bot <eric+marge@anholt.net>
Thu, 3 Sep 2020 18:02:50 +0000 (18:02 +0000)
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6472>

src/gallium/frontends/clover/nir/invocation.cpp

index 0811f1b24beb028ffef81cc209e93d988f0948fb..f2c53fc4b22b46c136595dd65c67aefc2b414d3d 100644 (file)
@@ -220,18 +220,11 @@ module clover::nir::spirv_to_nir(const module &mod, const device &dev,
       auto args = sym.args;
       NIR_PASS_V(nir, clover_lower_nir, args, dev.max_block_size().size());
 
-      // Calculate input offsets.
-      unsigned offset = 0;
-      nir_foreach_uniform_variable(var, nir) {
-         offset = align(offset, glsl_get_cl_alignment(var->type));
-         var->data.driver_location = offset;
-         offset += glsl_get_cl_size(var->type);
-      }
-
       NIR_PASS_V(nir, nir_lower_mem_constant_vars,
                  glsl_get_cl_type_size_align);
       NIR_PASS_V(nir, nir_lower_vars_to_explicit_types,
-                 nir_var_mem_shared | nir_var_function_temp,
+                 nir_var_uniform | nir_var_mem_shared |
+                 nir_var_mem_global | nir_var_function_temp,
                  glsl_get_cl_type_size_align);
 
       /* use offsets for kernel inputs (uniform) */