From 87f95fa7f24415f51391f128adf7f048358be226 Mon Sep 17 00:00:00 2001 From: Friedrich Vock Date: Sat, 19 Aug 2023 11:00:45 +0200 Subject: [PATCH] nir/load_store_vectorize: Handle intrinsics with constant base This includes nir_load_stack and nir_store_stack, which are vectorized in nir_lower_shader_calls. If not adjusted, we end up loading from the wrong base. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9596 Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9587 Cc: mesa-stable Part-of: --- src/compiler/nir/nir_opt_load_store_vectorize.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler/nir/nir_opt_load_store_vectorize.c b/src/compiler/nir/nir_opt_load_store_vectorize.c index 73e6ff6d8878..4bea8fbea6ff 100644 --- a/src/compiler/nir/nir_opt_load_store_vectorize.c +++ b/src/compiler/nir/nir_opt_load_store_vectorize.c @@ -756,6 +756,8 @@ vectorize_loads(nir_builder *b, struct vectorize_ctx *ctx, nir_intrinsic_set_range_base(first->intrin, low_base); nir_intrinsic_set_range(first->intrin, MAX2(low_end, high_end) - low_base); + } else if (nir_intrinsic_has_base(first->intrin) && info->base_src == -1 && info->deref_src == -1) { + nir_intrinsic_set_base(first->intrin, nir_intrinsic_base(low->intrin)); } first->key = low->key; -- GitLab