nvc0/ir: LOAD's can't be used for shader inputs
authorIlia Mirkin <imirkin@alum.mit.edu>
Fri, 22 May 2015 23:03:58 +0000 (19:03 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Fri, 22 May 2015 23:08:24 +0000 (19:08 -0400)
We forgot to convert to VFETCH in case of indirect access. Fix that.

This avoids crashes on the new gs-input-array-vec4-index-rd and
vs-output-array-vec4-index-wr-before-gs but they still fail.

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

index 64989ac88460fead95a9036af4433a158b2a2920..596ac95d48982f2f82b032662c0841e34f81b0ca 100644 (file)
@@ -240,6 +240,7 @@ GM107LoweringPass::visit(Instruction *i)
             Value *ptr = bld.mkOp2v(OP_SHL, TYPE_U32, bld.getSSA(),
                                     i->getIndirect(0, 0), bld.mkImm(4));
             i->setIndirect(0, 0, ptr);
+            i->op = OP_VFETCH;
          } else {
             i->op = OP_VFETCH;
             assert(prog->getType() != Program::TYPE_FRAGMENT); // INTERP
index 6d45e22121e1eb2517b2b5a566483844ec905330..411e2de1b11974c32919b6b8de428dfc82a183eb 100644 (file)
@@ -1750,6 +1750,7 @@ NVC0LoweringPass::visit(Instruction *i)
             Value *ptr = bld.mkOp2v(OP_SHL, TYPE_U32, bld.getSSA(),
                                     i->getIndirect(0, 0), bld.mkImm(4));
             i->setIndirect(0, 0, ptr);
+            i->op = OP_VFETCH;
          } else {
             i->op = OP_VFETCH;
             assert(prog->getType() != Program::TYPE_FRAGMENT); // INTERP