nvc0/ir: add base tex offset for fermi indirect tex case

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
This commit is contained in:
Ilia Mirkin 2014-08-06 01:22:49 -04:00
parent f73594778b
commit af3619e880
1 changed files with 10 additions and 2 deletions

View File

@ -603,10 +603,18 @@ NVC0LoweringPass::handleTEX(TexInstruction *i)
Value *ticRel = i->getIndirectR();
Value *tscRel = i->getIndirectS();
if (ticRel)
if (ticRel) {
i->setSrc(i->tex.rIndirectSrc, NULL);
if (tscRel)
if (i->tex.r)
ticRel = bld.mkOp2v(OP_ADD, TYPE_U32, bld.getScratch(),
ticRel, bld.mkImm(i->tex.r));
}
if (tscRel) {
i->setSrc(i->tex.sIndirectSrc, NULL);
if (i->tex.s)
tscRel = bld.mkOp2v(OP_ADD, TYPE_U32, bld.getScratch(),
tscRel, bld.mkImm(i->tex.s));
}
Value *arrayIndex = i->tex.target.isArray() ? i->getSrc(lyr) : NULL;
for (int s = dim; s >= 1; --s)