Commit 1567329f authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Only create back-buffer views for swapchains with WINED3DUSAGE_RENDERTARGET set.

Since without it the view wouldn't be usable. Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 7d16575d
......@@ -1077,7 +1077,7 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
goto err_out;
}
if (swapchain_desc->backbuffer_count)
if (swapchain_desc->backbuffer_count && swapchain_desc->backbuffer_usage & WINED3DUSAGE_RENDERTARGET)
{
struct wined3d_resource *back_buffer = &swapchain->back_buffers[0]->resource;
struct wined3d_view_desc view_desc;
......@@ -1113,7 +1113,7 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
TRACE("All defaults now set up.\n");
/* Clear the screen */
if (swapchain->back_buffers && swapchain->back_buffers[0])
if (device->back_buffer_view)
clear_flags |= WINED3DCLEAR_TARGET;
if (swapchain_desc->enable_auto_depth_stencil)
clear_flags |= WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL;
......@@ -4893,7 +4893,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
wined3d_rendertarget_view_decref(device->back_buffer_view);
device->back_buffer_view = NULL;
}
if (swapchain->desc.backbuffer_count)
if (swapchain->desc.backbuffer_count && swapchain->desc.backbuffer_usage & WINED3DUSAGE_RENDERTARGET)
{
struct wined3d_resource *back_buffer = &swapchain->back_buffers[0]->resource;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment