Riccardo Bortolato : d3d11: Handle NULL source box in d3d10_device_CopySubresourceRegion().
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Jan 21 11:22:06 CST 2016
Module: wine
Branch: master
Commit: aa472ac67a4f13925162f68abad21b377e2fc5b3
URL: http://source.winehq.org/git/wine.git/?a=commit;h=aa472ac67a4f13925162f68abad21b377e2fc5b3
Author: Riccardo Bortolato <rikyz619 at gmail.com>
Date: Tue Jan 19 22:28:08 2016 +0100
d3d11: Handle NULL source box in d3d10_device_CopySubresourceRegion().
Signed-off-by: Riccardo Bortolato <rikyz619 at gmail.com>
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/d3d11/device.c | 18 +++++++++++-------
dlls/wined3d/device.c | 24 +++++++++++++++++-------
2 files changed, 28 insertions(+), 14 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 8fc6cb1..38845ec 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -3186,17 +3186,21 @@ static void STDMETHODCALLTYPE d3d10_device_CopySubresourceRegion(ID3D10Device1 *
iface, dst_resource, dst_subresource_idx, dst_x, dst_y, dst_z,
src_resource, src_subresource_idx, src_box);
+ if (src_box)
+ {
+ wined3d_src_box.left = src_box->left;
+ wined3d_src_box.top = src_box->top;
+ wined3d_src_box.front = src_box->front;
+ wined3d_src_box.right = src_box->right;
+ wined3d_src_box.bottom = src_box->bottom;
+ wined3d_src_box.back = src_box->back;
+ }
+
wined3d_dst_resource = wined3d_resource_from_d3d10_resource(dst_resource);
wined3d_src_resource = wined3d_resource_from_d3d10_resource(src_resource);
- wined3d_src_box.left = src_box->left;
- wined3d_src_box.top = src_box->top;
- wined3d_src_box.front = src_box->front;
- wined3d_src_box.right = src_box->right;
- wined3d_src_box.bottom = src_box->bottom;
- wined3d_src_box.back = src_box->back;
wined3d_mutex_lock();
wined3d_device_copy_sub_resource_region(device->wined3d_device, wined3d_dst_resource, dst_subresource_idx,
- dst_x, dst_y, dst_z, wined3d_src_resource, src_subresource_idx, &wined3d_src_box);
+ dst_x, dst_y, dst_z, wined3d_src_resource, src_subresource_idx, src_box ? &wined3d_src_box : NULL);
wined3d_mutex_unlock();
}
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index d308083..87221c3 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4002,15 +4002,25 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
}
src_surface = surface_from_resource(tmp);
+ if (src_box)
+ {
+ src_rect.left = src_box->left;
+ src_rect.top = src_box->top;
+ src_rect.right = src_box->right;
+ src_rect.bottom = src_box->bottom;
+ }
+ else
+ {
+ src_rect.left = 0;
+ src_rect.top = 0;
+ src_rect.right = src_surface->resource.width;
+ src_rect.bottom = src_surface->resource.height;
+ }
+
dst_rect.left = dst_x;
dst_rect.top = dst_y;
- dst_rect.right = dst_x + (src_box->right - src_box->left);
- dst_rect.bottom = dst_y + (src_box->bottom - src_box->top);
-
- src_rect.left = src_box->left;
- src_rect.top = src_box->top;
- src_rect.right = src_box->right;
- src_rect.bottom = src_box->bottom;
+ dst_rect.right = dst_x + (src_rect.right - src_rect.left);
+ dst_rect.bottom = dst_y + (src_rect.bottom - src_rect.top);
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);
More information about the wine-cvs
mailing list