Stefan Dösinger : wined3d: Fix sRGB-> RGB copy condition.
Alexandre Julliard
julliard at winehq.org
Wed Sep 23 11:03:16 CDT 2009
Module: wine
Branch: master
Commit: 4fe014cb54c88118616cc4ba83da329f3b9a2575
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4fe014cb54c88118616cc4ba83da329f3b9a2575
Author: Stefan Dösinger <stefan at 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);
More information about the wine-cvs
mailing list