Commit 96120332 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3d8: Use wined3d_texture_get_sub_resource_desc() in d3d8_device_CopyRects().

parent 48580ccd
...@@ -1035,8 +1035,7 @@ static HRESULT WINAPI d3d8_device_CopyRects(IDirect3DDevice8 *iface, ...@@ -1035,8 +1035,7 @@ static HRESULT WINAPI d3d8_device_CopyRects(IDirect3DDevice8 *iface,
struct d3d8_surface *src = unsafe_impl_from_IDirect3DSurface8(src_surface); struct d3d8_surface *src = unsafe_impl_from_IDirect3DSurface8(src_surface);
struct d3d8_surface *dst = unsafe_impl_from_IDirect3DSurface8(dst_surface); struct d3d8_surface *dst = unsafe_impl_from_IDirect3DSurface8(dst_surface);
enum wined3d_format_id src_format, dst_format; enum wined3d_format_id src_format, dst_format;
struct wined3d_resource_desc wined3d_desc; struct wined3d_sub_resource_desc wined3d_desc;
struct wined3d_resource *wined3d_resource;
UINT src_w, src_h; UINT src_w, src_h;
TRACE("iface %p, src_surface %p, src_rects %p, rect_count %u, dst_surface %p, dst_points %p.\n", TRACE("iface %p, src_surface %p, src_rects %p, rect_count %u, dst_surface %p, dst_points %p.\n",
...@@ -1046,8 +1045,7 @@ static HRESULT WINAPI d3d8_device_CopyRects(IDirect3DDevice8 *iface, ...@@ -1046,8 +1045,7 @@ static HRESULT WINAPI d3d8_device_CopyRects(IDirect3DDevice8 *iface,
* destination texture is in WINED3D_POOL_DEFAULT. */ * destination texture is in WINED3D_POOL_DEFAULT. */
wined3d_mutex_lock(); wined3d_mutex_lock();
wined3d_resource = wined3d_texture_get_sub_resource(src->wined3d_texture, src->sub_resource_idx); wined3d_texture_get_sub_resource_desc(src->wined3d_texture, src->sub_resource_idx, &wined3d_desc);
wined3d_resource_get_desc(wined3d_resource, &wined3d_desc);
if (wined3d_desc.usage & WINED3DUSAGE_DEPTHSTENCIL) if (wined3d_desc.usage & WINED3DUSAGE_DEPTHSTENCIL)
{ {
WARN("Source %p is a depth stencil surface, returning D3DERR_INVALIDCALL.\n", src_surface); WARN("Source %p is a depth stencil surface, returning D3DERR_INVALIDCALL.\n", src_surface);
...@@ -1058,8 +1056,7 @@ static HRESULT WINAPI d3d8_device_CopyRects(IDirect3DDevice8 *iface, ...@@ -1058,8 +1056,7 @@ static HRESULT WINAPI d3d8_device_CopyRects(IDirect3DDevice8 *iface,
src_w = wined3d_desc.width; src_w = wined3d_desc.width;
src_h = wined3d_desc.height; src_h = wined3d_desc.height;
wined3d_resource = wined3d_texture_get_sub_resource(dst->wined3d_texture, dst->sub_resource_idx); wined3d_texture_get_sub_resource_desc(dst->wined3d_texture, dst->sub_resource_idx, &wined3d_desc);
wined3d_resource_get_desc(wined3d_resource, &wined3d_desc);
if (wined3d_desc.usage & WINED3DUSAGE_DEPTHSTENCIL) if (wined3d_desc.usage & WINED3DUSAGE_DEPTHSTENCIL)
{ {
WARN("Destination %p is a depth stencil surface, returning D3DERR_INVALIDCALL.\n", dst_surface); WARN("Destination %p is a depth stencil surface, returning D3DERR_INVALIDCALL.\n", dst_surface);
......
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