Jump to content
  • Advertisement
Sign in to follow this  
DividedByZero

CreateInputLayout() question

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

HI Guys,

 

I am wondering why CreateInputLayout() in DirectX 11 requires a reference to a vertex shader?

 

Does this mean that when you IASetInputLayout() when you go to draw the triangle list, you must make sure that you have a shader with a 'compatible' input selected?

 

What happens if the shader that is set has an incompatible input layout? Does your project go 'Bang'? Or will the shader continue with the parameters that are available at the time of the call? 

 

Thanks in advance :)

Share this post


Link to post
Share on other sites
Advertisement

Yes, the InputLayout can be used with any Vertex Shader that has a compatible input. If you try to use one that isn't compatible then the Debug Layer will print an error and the draw will almost certainly not draw.

Share this post


Link to post
Share on other sites
Mismatches *might* succeed in drawing, but could either be corrupt, or could cause terrible performance problems :lol:
Best to just use one IL per pair of VS input structure & buffer layout.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net 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!