nvc0/ir: Only store viewport in scratch register for GP
authorLyude <lyude@redhat.com>
Wed, 19 Apr 2017 22:38:01 +0000 (18:38 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Fri, 21 Apr 2017 03:24:06 +0000 (23:24 -0400)
EMIT only applies to geometry shaders. For everything else, we want to
export the viewport normally.

Signed-off-by: Lyude <lyude@redhat.com>
Reviewed-by: Boyan Ding <boyan.j.ding@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp

index 92cc13d61187e5865cdcfe37ef01678961f51602..b58300113176c5798e3e7eb19961bde6ae55df14 100644 (file)
@@ -2156,6 +2156,7 @@ Converter::storeDst(const tgsi::Instruction::DstRegister dst, int c,
          /* Save the viewport index into a scratch register so that it can be
             exported at EMIT time */
          if (info->out[idx].sn == TGSI_SEMANTIC_VIEWPORT_INDEX &&
+             prog->getType() == Program::TYPE_GEOMETRY &&
              viewport != NULL)
             mkOp1(OP_MOV, TYPE_U32, viewport, val);
          else