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

Author: Ilia Mirkin <imir...@alum.mit.edu>
Date:   Thu Sep 25 17:14:30 2014 -0400

gm107/ir: add support for indirect const buffer selection

This was missed in the commit that enabled it for fermi/kepler as part
of ARB_gpu_shader5

Signed-off-by: Ilia Mirkin <imir...@alum.mit.edu>
Cc: "10.3" <mesa-sta...@lists.freedesktop.org>
(cherry picked from commit cdc4de121564a47cbdac760622b6dc7112e548aa)

---

 .../drivers/nouveau/codegen/nv50_ir_lowering_gm107.cpp   |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

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 f6d5656..113f372 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_gm107.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_gm107.cpp
@@ -241,6 +241,20 @@ GM107LoweringPass::visit(Instruction *i)
             i->op = OP_VFETCH;
             assert(prog->getType() != Program::TYPE_FRAGMENT); // INTERP
          }
+      } else if (i->src(0).getFile() == FILE_MEMORY_CONST) {
+         if (i->src(0).isIndirect(1)) {
+            Value *ptr;
+            if (i->src(0).isIndirect(0))
+               ptr = bld.mkOp3v(OP_INSBF, TYPE_U32, bld.getSSA(),
+                                i->getIndirect(0, 1), bld.mkImm(0x1010),
+                                i->getIndirect(0, 0));
+            else
+               ptr = bld.mkOp2v(OP_SHL, TYPE_U32, bld.getSSA(),
+                                i->getIndirect(0, 1), bld.mkImm(16));
+            i->setIndirect(0, 1, NULL);
+            i->setIndirect(0, 0, ptr);
+            i->subOp = NV50_IR_SUBOP_LDC_IS;
+         }
       }
       break;
    case OP_ATOM:

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to