From e5cdbdecd262dfc405f1f09e7a1b272778f61f33 Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Fri, 27 Jun 2014 21:55:16 -0400 Subject: [PATCH] nvc0/ir: avoid creating restarts with non-0 stream Signed-off-by: Ilia Mirkin --- .../drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp index 2ba3c1c8e0f..9b7c49000a4 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp @@ -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: { -- 2.30.2