[PATCH 3/3] d3dx9: Apply changed states only in CommitChanges.

Paul Gofman gofmanp at gmail.com
Thu Mar 9 16:15:53 CST 2017


Signed-off-by: Paul Gofman <gofmanp at gmail.com>
---
 dlls/d3dx9_36/d3dx9_private.h |   8 ++-
 dlls/d3dx9_36/effect.c        | 146 ++++++++++++++++++++++++++++--------------
 dlls/d3dx9_36/preshader.c     |  40 ++++++++++--
 dlls/d3dx9_36/tests/effect.c  |  13 ----
 4 files changed, 137 insertions(+), 70 deletions(-)

diff --git a/dlls/d3dx9_36/d3dx9_private.h b/dlls/d3dx9_36/d3dx9_private.h
index 27b91a7..53cf99f 100644
--- a/dlls/d3dx9_36/d3dx9_private.h
+++ b/dlls/d3dx9_36/d3dx9_private.h
@@ -222,6 +222,11 @@ struct d3dx_parameter
     DWORD *dirty_flag_ptr;
 };
 
+static inline BOOL is_param_dirty(struct d3dx_parameter *param)
+{
+    return (*param->dirty_flag_ptr & PARAMETER_FLAG_DIRTY);
+}
+
 struct d3dx9_base_effect;
 
 struct d3dx_parameter *get_parameter_by_name(struct d3dx9_base_effect *base,
@@ -233,6 +238,7 @@ void d3dx_free_param_eval(struct d3dx_param_eval *peval) DECLSPEC_HIDDEN;
 HRESULT d3dx_evaluate_parameter(struct d3dx_param_eval *peval,
         const struct d3dx_parameter *param, void *param_value) DECLSPEC_HIDDEN;
 HRESULT d3dx_param_eval_set_shader_constants(struct IDirect3DDevice9 *device,
-        struct d3dx_param_eval *peval) DECLSPEC_HIDDEN;
+        struct d3dx_param_eval *peval, BOOL update_all) DECLSPEC_HIDDEN;
+BOOL is_param_eval_input_dirty(struct d3dx_param_eval *peval) DECLSPEC_HIDDEN;
 
 #endif /* __WINE_D3DX9_PRIVATE_H */
diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c
index ada78f9..b18465c 100644
--- a/dlls/d3dx9_36/effect.c
+++ b/dlls/d3dx9_36/effect.c
@@ -123,6 +123,9 @@ struct d3dx_pass
 
     struct d3dx_state *states;
     struct d3dx_parameter *annotations;
+
+    D3DLIGHT9 current_light[8];
+    D3DMATERIAL9 current_material;
 };
 
 struct d3dx_technique
@@ -1339,6 +1342,20 @@ static void set_dirty(struct d3dx_parameter *param)
     *param->dirty_flag_ptr |= PARAMETER_FLAG_DIRTY;
 }
 
