summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2016-10-06 16:46:35 -0700
committerEric Anholt <eric@anholt.net>2016-10-06 18:09:24 -0700
commitb30205b1120d4a87b6fb8eac9dea9a7f7a065123 (patch)
treed4db6bf42179ce07a90b744f0cd270e44ee8c90e
parentc81ec84c1ec24f11f86b2fb725956437c721fe18 (diff)
downloadexternal_mesa3d-b30205b1120d4a87b6fb8eac9dea9a7f7a065123.zip
external_mesa3d-b30205b1120d4a87b6fb8eac9dea9a7f7a065123.tar.gz
external_mesa3d-b30205b1120d4a87b6fb8eac9dea9a7f7a065123.tar.bz2
vc4: Fix assertion fails from trying to cast non-ALU instrs to ALU.
Fixes 100 piglit tests since the assertions were added to nir.h. What's amazing is that these tests used to pass, even when casting garbage.
-rw-r--r--src/gallium/drivers/vc4/vc4_program.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c
index 84add52..a91e620 100644
--- a/src/gallium/drivers/vc4/vc4_program.c
+++ b/src/gallium/drivers/vc4/vc4_program.c
@@ -918,6 +918,8 @@ static struct qreg ntq_emit_bcsel(struct vc4_compile *c, nir_alu_instr *instr,
{
if (!instr->src[0].src.is_ssa)
goto out;
+ if (instr->src[0].src.ssa->parent_instr->type != nir_instr_type_alu)
+ goto out;
nir_alu_instr *compare =
nir_instr_as_alu(instr->src[0].src.ssa->parent_instr);
if (!compare)