mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 09:18:04 +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>
(cherry picked from commit 7ed9fdf85b)
This commit is contained in:
parent
5f7b31ec14
commit
ef726afd59
2 changed files with 13 additions and 13 deletions
|
|
@ -44,7 +44,7 @@
|
|||
"description": "nir/search: check variable requirements even if it's already seen",
|
||||
"nominated": true,
|
||||
"nomination_type": 4,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -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