[PATCH 2/4] wined3d: flip PBO flags in flip_surface

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


This prevents a crash in Jedi Knight where one of the surfaces has a PBO and the other hasn't which happens
because the game constantly calls flip_surface.
---
 dlls/wined3d/surface.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index d14dbd0..deb5926 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2893,7 +2893,12 @@ void flip_surface(IWineD3DSurfaceImpl *front, IWineD3DSurfaceImpl *back) {
     {
         GLuint tmp_pbo = front->pbo;
         front->pbo = back->pbo;
+        if(back->pbo) front->Flags |= SFLAG_PBO;
+        else front->Flags &= ~SFLAG_PBO;
+
         back->pbo = tmp_pbo;
+        if(back->pbo) back->Flags |= SFLAG_PBO;
+        else back->Flags &= ~SFLAG_PBO;
     }
 
     /* client_memory should not be different, but just in case */
-- 
1.6.3.3




More information about the wine-patches mailing list