Sign in to follow this  
Quat

d3d11 Vertex Sizes

Recommended Posts

I am targeting Direct3D 11 hardware. I am wondering if I need to pay attention to the size of my vertices. Some of my vertices with skinning can get over 64 bytes. Is it worth while to use DXGI_FORMAT_R16G16B16_FLOAT instead of DXGI_FORMAT_R32G32B32_FLOAT say for normals and tangents? Likewise, I probably don't need 32-bit precision for my blend weights.

Is there conversion overhead when converting from R16_FLOAT to an R32_FLOAT in the shader? That is, if I submit R16_FLOAT data but use "float" in the shader code, is there overhead?

Share this post


Link to post
Share on other sites
[quote name='Quat' timestamp='1318963718' post='4873997']
I am targeting Direct3D 11 hardware. I am wondering if I need to pay attention to the size of my vertices. Some of my vertices with skinning can get over 64 bytes. Is it worth while to use DXGI_FORMAT_R16G16B16_FLOAT instead of DXGI_FORMAT_R32G32B32_FLOAT say for normals and tangents? Likewise, I probably don't need 32-bit precision for my blend weights.

Is there conversion overhead when converting from R16_FLOAT to an R32_FLOAT in the shader? That is, if I submit R16_FLOAT data but use "float" in the shader code, is there overhead?
[/quote]

Well, 16 bit floats take up less memory, therefore your vertices take up less space in the memory on your graphics card, and if you use your buffers dynamically and update them from CPU, then there is less data to send over to the card.

As far as I know in DIrectX 10 and up the 32 bit float is what is used everywhere, and therefore I would assume there would be very little or no penalty for the conversion.

That's my 2 cents, hopefully it will help.

Share this post


Link to post
Share on other sites
Most modern GPU's will do the format conversion in the shader by patching the vertex shader. However on any modern GPU is generally much better to use a little ALU for unpacking rather than use more bandwidth. So you should profile to know for sure, but in general using lower-precision formats should be a win.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this