diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 506961a215b..e7577d70786 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -207,6 +207,7 @@ static BOOL wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapch swapchain_desc->backbuffer_height = present_parameters->BackBufferHeight; swapchain_desc->backbuffer_format = wined3dformat_from_d3dformat(present_parameters->BackBufferFormat); swapchain_desc->backbuffer_count = max(1, present_parameters->BackBufferCount); + swapchain_desc->backbuffer_usage = WINED3DUSAGE_RENDERTARGET; swapchain_desc->multisample_type = present_parameters->MultiSampleType; swapchain_desc->multisample_quality = 0; /* d3d9 only */ swapchain_desc->swap_effect = present_parameters->SwapEffect; diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 51b4896353d..0a76227f6dd 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -229,6 +229,7 @@ static BOOL wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapch swapchain_desc->backbuffer_height = present_parameters->BackBufferHeight; swapchain_desc->backbuffer_format = wined3dformat_from_d3dformat(present_parameters->BackBufferFormat); swapchain_desc->backbuffer_count = max(1, present_parameters->BackBufferCount); + swapchain_desc->backbuffer_usage = WINED3DUSAGE_RENDERTARGET; swapchain_desc->multisample_type = present_parameters->MultiSampleType; swapchain_desc->multisample_quality = present_parameters->MultiSampleQuality; swapchain_desc->swap_effect = present_parameters->SwapEffect; @@ -817,7 +818,6 @@ static HRESULT d3d9_device_reset(struct d3d9_device *device, struct wined3d_display_mode wined3d_mode; HRESULT hr; - if (!extended && device->device_state == D3D9_DEVICE_STATE_LOST) { WARN("App not active, returning D3DERR_DEVICELOST.\n"); diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 27be401a2e5..5d1db804dc4 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -630,6 +630,7 @@ static HRESULT ddraw_create_swapchain(struct ddraw *ddraw, HWND window, BOOL win swapchain_desc.backbuffer_width = mode.width; swapchain_desc.backbuffer_height = mode.height; swapchain_desc.backbuffer_format = mode.format_id; + swapchain_desc.backbuffer_usage = WINED3DUSAGE_RENDERTARGET; swapchain_desc.swap_effect = WINED3D_SWAP_EFFECT_COPY; swapchain_desc.device_window = window; swapchain_desc.windowed = windowed; diff --git a/dlls/dxgi/factory.c b/dlls/dxgi/factory.c index f38d67ccff6..0020917ca69 100644 --- a/dlls/dxgi/factory.c +++ b/dlls/dxgi/factory.c @@ -313,6 +313,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChainForHwnd(IDXGIFactor wined3d_desc.backbuffer_height = swapchain_desc->Height; wined3d_desc.backbuffer_format = wined3dformat_from_dxgi_format(swapchain_desc->Format); wined3d_desc.backbuffer_count = swapchain_desc->BufferCount; + wined3d_desc.backbuffer_usage = WINED3DUSAGE_RENDERTARGET; wined3d_sample_desc_from_dxgi(&wined3d_desc.multisample_type, &wined3d_desc.multisample_quality, &swapchain_desc->SampleDesc); wined3d_desc.swap_effect = WINED3D_SWAP_EFFECT_DISCARD; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index a25b98d7496..5bd8804c17d 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4732,6 +4732,9 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, TRACE("swap_interval %u\n", swapchain_desc->swap_interval); TRACE("auto_restore_display_mode %#x\n", swapchain_desc->auto_restore_display_mode); + if (swapchain_desc->backbuffer_usage != WINED3DUSAGE_RENDERTARGET) + FIXME("Got unexpected backbuffer usage %#x.\n", swapchain_desc->backbuffer_usage); + /* No special treatment of these parameters. Just store them */ swapchain->desc.swap_effect = swapchain_desc->swap_effect; swapchain->desc.enable_auto_depth_stencil = swapchain_desc->enable_auto_depth_stencil; diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index dd3655f61c4..f73931301cc 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -920,7 +920,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3 goto err; } - texture_desc.usage |= WINED3DUSAGE_RENDERTARGET; + texture_desc.usage = swapchain->desc.backbuffer_usage; for (i = 0; i < swapchain->desc.backbuffer_count; ++i) { TRACE("Creating back buffer %u.\n", i); diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index a519e94bb30..8c274926e0a 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -1712,6 +1712,7 @@ struct wined3d_swapchain_desc UINT backbuffer_height; enum wined3d_format_id backbuffer_format; UINT backbuffer_count; + DWORD backbuffer_usage; enum wined3d_multisample_type multisample_type; DWORD multisample_quality; enum wined3d_swap_effect swap_effect;