struct D3DVERTEX
{
D3DXVECTOR3 p; //12 bytes
D3DXVECTOR3 n; //12 bytes
FLOAT tu, tv; //8 bytes
};//32 Byte stride
struct D3DVERTEX2T
{
D3DXVECTOR3 p; //12 bytes
D3DXVECTOR3 n; //12 bytes
FLOAT tu, tv; //8 bytes
FLOAT tu2, tv2; //8 bytes
FLOAT tu3, tv3; //8 bytes unnecessary for padding to multiple of 64 bytes
FLOAT tu4, tv4; //8 bytes unnecessary for padding to multiple of 64 bytes
FLOAT tu5, tv5; //8 bytes unnecessary for padding to multiple of 64 bytes
};//64 byte stride
struct D3DVERTEX3C
{
D3DXVECTOR3 p; //12 bytes
D3DCOLOR Color; //4 bytes
FLOAT tu, tv; //8 bytes
FLOAT tu2, tv2; //8 bytes unnecessary for padding purpose to multiple of 32 bytes
};//32 byte stride
My question is shall i use three VB for each above vertex types or one VB of given vertex type:-
struct D3DVERTEX
{
D3DXVECTOR3 p; //12 bytes
D3DXVECTOR3 n; //12 bytes
D3DCOLOR Color; //4 bytes
FLOAT tu, tv; //8 bytes
FLOAT tu2, tv2; //8 bytes
FLOAT tu3, tv3; //8 bytes unnecessary for padding to multiple of 64 bytes
FLOAT tu4, tv4; //8 bytes unnecessary for padding to multiple of 64 bytes
D3DCOLOR Color2; //4 bytes unnecessary for padding to multiple of 64 bytes
};//64 byte stride
Here in second case u can clearly see the unnecssary memory consumption. In my first case the wastage of memory is limited as the padded data is not much say i have 1MB D3DVERTEX, 200-300kB D3DVERTEX2T and 100-200kB D3DVERTEX3C. But i have 3 VB switches. And in Second case, no VB switches but memory overhead and it simplifies the coding looks but it increases the amount of data to be transfered.
1.Which one u think should be good...or is there any other method to make the things better?...
2.Also i heard of multiple stream, what should i do to make in two streams without any conflictions?...












