[WINESYNC] d3dx9/tests: Clear vertex shader constants in test_effect_states().
authorwinesync <ros-dev@reactos.org>
Sat, 1 Feb 2020 16:57:27 +0000 (17:57 +0100)
committerJérôme Gardou <zefklop@users.noreply.github.com>
Wed, 26 Feb 2020 17:19:18 +0000 (18:19 +0100)
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
wine commit id cf992bebb056814a05fe3a82011c4de701c144c4 by Paul Gofman <gofmanp@gmail.com>

modules/rostests/winetests/d3dx9_36/effect.c
sdk/tools/winesync/d3dx9.cfg

index fcfb82a..dc02f2c 100644 (file)
@@ -3001,40 +3001,55 @@ static const DWORD test_effect_states_effect_blob[] =
 };
 #define TEST_EFFECT_STATES_VSHADER_POS 271
 
+static const D3DXVECTOR4 fvect_filler = {-9999.0f, -9999.0f, -9999.0f, -9999.0f};
+
+static void test_effect_clear_vconsts(IDirect3DDevice9 *device)
+{
+    unsigned int i;
+    HRESULT hr;
+
+    for (i = 0; i < 256; ++i)
+    {
+        hr = IDirect3DDevice9_SetVertexShaderConstantF(device, i, &fvect_filler.x, 1);
+        ok(hr == D3D_OK, "Got result %#x.\n", hr);
+    }
+}
+
 static void test_effect_states(IDirect3DDevice9 *device)
 {
-    D3DMATRIX test_mat =
+    static const D3DMATRIX test_mat =
     {{{
         -1.0f, 0.0f, 0.0f, 0.0f,
         0.0f, 0.0f, 0.0f, 0.0f,
         0.0f, 0.0f, 0.0f, 0.0f,
         0.0f, 0.0f, 0.0f, 0.0f
     }}};
-    D3DMATRIX test_mat_camera =
+    static const D3DMATRIX test_mat_camera =
     {{{
         4.0f, 0.0f, 0.0f, 0.0f,
         0.0f, 0.0f, 0.0f, 0.0f,
         0.0f, 0.0f, 0.0f, 0.0f,
         0.0f, 0.0f, 0.0f, 6.0f
     }}};
-    D3DMATRIX test_mat_world1 =
+    static const D3DMATRIX test_mat_world1 =
     {{{
         2.0f, 0.0f, 0.0f, 0.0f,
         0.0f, 0.0f, 0.0f, 0.0f,
         0.0f, 0.0f, 0.0f, 0.0f,
         0.0f, 0.0f, 0.0f, 4.0f
     }}};
-    D3DMATRIX mat;
-    HRESULT hr;
+
+    IDirect3DVertexShader9 *vshader;
+    float float_data[4];
     ID3DXEffect *effect;
+    UINT byte_code_size;
+    void *byte_code;
+    D3DLIGHT9 light;
+    D3DMATRIX mat;
     UINT npasses;
     DWORD value;
-    IDirect3DVertexShader9 *vshader;
-    void *byte_code;
-    UINT byte_code_size;
+    HRESULT hr;
     BOOL bval;
-    D3DLIGHT9 light;
-    float float_data[4];
 
     hr = D3DXCreateEffect(device, test_effect_states_effect_blob, sizeof(test_effect_states_effect_blob),
             NULL, NULL, 0, NULL, &effect, NULL);
@@ -3086,6 +3101,8 @@ static void test_effect_states(IDirect3DDevice9 *device)
     ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
     ok(!memcmp(mat.m, test_mat.m, sizeof(mat)), "World matrix does not match.\n");
 
+    test_effect_clear_vconsts(device);
+
     hr = effect->lpVtbl->BeginPass(effect, 0);
     ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
 
@@ -4367,20 +4384,6 @@ static void test_effect_preshader_op_results_(unsigned int line, IDirect3DDevice
     }
 }
 
-static const D3DXVECTOR4 fvect_filler = {-9999.0f, -9999.0f, -9999.0f, -9999.0f};
-
-static void test_effect_preshader_clear_vconsts(IDirect3DDevice9 *device)
-{
-    unsigned int i;
-    HRESULT hr;
-
-    for (i = 0; i < 256; ++i)
-    {
-        hr = IDirect3DDevice9_SetVertexShaderConstantF(device, i, &fvect_filler.x, 1);
-        ok(hr == D3D_OK, "Got result %#x.\n", hr);
-    }
-}
-
 static const D3DXVECTOR4 test_effect_preshader_fvect_v[] =
 {
     {0.0f,   0.0f,  0.0f,  0.0f},
@@ -4588,7 +4591,7 @@ static void test_effect_preshader(IDirect3DDevice9 *device)
             NULL, NULL, 0, NULL, &effect, NULL);
     ok(hr == D3D_OK, "Got result %#x.\n", hr);
 
