d3dx9: Fix ID3DXConstantTable::SetVector.

oldstable
Józef Kucia 2012-08-16 17:21:22 +02:00 committed by Alexandre Julliard
parent 5fd7d9826c
commit 53ce2a240b
2 changed files with 4 additions and 24 deletions

View File

@ -1158,38 +1158,17 @@ static HRESULT WINAPI ID3DXConstantTableImpl_SetVector(ID3DXConstantTable *iface
TRACE("(%p)->(%p, %p, %p)\n", This, device, constant, vector);
return ID3DXConstantTable_SetVectorArray(iface, device, constant, vector, 1);
return set_vector_array(iface, device, constant, vector, 1, D3DXPT_FLOAT);
}
static HRESULT WINAPI ID3DXConstantTableImpl_SetVectorArray(ID3DXConstantTable *iface, LPDIRECT3DDEVICE9 device,
D3DXHANDLE constant, CONST D3DXVECTOR4 *vector, UINT count)
{
struct ID3DXConstantTableImpl *This = impl_from_ID3DXConstantTable(iface);
D3DXCONSTANT_DESC desc;
HRESULT hr;
UINT desc_count = 1;
TRACE("(%p)->(%p, %p, %p, %d)\n", This, device, constant, vector, count);
hr = ID3DXConstantTable_GetConstantDesc(iface, constant, &desc, &desc_count);
if (FAILED(hr))
{
TRACE("ID3DXConstantTable_GetConstantDesc failed: %08x\n", hr);
return D3DERR_INVALIDCALL;
}
switch (desc.RegisterSet)
{
case D3DXRS_FLOAT4:
set_float_shader_constant(This, device, desc.RegisterIndex, (float *)vector,
min(desc.RegisterCount, count));
break;
default:
FIXME("Handle other register sets\n");
return E_NOTIMPL;
}
return D3D_OK;
return set_vector_array(iface, device, constant, vector, count, D3DXPT_FLOAT);
}
static HRESULT WINAPI ID3DXConstantTableImpl_SetMatrix(ID3DXConstantTable *iface, LPDIRECT3DDEVICE9 device,

View File

@ -632,7 +632,8 @@ static void test_setting_basic_table(IDirect3DDevice9 *device)
ok(res == D3D_OK, "ID3DXConstantTable_SetVector failed on variable f: 0x%08x\n", res);
IDirect3DDevice9_GetVertexShaderConstantF(device, 6, out, 1);
ok(out[0] == f4.x, "The variable f was not set correctly by ID3DXConstantTable_SetVector, got %f, should be %f\n",
ok(out[0] == f4.x && out[1] == 0.0f && out[2] == 0.0f && out[3] == 0.0f,
"The variable f was not set correctly by ID3DXConstantTable_SetVector, got %f, should be %f\n",
out[0], f4.x);
refcnt = ID3DXConstantTable_Release(ctable);