From: Ilia Mirkin Date: Sat, 24 Mar 2018 19:15:45 +0000 (-0400) Subject: nvc0/ir: fix INTERP_* with indirect inputs X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=776e6af879318050cdf8245cd409ada7b843e358;p=mesa.git nvc0/ir: fix INTERP_* with indirect inputs There were two problems, both of which are fixed now: - The indirect address was not being shifted by 4 - The indirect address was being placed as an argument in the offset case This fixes some of the new interpolateAt* piglits which now test for these situations. Signed-off-by: Ilia Mirkin Reviewed-by: Karol Herbst --- diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp index 09b5228127a..3c5bad05fe7 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp @@ -3083,10 +3083,11 @@ Converter::handleINTERP(Value *dst[4]) assert(sym[c]); op = insn->op; mode = insn->ipa; + ptr = insn->getIndirect(0, 0); } } else { if (src.isIndirect(0)) - ptr = fetchSrc(src.getIndirect(0), 0, NULL); + ptr = shiftAddress(fetchSrc(src.getIndirect(0), 0, NULL)); // We can assume that the fixed index will point to an input of the same // interpolation type in case of an indirect. @@ -3144,10 +3145,10 @@ Converter::handleINTERP(Value *dst[4]) insn = mkOp1(op, TYPE_F32, dst[c], sym[c] ? sym[c] : srcToSym(src, c)); if (op == OP_PINTERP) insn->setSrc(1, w); - if (ptr) - insn->setIndirect(0, 0, ptr); if (offset) insn->setSrc(op == OP_PINTERP ? 2 : 1, offset); + if (ptr) + insn->setIndirect(0, 0, ptr); insn->setInterpolate(mode); }