Commit 346ce0b9 authored by Ilia Mirkin's avatar Ilia Mirkin
Browse files

nvc0/ir: don't worry about sampler in txq handling



There's no need to deal with samplers for texture size queries. That
code also was accidentally setting an invalid sIndirectSrc position, but
it can now just be removed.
Signed-off-by: Ilia Mirkin's avatarIlia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
parent 20e484af
...@@ -956,44 +956,30 @@ NVC0LoweringPass::handleTXD(TexInstruction *txd) ...@@ -956,44 +956,30 @@ NVC0LoweringPass::handleTXD(TexInstruction *txd)
bool bool
NVC0LoweringPass::handleTXQ(TexInstruction *txq) NVC0LoweringPass::handleTXQ(TexInstruction *txq)
{ {
if (txq->tex.rIndirectSrc < 0 && txq->tex.sIndirectSrc < 0) if (txq->tex.rIndirectSrc < 0)
return true; return true;
Value *ticRel = txq->getIndirectR(); Value *ticRel = txq->getIndirectR();
Value *tscRel = txq->getIndirectS();
const int chipset = prog->getTarget()->getChipset(); const int chipset = prog->getTarget()->getChipset();
txq->setIndirectS(NULL); txq->setIndirectS(NULL);
txq->tex.sIndirectSrc = -1; txq->tex.sIndirectSrc = -1;
assert(ticRel);
if (chipset < NVISA_GK104_CHIPSET) { if (chipset < NVISA_GK104_CHIPSET) {
LValue *src = new_LValue(func, FILE_GPR); // 0xttxsaaaa LValue *src = new_LValue(func, FILE_GPR); // 0xttxsaaaa
if (ticRel) { txq->setSrc(txq->tex.rIndirectSrc, NULL);
txq->setSrc(txq->tex.rIndirectSrc, NULL); if (txq->tex.r)
if (txq->tex.r) ticRel = bld.mkOp2v(OP_ADD, TYPE_U32, bld.getScratch(),
ticRel = bld.mkOp2v(OP_ADD, TYPE_U32, bld.getScratch(), ticRel, bld.mkImm(txq->tex.r));
ticRel, bld.mkImm(txq->tex.r));
}
if (tscRel) {
txq->setSrc(txq->tex.sIndirectSrc, NULL);
if (txq->tex.s)
tscRel = bld.mkOp2v(OP_ADD, TYPE_U32, bld.getScratch(),
tscRel, bld.mkImm(txq->tex.s));
}
bld.loadImm(src, 0);
if (ticRel) bld.mkOp2(OP_SHL, TYPE_U32, src, ticRel, bld.mkImm(0x17));
bld.mkOp3(OP_INSBF, TYPE_U32, src, ticRel, bld.mkImm(0x0917), src);
if (tscRel)
bld.mkOp3(OP_INSBF, TYPE_U32, src, tscRel, bld.mkImm(0x0710), src);
txq->moveSources(0, 1); txq->moveSources(0, 1);
txq->setSrc(0, src); txq->setSrc(0, src);
} else { } else {
// XXX this ignores tsc, and assumes a 1:1 mapping
assert(txq->tex.rIndirectSrc >= 0);
Value *hnd = loadTexHandle( Value *hnd = loadTexHandle(
bld.mkOp2v(OP_SHL, TYPE_U32, bld.getSSA(), bld.mkOp2v(OP_SHL, TYPE_U32, bld.getSSA(),
txq->getIndirectR(), bld.mkImm(2)), txq->getIndirectR(), bld.mkImm(2)),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment