=?UTF-8?Q?Stefan=20D=C3=B6singer=20?=: wined3d: Only set SFLAG_DYNLOCK when map_binding = sysmem.

Alexandre Julliard julliard at winehq.org
Fri Jan 17 11:55:33 CST 2014


Module: wine
Branch: master
Commit: d640018a3c1d5b6bc109891cc4acf894a6c4413a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d640018a3c1d5b6bc109891cc4acf894a6c4413a

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Fri Jan 17 13:27:18 2014 +0100

wined3d: Only set SFLAG_DYNLOCK when map_binding = sysmem.

All other map bindings are never freed. Setting SFLAG_DYNLOCK if
map_binding != sysmem might only keep a heap memory allocation around
(e.g. after device_reset) that is never used.

---

 dlls/wined3d/surface.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 87de9e1..628a4a5 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3068,7 +3068,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
      * mapped regularly do not throw away the system memory copy. This avoids
      * the need to download the surface from OpenGL all the time. The surface
      * is still downloaded if the OpenGL texture is changed. */
-    if (!(surface->flags & SFLAG_DYNLOCK))
+    if (!(surface->flags & SFLAG_DYNLOCK) && surface->map_binding == WINED3D_LOCATION_SYSMEM)
     {
         if (++surface->lockCount > MAXLOCKCOUNT)
         {




More information about the wine-cvs mailing list