gk110/ir: fix emitting constbuf file index
authorIlia Mirkin <imirkin@alum.mit.edu>
Sat, 7 Jun 2014 04:18:34 +0000 (00:18 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sat, 7 Jun 2014 04:30:22 +0000 (00:30 -0400)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp

index caf42c1f78b9e3cc1e51d79b1237f1e007a09776..bc77bd8c07aa7080621abaa37f0d893fe73b532d 100644 (file)
@@ -287,10 +287,12 @@ CodeEmitterGK110::emitPredicate(const Instruction *i)
 void
 CodeEmitterGK110::setCAddress14(const ValueRef& src)
 {
-   const int32_t addr = src.get()->asSym()->reg.data.offset / 4;
+   const Storage& res = src.get()->asSym()->reg;
+   const int32_t addr = res.data.offset / 4;
 
    code[0] |= (addr & 0x01ff) << 23;
    code[1] |= (addr & 0x3e00) >> 9;
+   code[1] |= res.fileIndex << 5;
 }
 
 void
@@ -413,7 +415,6 @@ CodeEmitterGK110::emitForm_21(const Instruction *i, uint32_t opc2,
       case FILE_MEMORY_CONST:
          code[1] &= (s == 2) ? ~(0x4 << 28) : ~(0x8 << 28);
          setCAddress14(i->src(s));
-         code[1] |= i->getSrc(s)->reg.fileIndex << 5;
          break;
       case FILE_IMMEDIATE:
          setShortImmediate(i, s);