Re: d3dx8 [patch 1/2]: Implement D3DXGetFVFVertexSize
+ switch (FVF & 0xe) You should use D3DFVF_POSITION_MASK instead of 0xe here.
+ texture = FVF >> 16; + + for (i = 0; i < ((FVF&D3DFVF_TEXCOUNT_MASK) >> D3DFVF_TEXCOUNT_SHIFT); i++) + { + switch (texture & 3) + { + case D3DFVF_TEXTUREFORMAT1: + size = size + sizeof(FLOAT); + break; + case D3DFVF_TEXTUREFORMAT2: + size = size + sizeof(FLOAT) * 2; + break; + case D3DFVF_TEXTUREFORMAT3: + size = size + sizeof(FLOAT) * 3; + break; + case D3DFVF_TEXTUREFORMAT4: + size = size + sizeof(FLOAT) * 4; + break; + default: + break; + } + texture = texture >> 2; + } It's not completely obvious where you get the different shifts and masks here, a comment wouldn't hurt.
participants (1)
-
Henri Verbeet