Jump to content

View more

Image of the Day

Adding some finishing touches...
Follow us for more
#screenshotsaturday #indiedev... by #MakeGoodGames https://t.co/Otbwywbm3a
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

Another Input layout question...

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
2 replies to this topic

#1 Firelark   Members   

105
Like
0Likes
Like

Posted 12 November 2013 - 01:39 AM

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



#2 mhagain   Members   

13272
Like
3Likes
Like

Posted 12 November 2013 - 03:01 AM

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.


It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#3 Firelark   Members   

105
Like
0Likes
Like

Posted 12 November 2013 - 05:16 AM

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






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.