arametric segment or a radial one.
        float numSegmentsInJoin = tcsJoinArgs0.x;
        float numTotalCombinedSegments = numSegmentsInJoin + tcsTessArgs[0].x + tcsTessArgs[1].x +
                                         tcsTessArgs[2].x;
        float combinedEdgeID = round(gl_TessCoord.x * numTotalCombinedSegments);
        float strokeOutset = gl_TessCoord.y * 2.0 - 1.0;

        // Furthermore, the vertex shader may have chopped the curve into 3 different sections.
        // Determine which section we belong to, and where we fall relative to its first edge.
        float2 p0, p1, p2, p3;
        vec2 tan0;
        float numParametricSegments, radsPerSegment;
        if (combinedEdgeID < numSegmentsInJoin || numSegmentsInJoin == numTotalCombinedSegments) {
            // Our edge belongs to the join preceding the curve.
            p3 = p2 = p1 = p0 = tcsPts01[0].xy;
            tan0 = tcsJoinArgs0.zw;
            numParametricSegments = 1;
            radsPerSegment = tcsJoinArgs1.x;
            strokeOutset = clamp(strokeOutset, tcsJoinArgs1.y, tcsJoinArgs1.z);
            strokeOutset *= (combinedEdgeID == 1.0) ? tcsJoinArgs0.y : 1.0;
        } else if ((combinedEdgeID -= numSegmentsInJoin) < tcsTessArgs[0].x) {
            // Our edge belongs to the first curve section.
            p0=tcsPts01[0].xy, p1=tcsPts01[0].zw, p2=tcsPt2Tan0[0].xy, p3=tcsPts01[1].xy;
            tan0 = tcsPt2Tan0[0].zw;
            numParametricSegments = tcsTessArgs[0].y;
            radsPerSegment = tcsTessArgs[0].z;
        } else if ((combinedEdgeID -= tcsTessArgs[0].x) < tcsTessArgs[1].x) {
            // Our edge belongs to the second curve section.
            p0=tcsPts01[1].xy, p1=tcsPts01[1].zw, p2=tcsPt2Tan0[1].xy, p3=tcsPts01[2].xy;
            tan0 = tcsPt2Tan0[1].zw;
            numParametricSegments = tcsTessArgs[1].y;
            radsPerSegment = tcsTessArgs[1].z;
        } else {
            // Our edge belongs to the third curve section.
            combinedEdgeID -= tcsTessArgs[1].x;
            p0=tcsPts01[2].xy, p1=tcsPts01[2].zw, p2=tcsPt2Tan0[2].xy, p3=tcsEndPtEndTan.xy;
            tan0 = tcsPt2Tan0[2].zw;
            numParametricSegments = tcsTessArgs[2].y;
            radsPerSegment = tcsTessArgs[2].z;
        }
        float2 tan1 = tcsEndPtEndTan.zw;
        bool isFinalEdge = (gl_TessCoord.x == 1);
        float w = -1.0;  // w<0 means the curve is an integral cubic.
        if (isinf(p3.y)) {
            w = p3.x;  // The curve is actually a conic.
            p3 = p2;  // Setting p3 equal to p2 works for the remaining rotational logic.
        }