Jump to content
  • Advertisement
Sign in to follow this  
ongamex92

Is DXGI_FORMAT_R16G16B16_FLOAT missing!?

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

In order to create a input layout that represent a vertex element of type half3 we need DXGI_FORMAT_R16G16B16_X (in D3D11_INPUT_ELEMENT_DESC) but there isn't such element in DXGI_FORMAT enumeration.

 

Am I missing something?

Edited by imoogiBG

Share this post


Link to post
Share on other sites
Advertisement

Yes, 3 x 16-bit per-channel format is missing, just use DXGI_FORMAT_R16G16B16A16_x and ignore the fourth component ore use three DXGI_FORMAT_R16_x.

Share this post


Link to post
Share on other sites

I don't diractly need this. I was creating a wrapper around few graphics APIs when i found that DXGI_FORMAT_R16G16B16A16_x is missing. I'm just curious why did that hapen.

Share this post


Link to post
Share on other sites
It's a potentially very inefficient format on some hardware, and typically isn't needed. Three-component texture formats in generally are very non-ideal as they tend to cause most texels to be oddly aligned. Usual computer stuff: 1, 2, and 4 components work well since they're powers of two.

Share this post


Link to post
Share on other sites

AFAIK, vertex atributes have to be 4-byte aligned on pretty much every card.

e.g.

4x Int8 is ok, but 1/2/3x Int8 is not.

2/4x F16 is ok, but 1/3x F16 is not.

 

If this is working under another API (I'm guessing OpenGL), then it's probably doing something horrible behind the scenes, like reallocating your vertex buffers and moving/aligning all the attributes for you... or inserting a bunch of code at the beginning of your vertex shader to fetch several Int32 variables and bitshift/merge them together before reinterpreting as half-float and then converting to float... sad.png

Share this post


Link to post
Share on other sites

AFAIK, vertex atributes have to be 4-byte aligned on pretty much every card.

e.g.

4x Int8 is ok, but 1/2/3x Int8 is not.

2/4x F16 is ok, but 1/3x F16 is not.

 

If this is working under another API (I'm guessing OpenGL), then it's probably doing something horrible behind the scenes, like reallocating your vertex buffers and moving/aligning all the attributes for you... or inserting a bunch of code at the beginning of your vertex shader to fetch several Int32 variables and bitshift/merge them together before reinterpreting as half-float and then converting to float... sad.png

 

Thanks again for the explanation Hodgman. I don't use that format, so everything is fine for me. 

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!