Sign in to follow this  
Madhed

One vertex buffer, multiple vertex shaders

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this