# 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 on other sites
mhagain    13430

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 on other sites
Firelark    105

Thanks mhagain, that's what i wanted to know :)