diff options
author | Rob Clark <[email protected]> | 2019-03-16 10:29:44 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2019-03-21 09:13:05 -0400 |
commit | 1dffb089f903577602bae49931f3d2a71a1a8420 (patch) | |
tree | f9b0ac9b17ee15e6801b9b919e6e429ce0c0d1d6 /src/freedreno/ir3/ir3.c | |
parent | 45b7a581b4fc02d6b3af7899fa19d6ef09c6a3f8 (diff) |
freedreno/ir3: fix sam.s2en encoding
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/freedreno/ir3/ir3.c')
-rw-r--r-- | src/freedreno/ir3/ir3.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/freedreno/ir3/ir3.c b/src/freedreno/ir3/ir3.c index ee13291fb87..9169d2c15f3 100644 --- a/src/freedreno/ir3/ir3.c +++ b/src/freedreno/ir3/ir3.c @@ -446,15 +446,17 @@ static int emit_cat5(struct ir3_instruction *instr, void *ptr, struct ir3_info *info) { struct ir3_register *dst = instr->regs[0]; - struct ir3_register *src1 = instr->regs[1]; - struct ir3_register *src2 = instr->regs[2]; - struct ir3_register *src3 = instr->regs[3]; + /* To simplify things when there could be zero, one, or two args other + * than tex/sampler idx, we use the first src reg in the ir to hold + * samp_tex hvec2: + */ + struct ir3_register *src1 = instr->regs[2]; + struct ir3_register *src2 = instr->regs[3]; instr_cat5_t *cat5 = ptr; iassert_type(dst, type_size(instr->cat5.type) == 32) assume(src1 || !src2); - assume(src2 || !src3); if (src1) { cat5->full = ! (src1->flags & IR3_REG_HALF); @@ -462,17 +464,15 @@ static int emit_cat5(struct ir3_instruction *instr, void *ptr, } if (instr->flags & IR3_INSTR_S2EN) { + struct ir3_register *samp_tex = instr->regs[1]; if (src2) { iassert(!((src1->flags ^ src2->flags) & IR3_REG_HALF)); cat5->s2en.src2 = reg(src2, info, instr->repeat, IR3_REG_HALF); } - if (src3) { - iassert(src3->flags & IR3_REG_HALF); - cat5->s2en.src3 = reg(src3, info, instr->repeat, IR3_REG_HALF); - } + iassert(samp_tex->flags & IR3_REG_HALF); + cat5->s2en.src3 = reg(samp_tex, info, instr->repeat, IR3_REG_HALF); iassert(!(instr->cat5.samp | instr->cat5.tex)); } else { - iassert(!src3); if (src2) { iassert(!((src1->flags ^ src2->flags) & IR3_REG_HALF)); cat5->norm.src2 = reg(src2, info, instr->repeat, IR3_REG_HALF); |