Commit aa472ac6 authored by Riccardo Bortolato's avatar Riccardo Bortolato Committed by Alexandre Julliard

d3d11: Handle NULL source box in d3d10_device_CopySubresourceRegion().

parent 13b571c5
......@@ -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();
}
......
......@@ -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);
......
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