nir/lower_explicit_io: fix NON_UNIFORM access for UBO loads
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 3 Jun 2020 12:35:02 +0000 (14:35 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 8 Jun 2020 07:35:43 +0000 (07:35 +0000)
Make sure to propagate the NON_UNIFORM access for UBO loads, so
that non-uniform loads are correctly lowered.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5311>

src/compiler/nir/nir_lower_io.c

index c127802a59d89e9c2c97d377879d9a2a828b1d69..e45fffbcf9e539ee2c4e30c90f7b85585656af32 100644 (file)
@@ -911,7 +911,7 @@ build_explicit_io_load(nir_builder *b, nir_intrinsic_instr *intrin,
       load->src[1] = nir_src_for_ssa(addr_to_offset(b, addr, addr_format));
    }
 
-   if (mode != nir_var_mem_ubo && mode != nir_var_shader_in && mode != nir_var_mem_shared)
+   if (mode != nir_var_shader_in && mode != nir_var_mem_shared)
       nir_intrinsic_set_access(load, nir_intrinsic_access(intrin));
 
    unsigned bit_size = intrin->dest.ssa.bit_size;