clover: Use 64-bit offsets for shader_in on 64-bit GPUs
authorJason Ekstrand <jason@jlekstrand.net>
Fri, 21 Aug 2020 22:23:59 +0000 (17:23 -0500)
committerMarge Bot <eric+marge@anholt.net>
Tue, 1 Sep 2020 20:50:04 +0000 (20:50 +0000)
This really shouldn't matter as inputs should have logical pointers.
However, nir_builder defaults to building derefs based on the pointer
size in the shader_info.  It's easier for now to just be consistent
everywhere.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6379>

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

index 924651433330e8acd732593c19fd8525d88e547b..8ea6d3cf4d08f9b6bbe9cab4d009115e42e17d29 100644 (file)
@@ -231,8 +231,10 @@ module clover::nir::spirv_to_nir(const module &mod, const device &dev,
                  nir_var_mem_shared | nir_var_function_temp,
                  glsl_get_cl_type_size_align);
 
-      /* use offsets for uniform and shared memory */
+      /* use offsets for kernel inputs (uniform) */
       NIR_PASS_V(nir, nir_lower_explicit_io, nir_var_uniform,
+                 nir->info.cs.ptr_size == 64 ?
+                 nir_address_format_32bit_offset_as_64bit :
                  nir_address_format_32bit_offset);
 
       NIR_PASS_V(nir, nir_lower_explicit_io, nir_var_mem_constant,