How to Emulate a Stack and Recursive Functions in a DirectX 10 Shader

Recursion in Direct3D shader

Humus has released a new tech demo but this time there is no catch-eye effect: the demo shows how to implement a recursive function in a Direct3D 10 shader (in the geometry shader) in order to tesselate a mesh sphere. DX10 shader does not support recursive functions and to emulate this feature, Humus has used a while loop and some stack control variables. You can grab the demo HERE.