Mesa (10.3): gm107/ir: fix manual TXD for array targets

Emil Velikov evelikov at kemper.freedesktop.org
Sat Sep 27 18:07:40 UTC 2014


Module: Mesa
Branch: 10.3
Commit: 5aff846a60706b3e20711598ca947537d956a3e7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5aff846a60706b3e20711598ca947537d956a3e7

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Thu Sep 25 00:27:31 2014 -0400

gm107/ir: fix manual TXD for array targets

This parallels the fixes in commit afea9bae.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
Cc: "10.3" <mesa-stable at lists.freedesktop.org>
(cherry picked from commit d3c3bba6d07c97cfc1499a6bda73337584943971)

---

 src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_gm107.cpp |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_gm107.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_gm107.cpp
index 070b20a..f6d5656 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_gm107.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_gm107.cpp
@@ -58,6 +58,7 @@ GM107LoweringPass::handleManualTXD(TexInstruction *i)
    Value *zero = bld.loadImm(bld.getSSA(), 0);
    int l, c;
    const int dim = i->tex.target.getDim();
+   const int array = i->tex.target.isArray();
 
    i->op = OP_TEX; // no need to clone dPdx/dPdy later
 
@@ -69,7 +70,7 @@ GM107LoweringPass::handleManualTXD(TexInstruction *i)
       // mov coordinates from lane l to all lanes
       bld.mkOp(OP_QUADON, TYPE_NONE, NULL);
       for (c = 0; c < dim; ++c) {
-         bld.mkOp2(OP_SHFL, TYPE_F32, crd[c], i->getSrc(c), bld.mkImm(l));
+         bld.mkOp2(OP_SHFL, TYPE_F32, crd[c], i->getSrc(c + array), bld.mkImm(l));
          add = bld.mkOp2(OP_QUADOP, TYPE_F32, crd[c], crd[c], zero);
          add->subOp = 0x00;
          add->lanes = 1; /* abused for .ndv */
@@ -94,7 +95,7 @@ GM107LoweringPass::handleManualTXD(TexInstruction *i)
       // texture
       bld.insert(tex = cloneForward(func, i));
       for (c = 0; c < dim; ++c)
-         tex->setSrc(c, crd[c]);
+         tex->setSrc(c + array, crd[c]);
       bld.mkOp(OP_QUADPOP, TYPE_NONE, NULL);
 
       // save results




More information about the mesa-commit mailing list