On 19 January 2016 at 22:28, Józef Kucia jkucia@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.
On Wed, Jan 20, 2016 at 1:06 PM, Henri Verbeet hverbeet@gmail.com wrote:
On 19 January 2016 at 22:28, Józef Kucia jkucia@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's not strictly necessary to do it here but I have to construct dst_rect based on src_box. In v2 I pass a NULL src_rect to wined3d_surface_blt(). I am not sure if it's really better.
On 20 January 2016 at 22:11, Józef Kucia joseph.kucia@gmail.com wrote:
It's not strictly necessary to do it here but I have to construct dst_rect based on src_box. In v2 I pass a NULL src_rect to wined3d_surface_blt(). I am not sure if it's really better.
You're probably right, I think I like the original better as well.