[PATCH 1/4] wined3d: fix flip_surface flag copying bug

Roderick Colenbrander thunderbird2k at gmail.com
Wed Apr 28 07:29:19 CDT 2010


This patch fixes a part of bug 22356. The issue is that Jedi Knight performs a full surface copy
from the back to the front buffer which in the end uses flip_surface. flip_surface swaps
the surface flags which causes an issue in this case because only one of the buffers
ever had SFLAG_CONVERTED set. This means that SFLAG_CONVERTED is set for the odd frame
and unset for the even frame.
---
 dlls/wined3d/surface.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index fcdfec8..d14dbd0 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2917,10 +2917,13 @@ void flip_surface(IWineD3DSurfaceImpl *front, IWineD3DSurfaceImpl *back) {
         front->texture_name_srgb = tmp;
     }
 
+    /* Copy location flags */
     {
         DWORD tmp_flags = back->Flags;
-        back->Flags = front->Flags;
-        front->Flags = tmp_flags;
+        back->Flags &= ~SFLAG_LOCATIONS;
+        back->Flags |= front->Flags & SFLAG_LOCATIONS;
+        front->Flags &= ~SFLAG_LOCATIONS;
+        front->Flags |= tmp_flags & SFLAG_LOCATIONS;
     }
 }
 
-- 
1.6.3.3




More information about the wine-patches mailing list