From 2066e1a96216efcbd53ef7de70a193317952ca5f Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Wed, 20 Apr 2016 19:29:10 +0200 Subject: [PATCH] wined3d: Implement surface_modify_ds_location() on top of the regular resource location management. Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/surface.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 162c932b193..7a711934a0c 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -2606,19 +2606,16 @@ static void surface_depth_blt(const struct wined3d_surface *surface, struct wine void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) { - struct wined3d_texture_sub_resource *sub_resource; + struct wined3d_texture *texture = surface->container; + unsigned int sub_resource_idx; TRACE("surface %p, new location %#x, w %u, h %u.\n", surface, location, w, h); - sub_resource = surface_get_sub_resource(surface); - if (((sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB) && !(location & WINED3D_LOCATION_TEXTURE_RGB)) - || (!(sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB) - && (location & WINED3D_LOCATION_TEXTURE_RGB))) - wined3d_texture_set_dirty(surface->container); - + sub_resource_idx = surface_get_sub_resource_idx(surface); surface->ds_current_size.cx = w; surface->ds_current_size.cy = h; - sub_resource->locations = location; + wined3d_texture_validate_location(texture, sub_resource_idx, location); + wined3d_texture_invalidate_location(texture, sub_resource_idx, ~location); } /* Context activation is done by the caller. */ -- 2.11.4.GIT