From: Connor McAdams cmcadams@codeweavers.com
Tests show that nothing is written to multisampled destination surfaces, so just return success early.
Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/d3dx9_36/surface.c | 6 ++++++ dlls/d3dx9_36/tests/surface.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 344a491765e..62ca72de665 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -2174,6 +2174,12 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface, }
IDirect3DSurface9_GetDesc(dst_surface, &surfdesc); + if (surfdesc.MultiSampleType != D3DMULTISAMPLE_NONE) + { + TRACE("Multisampled destination surface, doing nothing.\n"); + return D3D_OK; + } + destformatdesc = get_format_info(surfdesc.Format); if (!dst_rect) { diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index 44f5b2d2cad..cd31a024f73 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -945,7 +945,7 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device) /* D3DXLoadSurfaceFromMemory should return success with a multisampled render target. */ SetRect(&rect, 0, 0, 2, 2); hr = D3DXLoadSurfaceFromMemory(newsurf, NULL, &rect, pixdata_a8r8g8b8, D3DFMT_A8R8G8B8, 8, NULL, &rect, D3DX_FILTER_NONE, 0); - todo_wine ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
/* The call succeeds, but the surface isn't actually written to. */ get_surface_readback(device, newsurf, D3DFMT_A8R8G8B8, &surface_rb); @@ -986,7 +986,7 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
/* Contents of the multisampled surface are preserved. */ hr = D3DXLoadSurfaceFromMemory(newsurf, NULL, NULL, pixdata, D3DFMT_A8R8G8B8, 8, NULL, &rect, D3DX_FILTER_POINT, 0); - todo_wine ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
get_surface_readback(device, newsurf, D3DFMT_A8R8G8B8, &surface_rb); check_readback_pixel_4bpp(&surface_rb, 0, 0, pixdata_a8r8g8b8[0], TRUE);