Overview

<aside> 📝 Requires Shader Model 5.0.

</aside>

When using tesselation, both the Hull Shader and Domain Shader must be set.

Vertex Shader

The vertex shader passes the control points to the hull shader.

VertexOutput Output;
Output.Position = Input.Position;
return Output;

Hull Shader

The hull shader signature requires an InputPatch parameter.

The output structure and output patch size are specified as template arguments in InputPatch.

Attributes:

<aside> 💡 The input patch size must match the call to IASetPrimitiveTopology.

</aside>

The hull shader passes the control points to the domain shader.

HullOutput Output;
Output.Position = Patch[index].Position;
return Output;

Domain Shader

The domain shader calculates the final SV_Position for each vertex, that is passed to the rasterizer.