nvc0/ir: avoid creating restarts with non-0 stream
authorIlia Mirkin <imirkin@alum.mit.edu>
Sat, 28 Jun 2014 01:55:16 +0000 (21:55 -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_from_tgsi.cpp

index 2ba3c1c8e0ffa62c4744d548e9524146089ca906..9b7c49000a4b90c5b66e8f49514e36e3cb183e23 100644 (file)
@@ -2546,11 +2546,15 @@ Converter::handleInstruction(const struct tgsi_full_instruction *insn)
       }
       /* fallthrough */
    case TGSI_OPCODE_ENDPRIM:
-      // get vertex stream if specified (must be immediate)
-      src0 = tgsi.srcCount() ?
-         mkImm(tgsi.getSrc(0).getValueU32(0, info)) : zero;
+   {
+      // get vertex stream (must be immediate)
+      unsigned int stream = tgsi.getSrc(0).getValueU32(0, info);
+      if (stream && op == OP_RESTART)
+         break;
+      src0 = mkImm(stream);
       mkOp1(op, TYPE_U32, NULL, src0)->fixed = 1;
       break;
+   }
    case TGSI_OPCODE_IF:
    case TGSI_OPCODE_UIF:
    {