Sign in to follow this  
Firelark

Another Input layout question...

Recommended Posts

Firelark    105

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

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