From b7bd021c700961b6eb3f9ee5b7777f4c7e1bab45 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 11 May 2020 09:20:39 -0400 Subject: [PATCH] pan/mdg: Fix derivative swizzle Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/midgard/midgard_derivatives.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/panfrost/midgard/midgard_derivatives.c b/src/panfrost/midgard/midgard_derivatives.c index c9c6c028658..5c01ebaf64a 100644 --- a/src/panfrost/midgard/midgard_derivatives.c +++ b/src/panfrost/midgard/midgard_derivatives.c @@ -103,7 +103,8 @@ midgard_emit_derivatives(compiler_context *ctx, nir_alu_instr *instr) .mask = mask_of(nr_components), .dest = nir_dest_index(&instr->dest.dest), .dest_type = nir_type_float32, - .src = { nir_src_index(ctx, &instr->src[0].src), ~0, ~0, ~0 }, + .src = { ~0, nir_src_index(ctx, &instr->src[0].src), ~0, ~0 }, + .swizzle = SWIZZLE_IDENTITY_4, .src_types = { nir_type_float32, nir_type_float32 }, .texture = { .op = mir_derivative_op(instr->op), @@ -114,9 +115,6 @@ midgard_emit_derivatives(compiler_context *ctx, nir_alu_instr *instr) } }; - ins.swizzle[0][2] = ins.swizzle[0][3] = COMPONENT_X; - ins.swizzle[1][2] = ins.swizzle[1][3] = COMPONENT_X; - if (!instr->dest.dest.is_ssa) ins.mask &= instr->dest.write_mask; -- 2.30.2