Fixes 1 of 2 issues discussed in https://bugs.winehq.org/show_bug.cgi?id=39080.
Signed-off-by: Paul Gofman gofmanp@gmail.com --- dlls/wined3d/context.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 37203738fe..c7eb7849fc 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -599,7 +599,8 @@ static struct fbo_entry *context_find_fbo_entry(struct wined3d_context *context, depth_stencil = &ds_null; } else if (ds_texture->resource.multisample_type != rt_texture->resource.multisample_type - || ds_texture->resource.multisample_quality != rt_texture->resource.multisample_quality) + || (ds_texture->resource.multisample_type + && ds_texture->resource.multisample_quality != rt_texture->resource.multisample_quality)) { WARN("Color multisample type %u and quality %u, depth stencil has %u and %u, disabling ds buffer.\n", rt_texture->resource.multisample_type, rt_texture->resource.multisample_quality,
Signed-off-by: Paul Gofman gofmanp@gmail.com --- dlls/d3d9/tests/visual.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index f999ea99cd..bd3b8bc79d 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -20149,6 +20149,33 @@ static void test_multisample_mismatch(void) hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr);
+ /* Draw with both buffers single sampled but multisample quality set to 1 for depth buffer. + * The difference in multisample quality parameter is ignored. */ + IDirect3DSurface9_Release(ds); + hr = IDirect3DDevice9_CreateDepthStencilSurface(device, 640, 480, D3DFMT_D24X8, + D3DMULTISAMPLE_NONE, 1, FALSE, &ds, NULL); + ok(SUCCEEDED(hr), "Failed to create depth/stencil, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderTarget(device, 0, rt); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetDepthStencilSurface(device, ds); + ok(SUCCEEDED(hr), "Failed to set depth stencil surface, hr %#x.\n", hr); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x0000ff00, 0.5f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, D3DZB_TRUE); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + color = getPixelColor(device, 62, 240); + ok(color_match(color, 0x000000ff, 1), "Got unexpected color 0x%08x.\n", color); + color = getPixelColor(device, 322, 240); + ok(color_match(color, 0x0000ff00, 1), "Got unexpected color 0x%08x.\n", color); + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); + IDirect3DSurface9_Release(rt); IDirect3DSurface9_Release(ds); IDirect3DSurface9_Release(rt_multi);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com