From 74886cabaa3e07b25bcc8890b485f9b0faf1b3a7 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 30 Oct 2020 15:07:47 -0500 Subject: [PATCH] nir/opt_find_array_copies: Allow copies from mem_constant Reviewed-by: Jesse Natalie Part-of: --- src/compiler/nir/nir_opt_find_array_copies.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/compiler/nir/nir_opt_find_array_copies.c b/src/compiler/nir/nir_opt_find_array_copies.c index 83f284ecbfc..d8e007df806 100644 --- a/src/compiler/nir/nir_opt_find_array_copies.c +++ b/src/compiler/nir/nir_opt_find_array_copies.c @@ -587,10 +587,9 @@ opt_find_array_copies_block(nir_builder *b, nir_block *block, /* The source must be either local or something that's guaranteed to be * read-only. */ - const nir_variable_mode read_only_modes = - nir_var_shader_in | nir_var_uniform | nir_var_system_value; if (src_deref && - !(src_deref->mode & (nir_var_function_temp | read_only_modes))) { + !(src_deref->mode & (nir_var_function_temp | + nir_var_read_only_modes))) { src_deref = NULL; }