nv50/ir/nir: don't emit a restart with set a stream_id
authorKarol Herbst <kherbst@redhat.com>
Tue, 16 Jun 2020 15:02:06 +0000 (17:02 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 22 Jun 2020 11:41:31 +0000 (11:41 +0000)
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Tested-by: Ben Skeggs <bskeggs@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5512>

src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp

index 40c1c526224eba9e97d496b52602d2a5d20b78c2..1638872bdf9b8564d1d7213e112be691d2460661 100644 (file)
@@ -1946,12 +1946,17 @@ Converter::visit(nir_intrinsic_instr *insn)
       }
       break;
    }
-   case nir_intrinsic_emit_vertex:
+   case nir_intrinsic_emit_vertex: {
       if (info->io.genUserClip > 0)
          handleUserClipPlanes();
-      // fallthrough
+      uint32_t idx = nir_intrinsic_stream_id(insn);
+      mkOp1(getOperation(op), TYPE_U32, NULL, mkImm(idx))->fixed = 1;
+      break;
+   }
    case nir_intrinsic_end_primitive: {
       uint32_t idx = nir_intrinsic_stream_id(insn);
+      if (idx)
+         break;
       mkOp1(getOperation(op), TYPE_U32, NULL, mkImm(idx))->fixed = 1;
       break;
    }