In Direct3D 11, I have a vertex that is used for multiple triangles. In other words, the same vertex is referenced by multiple indices. In my HLSL vertex shader, I want to know which INDEX is being processed. Is there a way to do this? Something similar like the HLSL semantics 'SV_VertexID' or 'SV_PrimitiveID', but for the current index?
To be clear, suppose the index buffer is: Index[3]={10,11,12}; SV_VertexID (using ID3D11DeviceContext::DrawIndexed()) will return 10, 11 and 12. But I want 0, 1, 2.
A counter inside the vertex shader that starts at 0 and is increased each call to the vertex shader would also helpfull. Each frame, this counter should be reset to 0. Is this possible?
Thank you.