Commit f36eea56 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Avoid calling wined3d_rendertarget_view_create() with WINED3DFMT_UNKNOWN.

parent 8a69c5d8
......@@ -1041,13 +1041,14 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
if (swapchain_desc->backbuffer_count)
{
struct wined3d_resource *back_buffer = &swapchain->back_buffers[0]->resource;
struct wined3d_rendertarget_view_desc view_desc;
view_desc.format_id = swapchain_desc->backbuffer_format;
view_desc.format_id = back_buffer->format->id;
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,
if (FAILED(hr = wined3d_rendertarget_view_create(&view_desc, back_buffer,
NULL, &wined3d_null_parent_ops, &device->back_buffer_view)))
{
ERR("Failed to create rendertarget view, hr %#x.\n", hr);
......@@ -4865,11 +4866,13 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
}
if (swapchain->desc.backbuffer_count)
{
view_desc.format_id = swapchain_desc->backbuffer_format;
struct wined3d_resource *back_buffer = &swapchain->back_buffers[0]->resource;
view_desc.format_id = back_buffer->format->id;
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,
if (FAILED(hr = wined3d_rendertarget_view_create(&view_desc, back_buffer,
NULL, &wined3d_null_parent_ops, &device->back_buffer_view)))
{
ERR("Failed to create rendertarget view, hr %#x.\n", hr);
......
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