mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
nir: skip bcsel with non-trivial swizzle in opt_simplify_bcsel_of_phi()
Fixes validation error in a Dota 2 shader. Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Fixes:b031c64349("nir: Convert a bcsel with only phi node sources to a phi node") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7426> (cherry picked from commit233a820f2c)
This commit is contained in:
parent
db671d8687
commit
307fe5bd61
2 changed files with 6 additions and 7 deletions
|
|
@ -4477,7 +4477,7 @@
|
||||||
"description": "nir: skip bcsel with non-trivial swizzle in opt_simplify_bcsel_of_phi()",
|
"description": "nir: skip bcsel with non-trivial swizzle in opt_simplify_bcsel_of_phi()",
|
||||||
"nominated": true,
|
"nominated": true,
|
||||||
"nomination_type": 1,
|
"nomination_type": 1,
|
||||||
"resolution": 0,
|
"resolution": 1,
|
||||||
"master_sha": null,
|
"master_sha": null,
|
||||||
"because_sha": "b031c643491a92a5574c7a4bd659df33f2d89bb6"
|
"because_sha": "b031c643491a92a5574c7a4bd659df33f2d89bb6"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -644,14 +644,13 @@ opt_simplify_bcsel_of_phi(nir_builder *b, nir_loop *loop)
|
||||||
|
|
||||||
bool match = true;
|
bool match = true;
|
||||||
for (unsigned i = 0; i < 3; i++) {
|
for (unsigned i = 0; i < 3; i++) {
|
||||||
/* FINISHME: The abs and negate cases could be handled by adding
|
/* FINISHME: The abs, negate and swizzled cases could be handled by
|
||||||
* move instructions at the bottom of the continue block and more
|
* adding move instructions at the bottom of the continue block and
|
||||||
* phi nodes in the header_block.
|
* more phi nodes in the header_block.
|
||||||
*/
|
*/
|
||||||
if (!bcsel->src[i].src.is_ssa ||
|
if (!nir_alu_src_is_trivial_ssa(bcsel, i) ||
|
||||||
bcsel->src[i].src.ssa->parent_instr->type != nir_instr_type_phi ||
|
bcsel->src[i].src.ssa->parent_instr->type != nir_instr_type_phi ||
|
||||||
bcsel->src[i].src.ssa->parent_instr->block != header_block ||
|
bcsel->src[i].src.ssa->parent_instr->block != header_block) {
|
||||||
bcsel->src[i].negate || bcsel->src[i].abs) {
|
|
||||||
match = false;
|
match = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue