On 19 January 2016 at 22:28, Józef Kucia <jkucia(a)codeweavers.com> wrote:
@@ -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; + } That's mostly what surface_get_rect() does, except that it doesn't take a wined3d_box structure, of course. wined3d_surface_blt() can handle a NULL src_rect though, so you don't need to do it here.
It may make sense to require callers to pass a non-NULL wined3d_box to wined3d_texture_blt(). I think that everything that calls wined3d_surface_blt() or wined3d_texture_blt() should have easy access to the surface dimensions. That's a bit more involved because there are callers outside wined3d though.