Advertisement Jump to content
Sign in to follow this  

Vertex Formats

This topic is 2840 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hiya :)

Say you have a vertex buffer consisting of a position, normal and one set of texture coordinates. When you render it using D3D9, you set the vertex declaration describing this format. Then say you have 2 shaders, the first using all these elements as input and the second using only the position. As far as my understanding goes, the vertex declaration just tells you what information is available to a shader, not that it needs to be used... right? So the second shader would run fine even though it only specifies a position as it's input.

Is this how it's usually done?

Also, a quick side question if I can - how widely supported is D3D10 now?

Many thanks for any help :)


Share this post

Link to post
Share on other sites
Yeah, the shader will run just fine. If you really wanted to you could use two streams; one containing position that's used for both shaders and one containing everything else that's used for the first shader only. You'd also need two vertex declarations of course. I'd only do that if there was measurable performance overhead from just using the same buffer and decl for both though (and a measurable performance gain from 2 streams/2 decls).

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!