wined3d: Make wined3d_device_copy_sub_resource_region return an error code.
Signed-off-by: Riccardo Bortolato <rikyz619@gmail.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
905261ab40
commit
4a4efc3506
|
@ -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,
|
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 dst_y, unsigned int dst_z, struct wined3d_resource *src_resource,
|
||||||
unsigned int src_sub_resource_idx, const struct wined3d_box *src_box)
|
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)
|
if (src_resource == dst_resource && src_sub_resource_idx == dst_sub_resource_idx)
|
||||||
{
|
{
|
||||||
WARN("Source and destination are the same sub-resource.\n");
|
WARN("Source and destination are the same sub-resource.\n");
|
||||||
return;
|
return WINED3DERR_INVALIDCALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (src_resource->type != dst_resource->type)
|
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",
|
WARN("Resource types (%s / %s) don't match.\n",
|
||||||
debug_d3dresourcetype(dst_resource->type),
|
debug_d3dresourcetype(dst_resource->type),
|
||||||
debug_d3dresourcetype(src_resource->type));
|
debug_d3dresourcetype(src_resource->type));
|
||||||
return;
|
return WINED3DERR_INVALIDCALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (src_resource->format->id != dst_resource->format->id)
|
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",
|
WARN("Resource formats (%s / %s) don't match.\n",
|
||||||
debug_d3dformat(dst_resource->format->id),
|
debug_d3dformat(dst_resource->format->id),
|
||||||
debug_d3dformat(src_resource->format->id));
|
debug_d3dformat(src_resource->format->id));
|
||||||
return;
|
return WINED3DERR_INVALIDCALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dst_resource->type != WINED3D_RTYPE_TEXTURE)
|
if (dst_resource->type != WINED3D_RTYPE_TEXTURE)
|
||||||
{
|
{
|
||||||
FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(dst_resource->type));
|
FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(dst_resource->type));
|
||||||
return;
|
return WINED3DERR_INVALIDCALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
dst_texture = wined3d_texture_from_resource(dst_resource);
|
dst_texture = wined3d_texture_from_resource(dst_resource);
|
||||||
if (!(tmp = wined3d_texture_get_sub_resource(dst_texture, dst_sub_resource_idx)))
|
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);
|
WARN("Invalid dst_sub_resource_idx %u.\n", dst_sub_resource_idx);
|
||||||
return;
|
return WINED3DERR_INVALIDCALL;
|
||||||
}
|
}
|
||||||
dst_surface = surface_from_resource(tmp);
|
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)))
|
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);
|
WARN("Invalid src_sub_resource_idx %u.\n", src_sub_resource_idx);
|
||||||
return;
|
return WINED3DERR_INVALIDCALL;
|
||||||
}
|
}
|
||||||
src_surface = surface_from_resource(tmp);
|
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)))
|
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);
|
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,
|
void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, struct wined3d_resource *resource,
|
||||||
|
|
|
@ -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);
|
struct wined3d_rendertarget_view *view, const RECT *rect, const struct wined3d_color *color);
|
||||||
void __cdecl wined3d_device_copy_resource(struct wined3d_device *device,
|
void __cdecl wined3d_device_copy_resource(struct wined3d_device *device,
|
||||||
struct wined3d_resource *dst_resource, struct wined3d_resource *src_resource);
|
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,
|
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 dst_y, unsigned int dst_z, struct wined3d_resource *src_resource,
|
||||||
unsigned int src_sub_resource_idx, const struct wined3d_box *src_box);
|
unsigned int src_sub_resource_idx, const struct wined3d_box *src_box);
|
||||||
|
|
Loading…
Reference in New Issue