in d3d/archive/images/d3d11/tessellator.cpp [967:1018]
void CHWTessellator::TessellateTriDomain( float tessFactor_Ueq0, float tessFactor_Veq0, float tessFactor_Weq0,
float insideTessFactor )
{
PROCESSED_TESS_FACTORS_TRI processedTessFactors;
TriProcessTessFactors(tessFactor_Ueq0,tessFactor_Veq0,tessFactor_Weq0,insideTessFactor,processedTessFactors);
if( processedTessFactors.bPatchCulled )
{
m_NumPoints = 0;
m_NumIndices = 0;
return;
}
else if( processedTessFactors.bJustDoMinimumTessFactor )
{
DefinePoint(/*U*/0,/*V*/FXP_ONE,/*pointStorageOffset*/0); //V=1 (beginning of Ueq0 edge VW)
DefinePoint(/*U*/0,/*V*/0,/*pointStorageOffset*/1); //W=1 (beginning of Veq0 edge WU)
DefinePoint(/*U*/FXP_ONE,/*V*/0,/*pointStorageOffset*/2); //U=1 (beginning of Weq0 edge UV)
m_NumPoints = 3;
switch(m_outputPrimitive)
{
case D3D11_TESSELLATOR_OUTPUT_TRIANGLE_CW:
case D3D11_TESSELLATOR_OUTPUT_TRIANGLE_CCW:
// function orients them CCW if needed
DefineClockwiseTriangle(0,1,2,/*indexStorageBaseOffset*/m_NumIndices);
m_NumIndices = 3;
break;
case D3D11_TESSELLATOR_OUTPUT_POINT:
DumpAllPoints();
break;
case D3D11_TESSELLATOR_OUTPUT_LINE:
DumpAllPointsAsInOrderLineList();
break;
}
return;
}
TriGeneratePoints(processedTessFactors);
if( m_outputPrimitive == D3D11_TESSELLATOR_OUTPUT_POINT )
{
DumpAllPoints();
return;
}
if( m_outputPrimitive == D3D11_TESSELLATOR_OUTPUT_LINE )
{
DumpAllPointsAsInOrderLineList();
return;
}
TriGenerateConnectivity(processedTessFactors); // can be done in parallel to TriGeneratePoints()
}