wined3d: Avoid calling wined3d_rendertarget_view_create() with WINED3DFMT_UNKNOWN.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2016-06-17 10:41:42 +02:00 committed by Alexandre Julliard
parent 8a69c5d81f
commit f36eea56e4
1 changed files with 7 additions and 4 deletions

View File

@ -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);