nvc0/ir: fix overwriting of offset register with interpolateAtOffset
authorIlia Mirkin <imirkin@alum.mit.edu>
Sat, 8 Apr 2017 03:23:25 +0000 (23:23 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sat, 8 Apr 2017 03:31:01 +0000 (23:31 -0400)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp

index 5eecce75347b007f088c03e1982cac2f18e2dfaf..1e2f6111fc40dbfbe0b3c545ef4857b9d120d7ce 100644 (file)
@@ -3015,8 +3015,8 @@ Converter::handleINTERP(Value *dst[4])
       // and then convert to s32.
       Value *offs[2];
       for (c = 0; c < 2; c++) {
-         offs[c] = fetchSrc(1, c);
-         mkOp2(OP_MIN, TYPE_F32, offs[c], offs[c], loadImm(NULL, 0.4375f));
+         offs[c] = getScratch();
+         mkOp2(OP_MIN, TYPE_F32, offs[c], fetchSrc(1, c), loadImm(NULL, 0.4375f));
          mkOp2(OP_MAX, TYPE_F32, offs[c], offs[c], loadImm(NULL, -0.5f));
          mkOp2(OP_MUL, TYPE_F32, offs[c], offs[c], loadImm(NULL, 4096.0f));
          mkCvt(OP_CVT, TYPE_S32, offs[c], TYPE_F32, offs[c]);