Module: wine
Branch: master
Commit: 4fe014cb54c88118616cc4ba83da329f3b9a2575
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4fe014cb54c88118616cc4ba8…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Mon Sep 7 11:37:38 2009 +0200
wined3d: Fix sRGB->RGB copy condition.
The old condition happened to work, because SFLAG_INTEXTURE was not
set(we're loading it), and neither was SFLAG_INDRAWABLE(otherwise
INTEXTURE would be set too). If the fbo INDRAWABLE == INTEXTURE is
replaced by INDRAWABLE == INSRGBTEX this doesn't hold true any longer
because SFLAG_INDRAWABLE is set, but not used because the drawable
readback is never used for fbos.
---
dlls/wined3d/surface.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 7221ef0..53b969a 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -4851,12 +4851,18 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadLocation(IWineD3DSurface *iface, D
IWineD3DSurfaceImpl_LoadLocation(iface, SFLAG_INSYSMEM, rect);
}
} else {
- if((This->Flags & SFLAG_LOCATIONS) == SFLAG_INSRGBTEX) {
+ if((This->Flags & (SFLAG_INSRGBTEX | SFLAG_INSYSMEM)) == SFLAG_INSRGBTEX) {
/* Performance warning ... */
FIXME("%p: Downloading srgb texture to reload it as rgb\n", This);
IWineD3DSurfaceImpl_LoadLocation(iface, SFLAG_INSYSMEM, rect);
}
}
+ if(!(This->Flags & SFLAG_INSYSMEM)) {
+ /* Should not happen */
+ ERR("Trying to load a texture from sysmem, but SFLAG_INSYSMEM is not set\n");
+ /* Lets hope we get it from somewhere... */
+ IWineD3DSurfaceImpl_LoadLocation(iface, SFLAG_INSYSMEM, rect);
+ }
if (!device->isInDraw) ActivateContext(device, NULL, CTXUSAGE_RESOURCELOAD);
surface_bind_and_dirtify(This, srgb);
Module: wine
Branch: master
Commit: 33ca3c02076082131c0b846dd37f5d924f8d9b96
URL: http://source.winehq.org/git/wine.git/?a=commit;h=33ca3c02076082131c0b846dd…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Sat Sep 5 22:32:51 2009 +0200
wined3d: Don't mark SFLAG_INTEXTURE up to date with fbo stretchrect.
FBO stretchrect marks SFLAG_INDRAWABLE up to date, which currently
also marks SFLAG_INTEXTURE up to date. However, this will change when
we enable rendering to the srgb copy, in which case the drawable could
be equal to the srgb copy, not the rgb copy.
---
dlls/wined3d/surface.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 4e4ac33..7221ef0 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3098,6 +3098,11 @@ static inline void fb_copy_to_texture_direct(IWineD3DSurfaceImpl *This, IWineD3D
checkGLcall("glCopyTexSubImage2D");
LEAVE_GL();
+
+ /* The texture is now most up to date - If the surface is a render target and has a drawable, this
+ * path is never entered
+ */
+ IWineD3DSurface_ModifyLocation((IWineD3DSurface *) This, SFLAG_INTEXTURE, TRUE);
}
/* Uses the hardware to stretch and flip the image */
@@ -3345,6 +3350,11 @@ static inline void fb_copy_to_texture_hwstretch(IWineD3DSurfaceImpl *This, IWine
}
LEAVE_GL();
+
+ /* The texture is now most up to date - If the surface is a render target and has a drawable, this
+ * path is never entered
+ */
+ IWineD3DSurface_ModifyLocation((IWineD3DSurface *) This, SFLAG_INTEXTURE, TRUE);
}
/* Not called from the VTable */
@@ -3615,10 +3625,6 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
} else {
This->Flags &= ~SFLAG_INSYSMEM;
}
- /* The texture is now most up to date - If the surface is a render target and has a drawable, this
- * path is never entered
- */
- IWineD3DSurface_ModifyLocation((IWineD3DSurface *) This, SFLAG_INTEXTURE, TRUE);
return WINED3D_OK;
} else if(Src) {