From: Józef Kucia jkucia@codeweavers.com
Fixes a regression introduced by fb6b3cc872077e641cf68165e04012a95c94699d.
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/wined3d/surface.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 1824a9854ba6..0be72041cdd5 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -2348,6 +2348,10 @@ BOOL surface_load_renderbuffer(struct wined3d_surface *surface, src_location = WINED3D_LOCATION_RB_RESOLVED; else if (locations & WINED3D_LOCATION_TEXTURE_SRGB) src_location = WINED3D_LOCATION_TEXTURE_SRGB; + else if (locations & WINED3D_LOCATION_TEXTURE_RGB) + src_location = WINED3D_LOCATION_TEXTURE_RGB; + else if (locations & WINED3D_LOCATION_DRAWABLE) + src_location = WINED3D_LOCATION_DRAWABLE; else /* surface_blt_fbo will load the source location if necessary. */ src_location = WINED3D_LOCATION_TEXTURE_RGB;
From: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/d3d9/tests/visual.c | 73 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index 557631cddaee..3686fc678e3b 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -16249,6 +16249,78 @@ done: DestroyWindow(window); }
+static void test_multisample_get_front_buffer_data(void) +{ + IDirect3DSwapChain9 *swapchain; + D3DPRESENT_PARAMETERS d3dpp; + IDirect3DSurface9 *readback; + IDirect3DTexture9 *texture; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; + HWND window; + DWORD color; + HRESULT hr; + + window = create_window(); + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create D3D object.\n"); + if (FAILED(IDirect3D9_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_A8R8G8B8, TRUE, D3DMULTISAMPLE_2_SAMPLES, NULL))) + { + skip("Multisampling not supported for D3DFMT_A8R8G8B8.\n"); + goto done; + } + if (!(device = create_device(d3d, window, window, FALSE))) + { + skip("Failed to create D3D device.\n"); + goto done; + } + + hr = IDirect3DDevice9_GetSwapChain(device, 0, &swapchain); + ok(hr == D3D_OK, "Failed to get the implicit swapchain, hr %#x.\n", hr); + hr = IDirect3DSwapChain9_GetPresentParameters(swapchain, &d3dpp); + ok(hr == D3D_OK, "Failed to get present parameters, hr %#x.\n", hr); + IDirect3DSwapChain9_Release(swapchain); + d3dpp.MultiSampleType = D3DMULTISAMPLE_2_SAMPLES; + d3dpp.MultiSampleQuality = 0; + hr = IDirect3DDevice9_Reset(device, &d3dpp); + ok(hr == D3D_OK, "Failed to reset device, hr %#x.\n", hr); + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x00f0ff0f, 0.0, 0); + ok(SUCCEEDED(hr), "Failed to clear render target, hr %#x.\n", hr); + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); + + hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 640, 480, D3DFMT_A8R8G8B8, + D3DPOOL_SYSTEMMEM, &readback, NULL); + ok(SUCCEEDED(hr), "Failed to create readback surface, hr %#x.\n", hr); + hr = IDirect3DDevice9_GetFrontBufferData(device, 0, readback); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + color = getPixelColorFromSurface(readback, 320, 240); + ok(color == 0x00f0ff0f, "Got unexpected color 0x%08x.\n", color); + IDirect3DSurface9_Release(readback); + + hr = IDirect3DDevice9_CreateTexture(device, 640, 480, 1, + 0, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &texture, NULL); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + + hr = IDirect3DTexture9_GetSurfaceLevel(texture, 0, &readback); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + hr = IDirect3DDevice9_GetFrontBufferData(device, 0, readback); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + color = getPixelColorFromSurface(readback, 320, 240); + ok(color == 0x00f0ff0f, "Got unexpected color 0x%08x.\n", color); + IDirect3DSurface9_Release(readback); + IDirect3DTexture9_Release(texture); + + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); +} + static void multisampled_depth_buffer_test(void) { IDirect3DDevice9 *device = 0; @@ -23839,6 +23911,7 @@ START_TEST(visual) srgbwrite_format_test(); update_surface_test(); multisample_get_rtdata_test(); + test_multisample_get_front_buffer_data(); zenable_test(); fog_special_test(); volume_srgb_test();
Hi,
While running your changed tests on Windows, 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=36515
Your paranoid android.
=== w8 (32 bit visual) === visual.c:8493: Test failed: Got unexpected color 0x00008080 for quad 2 (different colors).