d3d8: Get rid of the format switching code in d3d8_device_CopyRects().

This can't possibly do anything, since we fail texture creation for
WINED3DFMT_UNKNOWN. If texture creation with D3DFMT_UNKNOWN is actually
supposed to work, we should probably pick an appropriate format at creation,
instead of during CopyRects(). This code has existed in some form or another
since the initial version in commit 850a9429db.
No tests, of course.
This commit is contained in:
Henri Verbeet 2014-09-29 09:11:51 +02:00 committed by Alexandre Julliard
parent 7dcfb9d3e5
commit d5365aae28

View file

@ -988,7 +988,6 @@ static HRESULT WINAPI d3d8_device_CopyRects(IDirect3DDevice8 *iface,
struct wined3d_resource_desc wined3d_desc;
struct wined3d_resource *wined3d_resource;
UINT src_w, src_h;
HRESULT hr;
TRACE("iface %p, src_surface %p, src_rects %p, rect_count %u, dst_surface %p, dst_points %p.\n",
iface, src_surface, src_rects, rect_count, dst_surface, dst_points);
@ -1020,24 +1019,13 @@ static HRESULT WINAPI d3d8_device_CopyRects(IDirect3DDevice8 *iface,
dst_format = wined3d_desc.format;
/* Check that the source and destination formats match */
if (src_format != dst_format && WINED3DFMT_UNKNOWN != dst_format)
if (src_format != dst_format)
{
WARN("Source %p format must match the destination %p format, returning D3DERR_INVALIDCALL.\n",
src_surface, dst_surface);
wined3d_mutex_unlock();
return D3DERR_INVALIDCALL;
}
else if (WINED3DFMT_UNKNOWN == dst_format)
{
TRACE("Converting destination surface from WINED3DFMT_UNKNOWN to the source format.\n");
if (FAILED(hr = wined3d_surface_update_desc(dst->wined3d_surface, wined3d_desc.width, wined3d_desc.height,
src_format, wined3d_desc.multisample_type, wined3d_desc.multisample_quality, NULL, 0)))
{
WARN("Failed to update surface desc, hr %#x.\n", hr);
wined3d_mutex_unlock();
return hr;
}
}
/* Quick if complete copy ... */
if (!rect_count && !src_rects && !dst_points)