Skip to main content
gamedev.net
🔒 Locked

[DirectX 10] Input Element Desc -- Bytes offset

Started by Aqua Costa Jun 27, 2010 at 9:08 AM 3 replies 1.3k views
Original Post
Aqua Costa
Aqua Costa
How do I know the value of bytes offset between elements in the Input Element Desc?

Like, between DXGI_FORMAT_R32G32B32_FLOAT I used an offset of 12, but I dont know which value use between DXGI_FORMAT_R32G32_FLOAT etc.

Is there any documentation telling the bytes offset of each format?
Foofles
Foofles
You can just use the D3D10_APPEND_ALIGNED_ELEMENT macro to automatically pack it with the proper offset.
Demirug
Demirug
The format names contain the bits per channel. Just sum them and divide by 8 to get the size of a format in bytes.
Aqua Costa
Aqua Costa
Quote:
Original post by Demirug
The format names contain the bits per channel. Just sum them and divide by 8 to get the size of a format in bytes.



Thanks, by the way, is there any drawback of using D3D10_APPEND_ALIGNED_ELEMENT? Because I don't know why usually people don't use it...
Demirug
Demirug
Well the CPU needs to calculate the offsets for you. But this is nothing you should care about.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.