mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
nir/search: check variable requirements even if it's already seen
Even if it's already seen, the variable might have some unchecked requirements. Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12320 Backport-to: 25.1 Reviewed-by: Georg Lehmann <dadschoorse@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32837>
This commit is contained in:
parent
f45026751f
commit
7ed9fdf85b
1 changed files with 12 additions and 12 deletions
|
|
@ -274,6 +274,18 @@ match_value(const nir_algebraic_table *table,
|
|||
nir_search_variable *var = nir_search_value_as_variable(value);
|
||||
assert(var->variable < NIR_SEARCH_MAX_VARIABLES);
|
||||
|
||||
if (var->is_constant &&
|
||||
instr->src[src].src.ssa->parent_instr->type != nir_instr_type_load_const)
|
||||
return false;
|
||||
|
||||
if (var->cond_index != -1 && !table->variable_cond[var->cond_index](state->range_ht, instr,
|
||||
src, num_components, new_swizzle))
|
||||
return false;
|
||||
|
||||
if (var->type != nir_type_invalid &&
|
||||
!src_is_type(instr->src[src].src, var->type))
|
||||
return false;
|
||||
|
||||
if (state->variables_seen & (1 << var->variable)) {
|
||||
if (state->variables[var->variable].src.ssa != instr->src[src].src.ssa)
|
||||
return false;
|
||||
|
|
@ -285,18 +297,6 @@ match_value(const nir_algebraic_table *table,
|
|||
|
||||
return true;
|
||||
} else {
|
||||
if (var->is_constant &&
|
||||
instr->src[src].src.ssa->parent_instr->type != nir_instr_type_load_const)
|
||||
return false;
|
||||
|
||||
if (var->cond_index != -1 && !table->variable_cond[var->cond_index](state->range_ht, instr,
|
||||
src, num_components, new_swizzle))
|
||||
return false;
|
||||
|
||||
if (var->type != nir_type_invalid &&
|
||||
!src_is_type(instr->src[src].src, var->type))
|
||||
return false;
|
||||
|
||||
state->variables_seen |= (1 << var->variable);
|
||||
state->variables[var->variable].src = instr->src[src].src;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue