nv50/ir: handle clipvertex for geom and tess shaders as well
authorKarol Herbst <kherbst@redhat.com>
Sat, 30 Jun 2018 02:58:30 +0000 (04:58 +0200)
committerKarol Herbst <kherbst@redhat.com>
Mon, 2 Jul 2018 14:21:31 +0000 (16:21 +0200)
this will be needed for compatibility profiles

v2: handle tess shaders

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp

index c92acc996c43e96aa060d9e1ad1351f2eefce2e6..2f9bcc1f34b53e7e9b9383a0ea72d9c8db6b98b7 100644 (file)
@@ -3613,6 +3613,9 @@ Converter::handleInstruction(const struct tgsi_full_instruction *insn)
                                   info->out[info->io.viewportId].slot[0] * 4);
          mkStore(OP_EXPORT, TYPE_U32, vpSym, NULL, viewport);
       }
+      /* handle user clip planes for each emitted vertex */
+      if (info->io.genUserClip > 0)
+         handleUserClipPlanes();
       /* fallthrough */
    case TGSI_OPCODE_ENDPRIM:
    {
@@ -3787,7 +3790,9 @@ Converter::handleInstruction(const struct tgsi_full_instruction *insn)
       setPosition(epilogue, true);
       if (prog->getType() == Program::TYPE_FRAGMENT)
          exportOutputs();
-      if (info->io.genUserClip > 0)
+      if ((prog->getType() == Program::TYPE_VERTEX ||
+           prog->getType() == Program::TYPE_TESSELLATION_EVAL
+          ) && info->io.genUserClip > 0)
          handleUserClipPlanes();
       mkOp(OP_EXIT, TYPE_NONE, NULL)->terminator = 1;
    }