summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2018-03-24 15:15:45 -0400
committerIlia Mirkin <[email protected]>2018-03-27 20:41:11 -0400
commit776e6af879318050cdf8245cd409ada7b843e358 (patch)
tree73f301b9b79c0d73296f182d88d4eb560ac91b0d /src/gallium/drivers/nouveau
parent629ee690addad9b3dc8f68cfff5ae09858f31caf (diff)
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 <[email protected]> Reviewed-by: Karol Herbst <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau')
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp7
1 files changed, 4 insertions, 3 deletions
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);
}