From 384c4df23dafa516fbe76e2844b259087400543f Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Fri, 14 Aug 2020 21:56:00 +0200 Subject: [PATCH] clover/nir: fix mem_shared by using address_format_32bit_offset Signed-off-by: Karol Herbst Reviewed-by: Alyssa Rosenzweig Part-of: --- src/gallium/frontends/clover/nir/invocation.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gallium/frontends/clover/nir/invocation.cpp b/src/gallium/frontends/clover/nir/invocation.cpp index b48dbd5f84a..cae6ff235ba 100644 --- a/src/gallium/frontends/clover/nir/invocation.cpp +++ b/src/gallium/frontends/clover/nir/invocation.cpp @@ -134,13 +134,16 @@ 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); + /* use offsets for shader_in and shared memory */ nir_variable_mode modes = (nir_variable_mode)( - nir_var_mem_global | + nir_var_shader_in | nir_var_mem_shared); + NIR_PASS_V(nir, nir_lower_explicit_io, modes, nir_address_format_32bit_offset); + + /* use global format for global memory */ nir_address_format format = nir->info.cs.ptr_size == 64 ? nir_address_format_64bit_global : nir_address_format_32bit_global; - NIR_PASS_V(nir, nir_lower_explicit_io, modes, format); + NIR_PASS_V(nir, nir_lower_explicit_io, nir_var_mem_global, format); NIR_PASS_V(nir, nir_lower_system_values); if (compiler_options->lower_int64_options) -- 2.30.2