Jump to content

View more

Image of the Day

雑魚は多めにして、爽快感重視にしつつ・・・(´・ω・`)
早いとこ、ベースを作って、完成にもっていかないとね。
タイトルもまだ迷ってるだよなぁ。 
#indiedev  #indiegame #screenshotsaturday https://t.co/IwVbswGrhe
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

One vertex buffer, multiple vertex shaders

4: Adsense

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   Members   

4095
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?



#2 Burnt_Fyr   Members   

1664
Like
5Likes
Like

Posted 05 January 2013 - 08:22 PM

*
POPULAR

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   

19429
Like
6Likes
Like

Posted 05 January 2013 - 09:21 PM

*
POPULAR

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   Members   

4095
Like
0Likes
Like

Posted 06 January 2013 - 04:54 AM

Ah okay that makes sense.

 

Thanks for your answers.



#5 e.s.   Members   

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.