PDA

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



Albert Jin
11-27-2010, 12:31 AM
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.

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

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