nir/opt_find_array_copies: Allow copies from mem_constant

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6332>
This commit is contained in:
Jason Ekstrand 2020-10-30 15:07:47 -05:00 committed by Marge Bot
parent 89abfbeb7a
commit 74886cabaa

View file

@ -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;
}