Module: wine Branch: master Commit: 3ccac1a71f1650456b389408486f212c4635d919 URL: http://source.winehq.org/git/wine.git/?a=commit;h=3ccac1a71f1650456b38940848...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Tue Apr 14 10:16:02 2015 +0200
d3d9: Update the backbuffer D3DPRESENT_PARAMETERS after a successful reset.
---
dlls/d3d9/device.c | 13 +++++++++++++ dlls/d3d9/tests/d3d9ex.c | 6 +++--- dlls/d3d9/tests/device.c | 6 +++--- 3 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 97c71bb..0b1a77a 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -667,9 +667,22 @@ static HRESULT d3d9_device_reset(struct d3d9_device *device, wined3d_swapchain_desc_from_present_parameters(&swapchain_desc, present_parameters); if (SUCCEEDED(hr = wined3d_device_reset(device->wined3d_device, &swapchain_desc, mode ? &wined3d_mode : NULL, reset_enum_callback, !device->d3d_parent->extended))) + { + struct wined3d_swapchain *wined3d_swapchain; + + wined3d_swapchain = wined3d_device_get_swapchain(device->wined3d_device, 0); + wined3d_swapchain_get_desc(wined3d_swapchain, &swapchain_desc); + present_parameters->BackBufferWidth = swapchain_desc.backbuffer_width; + present_parameters->BackBufferHeight = swapchain_desc.backbuffer_height; + present_parameters->BackBufferFormat = d3dformat_from_wined3dformat(swapchain_desc.backbuffer_format); + present_parameters->BackBufferCount = swapchain_desc.backbuffer_count; + device->device_state = D3D9_DEVICE_STATE_OK; + } else if (!device->d3d_parent->extended) + { device->device_state = D3D9_DEVICE_STATE_NOT_RESET; + }
wined3d_mutex_unlock();
diff --git a/dlls/d3d9/tests/d3d9ex.c b/dlls/d3d9/tests/d3d9ex.c index bd956b6..6118ce9 100644 --- a/dlls/d3d9/tests/d3d9ex.c +++ b/dlls/d3d9/tests/d3d9ex.c @@ -1062,11 +1062,11 @@ static void test_reset(void) hr = IDirect3DDevice9Ex_TestCooperativeLevel(device); ok(hr == D3D_OK, "Got unexpected cooperative level %#x.\n", hr);
- todo_wine ok(d3dpp.BackBufferWidth == 200, "Got unexpected BackBufferWidth %u.\n", d3dpp.BackBufferWidth); - todo_wine ok(d3dpp.BackBufferHeight == 150, "Got unexpected BackBufferHeight %u.\n", d3dpp.BackBufferHeight); + ok(d3dpp.BackBufferWidth == 200, "Got unexpected BackBufferWidth %u.\n", d3dpp.BackBufferWidth); + ok(d3dpp.BackBufferHeight == 150, "Got unexpected BackBufferHeight %u.\n", d3dpp.BackBufferHeight); todo_wine ok(d3dpp.BackBufferFormat == d3ddm.Format, "Got unexpected BackBufferFormat %#x, expected %#x.\n", d3dpp.BackBufferFormat, d3ddm.Format); - todo_wine ok(d3dpp.BackBufferCount == 1, "Got unexpected BackBufferCount %u.\n", d3dpp.BackBufferCount); + ok(d3dpp.BackBufferCount == 1, "Got unexpected BackBufferCount %u.\n", d3dpp.BackBufferCount); ok(!d3dpp.MultiSampleType, "Got unexpected MultiSampleType %u.\n", d3dpp.MultiSampleType); ok(!d3dpp.MultiSampleQuality, "Got unexpected MultiSampleQuality %u.\n", d3dpp.MultiSampleQuality); ok(d3dpp.SwapEffect == D3DSWAPEFFECT_DISCARD, "Got unexpected SwapEffect %#x.\n", d3dpp.SwapEffect); diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 9ecbae0..174fc13 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -1867,11 +1867,11 @@ static void test_reset(void) hr = IDirect3DDevice9_TestCooperativeLevel(device1); ok(hr == D3D_OK, "IDirect3DDevice9_TestCooperativeLevel after a successful reset returned %#x\n", hr);
- todo_wine ok(d3dpp.BackBufferWidth == 200, "Got unexpected BackBufferWidth %u.\n", d3dpp.BackBufferWidth); - todo_wine ok(d3dpp.BackBufferHeight == 150, "Got unexpected BackBufferHeight %u.\n", d3dpp.BackBufferHeight); + ok(d3dpp.BackBufferWidth == 200, "Got unexpected BackBufferWidth %u.\n", d3dpp.BackBufferWidth); + ok(d3dpp.BackBufferHeight == 150, "Got unexpected BackBufferHeight %u.\n", d3dpp.BackBufferHeight); todo_wine ok(d3dpp.BackBufferFormat == d3ddm.Format, "Got unexpected BackBufferFormat %#x, expected %#x.\n", d3dpp.BackBufferFormat, d3ddm.Format); - todo_wine ok(d3dpp.BackBufferCount == 1, "Got unexpected BackBufferCount %u.\n", d3dpp.BackBufferCount); + ok(d3dpp.BackBufferCount == 1, "Got unexpected BackBufferCount %u.\n", d3dpp.BackBufferCount); ok(!d3dpp.MultiSampleType, "Got unexpected MultiSampleType %u.\n", d3dpp.MultiSampleType); ok(!d3dpp.MultiSampleQuality, "Got unexpected MultiSampleQuality %u.\n", d3dpp.MultiSampleQuality); ok(d3dpp.SwapEffect == D3DSWAPEFFECT_DISCARD, "Got unexpected SwapEffect %#x.\n", d3dpp.SwapEffect);