
struct VSOutput
{
	float4 f4Position : SV_Position;
	float3 f3Color	: COLOR;
};

// Output patch constant data.
struct HS_CONSTANT_DATA_OUTPUT
{
    float Edges[4]  : SV_TessFactor;
};

HS_CONSTANT_DATA_OUTPUT ConstantHS( InputPatch<VSOutput, 2> p, 
                                    out float Inside[1+1] : SV_InsideTessFactor,
                                    uint BlockID : SV_PrimitiveID)
{
    HS_CONSTANT_DATA_OUTPUT Factors;
    Factors.Edges[0] = 2.5;
    Factors.Edges[1] = 4.5;
    Factors.Edges[2] = 5.5;
    Factors.Edges[3] = 7.5;
    Inside[0] = 6.2;
    Inside[1] = 7.3;
    return Factors;
}


struct HSOutput
{
    float4 Position : SV_Position;
    float3 Color : COL;
};

[domain("quad")]
[partitioning("fractional_even")]
[outputtopology("triangle_cw")]
[outputcontrolpoints(2)]
[patchconstantfunc("ConstantHS")]
[maxtessfactor( (float)(32.f+2.f) )]
HSOutput main(InputPatch<VSOutput, 2> inputPatch, uint uCPID : SV_OutputControlPointID)
{
    HSOutput Out;
    Out.Position = inputPatch[uCPID].f4Position;
    Out.Color = inputPatch[uCPID].f3Color;
    return Out;
}