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?
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?
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.
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.
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...
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...
Thanks again for the explanation Hodgman. I don't use that format, so everything is fine for me.