void CHWTessellator::TessellateQuadDomain()

in d3d/archive/images/d3d11/tessellator.cpp [446:499]


void CHWTessellator::TessellateQuadDomain( float tessFactor_Ueq0, float tessFactor_Veq0, float tessFactor_Ueq1, float tessFactor_Veq1, 
                                         float insideTessFactor_U, float insideTessFactor_V )
{
    PROCESSED_TESS_FACTORS_QUAD processedTessFactors;
    QuadProcessTessFactors(tessFactor_Ueq0,tessFactor_Veq0,tessFactor_Ueq1,tessFactor_Veq1,insideTessFactor_U,insideTessFactor_V,processedTessFactors);

    if( processedTessFactors.bPatchCulled )
    {
        m_NumPoints = 0;
        m_NumIndices = 0;
        return;
    }
    else if( processedTessFactors.bJustDoMinimumTessFactor )
    {
        DefinePoint(/*U*/0,/*V*/0,/*pointStorageOffset*/0);
        DefinePoint(/*U*/FXP_ONE,/*V*/0,/*pointStorageOffset*/1);
        DefinePoint(/*U*/FXP_ONE,/*V*/FXP_ONE,/*pointStorageOffset*/2);
        DefinePoint(/*U*/0,/*V*/FXP_ONE,/*pointStorageOffset*/3);
        m_NumPoints = 4;

        switch(m_outputPrimitive)
        {
        case D3D11_TESSELLATOR_OUTPUT_TRIANGLE_CW:
        case D3D11_TESSELLATOR_OUTPUT_TRIANGLE_CCW:
            // function orients them CCW if needed
            DefineClockwiseTriangle(0,1,3,/*indexStorageOffset*/0);
            DefineClockwiseTriangle(1,2,3,/*indexStorageOffset*/3);
            m_NumIndices = 6;
            break;
        case D3D11_TESSELLATOR_OUTPUT_POINT:
            DumpAllPoints();
            break;
        case D3D11_TESSELLATOR_OUTPUT_LINE:
            DumpAllPointsAsInOrderLineList();
            break;
        }
        return;
    }

    QuadGeneratePoints(processedTessFactors);

    if( m_outputPrimitive == D3D11_TESSELLATOR_OUTPUT_POINT )
    {
        DumpAllPoints();
        return;
    }
    if( m_outputPrimitive == D3D11_TESSELLATOR_OUTPUT_LINE )
    {
        DumpAllPointsAsInOrderLineList();
        return;
    }

    QuadGenerateConnectivity(processedTessFactors); // can be done in parallel to QuadGeneratePoints()
}