Module: wine
Branch: master
Commit: b0c4673779f0d4e3b8fde7356016b876ddeeffa8
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b0c4673779f0d4e3b8fde7356…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Thu Jul 24 13:38:10 2008 -0500
wined3d: Update the surface locations in Present.
---
dlls/wined3d/swapchain.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 77655d0..318c220 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -309,11 +309,30 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO
IWineD3DSurfaceImpl *back = (IWineD3DSurfaceImpl *) This->backBuffer[0];
if(front->resource.size == back->resource.size) {
+ DWORD fbflags;
flip_surface(front, back);
+
+ /* Tell the front buffer surface that is has been modified. However,
+ * the other locations were preserved during that, so keep the flags.
+ * This serves to update the emulated overlay, if any
+ */
+ fbflags = front->Flags;
+ IWineD3DSurface_ModifyLocation(This->frontBuffer, SFLAG_INDRAWABLE, TRUE);
+ front->Flags = fbflags;
} else {
IWineD3DSurface_ModifyLocation((IWineD3DSurface *) front, SFLAG_INDRAWABLE, TRUE);
IWineD3DSurface_ModifyLocation((IWineD3DSurface *) back, SFLAG_INDRAWABLE, TRUE);
}
+ } else {
+ IWineD3DSurface_ModifyLocation(This->frontBuffer, SFLAG_INDRAWABLE, TRUE);
+ /* If the swapeffect is DISCARD, the back buffer is undefined. That means the SYSMEM
+ * and INTEXTURE copies can keep their old content if they have any defined content.
+ * If the swapeffect is COPY, the content remains the same. If it is FLIP however,
+ * the texture / sysmem copy needs to be reloaded from the drawable
+ */
+ if(This->presentParms.SwapEffect == WINED3DSWAPEFFECT_FLIP) {
+ IWineD3DSurface_ModifyLocation(This->backBuffer[0], SFLAG_INDRAWABLE, TRUE);
+ }
}
if(This->presentParms.PresentationInterval != WINED3DPRESENT_INTERVAL_IMMEDIATE && GL_SUPPORT(SGI_VIDEO_SYNC)) {
Module: wine
Branch: master
Commit: 44d419ad8e203926710c8b2bf291e69586ce2bd3
URL: http://source.winehq.org/git/wine.git/?a=commit;h=44d419ad8e203926710c8b2bf…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Mon Aug 4 13:34:47 2008 -0500
wined3d: Call glFlush outside the GL lock.
---
dlls/wined3d/device.c | 6 +++---
dlls/wined3d/surface.c | 12 +++++-------
2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 9e97d3b..dab4b38 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4945,10 +4945,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_EndScene(IWineD3DDevice *iface) {
ActivateContext(This, This->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD);
/* We only have to do this if we need to read the, swapbuffers performs a flush for us */
- ENTER_GL();
glFlush();
- checkGLcall("glFlush");
- LEAVE_GL();
+ /* No checkGLcall here to avoid locking the lock just for checking a call that hardly ever
+ * fails
+ */
This->inScene = FALSE;
return WINED3D_OK;
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index cb4d879..10c8ab1 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3438,10 +3438,6 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *
checkGLcall("glDisable(GL_ALPHA_TEST)");
}
- /* Flush in case the drawable is used by multiple GL contexts */
- if(dstSwapchain && (This == (IWineD3DSurfaceImpl *) dstSwapchain->frontBuffer || dstSwapchain->num_contexts >= 2))
- glFlush();
-
glBindTexture(Src->glDescription.target, 0);
checkGLcall("glBindTexture(Src->glDescription.target, 0)");
/* Leave the opengl state valid for blitting */
@@ -3465,6 +3461,10 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *
LEAVE_GL();
+ /* Flush in case the drawable is used by multiple GL contexts */
+ if(dstSwapchain && (This == (IWineD3DSurfaceImpl *) dstSwapchain->frontBuffer || dstSwapchain->num_contexts >= 2))
+ glFlush();
+
/* TODO: If the surface is locked often, perform the Blt in software on the memory instead */
/* The surface is now in the drawable. On onscreen surfaces or without fbos the texture
* is outdated now
@@ -3729,9 +3729,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_RealizePalette(IWineD3DSurface *iface) {
/* Without this some palette updates are missed. This at least happens on Nvidia drivers but
* it works fine using Mesa. */
- ENTER_GL();
glFlush();
- LEAVE_GL();
} else {
if(!(This->Flags & SFLAG_INSYSMEM)) {
TRACE("Palette changed with surface that does not have an up to date system memory copy\n");
@@ -4183,6 +4181,7 @@ static inline void surface_blt_to_drawable(IWineD3DSurfaceImpl *This, const RECT
glDisable(GL_TEXTURE_2D);
checkGLcall("glDisable(GL_TEXTURE_2D)");
}
+ LEAVE_GL();
hr = IWineD3DSurface_GetContainer((IWineD3DSurface*)This, &IID_IWineD3DSwapChain, (void **) &swapchain);
if(hr == WINED3D_OK && swapchain) {
@@ -4204,7 +4203,6 @@ static inline void surface_blt_to_drawable(IWineD3DSurfaceImpl *This, const RECT
IWineD3DBaseTexture_Release(texture);
}
}
- LEAVE_GL();
}
/*****************************************************************************