gk104/ir: sampler doesn't matter for txf
authorIlia Mirkin <imirkin@alum.mit.edu>
Mon, 7 Dec 2015 21:14:53 +0000 (16:14 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Mon, 7 Dec 2015 21:22:54 +0000 (16:22 -0500)
We actually leave the sampler unset for OP_TXF, which caused the GK104+
logic to treat some texel fetches as indirect. While this works, it's
incredibly wasteful. This only happened when the texture was > 0 (since
sampler remained == 0).

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.0 11.1" <mesa-stable@lists.freedesktop.org>
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp

index b3fc73a2beb4722aefeee27c171921ae4069b212..0f575f2eeddd42035ff8d296fcaf854e4a55f0e6 100644 (file)
@@ -686,7 +686,7 @@ NVC0LoweringPass::handleTEX(TexInstruction *i)
          i->tex.s = 0x1f;
          i->setIndirectR(hnd);
          i->setIndirectS(NULL);
-      } else if (i->tex.r == i->tex.s) {
+      } else if (i->tex.r == i->tex.s || i->op == OP_TXF) {
          i->tex.r += prog->driver->io.texBindBase / 4;
          i->tex.s  = 0; // only a single cX[] value possible here
       } else {