diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 362276d62c6..bd070531be3 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3551,12 +3551,6 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, TRACE("device %p, src_texture %p, src_level %u, dst_texture %p, level_count %u.\n", device, src_texture, src_level, dst_texture, level_count); - if (src_texture->resource.format != dst_texture->resource.format) - { - WARN("Source and destination formats do not match.\n"); - return WINED3DERR_INVALIDCALL; - } - if (wined3d_texture_get_level_width(src_texture, src_level) != dst_texture->resource.width || wined3d_texture_get_level_height(src_texture, src_level) != dst_texture->resource.height || wined3d_texture_get_level_depth(src_texture, src_level) != dst_texture->resource.depth) @@ -3636,6 +3630,12 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, return WINED3DERR_INVALIDCALL; } + if (src_texture->resource.format != dst_texture->resource.format) + { + WARN("Source and destination formats do not match.\n"); + return WINED3DERR_INVALIDCALL; + } + level_count = min(wined3d_texture_get_level_count(src_texture), wined3d_texture_get_level_count(dst_texture)); diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 56fbaf2dcf3..c9d9c107f53 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -874,8 +874,6 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P struct wined3d_texture *src_texture = src_surface->container; struct wined3d_texture *dst_texture = dst_surface->container; unsigned int src_row_pitch, src_slice_pitch; - const struct wined3d_format *src_format; - const struct wined3d_format *dst_format; const struct wined3d_gl_info *gl_info; struct wined3d_context *context; struct wined3d_bo_address data; @@ -887,15 +885,6 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P dst_surface, wine_dbgstr_point(dst_point), src_surface, wine_dbgstr_rect(src_rect)); - src_format = src_texture->resource.format; - dst_format = dst_texture->resource.format; - - if (src_format->id != dst_format->id) - { - WARN("Source and destination surfaces should have the same format.\n"); - return WINED3DERR_INVALIDCALL; - } - if (!dst_point) { p.x = 0; @@ -947,7 +936,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P src_texture->sub_resources[src_sub_resource_idx].locations); wined3d_texture_get_pitch(src_texture, src_surface->texture_level, &src_row_pitch, &src_slice_pitch); - wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect, + wined3d_surface_upload_data(dst_surface, gl_info, src_texture->resource.format, src_rect, src_row_pitch, dst_point, FALSE, wined3d_const_bo_address(&data)); context_release(context);