Commit 1ac6cfca authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Use wined3d_rendertarget_view_create() in wined3d_device_reset().

parent f1898abd
......@@ -4606,6 +4606,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
const struct wined3d_swapchain_desc *swapchain_desc, const struct wined3d_display_mode *mode,
wined3d_device_reset_cb callback, BOOL reset_state)
{
struct wined3d_rendertarget_view_desc view_desc;
struct wined3d_resource *resource, *cursor;
struct wined3d_swapchain *swapchain;
struct wined3d_display_mode m;
......@@ -4798,7 +4799,6 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
{
struct wined3d_resource_desc texture_desc;
struct wined3d_texture *texture;
struct wined3d_rendertarget_view_desc view_desc;
TRACE("Creating the depth stencil buffer\n");
......@@ -4841,13 +4841,19 @@ 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 && FAILED(hr = wined3d_rendertarget_view_create_from_surface(
surface_from_resource(wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)),
if (swapchain->desc.backbuffer_count)
{
view_desc.format_id = swapchain_desc->backbuffer_format;
view_desc.u.texture.level_idx = 0;
view_desc.u.texture.layer_idx = 0;
view_desc.u.texture.layer_count = 1;
if (FAILED(hr = wined3d_rendertarget_view_create(&view_desc, &swapchain->back_buffers[0]->resource,
NULL, &wined3d_null_parent_ops, &device->back_buffer_view)))
{
ERR("Failed to create rendertarget view, hr %#x.\n", hr);
return hr;
}
}
wine_rb_clear(&device->samplers, device_free_sampler, NULL);
......
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