Jump to content

  • Log In with Google      Sign In   
  • Create Account

Is DXGI_FORMAT_R16G16B16_FLOAT missing!?


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

#1   Members   

2901
Like
0Likes
Like

Posted 10 April 2014 - 12:56 PM

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, 10 April 2014 - 12:56 PM.


#2   Members   

4369
Like
0Likes
Like

Posted 10 April 2014 - 01:11 PM

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.


"Recursion is the first step towards madness." - "Skeggǫld, Skálmǫld, Skildir ro Klofnir!"
Direct3D 12 quick reference: https://github.com/alessiot89/D3D12QuickRef/

#3   Members   

2901
Like
0Likes
Like

Posted 10 April 2014 - 03:09 PM

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.



#4   Members   

16709
Like
3Likes
Like

Posted 10 April 2014 - 04:18 PM

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.

Game Developer, C++ Geek, Dragon Slayer - http://seanmiddleditch.com

C++ SG14 "Games & Low Latency" - Co-chair - public forums

Wargaming Seattle - Lead Server Engineer - We're hiring!


#5   Moderators   

49386
Like
3Likes
Like

Posted 10 April 2014 - 08:05 PM

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



#6   Members   

2901
Like
0Likes
Like

Posted 11 April 2014 - 03:42 AM

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. 






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.