diff --git a/src/compiler/nir/nir_opt_load_store_vectorize.c b/src/compiler/nir/nir_opt_load_store_vectorize.c index 928ba233f09..4b476f97ca1 100644 --- a/src/compiler/nir/nir_opt_load_store_vectorize.c +++ b/src/compiler/nir/nir_opt_load_store_vectorize.c @@ -1326,13 +1326,14 @@ vectorize_sorted_entries(struct vectorize_ctx *ctx, nir_function_impl *impl, struct entry *second = low->index < high->index ? high : low; uint64_t diff = high->offset_signed - low->offset_signed; - /* Allow overfetching by 4 bytes, which can be rejected - * by the callback if needed. + /* Allow overfetching by 28 bytes, which can be rejected by the + * callback if needed. Driver callbacks will likely want to + * restrict this to a smaller value, say 4 bytes (or none). */ unsigned max_hole = first->is_store || (ctx->options->has_shared2_amd && - get_variable_mode(first) == nir_var_mem_shared) ? 0 : 4; + get_variable_mode(first) == nir_var_mem_shared) ? 0 : 28; unsigned low_size = get_bit_size(low) / 8u * low->num_components; bool separate = diff > max_hole + low_size; diff --git a/src/compiler/nir/tests/load_store_vectorizer_tests.cpp b/src/compiler/nir/tests/load_store_vectorizer_tests.cpp index feae1c51259..66bc813623f 100644 --- a/src/compiler/nir/tests/load_store_vectorizer_tests.cpp +++ b/src/compiler/nir/tests/load_store_vectorizer_tests.cpp @@ -346,8 +346,6 @@ bool nir_load_store_vectorize_test::mem_vectorize_callback( { nir_load_store_vectorize_test *test = (nir_load_store_vectorize_test *)data; - assert(hole_size <= 4); - if (hole_size > test->max_hole_size || (!test->overfetch && !nir_num_components_valid(num_components))) return false;