diff --git a/.pick_status.json b/.pick_status.json index 95cfd412cd6..a975eff0724 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2344,7 +2344,7 @@ "description": "pan/bi: Fix source swizzle in bi_repair_ssa", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "dd94d1833f6cd05a123ca4aa038a6547685ec20b", "notes": null diff --git a/src/panfrost/compiler/bifrost/bi_repair_ssa.c b/src/panfrost/compiler/bifrost/bi_repair_ssa.c index 583fefae6c6..90990640246 100644 --- a/src/panfrost/compiler/bifrost/bi_repair_ssa.c +++ b/src/panfrost/compiler/bifrost/bi_repair_ssa.c @@ -50,6 +50,14 @@ record_write(struct repair_ctx *ctx, bi_block *block, unsigned node, bi_index val) { assert(node < ctx->n); + + /* The value always gets used as a source, where we don't want the + * destination "swizzle" and other modifiers that are applied on write. + */ + val.swizzle = BI_SWIZZLE_H01; + val.neg = false; + val.abs = false; + struct hash_table_u64 *defs = repair_block(ctx, block)->defs; _mesa_hash_table_u64_insert(defs, node, ralloc_memdup(defs, &val, sizeof(val))); @@ -106,6 +114,7 @@ resolve_read(struct repair_ctx *ctx, bi_block *block, bi_index node) } assert(!bi_is_null(val)); + assert(val.swizzle == BI_SWIZZLE_H01); record_write(ctx, block, node.value, val); return val; }