Paul Gofman : ddraw: Do not modify any states for _TEXTUREMAPBLEND if application sets the same value.

Alexandre Julliard julliard at winehq.org
Fri Jun 21 16:44:16 CDT 2019


Module: wine
Branch: master
Commit: 6978db2940363c0b6e42206159dca8e520316375
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=6978db2940363c0b6e42206159dca8e520316375

Author: Paul Gofman <gofmanp at gmail.com>
Date:   Tue Jun 18 20:52:26 2019 +0300

ddraw: Do not modify any states for _TEXTUREMAPBLEND if application sets the same value.

Signed-off-by: Paul Gofman <gofmanp at gmail.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ddraw/device.c       | 8 ++++++++
 dlls/ddraw/tests/ddraw4.c | 4 ++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
index ef940d7..cdf4de8 100644
--- a/dlls/ddraw/device.c
+++ b/dlls/ddraw/device.c
@@ -2723,6 +2723,14 @@ static HRESULT WINAPI d3d_device3_SetRenderState(IDirect3DDevice3 *iface,
 
         case D3DRENDERSTATE_TEXTUREMAPBLEND:
         {
+            if (value == device->texture_map_blend)
+            {
+                TRACE("Application is setting the same value over, nothing to do.\n");
+
+                hr = D3D_OK;
+                break;
+            }
+
             device->legacyTextureBlending = TRUE;
 
             switch (value)
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
index 3498ddb..6a8ecde 100644
--- a/dlls/ddraw/tests/ddraw4.c
+++ b/dlls/ddraw/tests/ddraw4.c
@@ -9689,13 +9689,13 @@ static void test_texturemapblend(void)
     ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
 
     color = get_surface_color(rt, 5, 5);
-    todo_wine ok(compare_color(color, 0x000000ff, 2), "Got unexpected color 0x%08x.\n", color);
+    ok(compare_color(color, 0x000000ff, 2), "Got unexpected color 0x%08x.\n", color);
     color = get_surface_color(rt, 400, 5);
     ok(compare_color(color, 0x000000ff, 2), "Got unexpected color 0x%08x.\n", color);
     color = get_surface_color(rt, 5, 245);
     ok(compare_color(color, 0x00000080, 2), "Got unexpected color 0x%08x.\n", color);
     color = get_surface_color(rt, 400, 245);
-    todo_wine ok(compare_color(color, 0x00000080, 2), "Got unexpected color 0x%08x.\n", color);
+    ok(compare_color(color, 0x00000080, 2), "Got unexpected color 0x%08x.\n", color);
 
     /* Turn legacy texture blending on again. */
     hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_ADD);




More information about the wine-cvs mailing list