+static BOOL param_clear_dirty_func(void *dummy, struct d3dx_parameter *param)
+{
+    *param->dirty_flag_ptr &= ~PARAMETER_FLAG_DIRTY;
+    return FALSE;
+}
+
+static void clear_dirty_all(struct d3dx9_base_effect *base)
+{
+    unsigned int i;
+
+    for (i = 0; i < base->parameter_count; ++i)
+        walk_parameter_tree(&base->parameters[i], param_clear_dirty_func, NULL);
+}
+
 static HRESULT d3dx9_base_effect_set_value(struct d3dx9_base_effect *base,
         D3DXHANDLE parameter, const void *data, UINT bytes)
 {
@@ -1570,8 +1587,12 @@ static HRESULT d3dx9_base_effect_set_int(struct d3dx9_base_effect *base, D3DXHAN
     {
         if (param->rows == 1 && param->columns == 1)
         {
-            set_number(param->data, param->type, &n, D3DXPT_INT);
-            set_dirty(param);
+            DWORD value;
+
+            set_number(&value, param->type, &n, D3DXPT_INT);
+            if (value != *(DWORD *)param->data)
+                set_dirty(param);
+             *(DWORD *)param->data = value;
             return D3D_OK;
         }
 
@@ -1707,8 +1728,12 @@ static HRESULT d3dx9_base_effect_set_float(struct d3dx9_base_effect *base, D3DXH
 
     if (param && !param->element_count && param->rows == 1 && param->columns == 1)
     {
-        set_number((DWORD *)param->data, param->type, &f, D3DXPT_FLOAT);
-        set_dirty(param);
+        DWORD value;
+
+        set_number(&value, param->type, &f, D3DXPT_FLOAT);
+        if (value != *(DWORD *)param->data)
+            set_dirty(param);
+         *(DWORD *)param->data = value;
         return D3D_OK;
     }
 
@@ -2533,17 +2558,20 @@ static HRESULT d3dx9_base_effect_set_array_range(struct d3dx9_base_effect *base,
 }
 
 static HRESULT d3dx9_get_param_value_ptr(struct ID3DXEffectImpl *effect, struct d3dx_pass *pass,
-        struct d3dx_state *state, void **param_value, struct d3dx_parameter **out_param)
+        struct d3dx_state *state, void **param_value, struct d3dx_parameter **out_param,
+        BOOL update_all, BOOL *param_dirty)
 {
     struct d3dx_parameter *param = &state->parameter;
 
     *param_value = NULL;
     *out_param = NULL;
+    *param_dirty = FALSE;
 
     switch (state->type)
     {
         case ST_PARAMETER:
             param = param->referenced_param;
+            *param_dirty = is_param_dirty(param);
             /* fallthrough */
         case ST_CONSTANT:
             *out_param = param;
@@ -2555,23 +2583,34 @@ static HRESULT d3dx9_get_param_value_ptr(struct ID3DXEffectImpl *effect, struct
             static const struct d3dx_parameter array_idx_param =
                 {NULL, NULL, NULL, D3DXPC_SCALAR, D3DXPT_INT, 1, 1, 0, 0, 0, 0, sizeof(array_idx)};
             HRESULT hr;
+            struct d3dx_parameter *ref_param;
 
             if (!param->param_eval)
             {
                 FIXME("Preshader structure is null.\n");
                 return D3DERR_INVALIDCALL;
             }
-            if (FAILED(hr = d3dx_evaluate_parameter(param->param_eval, &array_idx_param, &array_idx)))
-                return hr;
+            if (update_all || is_param_eval_input_dirty(param->param_eval))
+            {
+                if (FAILED(hr = d3dx_evaluate_parameter(param->param_eval, &array_idx_param, &array_idx)))
+                    return hr;
+            }
+            else
+            {
+                array_idx = state->index;
+            }
+            ref_param = param->referenced_param;
+            TRACE("Array index %u, stored array index %u, element_count %u.\n", array_idx, state->index,
+                    ref_param->element_count);
 
-            param = param->referenced_param;
-            TRACE("Array index %u.\n", array_idx);
-            if (array_idx >= param->element_count)
+            if (array_idx >= ref_param->element_count)
             {
-                ERR("Computed array index %u is out of bound %u.\n", array_idx, param->element_count);
+                ERR("Computed array index %u is out of bound %u.\n", array_idx, ref_param->element_count);
                 return D3DERR_INVALIDCALL;
             }
-            param = &param->members[array_idx];
+            param = &ref_param->members[array_idx];
+            *param_dirty = state->index != array_idx || is_param_dirty(param);
+            state->index = array_idx;
 
             *param_value = param->data;
             *out_param = param;
@@ -2582,7 +2621,13 @@ static HRESULT d3dx9_get_param_value_ptr(struct ID3DXEffectImpl *effect, struct
             {
                 *out_param = param;
                 *param_value = param->data;
-                return d3dx_evaluate_parameter(param->param_eval, param, *param_value);
+                if (update_all || is_param_eval_input_dirty(param->param_eval))
+                {
+                    *param_dirty = TRUE;
+                    return d3dx_evaluate_parameter(param->param_eval, param, *param_value);
+                }
+                else
+                    return D3D_OK;
             }
             else
             {
@@ -2760,10 +2805,10 @@ static HRESULT d3dx_set_shader_const_state(IDirect3DDevice9 *device, enum SHADER
 }
 
 static HRESULT d3dx9_apply_state(struct ID3DXEffectImpl *effect, struct d3dx_pass *pass,
-        struct d3dx_state *state, unsigned int parent_index);
+        struct d3dx_state *state, unsigned int parent_index, BOOL update_all);
 
 static HRESULT d3dx_set_shader_constants(struct ID3DXEffectImpl *effect, struct d3dx_pass *pass,
-        struct d3dx_parameter *param, BOOL vs)
+        struct d3dx_parameter *param, BOOL vs, BOOL update_all)
 {
     IDirect3DDevice9 *device = effect->device;
     HRESULT hr, ret;
@@ -2777,7 +2822,7 @@ static HRESULT d3dx_set_shader_constants(struct ID3DXEffectImpl *effect, struct
         FIXME("param_eval structure is null.\n");
         return D3DERR_INVALIDCALL;
     }
-    if (FAILED(hr = d3dx_param_eval_set_shader_constants(device, param->param_eval)))
+    if (FAILED(hr = d3dx_param_eval_set_shader_constants(device, param->param_eval, update_all)))
         return hr;
     params = param->param_eval->shader_inputs.inputs_param;
     cdesc = param->param_eval->shader_inputs.inputs;
@@ -2795,7 +2840,7 @@ static HRESULT d3dx_set_shader_constants(struct ID3DXEffectImpl *effect, struct
             for (j = 0; j < sampler->state_count; ++j)
             {
                 if (FAILED(hr = d3dx9_apply_state(effect, pass, &sampler->states[j],
-                        cdesc[i].RegisterIndex + (vs ? D3DVERTEXTEXTURESAMPLER0 : 0))))
+                        cdesc[i].RegisterIndex + (vs ? D3DVERTEXTEXTURESAMPLER0 : 0), update_all)))
                     ret = hr;
             }
         }
@@ -2804,17 +2849,30 @@ static HRESULT d3dx_set_shader_constants(struct ID3DXEffectImpl *effect, struct
 }
 
 static HRESULT d3dx9_apply_state(struct ID3DXEffectImpl *effect, struct d3dx_pass *pass,
-        struct d3dx_state *state, unsigned int parent_index)
+        struct d3dx_state *state, unsigned int parent_index, BOOL update_all)
 {
     IDirect3DDevice9 *device = effect->device;
     struct d3dx_parameter *param;
     void *param_value;
+    BOOL param_dirty;
     HRESULT hr;
 
     TRACE("operation %u, index %u, type %u.\n", state->operation, state->index, state->type);
-    if (FAILED(hr = d3dx9_get_param_value_ptr(effect, pass, state, &param_value, &param)))
+    if (FAILED(hr = d3dx9_get_param_value_ptr(effect, pass, state, &param_value, &param,
+            update_all, &param_dirty)))
+    {
         /* Native d3dx returns D3D_OK from BeginPass or Commit involving out of bounds array
-         * access and does not touch affected state. */
+         * access and does not touch affected state, except for BeginPass fails with E_FAIL if
+         * out of bounds array index depends on dirty parameter(s) in BeginPass. The latter case
+         * is TODO. */
+        TRACE("d3dx9_get_param_value_ptr error %#x.\n", hr);
+        return D3D_OK;
+    }
+
+    if (!(update_all || param_dirty
+            || state_table[state->operation].class == SC_VERTEXSHADER
+            || state_table[state->operation].class == SC_PIXELSHADER
+            || state_table[state->operation].class == SC_SETSAMPLER))
         return D3D_OK;
 
     switch (state_table[state->operation].class)
@@ -2851,7 +2909,7 @@ static HRESULT d3dx9_apply_state(struct ID3DXEffectImpl *effect, struct d3dx_pas
             ret = D3D_OK;
             for (i = 0; i < sampler->state_count; i++)
             {
-                if (FAILED(hr = d3dx9_apply_state(effect, pass, &sampler->states[i], state->index)))
+                if (FAILED(hr = d3dx9_apply_state(effect, pass, &sampler->states[i], state->index, update_all)))
                     ret = hr;
             }
             return ret;
@@ -2867,17 +2925,19 @@ static HRESULT d3dx9_apply_state(struct ID3DXEffectImpl *effect, struct d3dx_pas
         }
         case SC_VERTEXSHADER:
             TRACE("%s, shader %p.\n", state_table[state->operation].name, *(IDirect3DVertexShader9 **)param_value);
-            if (FAILED(hr = IDirect3DDevice9_SetVertexShader(device, *(IDirect3DVertexShader9 **)param_value)))
+            if ((update_all || param_dirty)
+                    && FAILED(hr = IDirect3DDevice9_SetVertexShader(device, *(IDirect3DVertexShader9 **)param_value)))
                 ERR("Could not set vertex shader, hr %#x.\n", hr);
             else if (*(IDirect3DVertexShader9 **)param_value)
-                hr = d3dx_set_shader_constants(effect, pass, param, TRUE);
+                hr = d3dx_set_shader_constants(effect, pass, param, TRUE, update_all || param_dirty);
             return hr;
         case SC_PIXELSHADER:
             TRACE("%s, shader %p.\n", state_table[state->operation].name, *(IDirect3DPixelShader9 **)param_value);
-            if (FAILED(hr = IDirect3DDevice9_SetPixelShader(device, *(IDirect3DPixelShader9 **)param_value)))
+            if ((update_all || param_dirty)
+                    && FAILED(hr = IDirect3DDevice9_SetPixelShader(device, *(IDirect3DPixelShader9 **)param_value)))
                 ERR("Could not set pixel shader, hr %#x.\n", hr);
             else if (*(IDirect3DPixelShader9 **)param_value)
-                hr = d3dx_set_shader_constants(effect, pass, param, FALSE);
+                hr = d3dx_set_shader_constants(effect, pass, param, FALSE, update_all || param_dirty);
             return hr;
         case SC_TRANSFORM:
             TRACE("%s, state %u.\n", state_table[state->operation].name, state->index);
@@ -2888,31 +2948,19 @@ static HRESULT d3dx9_apply_state(struct ID3DXEffectImpl *effect, struct d3dx_pas
             return IDirect3DDevice9_LightEnable(device, state->index, *(BOOL *)param_value);
         case SC_LIGHT:
         {
-            D3DLIGHT9 light;
-
             TRACE("%s, index %u, op %u.\n", state_table[state->operation].name, state->index,
                     state_table[state->operation].op);
-            if (FAILED(hr = IDirect3DDevice9_GetLight(device, state->index, &light)))
-            {
-                WARN("Could not get light, hr %#x.\n", hr);
-                memset(&light, 0, sizeof(light));
-            }
-            d3dx9_set_light_parameter(state_table[state->operation].op, &light, param_value);
-            return IDirect3DDevice9_SetLight(device, state->index, &light);
+            d3dx9_set_light_parameter(state_table[state->operation].op,
+                    &pass->current_light[state->index], param_value);
+            return IDirect3DDevice9_SetLight(device, state->index, &pass->current_light[state->index]);
         }
         case SC_MATERIAL:
         {
-            D3DMATERIAL9 material;
-
             TRACE("%s, index %u, op %u.\n", state_table[state->operation].name, state->index,
                     state_table[state->operation].op);
-            if (FAILED(hr = IDirect3DDevice9_GetMaterial(device, &material)))
-            {
-                WARN("Could not get material, hr %#x.\n", hr);
-                memset(&material, 0, sizeof(material));
-            }
-            d3dx9_set_material_parameter(state_table[state->operation].op, &material, param_value);
-            return IDirect3DDevice9_SetMaterial(device, &material);
+            d3dx9_set_material_parameter(state_table[state->operation].op,
+                    &pass->current_material, param_value);
+            return IDirect3DDevice9_SetMaterial(device, &pass->current_material);
         }
         case SC_NPATCHMODE:
             TRACE("%s, nsegments %f.\n", state_table[state->operation].name, *(float *)param_value);
@@ -2929,7 +2977,7 @@ static HRESULT d3dx9_apply_state(struct ID3DXEffectImpl *effect, struct d3dx_pas
     return D3D_OK;
 }
 
-static HRESULT d3dx9_apply_pass_states(struct ID3DXEffectImpl *effect, struct d3dx_pass *pass)
+static HRESULT d3dx9_apply_pass_states(struct ID3DXEffectImpl *effect, struct d3dx_pass *pass, BOOL update_all)
 {
     unsigned int i;
     HRESULT ret;
@@ -2941,12 +2989,13 @@ static HRESULT d3dx9_apply_pass_states(struct ID3DXEffectImpl *effect, struct d3
     {
         HRESULT hr;
 
-        if (FAILED(hr = d3dx9_apply_state(effect, pass, &pass->states[i], ~0u)))
+        if (FAILED(hr = d3dx9_apply_state(effect, pass, &pass->states[i], ~0u, update_all)))
         {
             WARN("Error applying state, hr %#x.\n", hr);
             ret = hr;
         }
     }
+    clear_dirty_all(&effect->base_effect);
     return ret;
 }
 
@@ -3732,7 +3781,7 @@ static HRESULT WINAPI ID3DXEffectImpl_Begin(ID3DXEffect *iface, UINT *passes, DW
                 if (FAILED(hr = IDirect3DDevice9_BeginStateBlock(effect->device)))
                     ERR("BeginStateBlock failed, hr %#x.\n", hr);
                 for (i = 0; i < technique->pass_count; i++)
-                    d3dx9_apply_pass_states(effect, &technique->passes[i]);
+                    d3dx9_apply_pass_states(effect, &technique->passes[i], TRUE);
                 if (FAILED(hr = IDirect3DDevice9_EndStateBlock(effect->device, &technique->saved_state)))
                     ERR("EndStateBlock failed, hr %#x.\n", hr);
             }
@@ -3762,7 +3811,7 @@ static HRESULT WINAPI ID3DXEffectImpl_BeginPass(ID3DXEffect *iface, UINT pass)
     if (technique && pass < technique->pass_count && !effect->active_pass)
     {
         effect->active_pass = &technique->passes[pass];
-        return d3dx9_apply_pass_states(effect, effect->active_pass);
+        return d3dx9_apply_pass_states(effect, effect->active_pass, TRUE);
     }
 
     WARN("Invalid argument supplied.\n");
@@ -3781,8 +3830,7 @@ static HRESULT WINAPI ID3DXEffectImpl_CommitChanges(ID3DXEffect *iface)
         WARN("Called without an active pass.\n");
         return D3D_OK;
     }
-    /* TODO: apply only changed states */
-    return d3dx9_apply_pass_states(effect, effect->active_pass);
+    return d3dx9_apply_pass_states(effect, effect->active_pass, FALSE);
 }
 
 static HRESULT WINAPI ID3DXEffectImpl_EndPass(ID3DXEffect *iface)
diff --git a/dlls/d3dx9_36/preshader.c b/dlls/d3dx9_36/preshader.c
index 7373c41..d55885d 100644
--- a/dlls/d3dx9_36/preshader.c
+++ b/dlls/d3dx9_36/preshader.c
@@ -835,7 +835,7 @@ void d3dx_free_param_eval(struct d3dx_param_eval *peval)
     HeapFree(GetProcessHeap(), 0, peval);
 }
 
-static void set_constants(struct d3dx_regstore *rs, struct d3dx_const_tab *const_tab)
+static void set_constants(struct d3dx_regstore *rs, struct d3dx_const_tab *const_tab, BOOL update_all)
 {
     unsigned int const_idx;
 
@@ -850,6 +850,9 @@ static void set_constants(struct d3dx_regstore *rs, struct d3dx_const_tab *const
         BOOL transpose;
         unsigned int count;
 
+        if (!(update_all || is_param_dirty(param)))
+            continue;
+
         transpose = (const_set->constant_class == D3DXPC_MATRIX_COLUMNS && param->class == D3DXPC_MATRIX_ROWS)
                 || (param->class == D3DXPC_MATRIX_COLUMNS && const_set->constant_class == D3DXPC_MATRIX_ROWS);
         if (const_set->constant_class == D3DXPC_MATRIX_COLUMNS)
@@ -1148,6 +1151,24 @@ static HRESULT execute_preshader(struct d3dx_preshader *pres)
     return D3D_OK;
 }
 
+static BOOL is_const_tab_input_dirty(struct d3dx_const_tab *ctab)
+{
+    unsigned int i;
+
+    for (i = 0; i < ctab->const_set_count; ++i)
+    {
+        if (is_param_dirty(ctab->const_set[i].param))
+            return TRUE;
+    }
+    return FALSE;
+}
+
+BOOL is_param_eval_input_dirty(struct d3dx_param_eval *peval)
+{
+    return is_const_tab_input_dirty(&peval->pres.inputs)
+            || is_const_tab_input_dirty(&peval->shader_inputs);
+}
+
 HRESULT d3dx_evaluate_parameter(struct d3dx_param_eval *peval, const struct d3dx_parameter *param, void *param_value)
 {
     HRESULT hr;
@@ -1157,7 +1178,7 @@ HRESULT d3dx_evaluate_parameter(struct d3dx_param_eval *peval, const struct d3dx
 
     TRACE("peval %p, param %p, param_value %p.\n", peval, param, param_value);
 
-    set_constants(&peval->pres.regs, &peval->pres.inputs);
+    set_constants(&peval->pres.regs, &peval->pres.inputs, TRUE);
 
     if (FAILED(hr = execute_preshader(&peval->pres)))
         return hr;
@@ -1246,7 +1267,8 @@ static HRESULT set_shader_constants_device(struct IDirect3DDevice9 *device, stru
     return result;
 }
 
-HRESULT d3dx_param_eval_set_shader_constants(struct IDirect3DDevice9 *device, struct d3dx_param_eval *peval)
+HRESULT d3dx_param_eval_set_shader_constants(struct IDirect3DDevice9 *device, struct d3dx_param_eval *peval,
+        BOOL update_all)
 {
     static const enum pres_reg_tables set_tables[] =
             {PRES_REGTAB_OCONST, PRES_REGTAB_OICONST, PRES_REGTAB_OBCONST};
@@ -1257,11 +1279,15 @@ HRESULT d3dx_param_eval_set_shader_constants(struct IDirect3DDevice9 *device, st
 
     TRACE("device %p, peval %p, param_type %u.\n", device, peval, peval->param_type);
 
-    set_constants(rs, &pres->inputs);
-    if (FAILED(hr = execute_preshader(pres)))
-        return hr;
+    if (update_all || is_const_tab_input_dirty(&pres->inputs))
+    {
+        set_constants(rs, &pres->inputs, TRUE);
+        if (FAILED(hr = execute_preshader(pres)))
+            return hr;
+        regstore_reset_table(rs, PRES_REGTAB_CONST);
+    }
 
-    set_constants(rs, &peval->shader_inputs);
+    set_constants(rs, &peval->shader_inputs, update_all);
     result = D3D_OK;
     for (i = 0; i < ARRAY_SIZE(set_tables); ++i)
     {
diff --git a/dlls/d3dx9_36/tests/effect.c b/dlls/d3dx9_36/tests/effect.c
index e0fceb43..e81a10d 100644
--- a/dlls/d3dx9_36/tests/effect.c
+++ b/dlls/d3dx9_36/tests/effect.c
@@ -4010,7 +4010,6 @@ static void test_effect_preshader_op_results_(unsigned int line, IDirect3DDevice
         }
         else if (!state_updated[i])
         {
-            todo_wine_if(memcmp(v, empty_v, sizeof(float) * 4))
             ok_(__FILE__, line)(!memcmp(v, empty_v, sizeof(float) * 4),
                     "Parameter %s, test %d, operation %s, state updated unexpectedly.\n",
                     updated_param, i, test_effect_preshader_op_results[i].comment);
@@ -4103,7 +4102,6 @@ got (%g, %g, %g, %g), parameter %s.\n",
             }
             else
             {
-                todo_wine_if(memcmp(&fdata[i], &fvect_empty, sizeof(fdata[i])))
                 ok_(__FILE__, line)(!memcmp(&fdata[i], &fvect_empty, sizeof(fdata[i])),
                         "Vertex shader float constants updated unexpectedly, parameter %s.\n", updated_param);
             }
@@ -4868,11 +4866,9 @@ static void test_effect_commitchanges(IDirect3DDevice9 *device)
     ok(*(float *)&value == 4.0f, "Unexpected fog start %g.\n", *(float *)&value);
     hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_A, &value);
     ok(hr == D3D_OK, "Got result %#x.\n", hr);
-    todo_wine
     ok(*(float *)&value == 9999.0f, "Unexpected point scale A %g.\n", *(float *)&value);
     hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_B, &value);
     ok(hr == D3D_OK, "Got result %#x.\n", hr);
-    todo_wine
     ok(*(float *)&value == 9999.0f, "Unexpected point scale B %g.\n", *(float *)&value);
     test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[8].const_updated,
                 check_vconsts_parameters[8].param_name);
@@ -4903,11 +4899,9 @@ static void test_effect_commitchanges(IDirect3DDevice9 *device)
     ok(hr == D3D_OK, "Got result %#x.\n", hr);
     hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGDENSITY, &value);
     ok(hr == D3D_OK, "Got result %#x.\n", hr);
-    todo_wine
     ok(*(float *)&value == 9999.0f, "Unexpected fog density %g.\n", *(float *)&value);
     hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGSTART, &value);
     ok(hr == D3D_OK, "Got result %#x.\n", hr);
-    todo_wine
     ok(*(float *)&value == 9999.0f, "Unexpected fog start %g.\n", *(float *)&value);
     hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_A, &value);
     ok(hr == D3D_OK, "Got result %#x.\n", hr);
@@ -4942,10 +4936,7 @@ static void test_effect_commitchanges(IDirect3DDevice9 *device)
 
     hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
     ok(hr == D3D_OK, "Got result %#x.\n", hr);
-    todo_wine
     ok(!vshader, "Got non NULL vshader.\n");
-    if (vshader)
-        IDirect3DVertexShader9_Release(vshader);
     test_effect_preshader_compare_vconsts(device, const_no_update,
             "selector g_iVect");
     hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MINFILTER, &value);
@@ -4953,7 +4944,6 @@ static void test_effect_commitchanges(IDirect3DDevice9 *device)
     ok(value == 1, "Unexpected sampler 0 minfilter %u.\n", value);
     hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MAGFILTER, &value);
     ok(hr == D3D_OK, "Got result %#x.\n", hr);
-    todo_wine
     ok(value == 0, "Unexpected sampler 0 minfilter %u.\n", value);
 
     ivect[3] = 2;
@@ -4966,10 +4956,7 @@ static void test_effect_commitchanges(IDirect3DDevice9 *device)
     ok(hr == D3D_OK, "Got result %#x.\n", hr);
     hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
     ok(hr == D3D_OK, "Got result %#x.\n", hr);
-    todo_wine
     ok(!vshader, "Got non NULL vshader.\n");
-    if (vshader)
-        IDirect3DVertexShader9_Release(vshader);
     test_effect_preshader_compare_vconsts(device, const_no_update,
             "selector g_iVect");
     ivect[3] = 2;
-- 
2.9.3




More information about the wine-patches mailing list