Module: wine Branch: master Commit: 0a5e85d0718f05b9908f5c950863297d5936b7be URL: http://source.winehq.org/git/wine.git/?a=commit;h=0a5e85d0718f05b9908f5c9508...
Author: Paul Gofman gofmanp@gmail.com Date: Fri Apr 28 21:24:11 2017 +0300
d3dx9/tests: Add test for D3DXFX_LARGEADDRESSAWARE effect creation flag.
Signed-off-by: Paul Gofman gofmanp@gmail.com Signed-off-by: Matteo Bruni mbruni@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/d3dx9_36/tests/effect.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)
diff --git a/dlls/d3dx9_36/tests/effect.c b/dlls/d3dx9_36/tests/effect.c index 997c1fc..3e9d255 100644 --- a/dlls/d3dx9_36/tests/effect.c +++ b/dlls/d3dx9_36/tests/effect.c @@ -6150,6 +6150,39 @@ static void test_effect_shared_parameters(IDirect3DDevice9 *device) ok(!refcount, "Effect pool was not properly freed, refcount %u.\n", refcount); }
+static void test_effect_large_address_aware_flag(IDirect3DDevice9 *device) +{ + ID3DXEffect *effect; + D3DXHANDLE param; + static int expected_ivect[4] = {28, 29, 30, 31}; + int ivect[4]; + HRESULT hr; + + hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob), + NULL, NULL, D3DXFX_LARGEADDRESSAWARE, NULL, &effect, NULL); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + + param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect"); + ok(!!param, "GetParameterByName failed.\n"); + + hr = effect->lpVtbl->SetValue(effect, param, expected_ivect, sizeof(expected_ivect)); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + + hr = effect->lpVtbl->GetValue(effect, param, ivect, sizeof(ivect)); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + + ok(!memcmp(ivect, expected_ivect, sizeof(expected_ivect)), "Vector value mismatch.\n"); + + if (0) + { + /* Native d3dx crashes in GetValue(). */ + hr = effect->lpVtbl->GetValue(effect, "g_iVect", ivect, sizeof(ivect)); + ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr); + } + + effect->lpVtbl->Release(effect); +} + START_TEST(effect) { HWND wnd; @@ -6199,6 +6232,7 @@ START_TEST(effect) test_effect_state_manager(device); test_cross_effect_handle(device); test_effect_shared_parameters(device); + test_effect_large_address_aware_flag(device);
count = IDirect3DDevice9_Release(device); ok(count == 0, "The device was not properly freed: refcount %u\n", count);