[PATCH 2/7] wined3d: Implement surface_modify_ds_location() on top of the regular resource location management.
Henri Verbeet
hverbeet at codeweavers.com
Wed Apr 20 12:29:10 CDT 2016
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
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 162c932..7a71193 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.1.4
More information about the wine-patches
mailing list