From 5b6e5db5d022988612673598ee49b96da683cb85 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 13 Oct 2021 14:14:29 -0700 Subject: [PATCH] freedreno/ir3: Don't lower s2en if samp/tex is too large We only have four bits to encode an immediate samp/tex. Signed-off-by: Rob Clark Part-of: --- src/freedreno/ir3/ir3_cp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/freedreno/ir3/ir3_cp.c b/src/freedreno/ir3/ir3_cp.c index e6c7d520d27..551e50d44e0 100644 --- a/src/freedreno/ir3/ir3_cp.c +++ b/src/freedreno/ir3/ir3_cp.c @@ -621,7 +621,8 @@ instr_cp(struct ir3_cp_ctx *ctx, struct ir3_instruction *instr) struct ir3_register *samp = samp_tex->srcs[0]; struct ir3_register *tex = samp_tex->srcs[1]; - if ((samp->flags & IR3_REG_IMMED) && (tex->flags & IR3_REG_IMMED)) { + if ((samp->flags & IR3_REG_IMMED) && (tex->flags & IR3_REG_IMMED) && + (samp->iim_val < 16) && (tex->iim_val < 16)) { instr->flags &= ~IR3_INSTR_S2EN; instr->cat5.samp = samp->iim_val; instr->cat5.tex = tex->iim_val;