glsl: Add flag to disable part of do_vec_index_to_cond_assign

As of ca63a5ed3e ("glsl: fix interpolateAtXxx(some_vec[idx], ...)  with
dynamic idx"), this lowering pass does two things.  It converts
ir_binop_vector_extract to an if-ladder to select the dynamically
indexed component, and it extracts a ir_binop_vector_extract from the
source of an interpolateAt function and applies to the result instead.

This change adds a flag to disable the former behavior.  The latter is
still useful, but NIR has better (and soon even better) ways of doing
the former.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16440>
This commit is contained in:
Ian Romanick
2022-01-14 13:39:06 -08:00
committed by Marge Bot
parent 4eff1e6481
commit e944a98826
4 changed files with 20 additions and 12 deletions

View File

@@ -102,7 +102,7 @@ do_optimization(struct exec_list *ir, const char *optimization,
} else if (strcmp(optimization, "do_tree_grafting") == 0) {
return do_tree_grafting(ir);
} else if (strcmp(optimization, "do_vec_index_to_cond_assign") == 0) {
return do_vec_index_to_cond_assign(ir);
return do_vec_index_to_cond_assign(ir, true);
} else if (strcmp(optimization, "do_vec_index_to_swizzle") == 0) {
return do_vec_index_to_swizzle(ir);
} else if (strcmp(optimization, "lower_discard") == 0) {