From 73cc2dc08447a1be5cd23053d0d77465c589eb0e Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Fri, 19 Jul 2019 16:47:15 -0700 Subject: [PATCH] freedreno/ir3: fix for array/reg store vs meta instructions fishgl.com has a shader which does roughly: foo = texture(...); if (bar) foo = texture(...); after lowering phi webs to regs we end up w/ a vec4 reg (array). But since it was not an indirect access, we try to skip the extra mov. This results that the per-component fanout (split) meta instructions store directly to the reg (array). Which doesn't work out in RA. Signed-off-by: Rob Clark --- src/freedreno/ir3/ir3_context.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/freedreno/ir3/ir3_context.c b/src/freedreno/ir3/ir3_context.c index dc9ed10..c389f75 100644 --- a/src/freedreno/ir3/ir3_context.c +++ b/src/freedreno/ir3/ir3_context.c @@ -530,8 +530,11 @@ ir3_create_array_store(struct ir3_context *ctx, struct ir3_array *arr, int n, /* if not relative store, don't create an extra mov, since that * ends up being difficult for cp to remove. + * + * Also, don't skip the mov if the src is meta (like fanout/split), + * since that creates a situation that RA can't really handle properly. */ - if (!address) { + if (!address && !is_meta(src)) { dst = src->regs[0]; src->barrier_class |= IR3_BARRIER_ARRAY_W; -- 2.7.4