Henri Verbeet wrote:
That's insane. Any FVF validation should be done before starting the conversion, not afterwards by calling D3DXFVFFromDeclarator().
Thank you Henri for your wonderful feedback.
I was wondering if you had any particular suggestions as to the strategy for verification of FVF validity.
Right now I am thinking of a simple mask based approach, e.g., extending: d3d9types.h:#define D3DFVF_POSITION_MASK 0x400E d3d9types.h:#define D3DFVF_TEXCOUNT_MASK 0x0f00 as well as other masks, and then doing a simple validation for flags that may be outside this mask, such as:
d3dtypes.h:#define D3DFVF_TEXCOORDSIZE3(CoordIndex) (D3DFVF_TEXTUREFORMAT3 << (CoordIndex*2 + 16)) d3dtypes.h:#define D3DFVF_TEXCOORDSIZE2(CoordIndex) (D3DFVF_TEXTUREFORMAT2) d3dtypes.h:#define D3DFVF_TEXCOORDSIZE4(CoordIndex) (D3DFVF_TEXTUREFORMAT4 << (CoordIndex*2 + 16)) d3dtypes.h:#define D3DFVF_TEXCOORDSIZE1(CoordIndex) (D3DFVF_TEXTUREFORMAT1 << (CoordIndex*2 + 16))
If you have any other suggestions/comments please let me know. I will try to take a look later today.
Thank you!
Yours Misha