nvc0/ir: start offset at texBindBase for txq, like regular texturing
authorIlia Mirkin <imirkin@alum.mit.edu>
Fri, 11 Sep 2015 03:58:17 +0000 (23:58 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Mon, 14 Sep 2015 21:26:25 +0000 (17:26 -0400)
Curiously this has no actual effect. I think it's because the first 8
textures are bound in multiple slots for some reason. However seems
prudent to use these the same way as regular texturing, esp in the case
where there are more than 8 textures bound.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp

index b1f406585a931e4ccce0921479337f2e7e693fe6..b3fc73a2beb4722aefeee27c171921ae4069b212 100644 (file)
@@ -962,11 +962,14 @@ NVC0LoweringPass::handleTXD(TexInstruction *txd)
 bool
 NVC0LoweringPass::handleTXQ(TexInstruction *txq)
 {
+   const int chipset = prog->getTarget()->getChipset();
+   if (chipset >= NVISA_GK104_CHIPSET && txq->tex.rIndirectSrc < 0)
+      txq->tex.r += prog->driver->io.texBindBase / 4;
+
    if (txq->tex.rIndirectSrc < 0)
       return true;
 
    Value *ticRel = txq->getIndirectR();
-   const int chipset = prog->getTarget()->getChipset();
 
    txq->setIndirectS(NULL);
    txq->tex.sIndirectSrc = -1;