Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


One vertex buffer, multiple vertex shaders


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Madhed   Crossbones+   -  Reputation: 3129

Like
1Likes
Like

Posted 05 January 2013 - 11:56 AM

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?



Sponsor:

#2 Burnt_Fyr   Members   -  Reputation: 1247

Like
5Likes
Like

Posted 05 January 2013 - 08:22 PM

I'm regurgitating what i've read here(less then a week ago actually).

 

In dx9 flexible vertex formats, or their shader equivelents, had to be checked against the shaders each time a shader was bound, and this is why changing shaders was such a huge performance factor. In DX11, the input layouts are checked against a shader at creation time, so switching shaders has much less overhead in the newer api. As long as the semantics in a layout match the semantics in the shaders to be used, then a single layout can be used for multiple shaders afaik.



#3 MJP   Moderators   -  Reputation: 11736

Like
5Likes
Like

Posted 05 January 2013 - 09:21 PM

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.



#4 Madhed   Crossbones+   -  Reputation: 3129

Like
0Likes
Like

Posted 06 January 2013 - 04:54 AM

Ah okay that makes sense.

 

Thanks for your answers.



#5 e.s.   Members   -  Reputation: 110

Like
0Likes
Like

Posted 27 January 2013 - 10:19 PM

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?






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS