nir_lower_to_source_mods: Don't sneek in an abs modifier from parent

If the abs source modifiers is not supported for the current
instruction because it is an instruction with three sources we
may still see a parent mov that has the `abs` modifier. In this
case we must not propagate that abs modifier from that parent
instructions.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7350

Fixes: cd73b6174b
    nir/lower_to_source_mods: Stop turning add, sat, and neg into mov

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18902>
(cherry picked from commit 9ebe893a61f30c2b1bb24e7870a2ba314356a4fd)
This commit is contained in:
Gert Wollny 2022-09-30 15:27:13 +02:00 committed by Dylan Baker
parent 4d6fe87a24
commit bdc71b81c8
2 changed files with 3 additions and 2 deletions

View File

@ -103,7 +103,7 @@
"description": "nir_lower_to_source_mods: Don't sneek in an abs modifier from parent",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "cd73b6174b093b75f581c3310bf784bed7c74c1f"
},

View File

@ -106,7 +106,8 @@ nir_lower_to_source_mods_block(nir_block *block,
continue;
if (!lower_abs && (parent->op == nir_op_fabs ||
parent->op == nir_op_iabs))
parent->op == nir_op_iabs ||
parent->src[0].abs))
continue;
nir_instr_rewrite_src(instr, &alu->src[i].src, parent->src[0].src);