d3d9: Use the correct size for D3DFVF_XYZW.

This commit is contained in:
Chris Robinson 2008-12-28 09:57:13 -08:00 committed by Alexandre Julliard
parent 7f11abc91b
commit 0bdab5f80c
2 changed files with 9 additions and 0 deletions

View File

@ -452,6 +452,11 @@ static void test_fvf_decl_conversion(IDirect3DDevice9 *pDevice)
{ { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, D3DDECL_END() };
VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, D3DFVF_XYZ, test_buffer, 1));
}
{
CONST D3DVERTEXELEMENT9 test_buffer[] =
{ { 0, 0, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_POSITION, 0 }, D3DDECL_END() };
VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, D3DFVF_XYZW, test_buffer, 1));
}
{
CONST D3DVERTEXELEMENT9 test_buffer[] =
{ { 0, 0, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_POSITIONT, 0 }, D3DDECL_END() };

View File

@ -96,6 +96,10 @@ HRESULT vdecl_convert_fvf(
elements[idx].Type = D3DDECLTYPE_FLOAT4;
elements[idx].Usage = D3DDECLUSAGE_POSITIONT;
}
else if (!has_blend && (fvf & D3DFVF_XYZW) == D3DFVF_XYZW) {
elements[idx].Type = D3DDECLTYPE_FLOAT4;
elements[idx].Usage = D3DDECLUSAGE_POSITION;
}
else {
elements[idx].Type = D3DDECLTYPE_FLOAT3;
elements[idx].Usage = D3DDECLUSAGE_POSITION;