d3dx9/tests: Add effect parameter value SetVectorArray() test.
This commit is contained in:
parent
9c63b11372
commit
d0fbe7f5a5
|
@ -1640,7 +1640,7 @@ static void test_effect_parameter_value(IDirect3DDevice9 *device)
|
||||||
FLOAT fvalue;
|
FLOAT fvalue;
|
||||||
DWORD input_value[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
|
DWORD input_value[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
|
||||||
DWORD expected_value[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
|
DWORD expected_value[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
|
||||||
UINT l;
|
UINT l, element;
|
||||||
|
|
||||||
parameter = effect->lpVtbl->GetParameterByName(effect, NULL, res_full_name);
|
parameter = effect->lpVtbl->GetParameterByName(effect, NULL, res_full_name);
|
||||||
ok(parameter != NULL, "%u - %s: GetParameterByName failed\n", i, res_full_name);
|
ok(parameter != NULL, "%u - %s: GetParameterByName failed\n", i, res_full_name);
|
||||||
|
@ -1865,6 +1865,39 @@ static void test_effect_parameter_value(IDirect3DDevice9 *device)
|
||||||
}
|
}
|
||||||
test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
|
test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
|
||||||
test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
|
test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
|
||||||
|
|
||||||
|
/* SetVectorArray */
|
||||||
|
for (element = 0; element < res_desc->Elements + 1; ++element)
|
||||||
|
{
|
||||||
|
fvalue = 1.33;
|
||||||
|
for (l = 0; l < element * 4; ++l)
|
||||||
|
{
|
||||||
|
*(input_value + l) = *(DWORD *)&fvalue;
|
||||||
|
fvalue += 1.12;
|
||||||
|
}
|
||||||
|
memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
|
||||||
|
hr = effect->lpVtbl->SetVectorArray(effect, parameter, (D3DXVECTOR4 *)input_value, element);
|
||||||
|
if (res_desc->Elements && res_desc->Class == D3DXPC_VECTOR && element <= res_desc->Elements)
|
||||||
|
{
|
||||||
|
UINT m;
|
||||||
|
|
||||||
|
for (m = 0; m < element; ++m)
|
||||||
|
{
|
||||||
|
for (l = 0; l < res_desc->Columns; ++l)
|
||||||
|
{
|
||||||
|
set_number(expected_value + m * res_desc->Columns + l, res_desc->Type, input_value + m * 4 + l, D3DXPT_FLOAT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ok(hr == D3D_OK, "%u - %s: SetVectorArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetVectorArray failed, got %#x, expected %#x\n",
|
||||||
|
i, res_full_name, hr, D3DERR_INVALIDCALL);
|
||||||
|
}
|
||||||
|
test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
|
||||||
|
test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
count = effect->lpVtbl->Release(effect);
|
count = effect->lpVtbl->Release(effect);
|
||||||
|
|
Loading…
Reference in New Issue