-    test_effect_preshader_clear_vconsts(device);
+    test_effect_clear_vconsts(device);
 
     for (i = 0; i < 224; ++i)
     {
@@ -5448,7 +5451,7 @@ static void test_effect_commitchanges(IDirect3DDevice9 *device)
 
     for (i = 0; i < ARRAY_SIZE(check_vconsts_parameters); ++i)
     {
-        test_effect_preshader_clear_vconsts(device);
+        test_effect_clear_vconsts(device);
         param = effect->lpVtbl->GetParameterByName(effect, NULL, check_vconsts_parameters[i].param_name);
         ok(!!param, "GetParameterByName failed.\n");
         hr = effect->lpVtbl->GetValue(effect, param, buffer, sizeof(buffer));
@@ -5478,7 +5481,7 @@ static void test_effect_commitchanges(IDirect3DDevice9 *device)
                 check_bconsts_parameters[i].param_name);
     }
 
-    test_effect_preshader_clear_vconsts(device);
+    test_effect_clear_vconsts(device);
     param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_Selector");
     ok(!!param, "GetParameterByName failed.\n");
     fvect.x = fvect.y = fvect.z = fvect.w = 0.0f;
@@ -5489,7 +5492,7 @@ static void test_effect_commitchanges(IDirect3DDevice9 *device)
     test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[0].const_updated_mask,
                 check_vconsts_parameters[0].param_name);
 
-    test_effect_preshader_clear_vconsts(device);
+    test_effect_clear_vconsts(device);
     param = effect->lpVtbl->GetParameterByName(effect, NULL, "arr2");
     ok(!!param, "GetParameterByName failed.\n");
     param = effect->lpVtbl->GetParameterElement(effect, param, 0);
@@ -5501,7 +5504,7 @@ static void test_effect_commitchanges(IDirect3DDevice9 *device)
     test_effect_preshader_compare_vconsts(device, const_no_update_mask,
                 check_vconsts_parameters[10].param_name);
 
-    test_effect_preshader_clear_vconsts(device);
+    test_effect_clear_vconsts(device);
     param = effect->lpVtbl->GetParameterByName(effect, NULL, "arr2");
     ok(!!param, "GetParameterByName failed.\n");
     param = effect->lpVtbl->GetParameterElement(effect, param, 1);
@@ -5514,7 +5517,7 @@ static void test_effect_commitchanges(IDirect3DDevice9 *device)
     test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[10].const_updated_mask,
                 check_vconsts_parameters[10].param_name);
 
-    test_effect_preshader_clear_vconsts(device);
+    test_effect_clear_vconsts(device);
     param = effect->lpVtbl->GetParameterByName(effect, NULL, "arr2");
     ok(!!param, "GetParameterByName failed.\n");
     fvect.x = 92.0f;
@@ -5525,7 +5528,7 @@ static void test_effect_commitchanges(IDirect3DDevice9 *device)
     test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[10].const_updated_mask,
                 check_vconsts_parameters[10].param_name);
 
-    test_effect_preshader_clear_vconsts(device);
+    test_effect_clear_vconsts(device);
     param = effect->lpVtbl->GetParameterByName(effect, NULL, "arr2");
     ok(!!param, "GetParameterByName failed.\n");
     param = effect->lpVtbl->GetParameterElement(effect, param, 1);
@@ -5537,7 +5540,7 @@ static void test_effect_commitchanges(IDirect3DDevice9 *device)
     test_effect_preshader_compare_vconsts(device, const_no_update_mask,
                 check_vconsts_parameters[10].param_name);
 
-    test_effect_preshader_clear_vconsts(device);
+    test_effect_clear_vconsts(device);
     param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_Pos1");
     ok(!!param, "GetParameterByName failed.\n");
     fvect.x = fvect.y = fvect.z = fvect.w = 0.0f;
@@ -5548,7 +5551,7 @@ static void test_effect_commitchanges(IDirect3DDevice9 *device)
     test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[1].const_updated_mask,
                 check_vconsts_parameters[1].param_name);
 
