=?UTF-8?Q?Stefan=20D=C3=B6singer=20?=: wined3d: Move map binding loading to wined3d_surface_map.
Alexandre Julliard
julliard at winehq.org
Mon Jan 13 12:46:33 CST 2014
Module: wine
Branch: master
Commit: 4ca8f7104f429df245eab6373ad0e82eb61703d6
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4ca8f7104f429df245eab6373ad0e82eb61703d6
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Mon Jan 13 15:21:03 2014 +0100
wined3d: Move map binding loading to wined3d_surface_map.
---
dlls/wined3d/surface.c | 35 ++++++++++++++++++-----------------
1 file changed, 18 insertions(+), 17 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index a3c3ebf..0c83a0e 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -820,23 +820,6 @@ static BYTE *surface_map(struct wined3d_surface *surface, const RECT *rect, DWOR
TRACE("surface %p, rect %s, flags %#x.\n",
surface, wine_dbgstr_rect(rect), flags);
- surface_prepare_map_memory(surface);
- if (flags & WINED3D_MAP_DISCARD)
- {
- TRACE("WINED3D_MAP_DISCARD flag passed, marking SYSMEM as up to date.\n");
- surface_validate_location(surface, surface->map_binding);
- }
- else
- {
- if (surface->resource.usage & WINED3DUSAGE_DYNAMIC)
- WARN_(d3d_perf)("Mapping a dynamic surface without WINED3D_MAP_DISCARD.\n");
-
- surface_load_location(surface, surface->map_binding);
- }
-
- if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY)))
- surface_invalidate_location(surface, ~surface->map_binding);
-
switch (surface->map_binding)
{
case SFLAG_INUSERMEM:
@@ -3205,6 +3188,24 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
}
}
+ surface_prepare_map_memory(surface);
+ if (flags & WINED3D_MAP_DISCARD)
+ {
+ TRACE("WINED3D_MAP_DISCARD flag passed, marking %s as up to date.\n",
+ debug_surflocation(surface->map_binding));
+ surface_validate_location(surface, surface->map_binding);
+ }
+ else
+ {
+ if (surface->resource.usage & WINED3DUSAGE_DYNAMIC)
+ WARN_(d3d_perf)("Mapping a dynamic surface without WINED3D_MAP_DISCARD.\n");
+
+ surface_load_location(surface, surface->map_binding);
+ }
+
+ if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY)))
+ surface_invalidate_location(surface, ~surface->map_binding);
+
base_memory = surface->surface_ops->surface_map(surface, rect, flags);
if (format->flags & WINED3DFMT_FLAG_BROKEN_PITCH)
More information about the wine-cvs
mailing list