[PATCH] WineD3D: Update the surface locations in Present=0A=

Stefan Doesinger stefan at codeweavers.com
Thu Jul 24 13:38:10 CDT 2008


=0A=
---=0A=
 dlls/wined3d/swapchain.c |   19 +++++++++++++++++++=0A=
 1 files changed, 19 insertions(+), 0 deletions(-)=0A=
=0A=
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c=0A=
index 77655d0..318c220 100644=0A=
--- a/dlls/wined3d/swapchain.c=0A=
+++ b/dlls/wined3d/swapchain.c=0A=
@@ -309,11 +309,30 @@ static HRESULT WINAPI =
IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO=0A=
         IWineD3DSurfaceImpl *back =3D (IWineD3DSurfaceImpl *) =
This->backBuffer[0];=0A=
 =0A=
         if(front->resource.size =3D=3D back->resource.size) {=0A=
+            DWORD fbflags;=0A=
             flip_surface(front, back);=0A=
+=0A=
+            /* Tell the front buffer surface that is has been modified. =
However,=0A=
+             * the other locations were preserved during that, so keep =
the flags.=0A=
+             * This serves to update the emulated overlay, if any=0A=
+             */=0A=
+            fbflags =3D front->Flags;=0A=
+            IWineD3DSurface_ModifyLocation(This->frontBuffer, =
SFLAG_INDRAWABLE, TRUE);=0A=
+            front->Flags =3D fbflags;=0A=
         } else {=0A=
             IWineD3DSurface_ModifyLocation((IWineD3DSurface *) front, =
SFLAG_INDRAWABLE, TRUE);=0A=
             IWineD3DSurface_ModifyLocation((IWineD3DSurface *) back, =
SFLAG_INDRAWABLE, TRUE);=0A=
         }=0A=
+    } else {=0A=
+        IWineD3DSurface_ModifyLocation(This->frontBuffer, =
SFLAG_INDRAWABLE, TRUE);=0A=
+        /* If the swapeffect is DISCARD, the back buffer is undefined. =
That means the SYSMEM=0A=
+         * and INTEXTURE copies can keep their old content if they have =
any defined content.=0A=
+         * If the swapeffect is COPY, the content remains the same. If =
it is FLIP however,=0A=
+         * the texture / sysmem copy needs to be reloaded from the =
drawable=0A=
+         */=0A=
+        if(This->presentParms.SwapEffect =3D=3D WINED3DSWAPEFFECT_FLIP) =
{=0A=
+            IWineD3DSurface_ModifyLocation(This->backBuffer[0], =
SFLAG_INDRAWABLE, TRUE);=0A=
+        }=0A=
     }=0A=
 =0A=
     if(This->presentParms.PresentationInterval !=3D =
WINED3DPRESENT_INTERVAL_IMMEDIATE && GL_SUPPORT(SGI_VIDEO_SYNC)) {=0A=
-- =0A=
1.5.4.5=0A=
=0A=

------=_NextPart_000_0025_01C8F640.89D61E30--




More information about the wine-patches mailing list