-    test_effect_preshader_clear_vconsts(device);
+    test_effect_clear_vconsts(device);
     param = effect->lpVtbl->GetParameterByName(effect, NULL, "ts1");
     ok(!!param, "GetParameterByName failed.\n");
     param = effect->lpVtbl->GetParameterElement(effect, param, 0);
@@ -5572,7 +5575,7 @@ static void test_effect_commitchanges(IDirect3DDevice9 *device)
     ok(hr == D3D_OK, "Got result %#x.\n", hr);
     hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSCALE_B, value);
     ok(hr == D3D_OK, "Got result %#x.\n", hr);
-    test_effect_preshader_clear_vconsts(device);
+    test_effect_clear_vconsts(device);
     param = effect->lpVtbl->GetParameterByName(effect, NULL, "ts2");
     ok(!!param, "GetParameterByName failed.\n");
     param = effect->lpVtbl->GetParameterElement(effect, param, 0);
@@ -5609,7 +5612,7 @@ static void test_effect_commitchanges(IDirect3DDevice9 *device)
     ok(hr == D3D_OK, "Got result %#x.\n", hr);
     hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSCALE_B, value);
     ok(hr == D3D_OK, "Got result %#x.\n", hr);
-    test_effect_preshader_clear_vconsts(device);
+    test_effect_clear_vconsts(device);
     param = effect->lpVtbl->GetParameterByName(effect, NULL, "ts3");
     ok(!!param, "GetParameterByName failed.\n");
     param = effect->lpVtbl->GetParameterByName(effect, param, "ts");
@@ -5671,7 +5674,7 @@ static void test_effect_commitchanges(IDirect3DDevice9 *device)
 
     hr = IDirect3DDevice9_SetVertexShader(device, NULL);
     ok(hr == D3D_OK, "Got result %#x.\n", hr);
-    test_effect_preshader_clear_vconsts(device);
+    test_effect_clear_vconsts(device);
 
     hr = effect->lpVtbl->CommitChanges(effect);
     ok(hr == D3D_OK, "Got result %#x.\n", hr);
@@ -6671,7 +6674,7 @@ static void test_effect_shared_parameters(IDirect3DDevice9 *device)
     ok(hr == D3D_OK, "Got result %#x.\n", hr);
     }
 
-    test_effect_preshader_clear_vconsts(device);
+    test_effect_clear_vconsts(device);
     fvect.x = fvect.y = fvect.z = fvect.w = 28.0f;
     hr = effect2->lpVtbl->SetVector(effect2, "g_Pos1", &fvect);
     ok(hr == D3D_OK, "Got result %#x.\n", hr);
@@ -6770,7 +6773,7 @@ static void test_effect_shared_parameters(IDirect3DDevice9 *device)
     hr = effect1->lpVtbl->SetFloatArray(effect1, "arr2", fval, 2);
     ok(hr == D3D_OK, "Got result %#x.\n", hr);
 
-    test_effect_preshader_clear_vconsts(device);
+    test_effect_clear_vconsts(device);
 
     hr = effect1->lpVtbl->CommitChanges(effect1);
     ok(hr == D3D_OK, "Got result %#x.\n", hr);
@@ -6780,7 +6783,7 @@ static void test_effect_shared_parameters(IDirect3DDevice9 *device)
     fvect.x = -1.0f;
     test_effect_shared_parameters_compare_vconst(device, 30, &fvect, FALSE);
 
-    test_effect_preshader_clear_vconsts(device);
+    test_effect_clear_vconsts(device);
 
     hr = effect1->lpVtbl->CommitChanges(effect1);
     ok(hr == D3D_OK, "Got result %#x.\n", hr);
@@ -7079,7 +7082,7 @@ static void test_effect_skip_constants(IDirect3DDevice9 *device)
     hr = effect->lpVtbl->SetFloat(effect, "v5", 32.0f);
     ok(hr == D3D_OK, "Got result %#x.\n", hr);
 
-    test_effect_preshader_clear_vconsts(device);
+    test_effect_clear_vconsts(device);
 
     hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
     ok(hr == D3D_OK, "Got result %#x.\n", hr);
index d349c32..60874c0 100644 (file)
@@ -33,4 +33,4 @@ files:
   include/d3dx9shape.h: sdk/include/dxsdk/d3dx9shape.h
   include/d3dx9tex.h: sdk/include/dxsdk/d3dx9tex.h
 tags:
-  wine: 7e01ec6018c062d11b29ba2b9a2056d98e8bc406
+  wine: cf992bebb056814a05fe3a82011c4de701c144c4