bb->cfg.attach(&exit->cfg, Graph::Edge::TREE);
setPosition(exit, true);
- if (info->io.genUserClip > 0)
+ if ((prog->getType() == Program::TYPE_VERTEX ||
+ prog->getType() == Program::TYPE_TESSELLATION_EVAL)
+ && info->io.genUserClip > 0)
handleUserClipPlanes();
// TODO: for non main function this needs to be a OP_RETURN
}
break;
}
+ case Program::TYPE_GEOMETRY:
case Program::TYPE_VERTEX: {
if (info->io.genUserClip > 0 && idx == clipVertexOutput) {
mkMov(clipVtx[i], src);
break;
}
case nir_intrinsic_emit_vertex:
+ if (info->io.genUserClip > 0)
+ handleUserClipPlanes();
+ // fallthrough
case nir_intrinsic_end_primitive: {
uint32_t idx = nir_intrinsic_stream_id(insn);
mkOp1(getOperation(op), TYPE_U32, NULL, mkImm(idx))->fixed = 1;