• Advertisement
Sign in to follow this  

One vertex buffer, multiple vertex shaders

This topic is 1821 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

Okay, so I've finally started switching from D3D9 to D3D11.

One thing that confuses me is ID3D11Device::CreateInputLayout().

 

I have to supply my input element definition, so far so good. But it also requires the compiled vertex shader code.

What if I want to draw a mesh with different vertex shaders? Will I have to create a different input layout for each combination or can I just use one for every shader?

Share this post


Link to post
Share on other sites
Advertisement

You can re-use an input layout for multiple vertex shaders only if those vertex shaders have the same exact input signature. This means that those shader must take the same set of input parameters, with the same semantics.

 

Do the other shaders have to have the same exact byte size?  How do you load the other shaders into the DeviceContext and associate them with specific models in the VertexBuffer?

Share this post


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

  • Advertisement