From: Connor McAdams cmcadams@codeweavers.com
Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/d3dx9_36/effect.c | 31 +++++++++++++++++++++++++++++++ dlls/d3dx9_36/tests/effect.c | 5 +---- 2 files changed, 32 insertions(+), 4 deletions(-)
diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c index 67eaf2b5d63..75ce872e2c4 100644 --- a/dlls/d3dx9_36/effect.c +++ b/dlls/d3dx9_36/effect.c @@ -4465,6 +4465,37 @@ static HRESULT WINAPI d3dx_effect_SetRawValue(ID3DXEffect *iface, D3DXHANDLE par break; }
+ case D3DXPC_MATRIX_ROWS: + { + D3DXMATRIX *dst_elem; + uint8_t *dst_data; + unsigned int i; + + if (param->columns != 4 || param->rows != 4) + { + FIXME("%ux%u matrix parameters are currently unsupported.\n", param->rows, param->columns); + return E_NOTIMPL; + } + + if (byte_offset & 0x3f || bytes & 0x3f) + { + FIXME("Partial matrix updates are currently unsupported.\n"); + return E_NOTIMPL; + } + + if ((byte_offset + bytes) > param->bytes) + { + FIXME("Writing adjacent parameters is currently unsupported.\n"); + return E_NOTIMPL; + } + + dst_data = param_get_data_and_dirtify(effect, param, !byte_offset ? bytes : param->bytes, TRUE); + dst_elem = (D3DXMATRIX *)(dst_data + byte_offset); + for (i = 0; i < (bytes / sizeof(D3DXMATRIX)); ++i) + D3DXMatrixTranspose(&dst_elem[i], &((const D3DXMATRIX *)data)[i]); + break; + } + default: FIXME("Unhandled parameter class %s.\n", debug_d3dxparameter_class(param->class)); return E_NOTIMPL; diff --git a/dlls/d3dx9_36/tests/effect.c b/dlls/d3dx9_36/tests/effect.c index 9b166384364..939dbc5a1be 100644 --- a/dlls/d3dx9_36/tests/effect.c +++ b/dlls/d3dx9_36/tests/effect.c @@ -9033,7 +9033,6 @@ static void test_effect_set_raw_value(IDirect3DDevice9 *device) 3.0f, 7.0f, 10.0f, 14.0f, 4.0f, 0.0f, 11.0f, 0.0f } }, - .todo_hr = TRUE }, { "44_2", 0, 128, { .f = { 1.0f, 2.0f, 3.0f, 4.0f, @@ -9056,7 +9055,6 @@ static void test_effect_set_raw_value(IDirect3DDevice9 *device) 17.0f, 21.0f, 25.0f, 29.0f, 18.0f, 22.0f, 26.0f, 30.0f } }, - .todo_hr = TRUE }, /* Set second element. */ { "44_2", 64, 64, @@ -9075,7 +9073,6 @@ static void test_effect_set_raw_value(IDirect3DDevice9 *device) 3.0f, 7.0f, 10.0f, 14.0f, 4.0f, 0.0f, 11.0f, 0.0f } }, - .todo_hr = TRUE }, }; static const DWORD test_int_val[] = { 1, 2, 3, 4 }; @@ -9158,7 +9155,7 @@ static void test_effect_set_raw_value(IDirect3DDevice9 *device) ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
hr = effect->lpVtbl->SetRawValue(effect, param2, tmp, 0, 0); - todo_wine ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
param = effect->lpVtbl->GetParameterByName(effect, NULL, "i4"); param2 = effect->lpVtbl->GetParameterByName(effect, NULL, "i4_2");