diff --git a/src/freedreno/ir3/ir3_compiler.c b/src/freedreno/ir3/ir3_compiler.c index 689c94d5ab3..5321f458290 100644 --- a/src/freedreno/ir3/ir3_compiler.c +++ b/src/freedreno/ir3/ir3_compiler.c @@ -330,6 +330,7 @@ ir3_compiler_create(struct fd_device *dev, const struct fd_dev_id *dev_id, compiler->bool_type = (compiler->gen >= 5) ? TYPE_U16 : TYPE_U32; compiler->has_shared_regfile = compiler->gen >= 5; compiler->has_bitwise_triops = compiler->gen >= 5; + compiler->cat3_rel_offset_0_quirk = compiler->gen <= 5; /* The driver can't request this unless preambles are supported. */ if (options->push_ubo_with_preamble) diff --git a/src/freedreno/ir3/ir3_compiler.h b/src/freedreno/ir3/ir3_compiler.h index acbac4417c4..1f867d3f07f 100644 --- a/src/freedreno/ir3/ir3_compiler.h +++ b/src/freedreno/ir3/ir3_compiler.h @@ -304,6 +304,8 @@ struct ir3_compiler { bool reading_shading_rate_requires_smask_quirk; + bool cat3_rel_offset_0_quirk; + struct { /* The number of cycles needed for the result of one ALU operation to be * available to another ALU operation. Only valid when the halfness of the diff --git a/src/freedreno/ir3/ir3_cp.c b/src/freedreno/ir3/ir3_cp.c index 621d1f5645d..3fc162afe5f 100644 --- a/src/freedreno/ir3/ir3_cp.c +++ b/src/freedreno/ir3/ir3_cp.c @@ -381,7 +381,8 @@ reg_cp(struct ir3_cp_ctx *ctx, struct ir3_instruction *instr, * just somehow don't work out. This restriction may only * apply if the first src is also CONST. */ - if ((opc_cat(instr->opc) == 3) && (n == 2) && + if (ctx->so->compiler->cat3_rel_offset_0_quirk && + (opc_cat(instr->opc) == 3) && (n == 2) && (src_reg->flags & IR3_REG_RELATIV) && (src_reg->array.offset == 0)) return false;