Signed-off-by: Paul Gofman gofmanp@gmail.com --- dlls/ddraw/ddraw_private.h | 1 + dlls/ddraw/device.c | 73 +++++--------------------------------- dlls/ddraw/tests/ddraw4.c | 5 +++ 3 files changed, 14 insertions(+), 65 deletions(-)
diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h index b08f66564c..9e98d81c8e 100644 --- a/dlls/ddraw/ddraw_private.h +++ b/dlls/ddraw/ddraw_private.h @@ -327,6 +327,7 @@ struct d3d_device
/* Required to keep track which of two available texture blending modes in d3ddevice3 is used */ BOOL legacyTextureBlending; + D3DTEXTUREBLEND texture_map_blend;
D3DMATRIX legacy_projection; D3DMATRIX legacy_clipspace; diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index ac4da191a2..2de9941249 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -2463,62 +2463,7 @@ static HRESULT WINAPI d3d_device3_GetRenderState(IDirect3DDevice3 *iface,
case D3DRENDERSTATE_TEXTUREMAPBLEND: { - /* D3DRENDERSTATE_TEXTUREMAPBLEND is mapped to texture state stages in SetRenderState; reverse - the mapping to get the value. */ - DWORD colorop, colorarg1, colorarg2; - DWORD alphaop, alphaarg1, alphaarg2; - - wined3d_mutex_lock(); - - device->legacyTextureBlending = TRUE; - - colorop = wined3d_device_get_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_COLOR_OP); - colorarg1 = wined3d_device_get_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_COLOR_ARG1); - colorarg2 = wined3d_device_get_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_COLOR_ARG2); - alphaop = wined3d_device_get_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_ALPHA_OP); - alphaarg1 = wined3d_device_get_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_ALPHA_ARG1); - alphaarg2 = wined3d_device_get_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_ALPHA_ARG2); - - if (colorop == WINED3D_TOP_SELECT_ARG1 && colorarg1 == WINED3DTA_TEXTURE - && alphaop == WINED3D_TOP_SELECT_ARG1 && alphaarg1 == WINED3DTA_TEXTURE) - *value = D3DTBLEND_DECAL; - else if (colorop == WINED3D_TOP_SELECT_ARG1 && colorarg1 == WINED3DTA_TEXTURE - && alphaop == WINED3D_TOP_MODULATE - && alphaarg1 == WINED3DTA_TEXTURE && alphaarg2 == WINED3DTA_CURRENT) - *value = D3DTBLEND_DECALALPHA; - else if (colorop == WINED3D_TOP_MODULATE - && colorarg1 == WINED3DTA_TEXTURE && colorarg2 == WINED3DTA_CURRENT - && alphaop == WINED3D_TOP_MODULATE - && alphaarg1 == WINED3DTA_TEXTURE && alphaarg2 == WINED3DTA_CURRENT) - *value = D3DTBLEND_MODULATEALPHA; - else - { - struct wined3d_texture *tex = NULL; - BOOL tex_alpha = FALSE; - DDPIXELFORMAT ddfmt; - - if ((tex = wined3d_device_get_texture(device->wined3d_device, 0))) - { - struct wined3d_resource_desc desc; - - wined3d_resource_get_desc(wined3d_texture_get_resource(tex), &desc); - ddfmt.dwSize = sizeof(ddfmt); - ddrawformat_from_wined3dformat(&ddfmt, desc.format); - if (ddfmt.u5.dwRGBAlphaBitMask) - tex_alpha = TRUE; - } - - if (!(colorop == WINED3D_TOP_MODULATE - && colorarg1 == WINED3DTA_TEXTURE && colorarg2 == WINED3DTA_CURRENT - && alphaop == (tex_alpha ? WINED3D_TOP_SELECT_ARG1 : WINED3D_TOP_SELECT_ARG2) - && alphaarg1 == WINED3DTA_TEXTURE && alphaarg2 == WINED3DTA_CURRENT)) - ERR("Unexpected texture stage state setup, returning D3DTBLEND_MODULATE - likely erroneous.\n"); - - *value = D3DTBLEND_MODULATE; - } - - wined3d_mutex_unlock(); - + *value = device->texture_map_blend; return D3D_OK; }
@@ -2738,8 +2683,7 @@ static HRESULT WINAPI d3d_device3_SetRenderState(IDirect3DDevice3 *iface, in device - TRUE if the app is using TEXTUREMAPBLEND.
Tests show that setting TEXTUREMAPBLEND on native doesn't seem to change values returned by - GetTextureStageState and vice versa. Not so on Wine, but it is 'undefined' anyway so, probably, ok, - unless some broken game will be found that cares. */ + GetTextureStageState and vice versa. */
struct d3d_device *device = impl_from_IDirect3DDevice3(iface); HRESULT hr; @@ -2877,7 +2821,7 @@ static HRESULT WINAPI d3d_device3_SetRenderState(IDirect3DDevice3 *iface, default: FIXME("Unhandled texture environment %#x.\n", value); } - + device->texture_map_blend = value; hr = D3D_OK; break; } @@ -4948,19 +4892,15 @@ static HRESULT WINAPI d3d_device3_SetTexture(IDirect3DDevice3 *iface, { struct d3d_device *device = impl_from_IDirect3DDevice3(iface); struct ddraw_surface *tex = unsafe_impl_from_IDirect3DTexture2(texture); - DWORD texmapblend; HRESULT hr;
TRACE("iface %p, stage %u, texture %p.\n", iface, stage, texture);
wined3d_mutex_lock();
- if (device->legacyTextureBlending) - IDirect3DDevice3_GetRenderState(iface, D3DRENDERSTATE_TEXTUREMAPBLEND, &texmapblend); - hr = IDirect3DDevice7_SetTexture(&device->IDirect3DDevice7_iface, stage, &tex->IDirectDrawSurface7_iface);
- if (device->legacyTextureBlending && texmapblend == D3DTBLEND_MODULATE) + if (device->legacyTextureBlending && device->texture_map_blend == D3DTBLEND_MODULATE) { /* This fixup is required by the way D3DTBLEND_MODULATE maps to texture stage states. See d3d_device3_SetRenderState() for details. */ @@ -7131,8 +7071,11 @@ static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw, else if (version == 2) wined3d_device_set_render_state(ddraw->wined3d_device, WINED3D_RS_SPECULARENABLE, TRUE); if (version < 7) + { wined3d_device_set_render_state(ddraw->wined3d_device, WINED3D_RS_NORMALIZENORMALS, TRUE); - + IDirect3DDevice3_SetRenderState(&device->IDirect3DDevice3_iface, + D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_MODULATE); + } return D3D_OK; }
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index 7822bbaaf1..d12b0f015a 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -9500,6 +9500,7 @@ static void test_texturemapblend(void) DDSURFACEDESC2 surface_desc; IDirect3DTexture2 *texture; IDirect3DDevice3 *device; + DWORD texturemapblend; IDirectDraw4 *ddraw; IDirect3D3 *d3d; DDCOLORKEY ckey; @@ -9557,6 +9558,10 @@ static void test_texturemapblend(void) hr = IDirect3DDevice3_SetCurrentViewport(device, viewport); ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#x.\n", hr);
+ hr = IDirect3DDevice3_GetRenderState(device, D3DRENDERSTATE_TEXTUREMAPBLEND, &texturemapblend); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(texturemapblend == D3DTBLEND_MODULATE, "Got unexpected texture map blend %#x.\n", texturemapblend); + /* Test alpha with DDPF_ALPHAPIXELS texture - should be taken from texture * alpha channel. *
Signed-off-by: Paul Gofman gofmanp@gmail.com --- dlls/ddraw/device.c | 16 ++++++ dlls/ddraw/tests/ddraw4.c | 112 ++++++++++++++++++++++++++++++++++---- 2 files changed, 116 insertions(+), 12 deletions(-)
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index 2de9941249..3d7aca538b 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -5244,10 +5244,26 @@ static HRESULT WINAPI d3d_device3_SetTextureStageState(IDirect3DDevice3 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD value) { struct d3d_device *device = impl_from_IDirect3DDevice3(iface); + DWORD old_value; + HRESULT hr;
TRACE("iface %p, stage %u, state %#x, value %#x.\n", iface, stage, state, value);
+ /* Tests show that legacy texture blending is not reset if the texture stage state + * value is unchanged. */ + if (FAILED(hr = IDirect3DDevice7_GetTextureStageState(&device->IDirect3DDevice7_iface, + stage, state, &old_value))) + return hr; + + if (old_value == value) + { + TRACE("Application is setting the same value over, nothing to do.\n"); + return D3D_OK; + } + + device->legacyTextureBlending = FALSE; + return IDirect3DDevice7_SetTextureStageState(&device->IDirect3DDevice7_iface, stage, state, value); }
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index d12b0f015a..e5614f9b7f 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -9596,38 +9596,126 @@ static void test_texturemapblend(void) fx.dwSize = sizeof(fx); U5(fx).dwFillColor = 0xff0000ff; hr = IDirectDrawSurface4_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Failed to clear texture, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); U5(fx).dwFillColor = 0x800000ff; hr = IDirectDrawSurface4_Blt(surface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Failed to clear texture, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
/* Note that the ddraw1 version of this test runs tests 1-3 with * D3DRENDERSTATE_COLORKEYENABLE enabled, whereas this version only runs * test 4 with color keying on. Because no color key is set on the texture * this should not result in different behavior. */ hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_CULLMODE, D3DCULL_NONE); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_ZENABLE, D3DZB_FALSE); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_SRCBLEND, D3DBLEND_SRCALPHA); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_DESTBLEND, D3DBLEND_INVSRCALPHA); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_ALPHABLENDENABLE, TRUE); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_MODULATE); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + /* Texture stage state does not change so legacy texture blending stays enabled. */ + hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_MODULATE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice3_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &test1_quads[0], 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &test1_quads[4], 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice3_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + color = get_surface_color(rt, 5, 5); + ok(compare_color(color, 0x00000080, 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); + ok(compare_color(color, 0x000000ff, 2), "Got unexpected color 0x%08x.\n", color); + + /* Turn legacy texture blending off. */ + hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG2); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_SetTexture(device, 0, texture); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DViewport3_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_BeginScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, + D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &test1_quads[0], 4, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, + D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &test1_quads[4], 4, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_EndScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + color = get_surface_color(rt, 5, 5); + 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); + ok(compare_color(color, 0x00000080, 2), "Got unexpected color 0x%08x.\n", color); + + /* This doesn't turn legacy texture blending on again, as setting the same + * _TEXTUREMAPBLEND value. */ + hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_MODULATE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_SetTexture(device, 0, texture); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DViewport3_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_BeginScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, + D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &test1_quads[0], 4, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, + D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &test1_quads[4], 4, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_EndScene(device); + 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); + 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); + + /* Turn legacy texture blending on again. */ + hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_ADD); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_MODULATE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_SetTexture(device, 0, texture); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DViewport3_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_BeginScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, + D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &test1_quads[0], 4, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, + D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &test1_quads[4], 4, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_EndScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
color = get_surface_color(rt, 5, 5); ok(compare_color(color, 0x00000080, 2), "Got unexpected color 0x%08x.\n", color);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=53848
Your paranoid android.
=== wvistau64 (32 bit report) ===
ddraw: ddraw4.c:3066: Test failed: Expected message 0x46, but didn't receive it. ddraw4.c:3068: Test failed: Expected screen size 1024x768, got 0x0. ddraw4.c:3074: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3104: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3111: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3137: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3160: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3182: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3208: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3228: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3264: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3274: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3300: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3323: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3345: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3371: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3391: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3428: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746).
=== debian9 (32 bit Chinese:China report) ===
ddraw: ddraw7.c:2597: Test failed: Expected message 0x46, but didn't receive it. ddraw7.c:2599: Test failed: Expected screen size 1920x1200, got 0x0. ddraw7.c:2604: Test failed: Expected (0,0)-(1920,1200), got (0,0)-(1920,1080).
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Paul Gofman gofmanp@gmail.com --- 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 3d7aca538b..e07fe007f0 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -2725,6 +2725,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 e5614f9b7f..6121f4f2c1 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);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=53849
Your paranoid android.
=== wvistau64_zh_CN (32 bit report) ===
ddraw: ddraw4.c:3066: Test failed: Expected message 0x46, but didn't receive it. ddraw4.c:3068: Test failed: Expected screen size 1024x768, got 0x0. ddraw4.c:3074: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,745). ddraw4.c:3104: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,745). ddraw4.c:3111: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,745). ddraw4.c:3137: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,745). ddraw4.c:3160: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,745). ddraw4.c:3182: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,745). ddraw4.c:3208: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,745). ddraw4.c:3228: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,745). ddraw4.c:3264: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,745). ddraw4.c:3274: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,745). ddraw4.c:3300: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,745). ddraw4.c:3323: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,745). ddraw4.c:3345: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,745). ddraw4.c:3371: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,745). ddraw4.c:3391: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,745). ddraw4.c:3428: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,745).
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=53847
Your paranoid android.
=== debian9 (32 bit French report) ===
ddraw: ddraw4.c:2943: Test failed: Expected message 0x46, but didn't receive it. ddraw4.c:2945: Test failed: Expected screen size 1920x1200, got 0x0. ddraw4.c:2950: Test failed: Expected (0,0)-(1920,1200), got (0,0)-(1920,1080).