Jump to content
  • Advertisement
Sign in to follow this  
Firelark

Another Input layout question...

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

Hello

 

In directX 11, if I have a shader that takes vertices with POSITION defined as float3:

float3 pos : POSITION

Am I then allowed to use that shader with an input layout where the POSITION is defined to be a four component float using DXGI_FORMAT_R32G32B32A32_FLOAT? In essence am I allowed to use an input layout with more components (float3 < float4) in the input than the shader requires?

 

Also am I allowed to use an input layout where the POSITION is defined to be a two component float using DXGI_FORMAT_R32G32_FLOAT or a one component float using DXGI_FORMAT_R32_FLOAT? In essence am I allowed to use an input layout with fewer components in the input than what is defined in the shader.

 

Is there any kind of flexibility like this or do I have to provide an input layout where the POSITION is defined to be exactly a three component float?

 

Thanks for any help!

Karl

Share this post


Link to post
Share on other sites
Advertisement

Yes.

 

The input will be expanded to 4 component by adding the missing components, so a missing second component will get 0, third will get 0 and fourth will get 1.

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!