View Full Version : What's the HLSL equivalence of gl_VertexId?

Albert Jin
11-26-2010, 11:31 PM
I am just curious. It seems that HLSL for Direct3D does not have any built-in variables at all.

BTW, I recently tried to use gl_VertexId on an old NV card, which supports GL_ARB_shader_objects but no GL_EXT_gpu_shader4. It complains "VERTEXID" semantics binding of gl_VertexId is not supported by vp40 profile.

11-27-2010, 01:22 AM
Yes it has:
SV_VertexID, SV_PrimitiveID, SV_InstanceID

Albert Jin
11-27-2010, 09:28 AM
Cool, it works :)