From 4a4efc35062ad5d99ba344a48d4d6111f6287abe Mon Sep 17 00:00:00 2001 From: Riccardo Bortolato Date: Thu, 29 Oct 2015 16:49:28 +0100 Subject: [PATCH] wined3d: Make wined3d_device_copy_sub_resource_region return an error code. Signed-off-by: Riccardo Bortolato Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/device.c | 16 +++++++++------- include/wine/wined3d.h | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index d00f2639b80..4806e3dc6c9 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3867,7 +3867,7 @@ void CDECL wined3d_device_copy_resource(struct wined3d_device *device, } } -void CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *device, +HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *device, struct wined3d_resource *dst_resource, unsigned int dst_sub_resource_idx, unsigned int dst_x, unsigned int dst_y, unsigned int dst_z, struct wined3d_resource *src_resource, unsigned int src_sub_resource_idx, const struct wined3d_box *src_box) @@ -3886,7 +3886,7 @@ void CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *device if (src_resource == dst_resource && src_sub_resource_idx == dst_sub_resource_idx) { WARN("Source and destination are the same sub-resource.\n"); - return; + return WINED3DERR_INVALIDCALL; } if (src_resource->type != dst_resource->type) @@ -3894,7 +3894,7 @@ void CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *device WARN("Resource types (%s / %s) don't match.\n", debug_d3dresourcetype(dst_resource->type), debug_d3dresourcetype(src_resource->type)); - return; + return WINED3DERR_INVALIDCALL; } if (src_resource->format->id != dst_resource->format->id) @@ -3902,20 +3902,20 @@ void CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *device WARN("Resource formats (%s / %s) don't match.\n", debug_d3dformat(dst_resource->format->id), debug_d3dformat(src_resource->format->id)); - return; + return WINED3DERR_INVALIDCALL; } if (dst_resource->type != WINED3D_RTYPE_TEXTURE) { FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(dst_resource->type)); - return; + return WINED3DERR_INVALIDCALL; } dst_texture = wined3d_texture_from_resource(dst_resource); if (!(tmp = wined3d_texture_get_sub_resource(dst_texture, dst_sub_resource_idx))) { WARN("Invalid dst_sub_resource_idx %u.\n", dst_sub_resource_idx); - return; + return WINED3DERR_INVALIDCALL; } dst_surface = surface_from_resource(tmp); @@ -3923,7 +3923,7 @@ void CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *device if (!(tmp = wined3d_texture_get_sub_resource(src_texture, src_sub_resource_idx))) { WARN("Invalid src_sub_resource_idx %u.\n", src_sub_resource_idx); - return; + return WINED3DERR_INVALIDCALL; } src_surface = surface_from_resource(tmp); @@ -3939,6 +3939,8 @@ void CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *device if (FAILED(hr = wined3d_surface_blt(dst_surface, &dst_rect, src_surface, &src_rect, 0, NULL, WINED3D_TEXF_POINT))) ERR("Failed to blit, hr %#x.\n", hr); + + return hr; } void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, struct wined3d_resource *resource, diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 9cc1e1cf3b4..52c822e3747 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2130,7 +2130,7 @@ HRESULT __cdecl wined3d_device_clear_rendertarget_view(struct wined3d_device *de struct wined3d_rendertarget_view *view, const RECT *rect, const struct wined3d_color *color); void __cdecl wined3d_device_copy_resource(struct wined3d_device *device, struct wined3d_resource *dst_resource, struct wined3d_resource *src_resource); -void __cdecl wined3d_device_copy_sub_resource_region(struct wined3d_device *device, +HRESULT __cdecl wined3d_device_copy_sub_resource_region(struct wined3d_device *device, struct wined3d_resource *dst_resource, unsigned int dst_sub_resource_idx, unsigned int dst_x, unsigned int dst_y, unsigned int dst_z, struct wined3d_resource *src_resource, unsigned int src_sub_resource_idx, const struct wined3d_box *src_box); -- 2.11.4.GIT