nvc0/ir: fix emitting vertex stream
authorIlia Mirkin <imirkin@alum.mit.edu>
Fri, 27 Jun 2014 04:27:07 +0000 (00:27 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Tue, 1 Jul 2014 15:34:40 +0000 (11:34 -0400)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp

index f69e6a183e19b119f22d24b26397d5f35b9c9e16..84c2c6b0a4978a6cebe01c30bb248fa70cc92609 100644 (file)
@@ -1507,13 +1507,14 @@ CodeEmitterNVC0::emitOUT(const Instruction *i)
 
    // vertex stream
    if (i->src(1).getFile() == FILE_IMMEDIATE) {
-      // Using immediate encoding here triggers an invalid opcode error
-      // or random results when error reporting is disabled.
-      // TODO: figure this out when we get multiple vertex streams
-      assert(SDATA(i->src(1)).u32 == 0);
-      srcId(NULL, 26);
-      // code[1] |= 0xc000;
-      // code[0] |= SDATA(i->src(1)).u32 << 26;
+      unsigned int stream = SDATA(i->src(1)).u32;
+      assert(stream < 4);
+      if (stream) {
+         code[1] |= 0xc000;
+         code[0] |= stream << 26;
+      } else {
+         srcId(NULL, 26);
+      }
    } else {
       srcId(i->src(1), 26);
    }